Skip to content

Commit f7f8d65

Browse files
committed
resolve: Remove ! from "cannot find" diagnostics for macros
1 parent 42a19dd commit f7f8d65

34 files changed

+42
-43
lines changed

src/librustc_resolve/macros.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -774,9 +774,8 @@ impl<'a> Resolver<'a> {
774774
}
775775
Err(..) => {
776776
assert!(initial_binding.is_none());
777-
let bang = if kind == MacroKind::Bang { "!" } else { "" };
778777
let expected = kind.descr_expected();
779-
let msg = format!("cannot find {} `{}{}` in this scope", expected, ident, bang);
778+
let msg = format!("cannot find {} `{}` in this scope", expected, ident);
780779
let mut err = self.session.struct_span_err(ident.span, &msg);
781780
self.unresolved_macro_suggestions(&mut err, kind, &parent_scope, ident);
782781
err.emit();

src/test/ui/empty/empty-macro-use.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
error: cannot find macro `macro_two!` in this scope
1+
error: cannot find macro `macro_two` in this scope
22
--> $DIR/empty-macro-use.rs:7:5
33
|
44
LL | macro_two!();

src/test/ui/ext-nonexistent.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
error: cannot find macro `iamnotanextensionthatexists!` in this scope
1+
error: cannot find macro `iamnotanextensionthatexists` in this scope
22
--> $DIR/ext-nonexistent.rs:2:13
33
|
44
LL | fn main() { iamnotanextensionthatexists!(""); }

src/test/ui/hygiene/no_implicit_prelude-2018.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
mod bar {
55
fn f() {
66
::std::print!(""); // OK
7-
print!(); //~ ERROR cannot find macro `print!` in this scope
7+
print!(); //~ ERROR cannot find macro `print` in this scope
88
}
99
}
1010

src/test/ui/hygiene/no_implicit_prelude-2018.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
error: cannot find macro `print!` in this scope
1+
error: cannot find macro `print` in this scope
22
--> $DIR/no_implicit_prelude-2018.rs:7:9
33
|
44
LL | print!();

src/test/ui/hygiene/no_implicit_prelude.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ mod bar {
1313
}
1414
fn f() {
1515
::foo::m!();
16-
assert_eq!(0, 0); //~ ERROR cannot find macro `panic!` in this scope
16+
assert_eq!(0, 0); //~ ERROR cannot find macro `panic` in this scope
1717
}
1818
}
1919

src/test/ui/hygiene/no_implicit_prelude.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
error: cannot find macro `panic!` in this scope
1+
error: cannot find macro `panic` in this scope
22
--> $DIR/no_implicit_prelude.rs:16:9
33
|
44
LL | assert_eq!(0, 0);

src/test/ui/issues/issue-11692-1.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
fn main() {
2-
print!(testo!()); //~ ERROR cannot find macro `testo!` in this scope
2+
print!(testo!()); //~ ERROR cannot find macro `testo` in this scope
33
}

src/test/ui/issues/issue-11692-1.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
error: cannot find macro `testo!` in this scope
1+
error: cannot find macro `testo` in this scope
22
--> $DIR/issue-11692-1.rs:2:12
33
|
44
LL | print!(testo!());

src/test/ui/issues/issue-11692-2.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
fn main() {
2-
concat!(test!()); //~ ERROR cannot find macro `test!` in this scope
2+
concat!(test!()); //~ ERROR cannot find macro `test` in this scope
33
}

0 commit comments

Comments
 (0)