diff options
| author | Caio <c410.f3r@gmail.com> | 2022-12-23 08:05:00 -0300 |
|---|---|---|
| committer | Caio <c410.f3r@gmail.com> | 2022-12-23 08:05:12 -0300 |
| commit | d4344d2f91de09ef35494585d92eb66e284890f3 (patch) | |
| tree | 12019522b3f247398dd30ba9febd66e4832eb337 /src/test/ui/macros | |
| parent | 5e656baf8bc832d3b77a1e49373352b3b2685fc0 (diff) | |
Move tests
Diffstat (limited to 'src/test/ui/macros')
| -rw-r--r-- | src/test/ui/macros/issue-25385.rs | 12 | ||||
| -rw-r--r-- | src/test/ui/macros/issue-25385.stderr | 20 |
2 files changed, 32 insertions, 0 deletions
diff --git a/src/test/ui/macros/issue-25385.rs b/src/test/ui/macros/issue-25385.rs new file mode 100644 index 00000000000..ea042a6c76b --- /dev/null +++ b/src/test/ui/macros/issue-25385.rs @@ -0,0 +1,12 @@ +macro_rules! foo { + ($e:expr) => { $e.foo() } + //~^ ERROR no method named `foo` found +} + +fn main() { + let a = 1i32; + foo!(a); + + foo!(1i32.foo()); + //~^ ERROR no method named `foo` found +} diff --git a/src/test/ui/macros/issue-25385.stderr b/src/test/ui/macros/issue-25385.stderr new file mode 100644 index 00000000000..39dbdd753a6 --- /dev/null +++ b/src/test/ui/macros/issue-25385.stderr @@ -0,0 +1,20 @@ +error[E0599]: no method named `foo` found for type `i32` in the current scope + --> $DIR/issue-25385.rs:2:23 + | +LL | ($e:expr) => { $e.foo() } + | ^^^ method not found in `i32` +... +LL | foo!(a); + | ------- in this macro invocation + | + = note: this error originates in the macro `foo` (in Nightly builds, run with -Z macro-backtrace for more info) + +error[E0599]: no method named `foo` found for type `i32` in the current scope + --> $DIR/issue-25385.rs:10:15 + | +LL | foo!(1i32.foo()); + | ^^^ method not found in `i32` + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0599`. |
