From fcc63acdf3a445c49fe859d0534a0a77c4774d0b Mon Sep 17 00:00:00 2001 From: Urgau Date: Tue, 6 May 2025 22:30:52 +0200 Subject: [PATCH 01/11] Add tests for `-Zremap-path-scope` and paths in diagnostics with deps --- tests/ui/errors/auxiliary/trait-debuginfo.rs | 4 ++ tests/ui/errors/auxiliary/trait-diag.rs | 4 ++ tests/ui/errors/auxiliary/trait-macro.rs | 4 ++ tests/ui/errors/auxiliary/trait.rs | 1 + ...prefix-diagnostics.not-diag-in-deps.stderr | 17 ++++++ ...-diagnostics.only-debuginfo-in-deps.stderr | 17 ++++++ ...refix-diagnostics.only-diag-in-deps.stderr | 17 ++++++ ...efix-diagnostics.only-macro-in-deps.stderr | 17 ++++++ .../errors/remap-path-prefix-diagnostics.rs | 57 +++++++++++++++++++ ...-diagnostics.with-debuginfo-in-deps.stderr | 17 ++++++ ...refix-diagnostics.with-diag-in-deps.stderr | 17 ++++++ ...efix-diagnostics.with-macro-in-deps.stderr | 17 ++++++ 12 files changed, 189 insertions(+) create mode 100644 tests/ui/errors/auxiliary/trait-debuginfo.rs create mode 100644 tests/ui/errors/auxiliary/trait-diag.rs create mode 100644 tests/ui/errors/auxiliary/trait-macro.rs create mode 100644 tests/ui/errors/auxiliary/trait.rs create mode 100644 tests/ui/errors/remap-path-prefix-diagnostics.not-diag-in-deps.stderr create mode 100644 tests/ui/errors/remap-path-prefix-diagnostics.only-debuginfo-in-deps.stderr create mode 100644 tests/ui/errors/remap-path-prefix-diagnostics.only-diag-in-deps.stderr create mode 100644 tests/ui/errors/remap-path-prefix-diagnostics.only-macro-in-deps.stderr create mode 100644 tests/ui/errors/remap-path-prefix-diagnostics.rs create mode 100644 tests/ui/errors/remap-path-prefix-diagnostics.with-debuginfo-in-deps.stderr create mode 100644 tests/ui/errors/remap-path-prefix-diagnostics.with-diag-in-deps.stderr create mode 100644 tests/ui/errors/remap-path-prefix-diagnostics.with-macro-in-deps.stderr diff --git a/tests/ui/errors/auxiliary/trait-debuginfo.rs b/tests/ui/errors/auxiliary/trait-debuginfo.rs new file mode 100644 index 0000000000000..d5a0825fe6d13 --- /dev/null +++ b/tests/ui/errors/auxiliary/trait-debuginfo.rs @@ -0,0 +1,4 @@ +//@ compile-flags: --remap-path-prefix={{src-base}}=remapped +//@ compile-flags: -Zremap-path-scope=debuginfo + +pub trait Trait: std::fmt::Display {} diff --git a/tests/ui/errors/auxiliary/trait-diag.rs b/tests/ui/errors/auxiliary/trait-diag.rs new file mode 100644 index 0000000000000..e07961a276a9d --- /dev/null +++ b/tests/ui/errors/auxiliary/trait-diag.rs @@ -0,0 +1,4 @@ +//@ compile-flags: --remap-path-prefix={{src-base}}=remapped +//@ compile-flags: -Zremap-path-scope=diagnostics + +pub trait Trait: std::fmt::Display {} diff --git a/tests/ui/errors/auxiliary/trait-macro.rs b/tests/ui/errors/auxiliary/trait-macro.rs new file mode 100644 index 0000000000000..48673d04ee16f --- /dev/null +++ b/tests/ui/errors/auxiliary/trait-macro.rs @@ -0,0 +1,4 @@ +//@ compile-flags: --remap-path-prefix={{src-base}}=remapped +//@ compile-flags: -Zremap-path-scope=macro + +pub trait Trait: std::fmt::Display {} diff --git a/tests/ui/errors/auxiliary/trait.rs b/tests/ui/errors/auxiliary/trait.rs new file mode 100644 index 0000000000000..0e7e5400aac59 --- /dev/null +++ b/tests/ui/errors/auxiliary/trait.rs @@ -0,0 +1 @@ +pub trait Trait: std::fmt::Display {} diff --git a/tests/ui/errors/remap-path-prefix-diagnostics.not-diag-in-deps.stderr b/tests/ui/errors/remap-path-prefix-diagnostics.not-diag-in-deps.stderr new file mode 100644 index 0000000000000..3ddff11798de3 --- /dev/null +++ b/tests/ui/errors/remap-path-prefix-diagnostics.not-diag-in-deps.stderr @@ -0,0 +1,17 @@ +error[E0277]: `A` doesn't implement `std::fmt::Display` + --> remapped/errors/remap-path-prefix-diagnostics.rs:LL:COL + | +LL | impl r#trait::Trait for A {} + | ^ `A` cannot be formatted with the default formatter + | + = help: the trait `std::fmt::Display` is not implemented for `A` + = note: in format strings you may be able to use `{:?}` (or {:#?} for pretty-print) instead +note: required by a bound in `Trait` + --> $DIR/auxiliary/trait.rs:LL:COL + | +LL | pub trait Trait: std::fmt::Display {} + | ^^^^^^^^^^^^^^^^^ required by this bound in `Trait` + +error: aborting due to 1 previous error + +For more information about this error, try `rustc --explain E0277`. diff --git a/tests/ui/errors/remap-path-prefix-diagnostics.only-debuginfo-in-deps.stderr b/tests/ui/errors/remap-path-prefix-diagnostics.only-debuginfo-in-deps.stderr new file mode 100644 index 0000000000000..85c781425b16a --- /dev/null +++ b/tests/ui/errors/remap-path-prefix-diagnostics.only-debuginfo-in-deps.stderr @@ -0,0 +1,17 @@ +error[E0277]: `A` doesn't implement `std::fmt::Display` + --> $DIR/remap-path-prefix-diagnostics.rs:LL:COL + | +LL | impl r#trait::Trait for A {} + | ^ `A` cannot be formatted with the default formatter + | + = help: the trait `std::fmt::Display` is not implemented for `A` + = note: in format strings you may be able to use `{:?}` (or {:#?} for pretty-print) instead +note: required by a bound in `Trait` + --> $DIR/auxiliary/trait-debuginfo.rs:LL:COL + | +LL | pub trait Trait: std::fmt::Display {} + | ^^^^^^^^^^^^^^^^^ required by this bound in `Trait` + +error: aborting due to 1 previous error + +For more information about this error, try `rustc --explain E0277`. diff --git a/tests/ui/errors/remap-path-prefix-diagnostics.only-diag-in-deps.stderr b/tests/ui/errors/remap-path-prefix-diagnostics.only-diag-in-deps.stderr new file mode 100644 index 0000000000000..792ea7925ad56 --- /dev/null +++ b/tests/ui/errors/remap-path-prefix-diagnostics.only-diag-in-deps.stderr @@ -0,0 +1,17 @@ +error[E0277]: `A` doesn't implement `std::fmt::Display` + --> $DIR/remap-path-prefix-diagnostics.rs:LL:COL + | +LL | impl r#trait::Trait for A {} + | ^ `A` cannot be formatted with the default formatter + | + = help: the trait `std::fmt::Display` is not implemented for `A` + = note: in format strings you may be able to use `{:?}` (or {:#?} for pretty-print) instead +note: required by a bound in `Trait` + --> $DIR/auxiliary/trait-diag.rs:LL:COL + | +LL | pub trait Trait: std::fmt::Display {} + | ^^^^^^^^^^^^^^^^^ required by this bound in `Trait` + +error: aborting due to 1 previous error + +For more information about this error, try `rustc --explain E0277`. diff --git a/tests/ui/errors/remap-path-prefix-diagnostics.only-macro-in-deps.stderr b/tests/ui/errors/remap-path-prefix-diagnostics.only-macro-in-deps.stderr new file mode 100644 index 0000000000000..d13333d2e4825 --- /dev/null +++ b/tests/ui/errors/remap-path-prefix-diagnostics.only-macro-in-deps.stderr @@ -0,0 +1,17 @@ +error[E0277]: `A` doesn't implement `std::fmt::Display` + --> $DIR/remap-path-prefix-diagnostics.rs:LL:COL + | +LL | impl r#trait::Trait for A {} + | ^ `A` cannot be formatted with the default formatter + | + = help: the trait `std::fmt::Display` is not implemented for `A` + = note: in format strings you may be able to use `{:?}` (or {:#?} for pretty-print) instead +note: required by a bound in `Trait` + --> $DIR/auxiliary/trait-macro.rs:LL:COL + | +LL | pub trait Trait: std::fmt::Display {} + | ^^^^^^^^^^^^^^^^^ required by this bound in `Trait` + +error: aborting due to 1 previous error + +For more information about this error, try `rustc --explain E0277`. diff --git a/tests/ui/errors/remap-path-prefix-diagnostics.rs b/tests/ui/errors/remap-path-prefix-diagnostics.rs new file mode 100644 index 0000000000000..fac7e937cb0b8 --- /dev/null +++ b/tests/ui/errors/remap-path-prefix-diagnostics.rs @@ -0,0 +1,57 @@ +// This test exercises `-Zremap-path-scope`, diagnostics printing paths and dependency. +// +// We test different combinations with/without remap in deps, with/without remap in this +// crate but always in deps and always here but never in deps. + +//@ revisions: with-diag-in-deps with-macro-in-deps with-debuginfo-in-deps +//@ revisions: only-diag-in-deps only-macro-in-deps only-debuginfo-in-deps +//@ revisions: not-diag-in-deps + +//@[with-diag-in-deps] compile-flags: --remap-path-prefix={{src-base}}=remapped +//@[with-macro-in-deps] compile-flags: --remap-path-prefix={{src-base}}=remapped +//@[with-debuginfo-in-deps] compile-flags: --remap-path-prefix={{src-base}}=remapped +//@[not-diag-in-deps] compile-flags: --remap-path-prefix={{src-base}}=remapped + +//@[with-diag-in-deps] compile-flags: -Zremap-path-scope=diagnostics +//@[with-macro-in-deps] compile-flags: -Zremap-path-scope=macro +//@[with-debuginfo-in-deps] compile-flags: -Zremap-path-scope=debuginfo +//@[not-diag-in-deps] compile-flags: -Zremap-path-scope=diagnostics + +//@[with-diag-in-deps] aux-build:trait-diag.rs +//@[with-macro-in-deps] aux-build:trait-macro.rs +//@[with-debuginfo-in-deps] aux-build:trait-debuginfo.rs +//@[only-diag-in-deps] aux-build:trait-diag.rs +//@[only-macro-in-deps] aux-build:trait-macro.rs +//@[only-debuginfo-in-deps] aux-build:trait-debuginfo.rs +//@[not-diag-in-deps] aux-build:trait.rs + +// The $SRC_DIR*.rs:LL:COL normalisation doesn't kick in automatically +// as the remapped revision will not begin with $SRC_DIR_REAL, +// so we have to do it ourselves. +//@ normalize-stderr: ".rs:\d+:\d+" -> ".rs:LL:COL" + +#[cfg(any(with_diag_in_deps, only_diag_in_deps))] +extern crate trait_diag as r#trait; + +#[cfg(any(with_macro_in_deps, only_macro_in_deps))] +extern crate trait_macro as r#trait; + +#[cfg(any(with_debuginfo_in_deps, only_debuginfo_in_deps))] +extern crate trait_debuginfo as r#trait; + +#[cfg(not_diag_in_deps)] +extern crate r#trait as r#trait; + +struct A; + +impl r#trait::Trait for A {} +//[with-macro-in-deps]~^ ERROR `A` doesn't implement `std::fmt::Display` +//[with-debuginfo-in-deps]~^^ ERROR `A` doesn't implement `std::fmt::Display` +//[only-diag-in-deps]~^^^ ERROR `A` doesn't implement `std::fmt::Display` +//[only-macro-in-deps]~^^^^ ERROR `A` doesn't implement `std::fmt::Display` +//[only-debuginfo-in-deps]~^^^^^ ERROR `A` doesn't implement `std::fmt::Display` + +//[with-diag-in-deps]~? ERROR `A` doesn't implement `std::fmt::Display` +//[not-diag-in-deps]~? ERROR `A` doesn't implement `std::fmt::Display` + +fn main() {} diff --git a/tests/ui/errors/remap-path-prefix-diagnostics.with-debuginfo-in-deps.stderr b/tests/ui/errors/remap-path-prefix-diagnostics.with-debuginfo-in-deps.stderr new file mode 100644 index 0000000000000..85c781425b16a --- /dev/null +++ b/tests/ui/errors/remap-path-prefix-diagnostics.with-debuginfo-in-deps.stderr @@ -0,0 +1,17 @@ +error[E0277]: `A` doesn't implement `std::fmt::Display` + --> $DIR/remap-path-prefix-diagnostics.rs:LL:COL + | +LL | impl r#trait::Trait for A {} + | ^ `A` cannot be formatted with the default formatter + | + = help: the trait `std::fmt::Display` is not implemented for `A` + = note: in format strings you may be able to use `{:?}` (or {:#?} for pretty-print) instead +note: required by a bound in `Trait` + --> $DIR/auxiliary/trait-debuginfo.rs:LL:COL + | +LL | pub trait Trait: std::fmt::Display {} + | ^^^^^^^^^^^^^^^^^ required by this bound in `Trait` + +error: aborting due to 1 previous error + +For more information about this error, try `rustc --explain E0277`. diff --git a/tests/ui/errors/remap-path-prefix-diagnostics.with-diag-in-deps.stderr b/tests/ui/errors/remap-path-prefix-diagnostics.with-diag-in-deps.stderr new file mode 100644 index 0000000000000..08f7fb2c73642 --- /dev/null +++ b/tests/ui/errors/remap-path-prefix-diagnostics.with-diag-in-deps.stderr @@ -0,0 +1,17 @@ +error[E0277]: `A` doesn't implement `std::fmt::Display` + --> remapped/errors/remap-path-prefix-diagnostics.rs:LL:COL + | +LL | impl r#trait::Trait for A {} + | ^ `A` cannot be formatted with the default formatter + | + = help: the trait `std::fmt::Display` is not implemented for `A` + = note: in format strings you may be able to use `{:?}` (or {:#?} for pretty-print) instead +note: required by a bound in `Trait` + --> remapped/errors/auxiliary/trait-diag.rs:LL:COL + | +LL | pub trait Trait: std::fmt::Display {} + | ^^^^^^^^^^^^^^^^^ required by this bound in `Trait` + +error: aborting due to 1 previous error + +For more information about this error, try `rustc --explain E0277`. diff --git a/tests/ui/errors/remap-path-prefix-diagnostics.with-macro-in-deps.stderr b/tests/ui/errors/remap-path-prefix-diagnostics.with-macro-in-deps.stderr new file mode 100644 index 0000000000000..d13333d2e4825 --- /dev/null +++ b/tests/ui/errors/remap-path-prefix-diagnostics.with-macro-in-deps.stderr @@ -0,0 +1,17 @@ +error[E0277]: `A` doesn't implement `std::fmt::Display` + --> $DIR/remap-path-prefix-diagnostics.rs:LL:COL + | +LL | impl r#trait::Trait for A {} + | ^ `A` cannot be formatted with the default formatter + | + = help: the trait `std::fmt::Display` is not implemented for `A` + = note: in format strings you may be able to use `{:?}` (or {:#?} for pretty-print) instead +note: required by a bound in `Trait` + --> $DIR/auxiliary/trait-macro.rs:LL:COL + | +LL | pub trait Trait: std::fmt::Display {} + | ^^^^^^^^^^^^^^^^^ required by this bound in `Trait` + +error: aborting due to 1 previous error + +For more information about this error, try `rustc --explain E0277`. From e53479795df4f101a955240e17be35c8e7605b88 Mon Sep 17 00:00:00 2001 From: Urgau Date: Tue, 6 May 2025 22:59:49 +0200 Subject: [PATCH 02/11] Rework `-Zremap-path-scope` macro test with dependency check --- tests/ui/errors/auxiliary/file-debuginfo.rs | 11 ++++ tests/ui/errors/auxiliary/file-diag.rs | 11 ++++ tests/ui/errors/auxiliary/file-macro.rs | 11 ++++ tests/ui/errors/auxiliary/file.rs | 8 +++ .../remap-path-prefix-macro.normal.run.stdout | 1 - ...-prefix-macro.not-macro-in-deps.run.stderr | 3 ++ ...ix-macro.only-debuginfo-in-deps.run.stderr | 3 ++ ...-prefix-macro.only-diag-in-deps.run.stderr | 3 ++ ...prefix-macro.only-macro-in-deps.run.stderr | 3 ++ tests/ui/errors/remap-path-prefix-macro.rs | 52 ++++++++++++++++--- ...ix-macro.with-debuginfo-in-deps.run.stderr | 3 ++ ...-prefix-macro.with-diag-in-deps.run.stderr | 3 ++ ...prefix-macro.with-macro-in-deps.run.stderr | 3 ++ ...h-prefix-macro.with-macro-scope.run.stdout | 1 - ...refix-macro.without-macro-scope.run.stdout | 1 - 15 files changed, 108 insertions(+), 9 deletions(-) create mode 100644 tests/ui/errors/auxiliary/file-debuginfo.rs create mode 100644 tests/ui/errors/auxiliary/file-diag.rs create mode 100644 tests/ui/errors/auxiliary/file-macro.rs create mode 100644 tests/ui/errors/auxiliary/file.rs delete mode 100644 tests/ui/errors/remap-path-prefix-macro.normal.run.stdout create mode 100644 tests/ui/errors/remap-path-prefix-macro.not-macro-in-deps.run.stderr create mode 100644 tests/ui/errors/remap-path-prefix-macro.only-debuginfo-in-deps.run.stderr create mode 100644 tests/ui/errors/remap-path-prefix-macro.only-diag-in-deps.run.stderr create mode 100644 tests/ui/errors/remap-path-prefix-macro.only-macro-in-deps.run.stderr create mode 100644 tests/ui/errors/remap-path-prefix-macro.with-debuginfo-in-deps.run.stderr create mode 100644 tests/ui/errors/remap-path-prefix-macro.with-diag-in-deps.run.stderr create mode 100644 tests/ui/errors/remap-path-prefix-macro.with-macro-in-deps.run.stderr delete mode 100644 tests/ui/errors/remap-path-prefix-macro.with-macro-scope.run.stdout delete mode 100644 tests/ui/errors/remap-path-prefix-macro.without-macro-scope.run.stdout diff --git a/tests/ui/errors/auxiliary/file-debuginfo.rs b/tests/ui/errors/auxiliary/file-debuginfo.rs new file mode 100644 index 0000000000000..08113ec26bfd4 --- /dev/null +++ b/tests/ui/errors/auxiliary/file-debuginfo.rs @@ -0,0 +1,11 @@ +//@ compile-flags: --remap-path-prefix={{src-base}}=remapped +//@ compile-flags: -Zremap-path-scope=debuginfo + +#[macro_export] +macro_rules! my_file { + () => { file!() } +} + +pub fn file() -> &'static str { + file!() +} diff --git a/tests/ui/errors/auxiliary/file-diag.rs b/tests/ui/errors/auxiliary/file-diag.rs new file mode 100644 index 0000000000000..f29c349f703b2 --- /dev/null +++ b/tests/ui/errors/auxiliary/file-diag.rs @@ -0,0 +1,11 @@ +//@ compile-flags: --remap-path-prefix={{src-base}}=remapped +//@ compile-flags: -Zremap-path-scope=diagnostics + +#[macro_export] +macro_rules! my_file { + () => { file!() } +} + +pub fn file() -> &'static str { + file!() +} diff --git a/tests/ui/errors/auxiliary/file-macro.rs b/tests/ui/errors/auxiliary/file-macro.rs new file mode 100644 index 0000000000000..11abc0549a7b8 --- /dev/null +++ b/tests/ui/errors/auxiliary/file-macro.rs @@ -0,0 +1,11 @@ +//@ compile-flags: --remap-path-prefix={{src-base}}=remapped +//@ compile-flags: -Zremap-path-scope=macro + +#[macro_export] +macro_rules! my_file { + () => { file!() } +} + +pub fn file() -> &'static str { + file!() +} diff --git a/tests/ui/errors/auxiliary/file.rs b/tests/ui/errors/auxiliary/file.rs new file mode 100644 index 0000000000000..63a7b3b58f0f5 --- /dev/null +++ b/tests/ui/errors/auxiliary/file.rs @@ -0,0 +1,8 @@ +#[macro_export] +macro_rules! my_file { + () => { file!() } +} + +pub fn file() -> &'static str { + file!() +} diff --git a/tests/ui/errors/remap-path-prefix-macro.normal.run.stdout b/tests/ui/errors/remap-path-prefix-macro.normal.run.stdout deleted file mode 100644 index 3bbdcbb8655b2..0000000000000 --- a/tests/ui/errors/remap-path-prefix-macro.normal.run.stdout +++ /dev/null @@ -1 +0,0 @@ -remapped/errors/remap-path-prefix-macro.rs diff --git a/tests/ui/errors/remap-path-prefix-macro.not-macro-in-deps.run.stderr b/tests/ui/errors/remap-path-prefix-macro.not-macro-in-deps.run.stderr new file mode 100644 index 0000000000000..182e517571596 --- /dev/null +++ b/tests/ui/errors/remap-path-prefix-macro.not-macro-in-deps.run.stderr @@ -0,0 +1,3 @@ +[remapped/errors/remap-path-prefix-macro.rs:LL:COL] file::my_file!() = "remapped/errors/remap-path-prefix-macro.rs" +[remapped/errors/remap-path-prefix-macro.rs:LL:COL] file::file() = "$DIR/auxiliary/file.rs" +[remapped/errors/remap-path-prefix-macro.rs:LL:COL] file!() = "remapped/errors/remap-path-prefix-macro.rs" diff --git a/tests/ui/errors/remap-path-prefix-macro.only-debuginfo-in-deps.run.stderr b/tests/ui/errors/remap-path-prefix-macro.only-debuginfo-in-deps.run.stderr new file mode 100644 index 0000000000000..982c4ecead0a3 --- /dev/null +++ b/tests/ui/errors/remap-path-prefix-macro.only-debuginfo-in-deps.run.stderr @@ -0,0 +1,3 @@ +[$DIR/remap-path-prefix-macro.rs:LL:COL] file::my_file!() = "$DIR/remap-path-prefix-macro.rs" +[$DIR/remap-path-prefix-macro.rs:LL:COL] file::file() = "$DIR/auxiliary/file-debuginfo.rs" +[$DIR/remap-path-prefix-macro.rs:LL:COL] file!() = "$DIR/remap-path-prefix-macro.rs" diff --git a/tests/ui/errors/remap-path-prefix-macro.only-diag-in-deps.run.stderr b/tests/ui/errors/remap-path-prefix-macro.only-diag-in-deps.run.stderr new file mode 100644 index 0000000000000..7bea2e3c1acbb --- /dev/null +++ b/tests/ui/errors/remap-path-prefix-macro.only-diag-in-deps.run.stderr @@ -0,0 +1,3 @@ +[$DIR/remap-path-prefix-macro.rs:LL:COL] file::my_file!() = "$DIR/remap-path-prefix-macro.rs" +[$DIR/remap-path-prefix-macro.rs:LL:COL] file::file() = "$DIR/auxiliary/file-diag.rs" +[$DIR/remap-path-prefix-macro.rs:LL:COL] file!() = "$DIR/remap-path-prefix-macro.rs" diff --git a/tests/ui/errors/remap-path-prefix-macro.only-macro-in-deps.run.stderr b/tests/ui/errors/remap-path-prefix-macro.only-macro-in-deps.run.stderr new file mode 100644 index 0000000000000..f74b0dd3ba310 --- /dev/null +++ b/tests/ui/errors/remap-path-prefix-macro.only-macro-in-deps.run.stderr @@ -0,0 +1,3 @@ +[$DIR/remap-path-prefix-macro.rs:LL:COL] file::my_file!() = "$DIR/remap-path-prefix-macro.rs" +[$DIR/remap-path-prefix-macro.rs:LL:COL] file::file() = "remapped/errors/auxiliary/file-macro.rs" +[$DIR/remap-path-prefix-macro.rs:LL:COL] file!() = "$DIR/remap-path-prefix-macro.rs" diff --git a/tests/ui/errors/remap-path-prefix-macro.rs b/tests/ui/errors/remap-path-prefix-macro.rs index 665156027c995..a3eaae0d42dc0 100644 --- a/tests/ui/errors/remap-path-prefix-macro.rs +++ b/tests/ui/errors/remap-path-prefix-macro.rs @@ -1,12 +1,52 @@ +// This test exercises `-Zremap-path-scope`, macros (like file!()) and dependency. +// +// We test different combinations with/without remap in deps, with/without remap in +// this crate but always in deps and always here but never in deps. + //@ run-pass //@ check-run-results -//@ revisions: normal with-macro-scope without-macro-scope -//@ compile-flags: --remap-path-prefix={{src-base}}=remapped -//@ [with-macro-scope]compile-flags: -Zremap-path-scope=macro,diagnostics -//@ [without-macro-scope]compile-flags: -Zremap-path-scope=diagnostics -// no-remap-src-base: Manually remap, so the remapped path remains in .stderr file. +//@ revisions: with-diag-in-deps with-macro-in-deps with-debuginfo-in-deps +//@ revisions: only-diag-in-deps only-macro-in-deps only-debuginfo-in-deps +//@ revisions: not-macro-in-deps + +//@[with-diag-in-deps] compile-flags: --remap-path-prefix={{src-base}}=remapped +//@[with-macro-in-deps] compile-flags: --remap-path-prefix={{src-base}}=remapped +//@[with-debuginfo-in-deps] compile-flags: --remap-path-prefix={{src-base}}=remapped +//@[not-macro-in-deps] compile-flags: --remap-path-prefix={{src-base}}=remapped + +//@[with-diag-in-deps] compile-flags: -Zremap-path-scope=diagnostics +//@[with-macro-in-deps] compile-flags: -Zremap-path-scope=macro +//@[with-debuginfo-in-deps] compile-flags: -Zremap-path-scope=debuginfo +//@[not-macro-in-deps] compile-flags: -Zremap-path-scope=macro + +//@[with-diag-in-deps] aux-build:file-diag.rs +//@[with-macro-in-deps] aux-build:file-macro.rs +//@[with-debuginfo-in-deps] aux-build:file-debuginfo.rs +//@[only-diag-in-deps] aux-build:file-diag.rs +//@[only-macro-in-deps] aux-build:file-macro.rs +//@[only-debuginfo-in-deps] aux-build:file-debuginfo.rs +//@[not-macro-in-deps] aux-build:file.rs + +// The $SRC_DIR*.rs:LL:COL normalisation doesn't kick in automatically +// as the remapped revision will not begin with $SRC_DIR_REAL, +// so we have to do it ourselves. +//@ normalize-stderr: ".rs:\d+:\d+" -> ".rs:LL:COL" + +#[cfg(any(with_diag_in_deps, only_diag_in_deps))] +extern crate file_diag as file; + +#[cfg(any(with_macro_in_deps, only_macro_in_deps))] +extern crate file_macro as file; + +#[cfg(any(with_debuginfo_in_deps, only_debuginfo_in_deps))] +extern crate file_debuginfo as file; + +#[cfg(not_macro_in_deps)] +extern crate file; fn main() { - println!("{}", file!()); + dbg!(file::my_file!()); + dbg!(file::file()); + dbg!(file!()); } diff --git a/tests/ui/errors/remap-path-prefix-macro.with-debuginfo-in-deps.run.stderr b/tests/ui/errors/remap-path-prefix-macro.with-debuginfo-in-deps.run.stderr new file mode 100644 index 0000000000000..982c4ecead0a3 --- /dev/null +++ b/tests/ui/errors/remap-path-prefix-macro.with-debuginfo-in-deps.run.stderr @@ -0,0 +1,3 @@ +[$DIR/remap-path-prefix-macro.rs:LL:COL] file::my_file!() = "$DIR/remap-path-prefix-macro.rs" +[$DIR/remap-path-prefix-macro.rs:LL:COL] file::file() = "$DIR/auxiliary/file-debuginfo.rs" +[$DIR/remap-path-prefix-macro.rs:LL:COL] file!() = "$DIR/remap-path-prefix-macro.rs" diff --git a/tests/ui/errors/remap-path-prefix-macro.with-diag-in-deps.run.stderr b/tests/ui/errors/remap-path-prefix-macro.with-diag-in-deps.run.stderr new file mode 100644 index 0000000000000..7bea2e3c1acbb --- /dev/null +++ b/tests/ui/errors/remap-path-prefix-macro.with-diag-in-deps.run.stderr @@ -0,0 +1,3 @@ +[$DIR/remap-path-prefix-macro.rs:LL:COL] file::my_file!() = "$DIR/remap-path-prefix-macro.rs" +[$DIR/remap-path-prefix-macro.rs:LL:COL] file::file() = "$DIR/auxiliary/file-diag.rs" +[$DIR/remap-path-prefix-macro.rs:LL:COL] file!() = "$DIR/remap-path-prefix-macro.rs" diff --git a/tests/ui/errors/remap-path-prefix-macro.with-macro-in-deps.run.stderr b/tests/ui/errors/remap-path-prefix-macro.with-macro-in-deps.run.stderr new file mode 100644 index 0000000000000..3d528e9b0cb5c --- /dev/null +++ b/tests/ui/errors/remap-path-prefix-macro.with-macro-in-deps.run.stderr @@ -0,0 +1,3 @@ +[remapped/errors/remap-path-prefix-macro.rs:LL:COL] file::my_file!() = "remapped/errors/remap-path-prefix-macro.rs" +[remapped/errors/remap-path-prefix-macro.rs:LL:COL] file::file() = "remapped/errors/auxiliary/file-macro.rs" +[remapped/errors/remap-path-prefix-macro.rs:LL:COL] file!() = "remapped/errors/remap-path-prefix-macro.rs" diff --git a/tests/ui/errors/remap-path-prefix-macro.with-macro-scope.run.stdout b/tests/ui/errors/remap-path-prefix-macro.with-macro-scope.run.stdout deleted file mode 100644 index 3bbdcbb8655b2..0000000000000 --- a/tests/ui/errors/remap-path-prefix-macro.with-macro-scope.run.stdout +++ /dev/null @@ -1 +0,0 @@ -remapped/errors/remap-path-prefix-macro.rs diff --git a/tests/ui/errors/remap-path-prefix-macro.without-macro-scope.run.stdout b/tests/ui/errors/remap-path-prefix-macro.without-macro-scope.run.stdout deleted file mode 100644 index 642823fec86a1..0000000000000 --- a/tests/ui/errors/remap-path-prefix-macro.without-macro-scope.run.stdout +++ /dev/null @@ -1 +0,0 @@ -$DIR/remap-path-prefix-macro.rs From f46806fb14d9ef9ba76b836019f9e2705b213c97 Mon Sep 17 00:00:00 2001 From: xizheyin Date: Wed, 7 May 2025 17:27:56 +0800 Subject: [PATCH 03/11] Add ui test suggest-remove-deref-issue-140166 Signed-off-by: xizheyin --- .../suggest-remove-deref-issue-140166.rs | 18 +++++++++++++ .../suggest-remove-deref-issue-140166.stderr | 26 +++++++++++++++++++ 2 files changed, 44 insertions(+) create mode 100644 tests/ui/traits/suggest-remove-deref-issue-140166.rs create mode 100644 tests/ui/traits/suggest-remove-deref-issue-140166.stderr diff --git a/tests/ui/traits/suggest-remove-deref-issue-140166.rs b/tests/ui/traits/suggest-remove-deref-issue-140166.rs new file mode 100644 index 0000000000000..1b832c7eba5c0 --- /dev/null +++ b/tests/ui/traits/suggest-remove-deref-issue-140166.rs @@ -0,0 +1,18 @@ +trait Trait {} + +struct Chars; +impl Trait for Chars {} + +struct FlatMap(T); +impl std::fmt::Debug for FlatMap { + fn fmt(&self, _: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + unimplemented!() + } +} + +fn lol() { + format_args!("{:?}", FlatMap(&Chars)); + //~^ ERROR the trait bound `&Chars: Trait` is not satisfied [E0277] +} + +fn main() {} diff --git a/tests/ui/traits/suggest-remove-deref-issue-140166.stderr b/tests/ui/traits/suggest-remove-deref-issue-140166.stderr new file mode 100644 index 0000000000000..8bdcf5981a50c --- /dev/null +++ b/tests/ui/traits/suggest-remove-deref-issue-140166.stderr @@ -0,0 +1,26 @@ +error[E0277]: the trait bound `&Chars: Trait` is not satisfied + --> $DIR/suggest-remove-deref-issue-140166.rs:14:26 + | +LL | format_args!("{:?}", FlatMap(&Chars)); + | ---- ^^^^^^^^^^^^^^^ the trait `Trait` is not implemented for `&Chars` + | | + | required by a bound introduced by this call + | +note: required for `FlatMap<&Chars>` to implement `Debug` + --> $DIR/suggest-remove-deref-issue-140166.rs:7:16 + | +LL | impl std::fmt::Debug for FlatMap { + | ----- ^^^^^^^^^^^^^^^ ^^^^^^^^^^ + | | + | unsatisfied trait bound introduced here +note: required by a bound in `core::fmt::rt::Argument::<'_>::new_debug` + --> $SRC_DIR/core/src/fmt/rt.rs:LL:COL +help: consider removing the leading `&`-reference + | +LL - format_args!("{:?}", FlatMap(&Chars)); +LL + format_args!("{:?}", latMap(&Chars)); + | + +error: aborting due to 1 previous error + +For more information about this error, try `rustc --explain E0277`. From bd88f3e3e3eefd781d5cc1f4fbc0630f50e70882 Mon Sep 17 00:00:00 2001 From: xizheyin Date: Wed, 7 May 2025 17:31:42 +0800 Subject: [PATCH 04/11] Check `&` before suggest remove deref when trait_selection Signed-off-by: xizheyin --- .../src/error_reporting/traits/suggestions.rs | 6 ++++++ tests/ui/traits/suggest-remove-deref-issue-140166.stderr | 6 +----- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/compiler/rustc_trait_selection/src/error_reporting/traits/suggestions.rs b/compiler/rustc_trait_selection/src/error_reporting/traits/suggestions.rs index de251ae2893c4..8801397b77541 100644 --- a/compiler/rustc_trait_selection/src/error_reporting/traits/suggestions.rs +++ b/compiler/rustc_trait_selection/src/error_reporting/traits/suggestions.rs @@ -1516,6 +1516,12 @@ impl<'a, 'tcx> TypeErrCtxt<'a, 'tcx> { } else { expr.span.with_hi(expr.span.lo() + BytePos(1)) }; + + match self.tcx.sess.source_map().span_to_snippet(span) { + Ok(snippet) if snippet.starts_with("&") => {} + _ => break 'outer, + } + suggestions.push((span, String::new())); let ty::Ref(_, inner_ty, _) = suggested_ty.kind() else { diff --git a/tests/ui/traits/suggest-remove-deref-issue-140166.stderr b/tests/ui/traits/suggest-remove-deref-issue-140166.stderr index 8bdcf5981a50c..90f24d86d53e0 100644 --- a/tests/ui/traits/suggest-remove-deref-issue-140166.stderr +++ b/tests/ui/traits/suggest-remove-deref-issue-140166.stderr @@ -6,6 +6,7 @@ LL | format_args!("{:?}", FlatMap(&Chars)); | | | required by a bound introduced by this call | + = help: the trait `Trait` is implemented for `Chars` note: required for `FlatMap<&Chars>` to implement `Debug` --> $DIR/suggest-remove-deref-issue-140166.rs:7:16 | @@ -15,11 +16,6 @@ LL | impl std::fmt::Debug for FlatMap { | unsatisfied trait bound introduced here note: required by a bound in `core::fmt::rt::Argument::<'_>::new_debug` --> $SRC_DIR/core/src/fmt/rt.rs:LL:COL -help: consider removing the leading `&`-reference - | -LL - format_args!("{:?}", FlatMap(&Chars)); -LL + format_args!("{:?}", latMap(&Chars)); - | error: aborting due to 1 previous error From 3286d4aad789a48bfaef5a682d6dcf2642012216 Mon Sep 17 00:00:00 2001 From: Daniel Paoliello Date: Wed, 7 May 2025 10:46:36 -0700 Subject: [PATCH 05/11] [win][arm64] Disable various DebugInfo tests that don't work on Arm64 Windows --- src/tools/compiletest/src/directive-list.rs | 1 + tests/debuginfo/step-into-match.rs | 4 ++++ tests/debuginfo/type-names.rs | 2 ++ tests/ui/runtime/backtrace-debuginfo.rs | 4 ++++ 4 files changed, 11 insertions(+) diff --git a/src/tools/compiletest/src/directive-list.rs b/src/tools/compiletest/src/directive-list.rs index 1449e9af19aa5..5757e422ae21e 100644 --- a/src/tools/compiletest/src/directive-list.rs +++ b/src/tools/compiletest/src/directive-list.rs @@ -35,6 +35,7 @@ const KNOWN_DIRECTIVE_NAMES: &[&str] = &[ "ignore-32bit", "ignore-64bit", "ignore-aarch64", + "ignore-aarch64-pc-windows-msvc", "ignore-aarch64-unknown-linux-gnu", "ignore-aix", "ignore-android", diff --git a/tests/debuginfo/step-into-match.rs b/tests/debuginfo/step-into-match.rs index 577e553c11985..d4b7ea201195e 100644 --- a/tests/debuginfo/step-into-match.rs +++ b/tests/debuginfo/step-into-match.rs @@ -1,6 +1,10 @@ //@ compile-flags: -g //@ ignore-android: FIXME(#10381) +// On Arm64 Windows, stepping at the end of a function on goes to the callsite, not the instruction +// after it. +//@ ignore-aarch64-pc-windows-msvc: Stepping out of functions behaves differently. + // === GDB TESTS ============================================================== // gdb-command: r diff --git a/tests/debuginfo/type-names.rs b/tests/debuginfo/type-names.rs index 4df6daf7b6ef0..3c7eab7e8d718 100644 --- a/tests/debuginfo/type-names.rs +++ b/tests/debuginfo/type-names.rs @@ -1,5 +1,7 @@ //@ ignore-lldb +//@ ignore-aarch64-pc-windows-msvc: Arm64 Windows cdb doesn't support JavaScript extensions. + // GDB changed the way that it formatted Foreign types //@ min-gdb-version: 9.2 diff --git a/tests/ui/runtime/backtrace-debuginfo.rs b/tests/ui/runtime/backtrace-debuginfo.rs index afc96d6bb5f54..37fce2788b7f0 100644 --- a/tests/ui/runtime/backtrace-debuginfo.rs +++ b/tests/ui/runtime/backtrace-debuginfo.rs @@ -42,9 +42,13 @@ macro_rules! dump_and_die { // there, even on i686-pc-windows-msvc. We do the best we can in // rust-lang/rust to test it as well, but sometimes we just gotta keep // landing PRs. + // + // aarch64-msvc is broken as its backtraces are truncated. + // See https://github.com/rust-lang/rust/issues/140489 if cfg!(any(target_os = "android", all(target_os = "linux", target_arch = "arm"), all(target_env = "msvc", target_arch = "x86"), + all(target_env = "msvc", target_arch = "aarch64"), target_os = "freebsd", target_os = "dragonfly", target_os = "openbsd")) { From 742aaf9b697a43c0da8c55fd234f8088f1cfe79c Mon Sep 17 00:00:00 2001 From: Daniel Paoliello Date: Wed, 7 May 2025 10:52:18 -0700 Subject: [PATCH 06/11] [arm64] Pointer auth test should link with C static library statically --- tests/run-make/pointer-auth-link-with-c/test.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/run-make/pointer-auth-link-with-c/test.rs b/tests/run-make/pointer-auth-link-with-c/test.rs index 1a3be80e898ba..795c6a45f8e61 100644 --- a/tests/run-make/pointer-auth-link-with-c/test.rs +++ b/tests/run-make/pointer-auth-link-with-c/test.rs @@ -1,4 +1,4 @@ -#[link(name = "test")] +#[link(name = "test", kind = "static")] extern "C" { fn foo() -> i32; } From 0cacc05531a4cf5229213e65eae2763ee4cf293e Mon Sep 17 00:00:00 2001 From: Daniel Paoliello Date: Wed, 7 May 2025 11:12:11 -0700 Subject: [PATCH 07/11] [win][arm64] Disable FS tests that require symlinks --- library/std/src/fs/tests.rs | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/library/std/src/fs/tests.rs b/library/std/src/fs/tests.rs index 46b0d832fec45..c81a5ff4d96e6 100644 --- a/library/std/src/fs/tests.rs +++ b/library/std/src/fs/tests.rs @@ -730,6 +730,10 @@ fn recursive_mkdir_empty() { } #[test] +#[cfg_attr( + all(windows, target_arch = "aarch64"), + ignore = "SymLinks not enabled on Arm64 Windows runners https://github.com/actions/partner-runner-images/issues/94" +)] fn recursive_rmdir() { let tmpdir = tmpdir(); let d1 = tmpdir.join("d1"); @@ -749,6 +753,10 @@ fn recursive_rmdir() { } #[test] +#[cfg_attr( + all(windows, target_arch = "aarch64"), + ignore = "SymLinks not enabled on Arm64 Windows runners https://github.com/actions/partner-runner-images/issues/94" +)] fn recursive_rmdir_of_symlink() { // test we do not recursively delete a symlink but only dirs. let tmpdir = tmpdir(); @@ -1533,6 +1541,10 @@ fn file_open_not_found() { } #[test] +#[cfg_attr( + all(windows, target_arch = "aarch64"), + ignore = "SymLinks not enabled on Arm64 Windows runners https://github.com/actions/partner-runner-images/issues/94" +)] fn create_dir_all_with_junctions() { let tmpdir = tmpdir(); let target = tmpdir.join("target"); @@ -2011,6 +2023,10 @@ fn test_rename_symlink() { #[test] #[cfg(windows)] +#[cfg_attr( + all(windows, target_arch = "aarch64"), + ignore = "SymLinks not enabled on Arm64 Windows runners https://github.com/actions/partner-runner-images/issues/94" +)] fn test_rename_junction() { let tmpdir = tmpdir(); let original = tmpdir.join("original"); From 75ca6c621e08eb7252bb542b9264e7ab7a8fc4e1 Mon Sep 17 00:00:00 2001 From: Daniel Paoliello Date: Wed, 7 May 2025 10:56:00 -0700 Subject: [PATCH 08/11] [win][arm64] Disable MSVC Linker 'Arm Hazard' warning --- .../src/spec/targets/aarch64_pc_windows_msvc.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/compiler/rustc_target/src/spec/targets/aarch64_pc_windows_msvc.rs b/compiler/rustc_target/src/spec/targets/aarch64_pc_windows_msvc.rs index 98d78520c9838..0d25b19f3fcf3 100644 --- a/compiler/rustc_target/src/spec/targets/aarch64_pc_windows_msvc.rs +++ b/compiler/rustc_target/src/spec/targets/aarch64_pc_windows_msvc.rs @@ -1,10 +1,15 @@ -use crate::spec::{Target, TargetMetadata, base}; +use crate::spec::{LinkerFlavor, Lld, Target, TargetMetadata, base}; pub(crate) fn target() -> Target { let mut base = base::windows_msvc::opts(); base.max_atomic_width = Some(128); base.features = "+v8a,+neon,+fp-armv8".into(); + // MSVC emits a warning about code that may trip "Cortex-A53 MPCore processor bug #843419" (see + // https://developer.arm.com/documentation/epm048406/latest) which is sometimes emitted by LLVM. + // Since Arm64 Windows 10+ isn't supported on that processor, it's safe to disable the warning. + base.add_pre_link_args(LinkerFlavor::Msvc(Lld::No), &["/arm64hazardfree"]); + Target { llvm_target: "aarch64-pc-windows-msvc".into(), metadata: TargetMetadata { From 34c42c8f314af939e2f28f46f96293642516aa97 Mon Sep 17 00:00:00 2001 From: onur-ozkan Date: Wed, 7 May 2025 22:34:56 +0300 Subject: [PATCH 09/11] do not allow stage > 0 on `x fmt` Signed-off-by: onur-ozkan --- src/bootstrap/src/core/build_steps/format.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/bootstrap/src/core/build_steps/format.rs b/src/bootstrap/src/core/build_steps/format.rs index 9da8b27a91778..ca8414530a577 100644 --- a/src/bootstrap/src/core/build_steps/format.rs +++ b/src/bootstrap/src/core/build_steps/format.rs @@ -9,7 +9,7 @@ use std::sync::mpsc::SyncSender; use build_helper::git::get_git_modified_files; use ignore::WalkBuilder; -use crate::core::builder::Builder; +use crate::core::builder::{Builder, Kind}; use crate::utils::build_stamp::BuildStamp; use crate::utils::exec::command; use crate::utils::helpers::{self, t}; @@ -122,6 +122,11 @@ fn print_paths(verb: &str, adjective: Option<&str>, paths: &[String]) { } pub fn format(build: &Builder<'_>, check: bool, all: bool, paths: &[PathBuf]) { + if build.kind == Kind::Format && build.top_stage != 0 { + eprintln!("ERROR: `x fmt` only supports stage 0."); + crate::exit!(1); + } + if !paths.is_empty() { eprintln!( "fmt error: path arguments are no longer accepted; use `--all` to format everything" From 1a18da56742f307644b831a749b931072b805f4e Mon Sep 17 00:00:00 2001 From: onur-ozkan Date: Wed, 7 May 2025 23:23:36 +0300 Subject: [PATCH 10/11] implement `x run rustfmt` Signed-off-by: onur-ozkan --- src/bootstrap/src/core/build_steps/format.rs | 1 + src/bootstrap/src/core/build_steps/run.rs | 53 ++++++++++++++++++++ src/bootstrap/src/core/builder/mod.rs | 1 + 3 files changed, 55 insertions(+) diff --git a/src/bootstrap/src/core/build_steps/format.rs b/src/bootstrap/src/core/build_steps/format.rs index ca8414530a577..93900a9043e7e 100644 --- a/src/bootstrap/src/core/build_steps/format.rs +++ b/src/bootstrap/src/core/build_steps/format.rs @@ -124,6 +124,7 @@ fn print_paths(verb: &str, adjective: Option<&str>, paths: &[String]) { pub fn format(build: &Builder<'_>, check: bool, all: bool, paths: &[PathBuf]) { if build.kind == Kind::Format && build.top_stage != 0 { eprintln!("ERROR: `x fmt` only supports stage 0."); + eprintln!("HELP: Use `x run rustfmt` to run in-tree rustfmt."); crate::exit!(1); } diff --git a/src/bootstrap/src/core/build_steps/run.rs b/src/bootstrap/src/core/build_steps/run.rs index 7ff385052940e..0bba441c3fa26 100644 --- a/src/bootstrap/src/core/build_steps/run.rs +++ b/src/bootstrap/src/core/build_steps/run.rs @@ -420,3 +420,56 @@ impl Step for CoverageDump { cmd.run(builder); } } + +#[derive(Debug, Clone, PartialEq, Eq, Hash)] +pub struct Rustfmt; + +impl Step for Rustfmt { + type Output = (); + const ONLY_HOSTS: bool = true; + + fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> { + run.path("src/tools/rustfmt") + } + + fn make_run(run: RunConfig<'_>) { + run.builder.ensure(Rustfmt); + } + + fn run(self, builder: &Builder<'_>) { + let host = builder.build.build; + + // `x run` uses stage 0 by default but rustfmt does not work well with stage 0. + // Change the stage to 1 if it's not set explicitly. + let stage = if builder.config.is_explicit_stage() || builder.top_stage >= 1 { + builder.top_stage + } else { + 1 + }; + + if stage == 0 { + eprintln!("rustfmt cannot be run at stage 0"); + eprintln!("HELP: Use `x fmt` to use stage 0 rustfmt."); + std::process::exit(1); + } + + let compiler = builder.compiler(stage, host); + let rustfmt_build = builder.ensure(tool::Rustfmt { compiler, target: host }); + + let mut rustfmt = tool::prepare_tool_cargo( + builder, + rustfmt_build.build_compiler, + Mode::ToolRustc, + host, + Kind::Run, + "src/tools/rustfmt", + SourceType::InTree, + &[], + ); + + rustfmt.args(["--bin", "rustfmt", "--"]); + rustfmt.args(builder.config.args()); + + rustfmt.into_cmd().run(builder); + } +} diff --git a/src/bootstrap/src/core/builder/mod.rs b/src/bootstrap/src/core/builder/mod.rs index 15dc3380a39a3..75cc5d3986b88 100644 --- a/src/bootstrap/src/core/builder/mod.rs +++ b/src/bootstrap/src/core/builder/mod.rs @@ -1116,6 +1116,7 @@ impl<'a> Builder<'a> { run::FeaturesStatusDump, run::CyclicStep, run::CoverageDump, + run::Rustfmt, ), Kind::Setup => { describe!(setup::Profile, setup::Hook, setup::Link, setup::Editor) From e85d014244da0c208bfbf6bfc60b89b1ecc831b0 Mon Sep 17 00:00:00 2001 From: onur-ozkan Date: Wed, 7 May 2025 23:33:15 +0300 Subject: [PATCH 11/11] add change-entry for `x run rustfmt` Signed-off-by: onur-ozkan --- src/bootstrap/src/utils/change_tracker.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/bootstrap/src/utils/change_tracker.rs b/src/bootstrap/src/utils/change_tracker.rs index d926185ffaf1c..1d0ea3ebf6105 100644 --- a/src/bootstrap/src/utils/change_tracker.rs +++ b/src/bootstrap/src/utils/change_tracker.rs @@ -406,4 +406,9 @@ pub const CONFIG_CHANGE_HISTORY: &[ChangeInfo] = &[ severity: ChangeSeverity::Info, summary: "Added a new option `rust.debug-assertions-tools` to control debug asssertions for tools.", }, + ChangeInfo { + change_id: 140732, + severity: ChangeSeverity::Info, + summary: "`./x run` now supports running in-tree `rustfmt`, e.g., `./x run rustfmt -- --check /path/to/file.rs`.", + }, ];