mirror of
https://github.com/rust-lang/rust.git
synced 2024-12-11 16:15:03 +00:00
More consistent use of backticks and "expected" in error messages.
Got some of the debug messages, here, too. I figure it doesn't hurt to get used to doing this even in places where users won't ever see it.
This commit is contained in:
parent
07a81ad12e
commit
5a63b2100e
@ -405,7 +405,7 @@ impl parser for parser {
|
|||||||
alt self.ch {
|
alt self.ch {
|
||||||
',' { self.bump(); }
|
',' { self.bump(); }
|
||||||
']' { self.bump(); ret ok(list(@values)); }
|
']' { self.bump(); ret ok(list(@values)); }
|
||||||
_ { ret self.error("expecting ',' or ']'"); }
|
_ { ret self.error("expected `,` or `]`"); }
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
@ -437,7 +437,7 @@ impl parser for parser {
|
|||||||
|
|
||||||
if self.ch != ':' {
|
if self.ch != ':' {
|
||||||
if self.eof() { break; }
|
if self.eof() { break; }
|
||||||
ret self.error("expecting ':'");
|
ret self.error("expected `:`");
|
||||||
}
|
}
|
||||||
self.bump();
|
self.bump();
|
||||||
|
|
||||||
@ -452,7 +452,7 @@ impl parser for parser {
|
|||||||
'}' { self.bump(); ret ok(dict(values)); }
|
'}' { self.bump(); ret ok(dict(values)); }
|
||||||
_ {
|
_ {
|
||||||
if self.eof() { break; }
|
if self.eof() { break; }
|
||||||
ret self.error("expecting ',' or '}'");
|
ret self.error("expected `,` or `}`");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -797,7 +797,7 @@ mod tests {
|
|||||||
assert from_str("[1,]") ==
|
assert from_str("[1,]") ==
|
||||||
err({line: 1u, col: 4u, msg: @"invalid syntax"});
|
err({line: 1u, col: 4u, msg: @"invalid syntax"});
|
||||||
assert from_str("[6 7]") ==
|
assert from_str("[6 7]") ==
|
||||||
err({line: 1u, col: 4u, msg: @"expecting ',' or ']'"});
|
err({line: 1u, col: 4u, msg: @"expected `,` or `]`"});
|
||||||
|
|
||||||
assert from_str("[]") == ok(list(@~[]));
|
assert from_str("[]") == ok(list(@~[]));
|
||||||
assert from_str("[ ]") == ok(list(@~[]));
|
assert from_str("[ ]") == ok(list(@~[]));
|
||||||
@ -826,13 +826,13 @@ mod tests {
|
|||||||
err({line: 1u, col: 6u, msg: @"EOF while parsing object"});
|
err({line: 1u, col: 6u, msg: @"EOF while parsing object"});
|
||||||
|
|
||||||
assert from_str("{\"a\" 1") ==
|
assert from_str("{\"a\" 1") ==
|
||||||
err({line: 1u, col: 6u, msg: @"expecting ':'"});
|
err({line: 1u, col: 6u, msg: @"expected `:`"});
|
||||||
assert from_str("{\"a\":") ==
|
assert from_str("{\"a\":") ==
|
||||||
err({line: 1u, col: 6u, msg: @"EOF while parsing value"});
|
err({line: 1u, col: 6u, msg: @"EOF while parsing value"});
|
||||||
assert from_str("{\"a\":1") ==
|
assert from_str("{\"a\":1") ==
|
||||||
err({line: 1u, col: 7u, msg: @"EOF while parsing object"});
|
err({line: 1u, col: 7u, msg: @"EOF while parsing object"});
|
||||||
assert from_str("{\"a\":1 1") ==
|
assert from_str("{\"a\":1 1") ==
|
||||||
err({line: 1u, col: 8u, msg: @"expecting ',' or '}'"});
|
err({line: 1u, col: 8u, msg: @"expected `,` or `}`"});
|
||||||
assert from_str("{\"a\":1,") ==
|
assert from_str("{\"a\":1,") ==
|
||||||
err({line: 1u, col: 8u, msg: @"EOF while parsing object"});
|
err({line: 1u, col: 8u, msg: @"EOF while parsing object"});
|
||||||
|
|
||||||
|
@ -28,23 +28,23 @@ impl parser_common for parser {
|
|||||||
fn unexpected_last(t: token::token) -> ! {
|
fn unexpected_last(t: token::token) -> ! {
|
||||||
self.span_fatal(
|
self.span_fatal(
|
||||||
copy self.last_span,
|
copy self.last_span,
|
||||||
"unexpected token: '" + token_to_str(self.reader, t) + "'");
|
"unexpected token: `" + token_to_str(self.reader, t) + "`");
|
||||||
}
|
}
|
||||||
|
|
||||||
fn unexpected() -> ! {
|
fn unexpected() -> ! {
|
||||||
self.fatal("unexpected token: '"
|
self.fatal("unexpected token: `"
|
||||||
+ token_to_str(self.reader, self.token) + "'");
|
+ token_to_str(self.reader, self.token) + "`");
|
||||||
}
|
}
|
||||||
|
|
||||||
fn expect(t: token::token) {
|
fn expect(t: token::token) {
|
||||||
if self.token == t {
|
if self.token == t {
|
||||||
self.bump();
|
self.bump();
|
||||||
} else {
|
} else {
|
||||||
let mut s: str = "expecting '";
|
let mut s: str = "expected `";
|
||||||
s += token_to_str(self.reader, t);
|
s += token_to_str(self.reader, t);
|
||||||
s += "' but found '";
|
s += "` but found `";
|
||||||
s += token_to_str(self.reader, self.token);
|
s += token_to_str(self.reader, self.token);
|
||||||
self.fatal(s + "'");
|
self.fatal(s + "`");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -53,8 +53,9 @@ impl parser_common for parser {
|
|||||||
token::IDENT(i, _) { self.bump(); ret self.get_str(i); }
|
token::IDENT(i, _) { self.bump(); ret self.get_str(i); }
|
||||||
token::ACTUALLY(token::w_ident(*)) { self.bug(
|
token::ACTUALLY(token::w_ident(*)) { self.bug(
|
||||||
"ident interpolation not converted to real token"); }
|
"ident interpolation not converted to real token"); }
|
||||||
_ { self.fatal("expecting ident, found "
|
_ { self.fatal("expected ident, found `"
|
||||||
+ token_to_str(self.reader, self.token)); }
|
+ token_to_str(self.reader, self.token)
|
||||||
|
+ "`"); }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -121,8 +122,9 @@ impl parser_common for parser {
|
|||||||
fn expect_keyword(word: str) {
|
fn expect_keyword(word: str) {
|
||||||
self.require_keyword(word);
|
self.require_keyword(word);
|
||||||
if !self.eat_keyword(word) {
|
if !self.eat_keyword(word) {
|
||||||
self.fatal("expecting " + word + ", found " +
|
self.fatal("expected `" + word + "`, found `" +
|
||||||
token_to_str(self.reader, self.token));
|
token_to_str(self.reader, self.token) +
|
||||||
|
"`");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -152,10 +154,11 @@ impl parser_common for parser {
|
|||||||
} else if self.token == token::BINOP(token::SHR) {
|
} else if self.token == token::BINOP(token::SHR) {
|
||||||
self.swap(token::GT, self.span.lo + 1u, self.span.hi);
|
self.swap(token::GT, self.span.lo + 1u, self.span.hi);
|
||||||
} else {
|
} else {
|
||||||
let mut s: str = "expecting ";
|
let mut s: str = "expected `";
|
||||||
s += token_to_str(self.reader, token::GT);
|
s += token_to_str(self.reader, token::GT);
|
||||||
s += ", found ";
|
s += "`, found `";
|
||||||
s += token_to_str(self.reader, self.token);
|
s += token_to_str(self.reader, self.token);
|
||||||
|
s += "`";
|
||||||
self.fatal(s);
|
self.fatal(s);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -311,7 +311,7 @@ class parser {
|
|||||||
vis: public})
|
vis: public})
|
||||||
}
|
}
|
||||||
|
|
||||||
_ { self.fatal("expected ';' or '}` \
|
_ { self.fatal("expected `;` or `}` \
|
||||||
but found `"
|
but found `"
|
||||||
+ token_to_str(self.reader, self.token) + "`");
|
+ token_to_str(self.reader, self.token) + "`");
|
||||||
}
|
}
|
||||||
@ -545,7 +545,7 @@ class parser {
|
|||||||
} else if self.token == token::MOD_SEP || is_ident(self.token) {
|
} else if self.token == token::MOD_SEP || is_ident(self.token) {
|
||||||
let path = self.parse_path_with_tps(colons_before_params);
|
let path = self.parse_path_with_tps(colons_before_params);
|
||||||
ty_path(path, self.get_id())
|
ty_path(path, self.get_id())
|
||||||
} else { self.fatal("expecting type"); };
|
} else { self.fatal("expected type"); };
|
||||||
|
|
||||||
let sp = mk_sp(lo, self.last_span.hi);
|
let sp = mk_sp(lo, self.last_span.hi);
|
||||||
ret @{id: self.get_id(),
|
ret @{id: self.get_id(),
|
||||||
@ -1176,7 +1176,7 @@ class parser {
|
|||||||
self.bump();
|
self.bump();
|
||||||
ret (some(sep), zerok);
|
ret (some(sep), zerok);
|
||||||
} else {
|
} else {
|
||||||
self.fatal("expected '*' or '+'");
|
self.fatal("expected `*` or `+`");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1709,8 +1709,9 @@ class parser {
|
|||||||
if self.token == token::UNDERSCORE {
|
if self.token == token::UNDERSCORE {
|
||||||
self.bump();
|
self.bump();
|
||||||
if self.token != token::RBRACE {
|
if self.token != token::RBRACE {
|
||||||
self.fatal("expecting }, found " +
|
self.fatal("expected `}`, found `" +
|
||||||
token_to_str(self.reader, self.token));
|
token_to_str(self.reader, self.token) +
|
||||||
|
"`");
|
||||||
}
|
}
|
||||||
etc = true;
|
etc = true;
|
||||||
break;
|
break;
|
||||||
@ -1855,7 +1856,7 @@ class parser {
|
|||||||
is_mutbl = class_mutable;
|
is_mutbl = class_mutable;
|
||||||
}
|
}
|
||||||
if !is_plain_ident(self.token) {
|
if !is_plain_ident(self.token) {
|
||||||
self.fatal("expecting ident");
|
self.fatal("expected ident");
|
||||||
}
|
}
|
||||||
let name = self.parse_ident();
|
let name = self.parse_ident();
|
||||||
self.expect(token::COLON);
|
self.expect(token::COLON);
|
||||||
@ -2000,9 +2001,9 @@ class parser {
|
|||||||
}
|
}
|
||||||
t {
|
t {
|
||||||
if classify::stmt_ends_with_semi(*stmt) {
|
if classify::stmt_ends_with_semi(*stmt) {
|
||||||
self.fatal("expected ';' or '}' after expression \
|
self.fatal("expected `;` or `}` after expression \
|
||||||
but found '"
|
but found `"
|
||||||
+ token_to_str(self.reader, t) + "'");
|
+ token_to_str(self.reader, t) + "`");
|
||||||
}
|
}
|
||||||
vec::push(stmts, stmt);
|
vec::push(stmts, stmt);
|
||||||
}
|
}
|
||||||
@ -2363,8 +2364,8 @@ class parser {
|
|||||||
alt self.parse_item(attrs, vis) {
|
alt self.parse_item(attrs, vis) {
|
||||||
some(i) { vec::push(items, i); }
|
some(i) { vec::push(items, i); }
|
||||||
_ {
|
_ {
|
||||||
self.fatal("expected item but found '" +
|
self.fatal("expected item but found `" +
|
||||||
token_to_str(self.reader, self.token) + "'");
|
token_to_str(self.reader, self.token) + "`");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#debug["parse_mod_items: attrs=%?", attrs];
|
#debug["parse_mod_items: attrs=%?", attrs];
|
||||||
|
@ -357,7 +357,7 @@ fn build_link_meta(sess: session, c: ast::crate, output: str,
|
|||||||
|
|
||||||
fn warn_missing(sess: session, name: str, default: str) {
|
fn warn_missing(sess: session, name: str, default: str) {
|
||||||
if !sess.building_library { ret; }
|
if !sess.building_library { ret; }
|
||||||
sess.warn(#fmt["missing crate link meta '%s', using '%s' as default",
|
sess.warn(#fmt["missing crate link meta `%s`, using `%s` as default",
|
||||||
name, default]);
|
name, default]);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -371,7 +371,7 @@ fn build_link_meta(sess: session, c: ast::crate, output: str,
|
|||||||
let mut os =
|
let mut os =
|
||||||
str::split_char(path::basename(output), '.');
|
str::split_char(path::basename(output), '.');
|
||||||
if (vec::len(os) < 2u) {
|
if (vec::len(os) < 2u) {
|
||||||
sess.fatal(#fmt("output file name %s doesn't\
|
sess.fatal(#fmt("output file name `%s` doesn't\
|
||||||
appear to have an extension", output));
|
appear to have an extension", output));
|
||||||
}
|
}
|
||||||
vec::pop(os);
|
vec::pop(os);
|
||||||
@ -680,7 +680,7 @@ fn link_binary(sess: session,
|
|||||||
// We run 'cc' here
|
// We run 'cc' here
|
||||||
let prog = run::program_output(cc_prog, cc_args);
|
let prog = run::program_output(cc_prog, cc_args);
|
||||||
if 0 != prog.status {
|
if 0 != prog.status {
|
||||||
sess.err(#fmt["linking with %s failed with code %d",
|
sess.err(#fmt["linking with `%s` failed with code %d",
|
||||||
cc_prog, prog.status]);
|
cc_prog, prog.status]);
|
||||||
sess.note(#fmt["%s arguments: %s",
|
sess.note(#fmt["%s arguments: %s",
|
||||||
cc_prog, str::connect(cc_args, " ")]);
|
cc_prog, str::connect(cc_args, " ")]);
|
||||||
@ -696,7 +696,7 @@ fn link_binary(sess: session,
|
|||||||
// Remove the temporary object file if we aren't saving temps
|
// Remove the temporary object file if we aren't saving temps
|
||||||
if !sess.opts.save_temps {
|
if !sess.opts.save_temps {
|
||||||
if ! os::remove_file(obj_filename) {
|
if ! os::remove_file(obj_filename) {
|
||||||
sess.warn(#fmt["failed to delete object file '%s'",
|
sess.warn(#fmt["failed to delete object file `%s`",
|
||||||
obj_filename]);
|
obj_filename]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -41,7 +41,7 @@ fn load_library_crate(cx: ctxt) -> {ident: str, data: @~[u8]} {
|
|||||||
some(t) { ret t; }
|
some(t) { ret t; }
|
||||||
none {
|
none {
|
||||||
cx.diag.span_fatal(
|
cx.diag.span_fatal(
|
||||||
cx.span, #fmt["can't find crate for '%s'", *cx.ident]);
|
cx.span, #fmt["can't find crate for `%s`", *cx.ident]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -43,7 +43,7 @@ fn check_capture_clause(tcx: ty::ctxt,
|
|||||||
if !vec::any(*freevars, |fv| fv.def == cap_def ) {
|
if !vec::any(*freevars, |fv| fv.def == cap_def ) {
|
||||||
tcx.sess.span_warn(
|
tcx.sess.span_warn(
|
||||||
cap_item.span,
|
cap_item.span,
|
||||||
#fmt("captured variable '%s' not used in closure",
|
#fmt("captured variable `%s` not used in closure",
|
||||||
*cap_item.name));
|
*cap_item.name));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -51,7 +51,7 @@ fn check_capture_clause(tcx: ty::ctxt,
|
|||||||
if !seen_defs.insert(cap_def_id, ()) {
|
if !seen_defs.insert(cap_def_id, ()) {
|
||||||
tcx.sess.span_err(
|
tcx.sess.span_err(
|
||||||
cap_item.span,
|
cap_item.span,
|
||||||
#fmt("variable '%s' captured more than once",
|
#fmt("variable `%s` captured more than once",
|
||||||
*cap_item.name));
|
*cap_item.name));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -127,7 +127,7 @@ fn get_lint_dict() -> lint_dict {
|
|||||||
("vecs_not_implicitly_copyable",
|
("vecs_not_implicitly_copyable",
|
||||||
@{lint: vecs_not_implicitly_copyable,
|
@{lint: vecs_not_implicitly_copyable,
|
||||||
desc: "make vecs and strs not implicitly copyable\
|
desc: "make vecs and strs not implicitly copyable\
|
||||||
('err' is ignored; only checked at top level",
|
(`err` is ignored; only checked at top level",
|
||||||
default: warn}),
|
default: warn}),
|
||||||
|
|
||||||
("implicit_copies",
|
("implicit_copies",
|
||||||
@ -223,7 +223,7 @@ impl methods for ctxt {
|
|||||||
self.span_lint(
|
self.span_lint(
|
||||||
self.get_level(unrecognized_warning),
|
self.get_level(unrecognized_warning),
|
||||||
meta.span,
|
meta.span,
|
||||||
#fmt("unknown warning: '%s'", name));
|
#fmt("unknown warning: `%s`", name));
|
||||||
}
|
}
|
||||||
(_, some((lint, new_level))) {
|
(_, some((lint, new_level))) {
|
||||||
// we do multiple unneeded copies of the map
|
// we do multiple unneeded copies of the map
|
||||||
|
@ -1309,7 +1309,7 @@ class Resolver {
|
|||||||
def_self(*) | def_arg(*) | def_local(*) |
|
def_self(*) | def_arg(*) | def_local(*) |
|
||||||
def_prim_ty(*) | def_ty_param(*) | def_binding(*) |
|
def_prim_ty(*) | def_ty_param(*) | def_binding(*) |
|
||||||
def_use(*) | def_upvar(*) | def_region(*) {
|
def_use(*) | def_upvar(*) | def_region(*) {
|
||||||
fail #fmt("didn't expect %?", def);
|
fail #fmt("didn't expect `%?`", def);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1360,14 +1360,14 @@ class Resolver {
|
|||||||
// skip them.
|
// skip them.
|
||||||
|
|
||||||
#debug("(building reduced graph for impls in external crate) looking \
|
#debug("(building reduced graph for impls in external crate) looking \
|
||||||
for impls in '%s' (%?)",
|
for impls in `%s` (%?)",
|
||||||
self.module_to_str(module),
|
self.module_to_str(module),
|
||||||
copy module.def_id);
|
copy module.def_id);
|
||||||
|
|
||||||
alt module.def_id {
|
alt module.def_id {
|
||||||
none {
|
none {
|
||||||
#debug("(building reduced graph for impls in external \
|
#debug("(building reduced graph for impls in external \
|
||||||
module) no def ID for '%s', skipping",
|
module) no def ID for `%s`, skipping",
|
||||||
self.module_to_str(module));
|
self.module_to_str(module));
|
||||||
ret;
|
ret;
|
||||||
}
|
}
|
||||||
@ -1390,7 +1390,7 @@ class Resolver {
|
|||||||
def_ids.insert(implementation.did, ());
|
def_ids.insert(implementation.did, ());
|
||||||
|
|
||||||
#debug("(building reduced graph for impls in external module) \
|
#debug("(building reduced graph for impls in external module) \
|
||||||
added impl '%s' (%?) to '%s'",
|
added impl `%s` (%?) to `%s`",
|
||||||
*implementation.ident,
|
*implementation.ident,
|
||||||
implementation.did,
|
implementation.did,
|
||||||
self.module_to_str(module));
|
self.module_to_str(module));
|
||||||
@ -1549,8 +1549,8 @@ class Resolver {
|
|||||||
let mut resolution_result;
|
let mut resolution_result;
|
||||||
let module_path = import_directive.module_path;
|
let module_path = import_directive.module_path;
|
||||||
|
|
||||||
#debug("(resolving import for module) resolving import '%s::...' in \
|
#debug("(resolving import for module) resolving import `%s::...` in \
|
||||||
'%s'",
|
`%s`",
|
||||||
*(*self.atom_table).atoms_to_str((*module_path).get()),
|
*(*self.atom_table).atoms_to_str((*module_path).get()),
|
||||||
self.module_to_str(module));
|
self.module_to_str(module));
|
||||||
|
|
||||||
@ -1633,15 +1633,15 @@ class Resolver {
|
|||||||
target: Atom, source: Atom)
|
target: Atom, source: Atom)
|
||||||
-> ResolveResult<()> {
|
-> ResolveResult<()> {
|
||||||
|
|
||||||
#debug("(resolving single import) resolving '%s' = '%s::%s' from \
|
#debug("(resolving single import) resolving `%s` = `%s::%s` from \
|
||||||
'%s'",
|
`%s`",
|
||||||
*(*self.atom_table).atom_to_str(target),
|
*(*self.atom_table).atom_to_str(target),
|
||||||
self.module_to_str(containing_module),
|
self.module_to_str(containing_module),
|
||||||
*(*self.atom_table).atom_to_str(source),
|
*(*self.atom_table).atom_to_str(source),
|
||||||
self.module_to_str(module));
|
self.module_to_str(module));
|
||||||
|
|
||||||
if !self.name_is_exported(containing_module, source) {
|
if !self.name_is_exported(containing_module, source) {
|
||||||
#debug("(resolving single import) name '%s' is unexported",
|
#debug("(resolving single import) name `%s` is unexported",
|
||||||
*(*self.atom_table).atom_to_str(source));
|
*(*self.atom_table).atom_to_str(source));
|
||||||
ret Failed;
|
ret Failed;
|
||||||
}
|
}
|
||||||
@ -1875,13 +1875,13 @@ class Resolver {
|
|||||||
|atom, target_import_resolution| {
|
|atom, target_import_resolution| {
|
||||||
|
|
||||||
if !self.name_is_exported(containing_module, atom) {
|
if !self.name_is_exported(containing_module, atom) {
|
||||||
#debug("(resolving glob import) name '%s' is unexported",
|
#debug("(resolving glob import) name `%s` is unexported",
|
||||||
*(*self.atom_table).atom_to_str(atom));
|
*(*self.atom_table).atom_to_str(atom));
|
||||||
again;
|
again;
|
||||||
}
|
}
|
||||||
|
|
||||||
#debug("(resolving glob import) writing module resolution \
|
#debug("(resolving glob import) writing module resolution \
|
||||||
%? into '%s'",
|
%? into `%s`",
|
||||||
is_none(target_import_resolution.module_target),
|
is_none(target_import_resolution.module_target),
|
||||||
self.module_to_str(module));
|
self.module_to_str(module));
|
||||||
|
|
||||||
@ -1952,7 +1952,7 @@ class Resolver {
|
|||||||
// Add all children from the containing module.
|
// Add all children from the containing module.
|
||||||
for containing_module.children.each |atom, name_bindings| {
|
for containing_module.children.each |atom, name_bindings| {
|
||||||
if !self.name_is_exported(containing_module, atom) {
|
if !self.name_is_exported(containing_module, atom) {
|
||||||
#debug("(resolving glob import) name '%s' is unexported",
|
#debug("(resolving glob import) name `%s` is unexported",
|
||||||
*(*self.atom_table).atom_to_str(atom));
|
*(*self.atom_table).atom_to_str(atom));
|
||||||
again;
|
again;
|
||||||
}
|
}
|
||||||
@ -1971,8 +1971,8 @@ class Resolver {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#debug("(resolving glob import) writing resolution '%s' in '%s' \
|
#debug("(resolving glob import) writing resolution `%s` in `%s` \
|
||||||
to '%s'",
|
to `%s`",
|
||||||
*(*self.atom_table).atom_to_str(atom),
|
*(*self.atom_table).atom_to_str(atom),
|
||||||
self.module_to_str(containing_module),
|
self.module_to_str(containing_module),
|
||||||
self.module_to_str(module));
|
self.module_to_str(module));
|
||||||
@ -2070,8 +2070,8 @@ class Resolver {
|
|||||||
let module_path_len = (*module_path).len();
|
let module_path_len = (*module_path).len();
|
||||||
assert module_path_len > 0u;
|
assert module_path_len > 0u;
|
||||||
|
|
||||||
#debug("(resolving module path for import) processing '%s' rooted at \
|
#debug("(resolving module path for import) processing `%s` rooted at \
|
||||||
'%s'",
|
`%s`",
|
||||||
*(*self.atom_table).atoms_to_str((*module_path).get()),
|
*(*self.atom_table).atoms_to_str((*module_path).get()),
|
||||||
self.module_to_str(module));
|
self.module_to_str(module));
|
||||||
|
|
||||||
@ -2107,8 +2107,8 @@ class Resolver {
|
|||||||
namespace: Namespace)
|
namespace: Namespace)
|
||||||
-> ResolveResult<Target> {
|
-> ResolveResult<Target> {
|
||||||
|
|
||||||
#debug("(resolving item in lexical scope) resolving '%s' in \
|
#debug("(resolving item in lexical scope) resolving `%s` in \
|
||||||
namespace %? in '%s'",
|
namespace %? in `%s`",
|
||||||
*(*self.atom_table).atom_to_str(name),
|
*(*self.atom_table).atom_to_str(name),
|
||||||
namespace,
|
namespace,
|
||||||
self.module_to_str(module));
|
self.module_to_str(module));
|
||||||
@ -2234,12 +2234,12 @@ class Resolver {
|
|||||||
xray: XrayFlag)
|
xray: XrayFlag)
|
||||||
-> ResolveResult<Target> {
|
-> ResolveResult<Target> {
|
||||||
|
|
||||||
#debug("(resolving name in module) resolving '%s' in '%s'",
|
#debug("(resolving name in module) resolving `%s` in `%s`",
|
||||||
*(*self.atom_table).atom_to_str(name),
|
*(*self.atom_table).atom_to_str(name),
|
||||||
self.module_to_str(module));
|
self.module_to_str(module));
|
||||||
|
|
||||||
if xray == NoXray && !self.name_is_exported(module, name) {
|
if xray == NoXray && !self.name_is_exported(module, name) {
|
||||||
#debug("(resolving name in module) name '%s' is unexported",
|
#debug("(resolving name in module) name `%s` is unexported",
|
||||||
*(*self.atom_table).atom_to_str(name));
|
*(*self.atom_table).atom_to_str(name));
|
||||||
ret Failed;
|
ret Failed;
|
||||||
}
|
}
|
||||||
@ -2320,8 +2320,8 @@ class Resolver {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#debug("(resolving one-level naming result) resolving import '%s' = \
|
#debug("(resolving one-level naming result) resolving import `%s` = \
|
||||||
'%s' in '%s'",
|
`%s` in `%s`",
|
||||||
*(*self.atom_table).atom_to_str(target_name),
|
*(*self.atom_table).atom_to_str(target_name),
|
||||||
*(*self.atom_table).atom_to_str(source_name),
|
*(*self.atom_table).atom_to_str(source_name),
|
||||||
self.module_to_str(module));
|
self.module_to_str(module));
|
||||||
@ -2456,7 +2456,7 @@ class Resolver {
|
|||||||
}
|
}
|
||||||
some(import_resolution) {
|
some(import_resolution) {
|
||||||
#debug("(resolving one-level renaming import) writing module \
|
#debug("(resolving one-level renaming import) writing module \
|
||||||
result %? for '%s' into '%s'",
|
result %? for `%s` into `%s`",
|
||||||
is_none(module_result),
|
is_none(module_result),
|
||||||
*(*self.atom_table).atom_to_str(target_name),
|
*(*self.atom_table).atom_to_str(target_name),
|
||||||
self.module_to_str(module));
|
self.module_to_str(module));
|
||||||
@ -2536,7 +2536,7 @@ class Resolver {
|
|||||||
some(_) {
|
some(_) {
|
||||||
// Bail out.
|
// Bail out.
|
||||||
#debug("(recording exports for module subtree) not recording \
|
#debug("(recording exports for module subtree) not recording \
|
||||||
exports for '%s'",
|
exports for `%s`",
|
||||||
self.module_to_str(module));
|
self.module_to_str(module));
|
||||||
ret;
|
ret;
|
||||||
}
|
}
|
||||||
@ -2622,7 +2622,7 @@ class Resolver {
|
|||||||
some(_) {
|
some(_) {
|
||||||
// Bail out.
|
// Bail out.
|
||||||
#debug("(building impl scopes for module subtree) not \
|
#debug("(building impl scopes for module subtree) not \
|
||||||
resolving implementations for '%s'",
|
resolving implementations for `%s`",
|
||||||
self.module_to_str(module));
|
self.module_to_str(module));
|
||||||
ret;
|
ret;
|
||||||
}
|
}
|
||||||
@ -2724,7 +2724,7 @@ class Resolver {
|
|||||||
some(name) {
|
some(name) {
|
||||||
alt orig_module.children.find(name) {
|
alt orig_module.children.find(name) {
|
||||||
none {
|
none {
|
||||||
#debug("!!! (with scope) didn't find '%s' in '%s'",
|
#debug("!!! (with scope) didn't find `%s` in `%s`",
|
||||||
*(*self.atom_table).atom_to_str(name),
|
*(*self.atom_table).atom_to_str(name),
|
||||||
self.module_to_str(orig_module));
|
self.module_to_str(orig_module));
|
||||||
}
|
}
|
||||||
@ -2732,7 +2732,7 @@ class Resolver {
|
|||||||
alt (*name_bindings).get_module_if_available() {
|
alt (*name_bindings).get_module_if_available() {
|
||||||
none {
|
none {
|
||||||
#debug("!!! (with scope) didn't find module \
|
#debug("!!! (with scope) didn't find module \
|
||||||
for '%s' in '%s'",
|
for `%s` in `%s`",
|
||||||
*(*self.atom_table).atom_to_str(name),
|
*(*self.atom_table).atom_to_str(name),
|
||||||
self.module_to_str(orig_module));
|
self.module_to_str(orig_module));
|
||||||
}
|
}
|
||||||
@ -3155,7 +3155,7 @@ class Resolver {
|
|||||||
|
|
||||||
self.resolve_type(argument.ty, visitor);
|
self.resolve_type(argument.ty, visitor);
|
||||||
|
|
||||||
#debug("(resolving function) recorded argument '%s'",
|
#debug("(resolving function) recorded argument `%s`",
|
||||||
*(*self.atom_table).atom_to_str(name));
|
*(*self.atom_table).atom_to_str(name));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -3504,7 +3504,7 @@ class Resolver {
|
|||||||
let mut result_def;
|
let mut result_def;
|
||||||
alt self.resolve_path(path, TypeNS, true, visitor) {
|
alt self.resolve_path(path, TypeNS, true, visitor) {
|
||||||
some(def) {
|
some(def) {
|
||||||
#debug("(resolving type) resolved '%s' to type",
|
#debug("(resolving type) resolved `%s` to type",
|
||||||
*path.idents.last());
|
*path.idents.last());
|
||||||
result_def = some(def);
|
result_def = some(def);
|
||||||
}
|
}
|
||||||
@ -3542,7 +3542,7 @@ class Resolver {
|
|||||||
alt copy result_def {
|
alt copy result_def {
|
||||||
some(def) {
|
some(def) {
|
||||||
// Write the result into the def map.
|
// Write the result into the def map.
|
||||||
#debug("(resolving type) writing resolution for '%s' \
|
#debug("(resolving type) writing resolution for `%s` \
|
||||||
(id %d)",
|
(id %d)",
|
||||||
connect(path.idents.map(|x| *x), "::"),
|
connect(path.idents.map(|x| *x), "::"),
|
||||||
path_id);
|
path_id);
|
||||||
@ -3550,7 +3550,7 @@ class Resolver {
|
|||||||
}
|
}
|
||||||
none {
|
none {
|
||||||
self.session.span_err
|
self.session.span_err
|
||||||
(ty.span, #fmt("use of undeclared type name '%s'",
|
(ty.span, #fmt("use of undeclared type name `%s`",
|
||||||
connect(path.idents.map(|x| *x),
|
connect(path.idents.map(|x| *x),
|
||||||
"::")));
|
"::")));
|
||||||
}
|
}
|
||||||
@ -3606,7 +3606,7 @@ class Resolver {
|
|||||||
|
|
||||||
alt self.resolve_enum_variant_or_const(atom) {
|
alt self.resolve_enum_variant_or_const(atom) {
|
||||||
FoundEnumVariant(def) if mode == RefutableMode {
|
FoundEnumVariant(def) if mode == RefutableMode {
|
||||||
#debug("(resolving pattern) resolving '%s' to \
|
#debug("(resolving pattern) resolving `%s` to \
|
||||||
enum variant",
|
enum variant",
|
||||||
*path.idents[0]);
|
*path.idents[0]);
|
||||||
|
|
||||||
@ -3628,7 +3628,7 @@ class Resolver {
|
|||||||
in scope");
|
in scope");
|
||||||
}
|
}
|
||||||
EnumVariantOrConstNotFound {
|
EnumVariantOrConstNotFound {
|
||||||
#debug("(resolving pattern) binding '%s'",
|
#debug("(resolving pattern) binding `%s`",
|
||||||
*path.idents[0]);
|
*path.idents[0]);
|
||||||
|
|
||||||
let is_mutable = mutability == Mutable;
|
let is_mutable = mutability == Mutable;
|
||||||
@ -3822,7 +3822,7 @@ class Resolver {
|
|||||||
-> NameDefinition {
|
-> NameDefinition {
|
||||||
|
|
||||||
if xray == NoXray && !self.name_is_exported(containing_module, name) {
|
if xray == NoXray && !self.name_is_exported(containing_module, name) {
|
||||||
#debug("(resolving definition of name in module) name '%s' is \
|
#debug("(resolving definition of name in module) name `%s` is \
|
||||||
unexported",
|
unexported",
|
||||||
*(*self.atom_table).atom_to_str(name));
|
*(*self.atom_table).atom_to_str(name));
|
||||||
ret NoNameDefinition;
|
ret NoNameDefinition;
|
||||||
@ -4018,7 +4018,7 @@ class Resolver {
|
|||||||
|
|
||||||
alt copy search_result {
|
alt copy search_result {
|
||||||
some(dl_def(def)) {
|
some(dl_def(def)) {
|
||||||
#debug("(resolving path in local ribs) resolved '%s' to \
|
#debug("(resolving path in local ribs) resolved `%s` to \
|
||||||
local: %?",
|
local: %?",
|
||||||
*(*self.atom_table).atom_to_str(name),
|
*(*self.atom_table).atom_to_str(name),
|
||||||
def);
|
def);
|
||||||
@ -4049,7 +4049,7 @@ class Resolver {
|
|||||||
}
|
}
|
||||||
some(def) {
|
some(def) {
|
||||||
#debug("(resolving item path in lexical scope) \
|
#debug("(resolving item path in lexical scope) \
|
||||||
resolved '%s' to item",
|
resolved `%s` to item",
|
||||||
*(*self.atom_table).atom_to_str(name));
|
*(*self.atom_table).atom_to_str(name));
|
||||||
ret some(def);
|
ret some(def);
|
||||||
}
|
}
|
||||||
@ -4082,7 +4082,7 @@ class Resolver {
|
|||||||
alt self.resolve_path(path, ValueNS, true, visitor) {
|
alt self.resolve_path(path, ValueNS, true, visitor) {
|
||||||
some(def) {
|
some(def) {
|
||||||
// Write the result into the def map.
|
// Write the result into the def map.
|
||||||
#debug("(resolving expr) resolved '%s'",
|
#debug("(resolving expr) resolved `%s`",
|
||||||
connect(path.idents.map(|x| *x), "::"));
|
connect(path.idents.map(|x| *x), "::"));
|
||||||
self.record_def(expr.id, def);
|
self.record_def(expr.id, def);
|
||||||
}
|
}
|
||||||
@ -4166,7 +4166,7 @@ class Resolver {
|
|||||||
some(_) {
|
some(_) {
|
||||||
// Bail out.
|
// Bail out.
|
||||||
#debug("(checking for unused imports in module subtree) not \
|
#debug("(checking for unused imports in module subtree) not \
|
||||||
checking for unused imports for '%s'",
|
checking for unused imports for `%s`",
|
||||||
self.module_to_str(module));
|
self.module_to_str(module));
|
||||||
ret;
|
ret;
|
||||||
}
|
}
|
||||||
@ -4262,7 +4262,7 @@ class Resolver {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fn dump_module(module: @Module) {
|
fn dump_module(module: @Module) {
|
||||||
#debug("Dump of module '%s':", self.module_to_str(module));
|
#debug("Dump of module `%s`:", self.module_to_str(module));
|
||||||
|
|
||||||
#debug("Children:");
|
#debug("Children:");
|
||||||
for module.children.each |name, _child| {
|
for module.children.each |name, _child| {
|
||||||
|
@ -262,7 +262,7 @@ fn check_main_fn_ty(ccx: @crate_ctxt,
|
|||||||
if !ok {
|
if !ok {
|
||||||
tcx.sess.span_err(main_span,
|
tcx.sess.span_err(main_span,
|
||||||
#fmt("Wrong type in main function: found `%s`, \
|
#fmt("Wrong type in main function: found `%s`, \
|
||||||
expecting `extern fn(~[str]) -> ()` \
|
expected `extern fn(~[str]) -> ()` \
|
||||||
or `extern fn() -> ()`",
|
or `extern fn() -> ()`",
|
||||||
ty_to_str(tcx, main_t)));
|
ty_to_str(tcx, main_t)));
|
||||||
}
|
}
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
// error-pattern: expecting mod
|
// error-pattern: expected `mod`
|
||||||
|
|
||||||
#[attr = "val"];
|
#[attr = "val"];
|
||||||
#[attr = "val"] // Unterminated
|
#[attr = "val"] // Unterminated
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
// error-pattern:expecting ']'
|
// error-pattern:expected `]`
|
||||||
|
|
||||||
// asterisk is bogus
|
// asterisk is bogus
|
||||||
#[attr*]
|
#[attr*]
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
// error-pattern: expecting
|
// error-pattern: expected
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
let int x = 5;
|
let int x = 5;
|
||||||
|
@ -1,3 +1,3 @@
|
|||||||
// error-pattern:expecting `extern fn(~[str])
|
// error-pattern:expected `extern fn(~[str])
|
||||||
|
|
||||||
fn main(x: int) { }
|
fn main(x: int) { }
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
// error-pattern: expecting
|
// error-pattern: expected
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
let x.y::<int>.z foo;
|
let x.y::<int>.z foo;
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
// error-pattern:variable 'x' captured more than once
|
// error-pattern:variable `x` captured more than once
|
||||||
fn main() {
|
fn main() {
|
||||||
let x = 5;
|
let x = 5;
|
||||||
let y = fn~(move x, copy x) -> int { x };
|
let y = fn~(move x, copy x) -> int { x };
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
// error-pattern:variable 'x' captured more than once
|
// error-pattern:variable `x` captured more than once
|
||||||
fn main() {
|
fn main() {
|
||||||
let x = 5;
|
let x = 5;
|
||||||
let y = fn~(copy x, copy x) -> int { x };
|
let y = fn~(copy x, copy x) -> int { x };
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
// error-pattern:variable 'x' captured more than once
|
// error-pattern:variable `x` captured more than once
|
||||||
fn main() {
|
fn main() {
|
||||||
let x = 5;
|
let x = 5;
|
||||||
let y = fn~(move x, move x) -> int { x };
|
let y = fn~(move x, move x) -> int { x };
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
fn main() {
|
fn main() {
|
||||||
do something
|
do something
|
||||||
|x| do somethingelse //~ ERROR: expecting '{' but found 'do'
|
|x| do somethingelse //~ ERROR: expected `{` but found `do`
|
||||||
|y| say(x, y)
|
|y| say(x, y)
|
||||||
}
|
}
|
||||||
|
@ -1,3 +1,3 @@
|
|||||||
fn main() {
|
fn main() {
|
||||||
let x = do y; //~ ERROR: expecting '{' but found
|
let x = do y; //~ ERROR: expected `{` but found
|
||||||
}
|
}
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
// error-pattern:unexpected token: '}'
|
// error-pattern:unexpected token: `}`
|
||||||
// Issue #1200
|
// Issue #1200
|
||||||
|
|
||||||
type t = {};
|
type t = {};
|
||||||
|
@ -1,3 +1,3 @@
|
|||||||
fn main() {
|
fn main() {
|
||||||
let v = ~[,]; //~ ERROR unexpected token: ','
|
let v = ~[,]; //~ ERROR unexpected token: `,`
|
||||||
}
|
}
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
// error-pattern:expected item but found '#'
|
// error-pattern:expected item but found `#`
|
||||||
|
|
||||||
// Don't know how to deal with a syntax extension appearing after an
|
// Don't know how to deal with a syntax extension appearing after an
|
||||||
// item attribute. Probably could use a better error message.
|
// item attribute. Probably could use a better error message.
|
||||||
|
@ -1,2 +1,2 @@
|
|||||||
// error-pattern:expecting
|
// error-pattern:expected
|
||||||
import foo::{bar}::baz
|
import foo::{bar}::baz
|
@ -1,4 +1,4 @@
|
|||||||
// error-pattern:expecting
|
// error-pattern:expected
|
||||||
|
|
||||||
import baz = foo::{bar};
|
import baz = foo::{bar};
|
||||||
|
|
||||||
|
@ -1,2 +1,2 @@
|
|||||||
// error-pattern:expecting
|
// error-pattern:expected
|
||||||
import foo::*::bar
|
import foo::*::bar
|
@ -1,4 +1,4 @@
|
|||||||
// error-pattern:expecting
|
// error-pattern:expected
|
||||||
|
|
||||||
import baz = foo::*;
|
import baz = foo::*;
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
// xfail-test
|
// xfail-test
|
||||||
|
|
||||||
fn foo(x) { //~ ERROR expecting ':' but found ')'
|
fn foo(x) { //~ ERROR expected `:` but found `)`
|
||||||
}
|
}
|
@ -1,4 +1,4 @@
|
|||||||
// error-pattern:can't find crate for 'std'
|
// error-pattern:can't find crate for `std`
|
||||||
|
|
||||||
use std(complex(meta(item)));
|
use std(complex(meta(item)));
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
// error-pattern:can't find crate for 'std'
|
// error-pattern:can't find crate for `std`
|
||||||
|
|
||||||
use std (name = "std",
|
use std (name = "std",
|
||||||
vers = "bogus");
|
vers = "bogus");
|
Loading…
Reference in New Issue
Block a user