From 631cd5845e8de329d0e227aaa707d7ea228b8f8f Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 17 Apr 2024 14:20:29 +0200 Subject: Merging upstream version 1.70.0+dfsg1. Signed-off-by: Daniel Baumann --- tests/ui/macros/bad-concat.stderr | 2 +- tests/ui/macros/concat-bytes-error.stderr | 8 +-- tests/ui/macros/concat.stderr | 4 +- tests/ui/macros/issue-100199.stderr | 2 +- tests/ui/macros/issue-106837.rs | 10 +++ tests/ui/macros/issue-106837.stderr | 18 +++++ tests/ui/macros/issue-109237.rs | 7 ++ tests/ui/macros/issue-109237.stderr | 18 +++++ tests/ui/macros/issue-40469.rs | 1 - tests/ui/macros/issue-98790.rs | 24 +++++++ tests/ui/macros/macro-comma-support-rpass.rs | 1 - tests/ui/macros/macro-include-items.rs | 1 - tests/ui/macros/macro-outer-attributes.stderr | 2 +- tests/ui/macros/macro-path-prelude-fail-4.stderr | 8 +++ tests/ui/macros/macro-path-prelude-fail-5.rs | 10 +++ tests/ui/macros/macro-path-prelude-fail-5.stderr | 30 ++++++++ tests/ui/macros/macros-nonfatal-errors.stderr | 18 ++++- tests/ui/macros/missing-writer.rs | 17 +++++ tests/ui/macros/missing-writer.stderr | 59 +++++++++++++++ tests/ui/macros/nested-use-as.rs | 83 ++++++++++++++++++++++ tests/ui/macros/nonterminal-matching.stderr | 3 + .../all-expr-kinds.rs | 7 +- tests/ui/macros/stringify.rs | 4 -- tests/ui/macros/syntax-extension-source-utils.rs | 7 +- 24 files changed, 316 insertions(+), 28 deletions(-) create mode 100644 tests/ui/macros/issue-106837.rs create mode 100644 tests/ui/macros/issue-106837.stderr create mode 100644 tests/ui/macros/issue-109237.rs create mode 100644 tests/ui/macros/issue-109237.stderr create mode 100644 tests/ui/macros/issue-98790.rs create mode 100644 tests/ui/macros/macro-path-prelude-fail-5.rs create mode 100644 tests/ui/macros/macro-path-prelude-fail-5.stderr create mode 100644 tests/ui/macros/missing-writer.rs create mode 100644 tests/ui/macros/missing-writer.stderr create mode 100644 tests/ui/macros/nested-use-as.rs (limited to 'tests/ui/macros') diff --git a/tests/ui/macros/bad-concat.stderr b/tests/ui/macros/bad-concat.stderr index 4316fd312..d67f3c33d 100644 --- a/tests/ui/macros/bad-concat.stderr +++ b/tests/ui/macros/bad-concat.stderr @@ -4,7 +4,7 @@ error: expected a literal LL | let _ = concat!(x, y, z, "bar"); | ^ ^ ^ | - = note: only literals (like `"foo"`, `42` and `3.14`) can be passed to `concat!()` + = note: only literals (like `"foo"`, `-42` and `3.14`) can be passed to `concat!()` error: aborting due to previous error diff --git a/tests/ui/macros/concat-bytes-error.stderr b/tests/ui/macros/concat-bytes-error.stderr index d6cd1a3d1..3f2c64922 100644 --- a/tests/ui/macros/concat-bytes-error.stderr +++ b/tests/ui/macros/concat-bytes-error.stderr @@ -4,7 +4,7 @@ error: expected a byte literal LL | concat_bytes!(pie); | ^^^ | - = note: only byte literals (like `b"foo"`, `b's'`, and `[3, 4, 5]`) can be passed to `concat_bytes!()` + = note: only byte literals (like `b"foo"`, `b's'` and `[3, 4, 5]`) can be passed to `concat_bytes!()` error: expected a byte literal --> $DIR/concat-bytes-error.rs:5:19 @@ -12,7 +12,7 @@ error: expected a byte literal LL | concat_bytes!(pie, pie); | ^^^ ^^^ | - = note: only byte literals (like `b"foo"`, `b's'`, and `[3, 4, 5]`) can be passed to `concat_bytes!()` + = note: only byte literals (like `b"foo"`, `b's'` and `[3, 4, 5]`) can be passed to `concat_bytes!()` error: cannot concatenate string literals --> $DIR/concat-bytes-error.rs:6:19 @@ -98,7 +98,7 @@ error: expected a byte literal LL | -33, | ^^^ | - = note: only byte literals (like `b"foo"`, `b's'`, and `[3, 4, 5]`) can be passed to `concat_bytes!()` + = note: only byte literals (like `b"foo"`, `b's'` and `[3, 4, 5]`) can be passed to `concat_bytes!()` error: cannot concatenate doubly nested array --> $DIR/concat-bytes-error.rs:35:9 @@ -151,7 +151,7 @@ error: expected a byte literal LL | concat_bytes!([pie; 2]); | ^^^ | - = note: only byte literals (like `b"foo"`, `b's'`, and `[3, 4, 5]`) can be passed to `concat_bytes!()` + = note: only byte literals (like `b"foo"`, `b's'` and `[3, 4, 5]`) can be passed to `concat_bytes!()` error: cannot concatenate float literals --> $DIR/concat-bytes-error.rs:46:20 diff --git a/tests/ui/macros/concat.stderr b/tests/ui/macros/concat.stderr index 61fb9de1e..d65d93544 100644 --- a/tests/ui/macros/concat.stderr +++ b/tests/ui/macros/concat.stderr @@ -16,7 +16,7 @@ error: expected a literal LL | concat!(foo); | ^^^ | - = note: only literals (like `"foo"`, `42` and `3.14`) can be passed to `concat!()` + = note: only literals (like `"foo"`, `-42` and `3.14`) can be passed to `concat!()` error: expected a literal --> $DIR/concat.rs:5:13 @@ -24,7 +24,7 @@ error: expected a literal LL | concat!(foo()); | ^^^^^ | - = note: only literals (like `"foo"`, `42` and `3.14`) can be passed to `concat!()` + = note: only literals (like `"foo"`, `-42` and `3.14`) can be passed to `concat!()` error: aborting due to 4 previous errors diff --git a/tests/ui/macros/issue-100199.stderr b/tests/ui/macros/issue-100199.stderr index 2cb45dc12..89a6f585c 100644 --- a/tests/ui/macros/issue-100199.stderr +++ b/tests/ui/macros/issue-100199.stderr @@ -7,7 +7,7 @@ LL | #[issue_100199::struct_with_bound] = note: this error originates in the attribute macro `issue_100199::struct_with_bound` (in Nightly builds, run with -Z macro-backtrace for more info) help: consider importing this trait | -LL | use traits::MyTrait; +LL + use traits::MyTrait; | error: aborting due to previous error diff --git a/tests/ui/macros/issue-106837.rs b/tests/ui/macros/issue-106837.rs new file mode 100644 index 000000000..7bbd3d68a --- /dev/null +++ b/tests/ui/macros/issue-106837.rs @@ -0,0 +1,10 @@ +fn main() { + concat!(-42); + concat!(-3.14); + + concat!(-"hello"); + //~^ ERROR expected a literal + + concat!(--1); + //~^ ERROR expected a literal +} diff --git a/tests/ui/macros/issue-106837.stderr b/tests/ui/macros/issue-106837.stderr new file mode 100644 index 000000000..998d6c5eb --- /dev/null +++ b/tests/ui/macros/issue-106837.stderr @@ -0,0 +1,18 @@ +error: expected a literal + --> $DIR/issue-106837.rs:5:13 + | +LL | concat!(-"hello"); + | ^^^^^^^^ + | + = note: only literals (like `"foo"`, `-42` and `3.14`) can be passed to `concat!()` + +error: expected a literal + --> $DIR/issue-106837.rs:8:13 + | +LL | concat!(--1); + | ^^^ + | + = note: only literals (like `"foo"`, `-42` and `3.14`) can be passed to `concat!()` + +error: aborting due to 2 previous errors + diff --git a/tests/ui/macros/issue-109237.rs b/tests/ui/macros/issue-109237.rs new file mode 100644 index 000000000..86a193c9e --- /dev/null +++ b/tests/ui/macros/issue-109237.rs @@ -0,0 +1,7 @@ +macro_rules! statement { + () => {;}; //~ ERROR expected expression +} + +fn main() { + let _ = statement!(); +} diff --git a/tests/ui/macros/issue-109237.stderr b/tests/ui/macros/issue-109237.stderr new file mode 100644 index 000000000..d125cff63 --- /dev/null +++ b/tests/ui/macros/issue-109237.stderr @@ -0,0 +1,18 @@ +error: expected expression, found `;` + --> $DIR/issue-109237.rs:2:12 + | +LL | () => {;}; + | ^ expected expression +... +LL | let _ = statement!(); + | ------------ in this macro invocation + | + = note: the macro call doesn't expand to an expression, but it can expand to a statement + = note: this error originates in the macro `statement` (in Nightly builds, run with -Z macro-backtrace for more info) +help: surround the macro invocation with `{}` to interpret the expansion as a statement + | +LL | let _ = { statement!(); }; + | ~~~~~~~~~~~~~~~~~ + +error: aborting due to previous error + diff --git a/tests/ui/macros/issue-40469.rs b/tests/ui/macros/issue-40469.rs index 25e08ef85..9b22aaef2 100644 --- a/tests/ui/macros/issue-40469.rs +++ b/tests/ui/macros/issue-40469.rs @@ -1,5 +1,4 @@ // run-pass -// ignore-pretty issue #37195 #![allow(dead_code)] diff --git a/tests/ui/macros/issue-98790.rs b/tests/ui/macros/issue-98790.rs new file mode 100644 index 000000000..8fe6fc41d --- /dev/null +++ b/tests/ui/macros/issue-98790.rs @@ -0,0 +1,24 @@ +// run-pass + +macro_rules! stringify_item { + ($item:item) => { + stringify!($item) + }; +} + +macro_rules! repro { + ($expr:expr) => { + stringify_item! { + pub fn repro() -> bool { + $expr + } + } + }; +} + +fn main() { + assert_eq!( + repro!(match () { () => true } | true), + "pub fn repro() -> bool { (match () { () => true, }) | true }" + ); +} diff --git a/tests/ui/macros/macro-comma-support-rpass.rs b/tests/ui/macros/macro-comma-support-rpass.rs index 25b8c3cc6..cb019792e 100644 --- a/tests/ui/macros/macro-comma-support-rpass.rs +++ b/tests/ui/macros/macro-comma-support-rpass.rs @@ -8,7 +8,6 @@ // implementations for some macro_rules! macros as an implementation // detail. -// ignore-pretty issue #37195 // compile-flags: --test -C debug_assertions=yes // revisions: std core diff --git a/tests/ui/macros/macro-include-items.rs b/tests/ui/macros/macro-include-items.rs index 332bf59c9..ad6f04009 100644 --- a/tests/ui/macros/macro-include-items.rs +++ b/tests/ui/macros/macro-include-items.rs @@ -1,7 +1,6 @@ // run-pass #![allow(non_camel_case_types)] -// ignore-pretty issue #37195 fn bar() {} diff --git a/tests/ui/macros/macro-outer-attributes.stderr b/tests/ui/macros/macro-outer-attributes.stderr index 4ea760ab8..0bdc3416f 100644 --- a/tests/ui/macros/macro-outer-attributes.stderr +++ b/tests/ui/macros/macro-outer-attributes.stderr @@ -6,7 +6,7 @@ LL | a::bar(); | help: consider importing this function | -LL | use b::bar; +LL + use b::bar; | help: if you import `bar`, refer to it directly | diff --git a/tests/ui/macros/macro-path-prelude-fail-4.stderr b/tests/ui/macros/macro-path-prelude-fail-4.stderr index dfd6818b6..81c6722b5 100644 --- a/tests/ui/macros/macro-path-prelude-fail-4.stderr +++ b/tests/ui/macros/macro-path-prelude-fail-4.stderr @@ -3,6 +3,14 @@ error: expected derive macro, found built-in attribute `inline` | LL | #[derive(inline)] | ^^^^^^ not a derive macro + | +help: remove from the surrounding `derive()` + --> $DIR/macro-path-prelude-fail-4.rs:1:10 + | +LL | #[derive(inline)] + | ^^^^^^ + = help: add as non-Derive macro + `#[inline]` error: aborting due to previous error diff --git a/tests/ui/macros/macro-path-prelude-fail-5.rs b/tests/ui/macros/macro-path-prelude-fail-5.rs new file mode 100644 index 000000000..b82b6bc78 --- /dev/null +++ b/tests/ui/macros/macro-path-prelude-fail-5.rs @@ -0,0 +1,10 @@ +#[derive(Clone, Debug)] // OK +struct S; + +#[derive(Debug, inline)] //~ ERROR expected derive macro, found built-in attribute `inline` +struct T; + +#[derive(inline, Debug)] //~ ERROR expected derive macro, found built-in attribute `inline` +struct U; + +fn main() {} diff --git a/tests/ui/macros/macro-path-prelude-fail-5.stderr b/tests/ui/macros/macro-path-prelude-fail-5.stderr new file mode 100644 index 000000000..105c59db6 --- /dev/null +++ b/tests/ui/macros/macro-path-prelude-fail-5.stderr @@ -0,0 +1,30 @@ +error: expected derive macro, found built-in attribute `inline` + --> $DIR/macro-path-prelude-fail-5.rs:4:17 + | +LL | #[derive(Debug, inline)] + | ^^^^^^ not a derive macro + | +help: remove from the surrounding `derive()` + --> $DIR/macro-path-prelude-fail-5.rs:4:17 + | +LL | #[derive(Debug, inline)] + | ^^^^^^ + = help: add as non-Derive macro + `#[inline]` + +error: expected derive macro, found built-in attribute `inline` + --> $DIR/macro-path-prelude-fail-5.rs:7:10 + | +LL | #[derive(inline, Debug)] + | ^^^^^^ not a derive macro + | +help: remove from the surrounding `derive()` + --> $DIR/macro-path-prelude-fail-5.rs:7:10 + | +LL | #[derive(inline, Debug)] + | ^^^^^^ + = help: add as non-Derive macro + `#[inline]` + +error: aborting due to 2 previous errors + diff --git a/tests/ui/macros/macros-nonfatal-errors.stderr b/tests/ui/macros/macros-nonfatal-errors.stderr index 93fbc9c8a..ca373ea6c 100644 --- a/tests/ui/macros/macros-nonfatal-errors.stderr +++ b/tests/ui/macros/macros-nonfatal-errors.stderr @@ -3,36 +3,48 @@ error: the `#[default]` attribute may only be used on unit enum variants | LL | #[default] | ^^^^^^^^^^ + | + = help: consider a manual implementation of `Default` error: the `#[default]` attribute may only be used on unit enum variants --> $DIR/macros-nonfatal-errors.rs:18:36 | LL | struct DefaultInnerAttrTupleStruct(#[default] ()); | ^^^^^^^^^^ + | + = help: consider a manual implementation of `Default` error: the `#[default]` attribute may only be used on unit enum variants --> $DIR/macros-nonfatal-errors.rs:22:1 | LL | #[default] | ^^^^^^^^^^ + | + = help: consider a manual implementation of `Default` error: the `#[default]` attribute may only be used on unit enum variants --> $DIR/macros-nonfatal-errors.rs:26:1 | LL | #[default] | ^^^^^^^^^^ + | + = help: consider a manual implementation of `Default` error: the `#[default]` attribute may only be used on unit enum variants --> $DIR/macros-nonfatal-errors.rs:36:11 | LL | Foo = #[default] 0, | ^^^^^^^^^^ + | + = help: consider a manual implementation of `Default` error: the `#[default]` attribute may only be used on unit enum variants --> $DIR/macros-nonfatal-errors.rs:37:14 | LL | Bar([u8; #[default] 1]), | ^^^^^^^^^^ + | + = help: consider a manual implementation of `Default` error: no default declared --> $DIR/macros-nonfatal-errors.rs:42:10 @@ -132,7 +144,7 @@ error: asm template must be a string literal LL | asm!(invalid); | ^^^^^^^ -error: concat_idents! requires ident args +error: `concat_idents!()` requires ident args --> $DIR/macros-nonfatal-errors.rs:101:5 | LL | concat_idents!("not", "idents"); @@ -150,7 +162,7 @@ error: expected string literal LL | env!(invalid); | ^^^^^^^ -error: env! takes 1 or 2 arguments +error: `env!()` takes 1 or 2 arguments --> $DIR/macros-nonfatal-errors.rs:105:5 | LL | env!(foo, abr, baz); @@ -162,7 +174,7 @@ error: environment variable `RUST_HOPEFULLY_THIS_DOESNT_EXIST` not defined at co LL | env!("RUST_HOPEFULLY_THIS_DOESNT_EXIST"); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | - = help: Use `std::env::var("RUST_HOPEFULLY_THIS_DOESNT_EXIST")` to read the variable at run time + = help: use `std::env::var("RUST_HOPEFULLY_THIS_DOESNT_EXIST")` to read the variable at run time = note: this error originates in the macro `env` (in Nightly builds, run with -Z macro-backtrace for more info) error: format argument must be a string literal diff --git a/tests/ui/macros/missing-writer.rs b/tests/ui/macros/missing-writer.rs new file mode 100644 index 000000000..7df965c36 --- /dev/null +++ b/tests/ui/macros/missing-writer.rs @@ -0,0 +1,17 @@ +// Check error for missing writer in writeln! and write! macro +fn main() { + let x = 1; + let y = 2; + write!("{}_{}", x, y); + //~^ ERROR format argument must be a string literal + //~| HELP you might be missing a string literal to format with + //~| ERROR cannot write into `&'static str` + //~| NOTE must implement `io::Write`, `fmt::Write`, or have a `write_fmt` method + //~| HELP a writer is needed before this format string + writeln!("{}_{}", x, y); + //~^ ERROR format argument must be a string literal + //~| HELP you might be missing a string literal to format with + //~| ERROR cannot write into `&'static str` + //~| NOTE must implement `io::Write`, `fmt::Write`, or have a `write_fmt` method + //~| HELP a writer is needed before this format string +} diff --git a/tests/ui/macros/missing-writer.stderr b/tests/ui/macros/missing-writer.stderr new file mode 100644 index 000000000..86dfe7d65 --- /dev/null +++ b/tests/ui/macros/missing-writer.stderr @@ -0,0 +1,59 @@ +error: format argument must be a string literal + --> $DIR/missing-writer.rs:5:21 + | +LL | write!("{}_{}", x, y); + | ^ + | +help: you might be missing a string literal to format with + | +LL | write!("{}_{}", "{} {}", x, y); + | ++++++++ + +error: format argument must be a string literal + --> $DIR/missing-writer.rs:11:23 + | +LL | writeln!("{}_{}", x, y); + | ^ + | +help: you might be missing a string literal to format with + | +LL | writeln!("{}_{}", "{} {}", x, y); + | ++++++++ + +error[E0599]: cannot write into `&'static str` + --> $DIR/missing-writer.rs:5:12 + | +LL | write!("{}_{}", x, y); + | -------^^^^^^^------- method not found in `&str` + | +note: must implement `io::Write`, `fmt::Write`, or have a `write_fmt` method + --> $DIR/missing-writer.rs:5:12 + | +LL | write!("{}_{}", x, y); + | ^^^^^^^ +help: a writer is needed before this format string + --> $DIR/missing-writer.rs:5:12 + | +LL | write!("{}_{}", x, y); + | ^ + +error[E0599]: cannot write into `&'static str` + --> $DIR/missing-writer.rs:11:14 + | +LL | writeln!("{}_{}", x, y); + | ---------^^^^^^^------- method not found in `&str` + | +note: must implement `io::Write`, `fmt::Write`, or have a `write_fmt` method + --> $DIR/missing-writer.rs:11:14 + | +LL | writeln!("{}_{}", x, y); + | ^^^^^^^ +help: a writer is needed before this format string + --> $DIR/missing-writer.rs:11:14 + | +LL | writeln!("{}_{}", x, y); + | ^ + +error: aborting due to 4 previous errors + +For more information about this error, try `rustc --explain E0599`. diff --git a/tests/ui/macros/nested-use-as.rs b/tests/ui/macros/nested-use-as.rs new file mode 100644 index 000000000..21aa81e80 --- /dev/null +++ b/tests/ui/macros/nested-use-as.rs @@ -0,0 +1,83 @@ +// check-pass +// edition:2018 +// issue: https://github.com/rust-lang/rust/issues/97534 + +macro_rules! m { + () => { + macro_rules! foo { + () => {} + } + use foo as bar; + } +} + +m!{} + +use bar as baz; + +baz!{} + +macro_rules! foo2 { + () => {}; +} + +macro_rules! m2 { + () => { + use foo2 as bar2; + }; +} + +m2! {} + +use bar2 as baz2; + +baz2! {} + +macro_rules! n1 { + () => { + macro_rules! n2 { + () => { + macro_rules! n3 { + () => { + macro_rules! n4 { + () => {} + } + use n4 as c4; + } + } + use n3 as c3; + } + } + use n2 as c2; + } +} + +use n1 as c1; +c1!{} +use c2 as a2; +a2!{} +use c3 as a3; +a3!{} +use c4 as a4; +a4!{} + +// https://github.com/rust-lang/rust/pull/108729#issuecomment-1474750675 +// reversed +use d5 as d6; +use d4 as d5; +use d3 as d4; +use d2 as d3; +use d1 as d2; +use foo2 as d1; +d6! {} + +// mess +use f3 as f4; +f5! {} +use f1 as f2; +use f4 as f5; +use f2 as f3; +use foo2 as f1; + +fn main() { +} diff --git a/tests/ui/macros/nonterminal-matching.stderr b/tests/ui/macros/nonterminal-matching.stderr index 5bbd54390..c2b047022 100644 --- a/tests/ui/macros/nonterminal-matching.stderr +++ b/tests/ui/macros/nonterminal-matching.stderr @@ -18,6 +18,9 @@ LL | macro n(a $nt_item b) { ... LL | complex_nonterminal!(enum E {}); | ------------------------------- in this macro invocation + = note: captured metavariables except for `:tt`, `:ident` and `:lifetime` cannot be compared to other tokens + = note: see for more information + = help: try using `:tt` instead in the macro definition = note: this error originates in the macro `complex_nonterminal` (in Nightly builds, run with -Z macro-backtrace for more info) error: aborting due to previous error diff --git a/tests/ui/macros/rfc-2011-nicer-assert-messages/all-expr-kinds.rs b/tests/ui/macros/rfc-2011-nicer-assert-messages/all-expr-kinds.rs index b8b6f0846..e88e24482 100644 --- a/tests/ui/macros/rfc-2011-nicer-assert-messages/all-expr-kinds.rs +++ b/tests/ui/macros/rfc-2011-nicer-assert-messages/all-expr-kinds.rs @@ -5,7 +5,7 @@ // needs-unwind Asserting on contents of error message #![allow(path_statements, unused_allocation)] -#![feature(box_syntax, core_intrinsics, generic_assert, generic_assert_internals)] +#![feature(core_intrinsics, generic_assert, generic_assert_internals)] macro_rules! test { ( @@ -127,9 +127,6 @@ fn main() { // block [ { elem } == 3 ] => "Assertion failed: { elem } == 3" - // box - [ box elem == box 3 ] => "Assertion failed: box elem == box 3" - // break [ loop { break elem; } == 3 ] => "Assertion failed: loop { break elem; } == 3" @@ -164,7 +161,7 @@ fn main() { // mac call // match - [ match elem { _ => elem } == 3 ] => "Assertion failed: match elem { _ => elem, } == 3" + [ match elem { _ => elem } == 3 ] => "Assertion failed: (match elem { _ => elem, }) == 3" // ret [ (|| { return elem; })() == 3 ] => "Assertion failed: (|| { return elem; })() == 3" diff --git a/tests/ui/macros/stringify.rs b/tests/ui/macros/stringify.rs index fdc2a7666..79d8cd757 100644 --- a/tests/ui/macros/stringify.rs +++ b/tests/ui/macros/stringify.rs @@ -4,7 +4,6 @@ #![feature(async_closure)] #![feature(box_patterns)] -#![feature(box_syntax)] #![feature(const_trait_impl)] #![feature(decl_macro)] #![feature(generators)] @@ -91,9 +90,6 @@ fn test_block() { #[test] fn test_expr() { - // ExprKind::Box - assert_eq!(stringify_expr!(box expr), "box expr"); - // ExprKind::Array assert_eq!(stringify_expr!([]), "[]"); assert_eq!(stringify_expr!([true]), "[true]"); diff --git a/tests/ui/macros/syntax-extension-source-utils.rs b/tests/ui/macros/syntax-extension-source-utils.rs index 7e46260d5..f41fadddd 100644 --- a/tests/ui/macros/syntax-extension-source-utils.rs +++ b/tests/ui/macros/syntax-extension-source-utils.rs @@ -1,7 +1,6 @@ // run-pass #![allow(stable_features)] -// ignore-pretty issue #37195 pub mod m1 { pub mod m2 { @@ -14,9 +13,9 @@ pub mod m1 { macro_rules! indirect_line { () => ( line!() ) } pub fn main() { - assert_eq!(line!(), 17); + assert_eq!(line!(), 16); assert_eq!(column!(), 16); - assert_eq!(indirect_line!(), 19); + assert_eq!(indirect_line!(), 18); assert!((file!().ends_with("syntax-extension-source-utils.rs"))); assert_eq!(stringify!((2*3) + 5).to_string(), "(2 * 3) + 5".to_string()); assert!(include!("syntax-extension-source-utils-files/includeme.\ @@ -33,5 +32,5 @@ pub fn main() { // The Windows tests are wrapped in an extra module for some reason assert!((m1::m2::where_am_i().ends_with("m1::m2"))); - assert_eq!((36, "(2 * 3) + 5"), (line!(), stringify!((2*3) + 5))); + assert_eq!((35, "(2 * 3) + 5"), (line!(), stringify!((2*3) + 5))); } -- cgit v1.2.3