librustc: Don't accept as Trait anymore; fix all occurrences of it.

This commit is contained in:
Patrick Walton 2013-03-12 13:00:50 -07:00
parent 24a0de4e7f
commit b1c699815d
101 changed files with 676 additions and 538 deletions

View file

@ -29,7 +29,7 @@ use core::vec;
// a given file into the current one.
/* line!(): expands to the current line number */
pub fn expand_line(cx: ext_ctxt, sp: span, tts: &[ast::token_tree])
pub fn expand_line(cx: @ext_ctxt, sp: span, tts: &[ast::token_tree])
-> base::MacResult {
base::check_zero_tts(cx, sp, tts, "line!");
@ -40,7 +40,7 @@ pub fn expand_line(cx: ext_ctxt, sp: span, tts: &[ast::token_tree])
}
/* col!(): expands to the current column number */
pub fn expand_col(cx: ext_ctxt, sp: span, tts: &[ast::token_tree])
pub fn expand_col(cx: @ext_ctxt, sp: span, tts: &[ast::token_tree])
-> base::MacResult {
base::check_zero_tts(cx, sp, tts, "col!");
@ -52,7 +52,7 @@ pub fn expand_col(cx: ext_ctxt, sp: span, tts: &[ast::token_tree])
/* file!(): expands to the current filename */
/* The filemap (`loc.file`) contains a bunch more information we could spit
* out if we wanted. */
pub fn expand_file(cx: ext_ctxt, sp: span, tts: &[ast::token_tree])
pub fn expand_file(cx: @ext_ctxt, sp: span, tts: &[ast::token_tree])
-> base::MacResult {
base::check_zero_tts(cx, sp, tts, "file!");
@ -62,13 +62,13 @@ pub fn expand_file(cx: ext_ctxt, sp: span, tts: &[ast::token_tree])
base::MRExpr(mk_base_str(cx, topmost.call_site, filename))
}
pub fn expand_stringify(cx: ext_ctxt, sp: span, tts: &[ast::token_tree])
pub fn expand_stringify(cx: @ext_ctxt, sp: span, tts: &[ast::token_tree])
-> base::MacResult {
let s = pprust::tts_to_str(tts, cx.parse_sess().interner);
base::MRExpr(mk_base_str(cx, sp, s))
}
pub fn expand_mod(cx: ext_ctxt, sp: span, tts: &[ast::token_tree])
pub fn expand_mod(cx: @ext_ctxt, sp: span, tts: &[ast::token_tree])
-> base::MacResult {
base::check_zero_tts(cx, sp, tts, "module_path!");
base::MRExpr(mk_base_str(cx, sp,
@ -79,7 +79,7 @@ pub fn expand_mod(cx: ext_ctxt, sp: span, tts: &[ast::token_tree])
// include! : parse the given file as an expr
// This is generally a bad idea because it's going to behave
// unhygienically.
pub fn expand_include(cx: ext_ctxt, sp: span, tts: &[ast::token_tree])
pub fn expand_include(cx: @ext_ctxt, sp: span, tts: &[ast::token_tree])
-> base::MacResult {
let file = get_single_str_from_tts(cx, sp, tts, "include!");
let p = parse::new_sub_parser_from_file(
@ -89,7 +89,7 @@ pub fn expand_include(cx: ext_ctxt, sp: span, tts: &[ast::token_tree])
}
// include_str! : read the given file, insert it as a literal string expr
pub fn expand_include_str(cx: ext_ctxt, sp: span, tts: &[ast::token_tree])
pub fn expand_include_str(cx: @ext_ctxt, sp: span, tts: &[ast::token_tree])
-> base::MacResult {
let file = get_single_str_from_tts(cx, sp, tts, "include_str!");
let res = io::read_whole_file_str(&res_rel_file(cx, sp, &Path(file)));
@ -103,7 +103,7 @@ pub fn expand_include_str(cx: ext_ctxt, sp: span, tts: &[ast::token_tree])
base::MRExpr(mk_base_str(cx, sp, result::unwrap(res)))
}
pub fn expand_include_bin(cx: ext_ctxt, sp: span, tts: &[ast::token_tree])
pub fn expand_include_bin(cx: @ext_ctxt, sp: span, tts: &[ast::token_tree])
-> base::MacResult {
let file = get_single_str_from_tts(cx, sp, tts, "include_bin!");
match io::read_whole_file(&res_rel_file(cx, sp, &Path(file))) {
@ -147,7 +147,7 @@ fn topmost_expn_info(expn_info: @codemap::ExpnInfo) -> @codemap::ExpnInfo {
// resolve a file-system path to an absolute file-system path (if it
// isn't already)
fn res_rel_file(cx: ext_ctxt, sp: codemap::span, arg: &Path) -> Path {
fn res_rel_file(cx: @ext_ctxt, sp: codemap::span, arg: &Path) -> Path {
// NB: relative paths are resolved relative to the compilation unit
if !arg.is_absolute {
let cu = Path(cx.codemap().span_to_filename(sp));