Skip to content

Commit ca147a0

Browse files
committed
Change imported macros to use leaky modules rather than leaky functions.
1 parent 6439e28 commit ca147a0

File tree

11 files changed

+9
-40
lines changed

11 files changed

+9
-40
lines changed

src/librustc/middle/trans/_match.rs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -172,11 +172,6 @@ use syntax::ast_util;
172172
use syntax::codemap::span;
173173
use syntax::print::pprust::pat_to_str;
174174

175-
pub fn macros() {
176-
// FIXME(#3114): Macro import/export.
177-
include!("macros.rs");
178-
}
179-
180175
// An option identifying a literal: either a unit-like struct or an
181176
// expression.
182177
pub enum Lit {

src/librustc/middle/trans/controlflow.rs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,6 @@ use middle::trans::datum::*;
1818

1919
use core::str;
2020

21-
pub fn macros() {
22-
// FIXME(#3114): Macro import/export.
23-
include!("macros.rs");
24-
}
25-
2621
pub fn trans_block(bcx: block, b: &ast::blk, dest: expr::Dest) -> block {
2722
let _icx = bcx.insn_ctxt("trans_block");
2823
let mut bcx = bcx;

src/librustc/middle/trans/expr.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -149,8 +149,6 @@ use syntax::codemap::spanned;
149149
// These are passed around by the code generating functions to track the
150150
// destination of a computation's value.
151151

152-
fn macros() { include!("macros.rs"); } // FIXME(#3114): Macro import/export.
153-
154152
pub enum Dest {
155153
SaveIn(ValueRef),
156154
Ignore,

src/librustc/middle/trans/macros.rs

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
{
11+
#[macro_escape];
1212

1313
macro_rules! unpack_datum(
1414
($bcx: ident, $inp: expr) => (
@@ -18,7 +18,7 @@ macro_rules! unpack_datum(
1818
db.datum
1919
}
2020
)
21-
);
21+
)
2222

2323
macro_rules! unpack_result(
2424
($bcx: ident, $inp: expr) => (
@@ -28,7 +28,7 @@ macro_rules! unpack_result(
2828
db.val
2929
}
3030
)
31-
);
31+
)
3232

3333
macro_rules! trace_span(
3434
($bcx: ident, $sp: expr, $str: expr) => (
@@ -39,7 +39,7 @@ macro_rules! trace_span(
3939
}
4040
}
4141
)
42-
);
42+
)
4343

4444
macro_rules! trace(
4545
($bcx: ident, $str: expr) => (
@@ -50,6 +50,5 @@ macro_rules! trace(
5050
}
5151
}
5252
)
53-
);
53+
)
5454

55-
}

src/librustc/middle/trans/meth.rs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,6 @@ use syntax::ast_util::local_def;
3939
use syntax::print::pprust::expr_to_str;
4040
use syntax::{ast, ast_map};
4141

42-
pub fn macros() {
43-
// FIXME(#3114): Macro import/export.
44-
include!("macros.rs");
45-
}
46-
4742
/**
4843
The main "translation" pass for methods. Generates code
4944
for non-monomorphized methods only. Other methods will

src/librustc/middle/typeck/infer/combine.rs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -72,11 +72,6 @@ use syntax::ast::{Onceness, purity, ret_style};
7272
use syntax::ast;
7373
use syntax::codemap::span;
7474

75-
pub fn macros() {
76-
// FIXME(#3114): Macro import/export.
77-
include!("macros.rs");
78-
}
79-
8075
pub trait Combine {
8176
fn infcx(&self) -> @mut InferCtxt;
8277
fn tag(&self) -> ~str;

src/librustc/middle/typeck/infer/lub.rs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,6 @@ use std::list;
2424
use syntax::ast::{Many, Once, extern_fn, m_const, impure_fn, noreturn};
2525
use syntax::ast::{pure_fn, ret_style, return_val, unsafe_fn};
2626

27-
pub fn macros() {
28-
// FIXME(#3114): Macro import/export.
29-
include!("macros.rs");
30-
}
31-
3227
pub enum Lub = CombineFields; // least-upper-bound: common supertype
3328

3429
pub impl Lub {

src/librustc/middle/typeck/infer/macros.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
{
11+
#[macro_escape];
1212

1313
macro_rules! if_ok(
1414
($inp: expr) => (
@@ -17,6 +17,5 @@ macro_rules! if_ok(
1717
Err(e) => { return Err(e); }
1818
}
1919
)
20-
);
20+
)
2121

22-
}

src/librustc/middle/typeck/infer/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -287,6 +287,7 @@ use syntax::codemap;
287287
use syntax::ast_util;
288288
use syntax::codemap::span;
289289

290+
pub mod macros;
290291
pub mod combine;
291292
pub mod glb;
292293
pub mod lattice;

src/librustc/middle/typeck/infer/sub.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,6 @@ use std::list::Nil;
2525
use std::list;
2626
use syntax::ast::{m_const, purity, ret_style};
2727

28-
pub fn macros() {
29-
// FIXME(#3114): Macro import/export.
30-
include!("macros.rs");
31-
}
3228

3329
pub enum Sub = CombineFields; // "subtype", "subregion" etc
3430

src/librustc/rustc.rc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ use back_ = back;
4949

5050
pub mod middle {
5151
pub mod trans {
52+
pub mod macros;
5253
pub mod inline;
5354
pub mod monomorphize;
5455
pub mod controlflow;

0 commit comments

Comments
 (0)