diff options
Diffstat (limited to 'src/libsyntax/ext')
| -rw-r--r-- | src/libsyntax/ext/base.rs | 4 | ||||
| -rw-r--r-- | src/libsyntax/ext/concat_idents.rs | 6 | ||||
| -rw-r--r-- | src/libsyntax/ext/deriving/decodable.rs | 2 | ||||
| -rw-r--r-- | src/libsyntax/ext/deriving/encodable.rs | 2 | ||||
| -rw-r--r-- | src/libsyntax/ext/deriving/generic.rs | 12 | ||||
| -rw-r--r-- | src/libsyntax/ext/deriving/mod.rs | 4 | ||||
| -rw-r--r-- | src/libsyntax/ext/deriving/to_str.rs | 2 | ||||
| -rw-r--r-- | src/libsyntax/ext/deriving/ty.rs | 4 | ||||
| -rw-r--r-- | src/libsyntax/ext/expand.rs | 7 | ||||
| -rw-r--r-- | src/libsyntax/ext/fmt.rs | 2 | ||||
| -rw-r--r-- | src/libsyntax/ext/pipes/liveness.rs | 2 | ||||
| -rw-r--r-- | src/libsyntax/ext/pipes/parse_proto.rs | 2 | ||||
| -rw-r--r-- | src/libsyntax/ext/pipes/pipec.rs | 4 | ||||
| -rw-r--r-- | src/libsyntax/ext/quote.rs | 6 | ||||
| -rw-r--r-- | src/libsyntax/ext/source_util.rs | 2 | ||||
| -rw-r--r-- | src/libsyntax/ext/trace_macros.rs | 2 | ||||
| -rw-r--r-- | src/libsyntax/ext/tt/macro_parser.rs | 4 | ||||
| -rw-r--r-- | src/libsyntax/ext/tt/macro_rules.rs | 10 | ||||
| -rw-r--r-- | src/libsyntax/ext/tt/transcribe.rs | 10 |
19 files changed, 42 insertions, 45 deletions
diff --git a/src/libsyntax/ext/base.rs b/src/libsyntax/ext/base.rs index a97c69ba4ff..2a7f8c8865b 100644 --- a/src/libsyntax/ext/base.rs +++ b/src/libsyntax/ext/base.rs @@ -250,7 +250,7 @@ pub fn mk_ctxt(parse_sess: @mut parse::ParseSess, cfg: ast::crate_cfg) fn call_site(&self) -> span { match *self.backtrace { Some(@ExpandedFrom(CallInfo {call_site: cs, _})) => cs, - None => self.bug(~"missing top span") + None => self.bug("missing top span") } } fn print_backtrace(&self) { } @@ -276,7 +276,7 @@ pub fn mk_ctxt(parse_sess: @mut parse::ParseSess, cfg: ast::crate_cfg) })) => { *self.backtrace = prev } - _ => self.bug(~"tried to pop without a push") + _ => self.bug("tried to pop without a push") } } fn span_fatal(&self, sp: span, msg: &str) -> ! { diff --git a/src/libsyntax/ext/concat_idents.rs b/src/libsyntax/ext/concat_idents.rs index 96e5e414322..da32cc11625 100644 --- a/src/libsyntax/ext/concat_idents.rs +++ b/src/libsyntax/ext/concat_idents.rs @@ -21,15 +21,13 @@ pub fn expand_syntax_ext(cx: @ext_ctxt, sp: span, tts: &[ast::token_tree]) if i & 1 == 1 { match *e { ast::tt_tok(_, token::COMMA) => (), - _ => cx.span_fatal(sp, ~"concat_idents! \ - expecting comma.") + _ => cx.span_fatal(sp, "concat_idents! expecting comma.") } } else { match *e { ast::tt_tok(_, token::IDENT(ident,_)) => res_str += cx.str_of(ident), - _ => cx.span_fatal(sp, ~"concat_idents! \ - requires ident args.") + _ => cx.span_fatal(sp, "concat_idents! requires ident args.") } } } diff --git a/src/libsyntax/ext/deriving/decodable.rs b/src/libsyntax/ext/deriving/decodable.rs index 2e2f382a768..fe205112046 100644 --- a/src/libsyntax/ext/deriving/decodable.rs +++ b/src/libsyntax/ext/deriving/decodable.rs @@ -291,7 +291,7 @@ fn expand_deriving_decodable_struct_method( unnamed_field => { cx.span_unimpl( span, - ~"unnamed fields with `deriving(Decodable)`" + "unnamed fields with `deriving(Decodable)`" ); } } diff --git a/src/libsyntax/ext/deriving/encodable.rs b/src/libsyntax/ext/deriving/encodable.rs index 8a1c3933f51..b1df8405d76 100644 --- a/src/libsyntax/ext/deriving/encodable.rs +++ b/src/libsyntax/ext/deriving/encodable.rs @@ -321,7 +321,7 @@ fn expand_deriving_encodable_struct_method( unnamed_field => { cx.span_unimpl( span, - ~"unnamed fields with `deriving(Encodable)`" + "unnamed fields with `deriving(Encodable)`" ); } } diff --git a/src/libsyntax/ext/deriving/generic.rs b/src/libsyntax/ext/deriving/generic.rs index fc14e3c3f73..2fc9dadfe2c 100644 --- a/src/libsyntax/ext/deriving/generic.rs +++ b/src/libsyntax/ext/deriving/generic.rs @@ -539,8 +539,8 @@ impl<'self> MethodDef<'self> { (opt_id, field, other_fields) } } - [] => { cx.span_bug(span, ~"No self arguments to non-static \ - method in generic `deriving`") } + [] => { cx.span_bug(span, "No self arguments to non-static \ + method in generic `deriving`") } }; // body of the inner most destructuring match @@ -658,8 +658,8 @@ impl<'self> MethodDef<'self> { // we've matched against all arguments, so make the final // expression at the bottom of the match tree if matches_so_far.len() == 0 { - cx.span_bug(span, ~"no self match on an enum in generic \ - `deriving`"); + cx.span_bug(span, "no self match on an enum in generic \ + `deriving`"); } // we currently have a vec of vecs, where each // subvec is the fields of one of the arguments, @@ -718,8 +718,8 @@ impl<'self> MethodDef<'self> { // make a matching-variant match, and a _ match. let index = match matching { Some(i) => i, - None => cx.span_bug(span, ~"Non-matching variants when required to \ - be matching in generic `deriving`") + None => cx.span_bug(span, "Non-matching variants when required to \ + be matching in generic `deriving`") }; // matching-variant match diff --git a/src/libsyntax/ext/deriving/mod.rs b/src/libsyntax/ext/deriving/mod.rs index 78cd5cdb423..6f4429af12d 100644 --- a/src/libsyntax/ext/deriving/mod.rs +++ b/src/libsyntax/ext/deriving/mod.rs @@ -67,11 +67,11 @@ pub fn expand_meta_deriving(cx: @ext_ctxt, match mitem.node { meta_name_value(_, ref l) => { - cx.span_err(l.span, ~"unexpected value in `deriving`"); + cx.span_err(l.span, "unexpected value in `deriving`"); in_items } meta_word(_) | meta_list(_, []) => { - cx.span_warn(mitem.span, ~"empty trait list in `deriving`"); + cx.span_warn(mitem.span, "empty trait list in `deriving`"); in_items } meta_list(_, ref titems) => { diff --git a/src/libsyntax/ext/deriving/to_str.rs b/src/libsyntax/ext/deriving/to_str.rs index 13cb09e970d..f155cb3790f 100644 --- a/src/libsyntax/ext/deriving/to_str.rs +++ b/src/libsyntax/ext/deriving/to_str.rs @@ -49,6 +49,6 @@ fn to_str_substructure(cx: @ext_ctxt, span: span, substr: &Substructure) -> @exp cx.ident_of("log_str")], ~[self_addr]) } - _ => cx.span_bug(span, ~"Invalid number of arguments in `deriving(ToStr)`") + _ => cx.span_bug(span, "Invalid number of arguments in `deriving(ToStr)`") } } diff --git a/src/libsyntax/ext/deriving/ty.rs b/src/libsyntax/ext/deriving/ty.rs index 8fd372e4792..5fc3aeb789c 100644 --- a/src/libsyntax/ext/deriving/ty.rs +++ b/src/libsyntax/ext/deriving/ty.rs @@ -167,8 +167,8 @@ pub impl Ty { Literal(ref p) => { p.to_path(cx, span, self_ty, self_generics) } - Ptr(*) => { cx.span_bug(span, ~"Pointer in a path in generic `deriving`") } - Tuple(*) => { cx.span_bug(span, ~"Tuple in a path in generic `deriving`") } + Ptr(*) => { cx.span_bug(span, "Pointer in a path in generic `deriving`") } + Tuple(*) => { cx.span_bug(span, "Tuple in a path in generic `deriving`") } } } } diff --git a/src/libsyntax/ext/expand.rs b/src/libsyntax/ext/expand.rs index db95cb65b76..ff0cf6f28ad 100644 --- a/src/libsyntax/ext/expand.rs +++ b/src/libsyntax/ext/expand.rs @@ -234,7 +234,7 @@ pub fn expand_item_mac(extsbox: @mut SyntaxEnv, item_mac(codemap::spanned { node: mac_invoc_tt(pth, ref tts), _}) => { (pth, copy *tts) } - _ => cx.span_bug(it.span, ~"invalid item macro invocation") + _ => cx.span_bug(it.span, "invalid item macro invocation") }; let extname = cx.parse_sess().interner.get(pth.idents[0]); @@ -377,8 +377,7 @@ pub fn expand_block(extsbox: @mut SyntaxEnv, // see note below about treatment of exts table with_exts_frame!(extsbox,orig(blk,sp,fld)) }, - _ => cx.span_bug(sp, - ~"expected ScopeMacros binding for \" block\"") + _ => cx.span_bug(sp, "expected ScopeMacros binding for \" block\"") } } @@ -628,7 +627,7 @@ pub fn expand_crate(parse_sess: @mut parse::ParseSess, attrs, parse_sess) { Some(item) => item, - None => cx.bug(~"expected core macros to parse correctly") + None => cx.bug("expected core macros to parse correctly") }; // This is run for its side-effects on the expander env, // as it registers all the core macros as expanders. diff --git a/src/libsyntax/ext/fmt.rs b/src/libsyntax/ext/fmt.rs index 26b3178a911..24046faa684 100644 --- a/src/libsyntax/ext/fmt.rs +++ b/src/libsyntax/ext/fmt.rs @@ -88,7 +88,7 @@ fn pieces_to_expr(cx: @ext_ctxt, sp: span, let count_is_args = ~[count_lit]; return mk_call_global(cx, sp, count_is_path, count_is_args); } - _ => cx.span_unimpl(sp, ~"unimplemented fmt! conversion") + _ => cx.span_unimpl(sp, "unimplemented fmt! conversion") } } fn make_ty(cx: @ext_ctxt, sp: span, t: Ty) -> @ast::expr { diff --git a/src/libsyntax/ext/pipes/liveness.rs b/src/libsyntax/ext/pipes/liveness.rs index 8799bd064f6..104e5f94d17 100644 --- a/src/libsyntax/ext/pipes/liveness.rs +++ b/src/libsyntax/ext/pipes/liveness.rs @@ -85,7 +85,7 @@ pub fn analyze(proto: @mut protocol_, _cx: @ext_ctxt) { } if self_live.len() > 0 { - let states = str::connect(self_live.map(|s| copy s.name), ~" "); + let states = str::connect(self_live.map(|s| copy s.name), " "); debug!("protocol %s is unbounded due to loops involving: %s", copy proto.name, states); diff --git a/src/libsyntax/ext/pipes/parse_proto.rs b/src/libsyntax/ext/pipes/parse_proto.rs index 5c99ddc9040..28c8c9a704d 100644 --- a/src/libsyntax/ext/pipes/parse_proto.rs +++ b/src/libsyntax/ext/pipes/parse_proto.rs @@ -114,7 +114,7 @@ impl proto_parser for parser::Parser { self.bump(); None } - _ => self.fatal(~"invalid next state") + _ => self.fatal("invalid next state") }; state.add_message(mname, *self.span, args, next); diff --git a/src/libsyntax/ext/pipes/pipec.rs b/src/libsyntax/ext/pipes/pipec.rs index b537ef87d54..8a9c714e7e9 100644 --- a/src/libsyntax/ext/pipes/pipec.rs +++ b/src/libsyntax/ext/pipes/pipec.rs @@ -96,7 +96,7 @@ impl gen_send for message { name, str::connect(vec::append_one( arg_names.map(|x| cx.str_of(*x)), - ~"s"), ~", ")); + ~"s"), ", ")); if !try { body += fmt!("::core::pipes::send(pipe, message);\n"); @@ -148,7 +148,7 @@ impl gen_send for message { } else { ~"(" + str::connect(arg_names.map(|x| copy *x), - ~", ") + ~")" + ", ") + ~")" }; let mut body = ~"{ "; diff --git a/src/libsyntax/ext/quote.rs b/src/libsyntax/ext/quote.rs index fc673c4422f..2134c2ba19b 100644 --- a/src/libsyntax/ext/quote.rs +++ b/src/libsyntax/ext/quote.rs @@ -86,7 +86,7 @@ pub mod rt { impl<'self> ToSource for &'self [@ast::item] { fn to_source(&self, cx: @ext_ctxt) -> ~str { - str::connect(self.map(|i| i.to_source(cx)), ~"\n\n") + str::connect(self.map(|i| i.to_source(cx)), "\n\n") } } @@ -98,7 +98,7 @@ pub mod rt { impl<'self> ToSource for &'self [@ast::Ty] { fn to_source(&self, cx: @ext_ctxt) -> ~str { - str::connect(self.map(|i| i.to_source(cx)), ~", ") + str::connect(self.map(|i| i.to_source(cx)), ", ") } } @@ -421,7 +421,7 @@ fn id_ext(cx: @ext_ctxt, str: &str) -> ast::ident { // Lift an ident to the expr that evaluates to that ident. fn mk_ident(cx: @ext_ctxt, sp: span, ident: ast::ident) -> @ast::expr { - let e_str = build::mk_uniq_str(cx, sp, cx.str_of(ident)); + let e_str = build::mk_base_str(cx, sp, cx.str_of(ident)); build::mk_method_call(cx, sp, build::mk_path(cx, sp, ids_ext(cx, ~[~"ext_cx"])), id_ext(cx, "ident_of"), diff --git a/src/libsyntax/ext/source_util.rs b/src/libsyntax/ext/source_util.rs index ab22b3152f4..c0d9b3f06af 100644 --- a/src/libsyntax/ext/source_util.rs +++ b/src/libsyntax/ext/source_util.rs @@ -67,7 +67,7 @@ pub fn expand_mod(cx: @ext_ctxt, sp: span, tts: &[ast::token_tree]) base::check_zero_tts(cx, sp, tts, "module_path!"); base::MRExpr(mk_base_str(cx, sp, str::connect(cx.mod_path().map( - |x| cx.str_of(*x)), ~"::"))) + |x| cx.str_of(*x)), "::"))) } // include! : parse the given file as an expr diff --git a/src/libsyntax/ext/trace_macros.rs b/src/libsyntax/ext/trace_macros.rs index 1bb40808142..0ecb3b2a3f4 100644 --- a/src/libsyntax/ext/trace_macros.rs +++ b/src/libsyntax/ext/trace_macros.rs @@ -39,7 +39,7 @@ pub fn expand_trace_macros(cx: @ext_ctxt, } else if rust_parser.is_keyword("false") { cx.set_trace_macros(false); } else { - cx.span_fatal(sp, ~"trace_macros! only accepts `true` or `false`") + cx.span_fatal(sp, "trace_macros! only accepts `true` or `false`") } rust_parser.bump(); diff --git a/src/libsyntax/ext/tt/macro_parser.rs b/src/libsyntax/ext/tt/macro_parser.rs index aa211973f1c..a34045a883e 100644 --- a/src/libsyntax/ext/tt/macro_parser.rs +++ b/src/libsyntax/ext/tt/macro_parser.rs @@ -371,7 +371,7 @@ pub fn parse( *sess.interner.get(bind)) } _ => fail!() - } }), ~" or "); + } }), " or "); return error(sp, fmt!( "Local ambiguity: multiple parsing options: \ built-in NTs %s or %u other options.", @@ -413,7 +413,7 @@ pub fn parse_nt(p: &Parser, name: &str) -> nonterminal { match name { "item" => match p.parse_item(~[]) { Some(i) => token::nt_item(i), - None => p.fatal(~"expected an item keyword") + None => p.fatal("expected an item keyword") }, "block" => token::nt_block(p.parse_block()), "stmt" => token::nt_stmt(p.parse_stmt(~[])), diff --git a/src/libsyntax/ext/tt/macro_rules.rs b/src/libsyntax/ext/tt/macro_rules.rs index be6cc7a846a..d34eca342e9 100644 --- a/src/libsyntax/ext/tt/macro_rules.rs +++ b/src/libsyntax/ext/tt/macro_rules.rs @@ -64,12 +64,12 @@ pub fn add_new_extension(cx: @ext_ctxt, // Extract the arguments: let lhses = match *argument_map.get(&lhs_nm) { @matched_seq(ref s, _) => /* FIXME (#2543) */ @copy *s, - _ => cx.span_bug(sp, ~"wrong-structured lhs") + _ => cx.span_bug(sp, "wrong-structured lhs") }; let rhses = match *argument_map.get(&rhs_nm) { @matched_seq(ref s, _) => /* FIXME (#2543) */ @copy *s, - _ => cx.span_bug(sp, ~"wrong-structured rhs") + _ => cx.span_bug(sp, "wrong-structured rhs") }; // Given `lhses` and `rhses`, this is the new macro we create @@ -114,10 +114,10 @@ pub fn add_new_extension(cx: @ext_ctxt, (*tts).slice(1u,(*tts).len()-1u).to_owned() } _ => cx.span_fatal( - sp, ~"macro rhs must be delimited") + sp, "macro rhs must be delimited") } }, - _ => cx.span_bug(sp, ~"bad thing in rhs") + _ => cx.span_bug(sp, "bad thing in rhs") }; // rhs has holes ( `$id` and `$(...)` that need filled) let trncbr = new_tt_reader(s_d, itr, Some(named_matches), @@ -139,7 +139,7 @@ pub fn add_new_extension(cx: @ext_ctxt, error(sp, ref msg) => cx.span_fatal(sp, (*msg)) } } - _ => cx.bug(~"non-matcher found in parsed lhses") + _ => cx.bug("non-matcher found in parsed lhses") } } cx.span_fatal(best_fail_spot, best_fail_msg); diff --git a/src/libsyntax/ext/tt/transcribe.rs b/src/libsyntax/ext/tt/transcribe.rs index 438efb2326c..d806801b7d1 100644 --- a/src/libsyntax/ext/tt/transcribe.rs +++ b/src/libsyntax/ext/tt/transcribe.rs @@ -234,9 +234,9 @@ pub fn tt_next_token(r: &mut TtReader) -> TokenAndSpan { lis_unconstrained => { r.sp_diag.span_fatal( sp, /* blame macro writer */ - ~"attempted to repeat an expression \ - containing no syntax \ - variables matched as repeating at this depth"); + "attempted to repeat an expression \ + containing no syntax \ + variables matched as repeating at this depth"); } lis_contradiction(ref msg) => { /* FIXME #2887 blame macro invoker instead*/ @@ -247,8 +247,8 @@ pub fn tt_next_token(r: &mut TtReader) -> TokenAndSpan { if !zerok { r.sp_diag.span_fatal(sp, /* FIXME #2887 blame invoker */ - ~"this must repeat at least \ - once"); + "this must repeat at least \ + once"); } r.stack.idx += 1u; |
