Skip to content

Commit

Permalink
Change imported macros to use leaky modules rather than leaky functions.
Browse files Browse the repository at this point in the history
  • Loading branch information
jbclements committed Feb 26, 2013
1 parent 6439e28 commit ca147a0
Show file tree
Hide file tree
Showing 11 changed files with 9 additions and 40 deletions.
5 changes: 0 additions & 5 deletions src/librustc/middle/trans/_match.rs
Original file line number Diff line number Diff line change
Expand Up @@ -172,11 +172,6 @@ use syntax::ast_util;
use syntax::codemap::span;
use syntax::print::pprust::pat_to_str;

pub fn macros() {
// FIXME(#3114): Macro import/export.
include!("macros.rs");
}

// An option identifying a literal: either a unit-like struct or an
// expression.
pub enum Lit {
Expand Down
5 changes: 0 additions & 5 deletions src/librustc/middle/trans/controlflow.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,6 @@ use middle::trans::datum::*;

use core::str;

pub fn macros() {
// FIXME(#3114): Macro import/export.
include!("macros.rs");
}

pub fn trans_block(bcx: block, b: &ast::blk, dest: expr::Dest) -> block {
let _icx = bcx.insn_ctxt("trans_block");
let mut bcx = bcx;
Expand Down
2 changes: 0 additions & 2 deletions src/librustc/middle/trans/expr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -149,8 +149,6 @@ use syntax::codemap::spanned;
// These are passed around by the code generating functions to track the
// destination of a computation's value.

fn macros() { include!("macros.rs"); } // FIXME(#3114): Macro import/export.

pub enum Dest {
SaveIn(ValueRef),
Ignore,
Expand Down
11 changes: 5 additions & 6 deletions src/librustc/middle/trans/macros.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.

{
#[macro_escape];

macro_rules! unpack_datum(
($bcx: ident, $inp: expr) => (
Expand All @@ -18,7 +18,7 @@ macro_rules! unpack_datum(
db.datum
}
)
);
)

macro_rules! unpack_result(
($bcx: ident, $inp: expr) => (
Expand All @@ -28,7 +28,7 @@ macro_rules! unpack_result(
db.val
}
)
);
)

macro_rules! trace_span(
($bcx: ident, $sp: expr, $str: expr) => (
Expand All @@ -39,7 +39,7 @@ macro_rules! trace_span(
}
}
)
);
)

macro_rules! trace(
($bcx: ident, $str: expr) => (
Expand All @@ -50,6 +50,5 @@ macro_rules! trace(
}
}
)
);
)

}
5 changes: 0 additions & 5 deletions src/librustc/middle/trans/meth.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,6 @@ use syntax::ast_util::local_def;
use syntax::print::pprust::expr_to_str;
use syntax::{ast, ast_map};

pub fn macros() {
// FIXME(#3114): Macro import/export.
include!("macros.rs");
}

/**
The main "translation" pass for methods. Generates code
for non-monomorphized methods only. Other methods will
Expand Down
5 changes: 0 additions & 5 deletions src/librustc/middle/typeck/infer/combine.rs
Original file line number Diff line number Diff line change
Expand Up @@ -72,11 +72,6 @@ use syntax::ast::{Onceness, purity, ret_style};
use syntax::ast;
use syntax::codemap::span;

pub fn macros() {
// FIXME(#3114): Macro import/export.
include!("macros.rs");
}

pub trait Combine {
fn infcx(&self) -> @mut InferCtxt;
fn tag(&self) -> ~str;
Expand Down
5 changes: 0 additions & 5 deletions src/librustc/middle/typeck/infer/lub.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,6 @@ use std::list;
use syntax::ast::{Many, Once, extern_fn, m_const, impure_fn, noreturn};
use syntax::ast::{pure_fn, ret_style, return_val, unsafe_fn};

pub fn macros() {
// FIXME(#3114): Macro import/export.
include!("macros.rs");
}

pub enum Lub = CombineFields; // least-upper-bound: common supertype

pub impl Lub {
Expand Down
5 changes: 2 additions & 3 deletions src/librustc/middle/typeck/infer/macros.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.

{
#[macro_escape];

macro_rules! if_ok(
($inp: expr) => (
Expand All @@ -17,6 +17,5 @@ macro_rules! if_ok(
Err(e) => { return Err(e); }
}
)
);
)

}
1 change: 1 addition & 0 deletions src/librustc/middle/typeck/infer/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,7 @@ use syntax::codemap;
use syntax::ast_util;
use syntax::codemap::span;

pub mod macros;
pub mod combine;
pub mod glb;
pub mod lattice;
Expand Down
4 changes: 0 additions & 4 deletions src/librustc/middle/typeck/infer/sub.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,6 @@ use std::list::Nil;
use std::list;
use syntax::ast::{m_const, purity, ret_style};

pub fn macros() {
// FIXME(#3114): Macro import/export.
include!("macros.rs");
}

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

Expand Down
1 change: 1 addition & 0 deletions src/librustc/rustc.rc
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ use back_ = back;

pub mod middle {
pub mod trans {
pub mod macros;
pub mod inline;
pub mod monomorphize;
pub mod controlflow;
Expand Down

0 comments on commit ca147a0

Please sign in to comment.