From 3a9981a6d547f4aba0915e3958618358a80ffdea Mon Sep 17 00:00:00 2001 From: Marijn Schouten Date: Sat, 3 Jan 2026 13:03:25 +0000 Subject: [PATCH 01/38] clippy fix: non_canonical_clone_impl (except Infallible) --- library/core/src/clone.rs | 2 +- library/core/src/marker.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/library/core/src/clone.rs b/library/core/src/clone.rs index 85b09ee06f1fd..f2fa6fd0ca3e9 100644 --- a/library/core/src/clone.rs +++ b/library/core/src/clone.rs @@ -680,7 +680,7 @@ mod impls { #[inline(always)] #[rustc_diagnostic_item = "noop_method_clone"] fn clone(&self) -> Self { - self + *self } } diff --git a/library/core/src/marker.rs b/library/core/src/marker.rs index 57416455e9de8..43300cc843c6d 100644 --- a/library/core/src/marker.rs +++ b/library/core/src/marker.rs @@ -849,7 +849,7 @@ impl Copy for PhantomData {} #[stable(feature = "rust1", since = "1.0.0")] impl Clone for PhantomData { fn clone(&self) -> Self { - Self + *self } } From 3a311edc97b9c93b3384ce8ff8ef47306e22ca41 Mon Sep 17 00:00:00 2001 From: Crystal Durham Date: Mon, 30 Mar 2026 18:55:59 -0400 Subject: [PATCH 02/38] add abort_immediate --- library/core/src/intrinsics/mod.rs | 2 ++ library/core/src/lib.rs | 2 ++ library/core/src/process.rs | 38 ++++++++++++++++++++++++++++++ library/std/src/process.rs | 4 ++++ 4 files changed, 46 insertions(+) create mode 100644 library/core/src/process.rs diff --git a/library/core/src/intrinsics/mod.rs b/library/core/src/intrinsics/mod.rs index 6f9d351300168..94d0c7eab9227 100644 --- a/library/core/src/intrinsics/mod.rs +++ b/library/core/src/intrinsics/mod.rs @@ -364,6 +364,8 @@ pub fn rustc_peek(_: T) -> T; /// On Unix, the /// process will probably terminate with a signal like `SIGABRT`, `SIGILL`, `SIGTRAP`, `SIGSEGV` or /// `SIGBUS`. The precise behavior is not guaranteed and not stable. +/// +/// The stabilization-track version of this intrinsic is [`core::process::abort_immediate`]. #[rustc_nounwind] #[rustc_intrinsic] pub fn abort() -> !; diff --git a/library/core/src/lib.rs b/library/core/src/lib.rs index 35f93d8fb33b2..73ca7c599cad3 100644 --- a/library/core/src/lib.rs +++ b/library/core/src/lib.rs @@ -305,6 +305,8 @@ pub mod panicking; #[unstable(feature = "pattern_type_macro", issue = "123646")] pub mod pat; pub mod pin; +#[unstable(feature = "abort_immediate", issue = "154601")] +pub mod process; #[unstable(feature = "random", issue = "130703")] pub mod random; #[stable(feature = "new_range_inclusive_api", since = "1.95.0")] diff --git a/library/core/src/process.rs b/library/core/src/process.rs new file mode 100644 index 0000000000000..4b94d71015205 --- /dev/null +++ b/library/core/src/process.rs @@ -0,0 +1,38 @@ +/// Terminates the process in a violent fashion. +/// +/// The function will never return and will immediately terminate the current +/// process in a platform specific "abnormal" manner. As a consequence, +/// no destructors on the current stack or any other thread's stack +/// will be run, Rust IO buffers (eg, from `BufWriter`) will not be flushed, +/// and C stdio buffers will not be flushed. +/// +/// Unlike [`abort`](../../std/process/fn.abort.html), `abort_immediate` does +/// not attempt to match C `abort()` or otherwise perform a "clean" abort. +/// Instead, it emits code that will crash the process with as little overhead +/// as possible, such as a "halt and catch fire" style instruction. You should +/// generally prefer using `abort` instead except where the absolute minimum +/// overhead is required. +/// +/// # Platform-specific behavior +/// +/// `abort_immediate` lowers to a trap instruction on *most* architectures; on +/// some architectures it simply lowers to call the unmangled `abort` function. +/// The exact behavior is architecture and system dependent. +/// +/// On bare-metal (no OS) systems the trap instruction usually causes a +/// *hardware* exception to be raised in a *synchronous* fashion; hardware +/// exceptions have nothing to do with C++ exceptions and are closer in +/// semantics to POSIX signals. +/// +/// On hosted applications (applications running under an OS), the trap +/// instruction *usually* terminates the whole process with an exit code that +/// corresponds to `SIGILL` or equivalent, *unless* this signal is handled. +/// Other signals such as `SIGABRT`, `SIGTRAP`, `SIGSEGV`, and `SIGBUS` may be +/// produced instead, depending on specifics. This is not an exhaustive list. +#[unstable(feature = "abort_immediate", issue = "154601")] +#[cold] +#[cfg_attr(miri, track_caller)] // even without panics, this helps for Miri backtraces +#[doc(alias = "halt")] +pub fn abort_immediate() -> ! { + crate::intrinsics::abort() +} diff --git a/library/std/src/process.rs b/library/std/src/process.rs index 321b68b3225ad..ebb07632d9638 100644 --- a/library/std/src/process.rs +++ b/library/std/src/process.rs @@ -2536,6 +2536,10 @@ pub fn abort() -> ! { crate::sys::abort_internal(); } +#[doc(inline)] +#[unstable(feature = "abort_immediate", issue = "154601")] +pub use core::process::abort_immediate; + /// Returns the OS-assigned process identifier associated with this process. /// /// # Examples From fb99fbec8486638f909700e2b0381186ffe1c384 Mon Sep 17 00:00:00 2001 From: Crystal Durham Date: Mon, 30 Mar 2026 19:05:26 -0400 Subject: [PATCH 03/38] add missing core::process module docs --- library/core/src/process.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/library/core/src/process.rs b/library/core/src/process.rs index 4b94d71015205..81481b2cba26e 100644 --- a/library/core/src/process.rs +++ b/library/core/src/process.rs @@ -1,3 +1,8 @@ +//! A module for working with processes. +//! +//! Most process-related functionality requires std, but [`abort_immediate`] +//! is available on all targets. + /// Terminates the process in a violent fashion. /// /// The function will never return and will immediately terminate the current From e9b36bd374e4b00ad48ce5d6694c2ebbf256b121 Mon Sep 17 00:00:00 2001 From: Jules Bertholet Date: Wed, 1 Apr 2026 21:25:42 -0400 Subject: [PATCH 04/38] `core::unicode`: Replace `Cased` table with `Lt` Shaves off 368 bytes from the total size of all Unicode data tables. --- library/core/src/char/methods.rs | 8 +- library/core/src/unicode/mod.rs | 2 +- library/core/src/unicode/unicode_data.rs | 90 ++++++++----------- library/coretests/tests/unicode.rs | 6 +- library/coretests/tests/unicode/test_data.rs | 61 ++----------- src/tools/unicode-table-generator/src/main.rs | 2 +- 6 files changed, 51 insertions(+), 118 deletions(-) diff --git a/library/core/src/char/methods.rs b/library/core/src/char/methods.rs index 46d48afbf5a14..83c86488e31a7 100644 --- a/library/core/src/char/methods.rs +++ b/library/core/src/char/methods.rs @@ -810,7 +810,7 @@ impl char { match self { 'a'..='z' | 'A'..='Z' => true, '\0'..='\u{A9}' => false, - _ => unicode::Cased(self), + _ => unicode::Lowercase(self) || unicode::Uppercase(self) || unicode::Lt(self), } } @@ -840,10 +840,10 @@ impl char { 'a'..='z' => Some(CharCase::Lower), 'A'..='Z' => Some(CharCase::Upper), '\0'..='\u{A9}' => None, - _ if !unicode::Cased(self) => None, _ if unicode::Lowercase(self) => Some(CharCase::Lower), _ if unicode::Uppercase(self) => Some(CharCase::Upper), - _ => Some(CharCase::Title), + _ if unicode::Lt(self) => Some(CharCase::Title), + _ => None, } } @@ -919,7 +919,7 @@ impl char { pub fn is_titlecase(self) -> bool { match self { '\0'..='\u{01C4}' => false, - _ => self.is_cased() && !self.is_lowercase() && !self.is_uppercase(), + _ => unicode::Lt(self), } } diff --git a/library/core/src/unicode/mod.rs b/library/core/src/unicode/mod.rs index 22a1166fdf168..8b2c526a08878 100644 --- a/library/core/src/unicode/mod.rs +++ b/library/core/src/unicode/mod.rs @@ -9,9 +9,9 @@ pub use unicode_data::conversions; #[rustfmt::skip] pub(crate) use unicode_data::alphabetic::lookup as Alphabetic; pub(crate) use unicode_data::case_ignorable::lookup as Case_Ignorable; -pub(crate) use unicode_data::cased::lookup as Cased; pub(crate) use unicode_data::grapheme_extend::lookup as Grapheme_Extend; pub(crate) use unicode_data::lowercase::lookup as Lowercase; +pub(crate) use unicode_data::lt::lookup as Lt; pub(crate) use unicode_data::n::lookup as N; pub(crate) use unicode_data::uppercase::lookup as Uppercase; pub(crate) use unicode_data::white_space::lookup as White_Space; diff --git a/library/core/src/unicode/unicode_data.rs b/library/core/src/unicode/unicode_data.rs index f602cd5c5b6b3..83d3808051840 100644 --- a/library/core/src/unicode/unicode_data.rs +++ b/library/core/src/unicode/unicode_data.rs @@ -1,16 +1,16 @@ //! This file is generated by `./x run src/tools/unicode-table-generator`; do not edit manually! // Alphabetic : 1723 bytes, 147369 codepoints in 759 ranges (U+0000AA - U+03347A) using skiplist // Case_Ignorable : 1063 bytes, 2789 codepoints in 459 ranges (U+0000A8 - U+0E01F0) using skiplist -// Cased : 401 bytes, 4580 codepoints in 156 ranges (U+0000AA - U+01F18A) using skiplist // Grapheme_Extend : 899 bytes, 2232 codepoints in 383 ranges (U+000300 - U+0E01F0) using skiplist // Lowercase : 943 bytes, 2569 codepoints in 676 ranges (U+0000AA - U+01E944) using bitset +// Lt : 33 bytes, 31 codepoints in 10 ranges (U+0001C5 - U+001FFD) using skiplist // N : 463 bytes, 1914 codepoints in 145 ranges (U+0000B2 - U+01FBFA) using skiplist // Uppercase : 799 bytes, 1980 codepoints in 659 ranges (U+0000C0 - U+01F18A) using bitset // White_Space : 256 bytes, 19 codepoints in 8 ranges (U+000085 - U+003001) using cascading // to_lower : 1112 bytes, 1462 codepoints in 185 ranges (U+0000C0 - U+01E921) using 2-level LUT // to_upper : 1998 bytes, 1554 codepoints in 299 ranges (U+0000B5 - U+01E943) using 2-level LUT // to_title : 340 bytes, 135 codepoints in 49 ranges (U+0000DF - U+00FB17) using 2-level LUT -// Total : 9997 bytes +// Total : 9629 bytes #[inline(always)] const fn bitset_search< @@ -337,59 +337,6 @@ pub mod case_ignorable { } } -#[rustfmt::skip] -pub mod cased { - use super::ShortOffsetRunHeader; - - static SHORT_OFFSET_RUNS: [ShortOffsetRunHeader; 22] = [ - ShortOffsetRunHeader::new(0, 4256), ShortOffsetRunHeader::new(51, 5024), - ShortOffsetRunHeader::new(61, 7296), ShortOffsetRunHeader::new(65, 7958), - ShortOffsetRunHeader::new(74, 9398), ShortOffsetRunHeader::new(149, 11264), - ShortOffsetRunHeader::new(151, 42560), ShortOffsetRunHeader::new(163, 43824), - ShortOffsetRunHeader::new(177, 64256), ShortOffsetRunHeader::new(183, 65313), - ShortOffsetRunHeader::new(187, 66560), ShortOffsetRunHeader::new(191, 67456), - ShortOffsetRunHeader::new(213, 68736), ShortOffsetRunHeader::new(221, 71840), - ShortOffsetRunHeader::new(229, 93760), ShortOffsetRunHeader::new(231, 119808), - ShortOffsetRunHeader::new(237, 120486), ShortOffsetRunHeader::new(274, 122624), - ShortOffsetRunHeader::new(297, 122928), ShortOffsetRunHeader::new(303, 125184), - ShortOffsetRunHeader::new(305, 127280), ShortOffsetRunHeader::new(307, 1241482), - ]; - static OFFSETS: [u8; 313] = [ - 170, 1, 10, 1, 4, 1, 5, 23, 1, 31, 1, 195, 1, 4, 4, 208, 2, 35, 7, 2, 30, 5, 96, 1, 42, 4, - 2, 2, 2, 4, 1, 1, 6, 1, 1, 3, 1, 1, 1, 20, 1, 83, 1, 139, 8, 166, 1, 38, 9, 41, 0, 38, 1, 1, - 5, 1, 2, 43, 1, 4, 0, 86, 2, 6, 0, 11, 5, 43, 2, 3, 64, 192, 64, 0, 2, 6, 2, 38, 2, 6, 2, 8, - 1, 1, 1, 1, 1, 1, 1, 31, 2, 53, 1, 7, 1, 1, 3, 3, 1, 7, 3, 4, 2, 6, 4, 13, 5, 3, 1, 7, 116, - 1, 13, 1, 16, 13, 101, 1, 4, 1, 2, 10, 1, 1, 3, 5, 6, 1, 1, 1, 1, 1, 1, 4, 1, 6, 4, 1, 2, 4, - 5, 5, 4, 1, 17, 32, 3, 2, 0, 52, 0, 229, 6, 4, 3, 2, 12, 38, 1, 1, 5, 1, 0, 46, 18, 30, 132, - 102, 3, 4, 1, 77, 20, 6, 1, 3, 0, 43, 1, 14, 6, 80, 0, 7, 12, 5, 0, 26, 6, 26, 0, 80, 96, - 36, 4, 36, 116, 11, 1, 15, 1, 7, 1, 2, 1, 11, 1, 15, 1, 7, 1, 2, 0, 1, 2, 3, 1, 42, 1, 9, 0, - 51, 13, 51, 93, 22, 10, 22, 0, 64, 0, 64, 32, 25, 2, 25, 0, 85, 1, 71, 1, 2, 2, 1, 2, 2, 2, - 4, 1, 12, 1, 1, 1, 7, 1, 65, 1, 4, 2, 8, 1, 7, 1, 28, 1, 4, 1, 5, 1, 1, 3, 7, 1, 0, 2, 25, - 1, 25, 1, 31, 1, 25, 1, 31, 1, 25, 1, 31, 1, 25, 1, 31, 1, 25, 1, 8, 0, 10, 1, 20, 6, 6, 0, - 62, 0, 68, 0, 26, 6, 26, 6, 26, 0, - ]; - #[inline] - pub fn lookup(c: char) -> bool { - debug_assert!(!c.is_ascii()); - (c as u32) >= 0xaa && lookup_slow(c) - } - - #[inline(never)] - fn lookup_slow(c: char) -> bool { - const { - assert!(SHORT_OFFSET_RUNS.last().unwrap().0 > char::MAX as u32); - let mut i = 0; - while i < SHORT_OFFSET_RUNS.len() { - assert!(SHORT_OFFSET_RUNS[i].start_index() < OFFSETS.len()); - i += 1; - } - } - // SAFETY: We just ensured the last element of `SHORT_OFFSET_RUNS` is greater than `std::char::MAX` - // and the start indices of all elements in `SHORT_OFFSET_RUNS` are smaller than `OFFSETS.len()`. - unsafe { super::skip_search(c, &SHORT_OFFSET_RUNS, &OFFSETS) } - } -} - #[rustfmt::skip] pub mod grapheme_extend { use super::ShortOffsetRunHeader; @@ -574,6 +521,39 @@ pub mod lowercase { } } +#[rustfmt::skip] +pub mod lt { + use super::ShortOffsetRunHeader; + + static SHORT_OFFSET_RUNS: [ShortOffsetRunHeader; 3] = [ + ShortOffsetRunHeader::new(0, 453), ShortOffsetRunHeader::new(1, 8072), + ShortOffsetRunHeader::new(9, 1122301), + ]; + static OFFSETS: [u8; 21] = [ + 0, 1, 2, 1, 2, 1, 38, 1, 0, 8, 8, 8, 8, 8, 12, 1, 15, 1, 47, 1, 0, + ]; + #[inline] + pub fn lookup(c: char) -> bool { + debug_assert!(!c.is_ascii()); + (c as u32) >= 0x1c5 && lookup_slow(c) + } + + #[inline(never)] + fn lookup_slow(c: char) -> bool { + const { + assert!(SHORT_OFFSET_RUNS.last().unwrap().0 > char::MAX as u32); + let mut i = 0; + while i < SHORT_OFFSET_RUNS.len() { + assert!(SHORT_OFFSET_RUNS[i].start_index() < OFFSETS.len()); + i += 1; + } + } + // SAFETY: We just ensured the last element of `SHORT_OFFSET_RUNS` is greater than `std::char::MAX` + // and the start indices of all elements in `SHORT_OFFSET_RUNS` are smaller than `OFFSETS.len()`. + unsafe { super::skip_search(c, &SHORT_OFFSET_RUNS, &OFFSETS) } + } +} + #[rustfmt::skip] pub mod n { use super::ShortOffsetRunHeader; diff --git a/library/coretests/tests/unicode.rs b/library/coretests/tests/unicode.rs index a8a221db8f955..12eed25a1feae 100644 --- a/library/coretests/tests/unicode.rs +++ b/library/coretests/tests/unicode.rs @@ -60,9 +60,9 @@ fn case_ignorable() { #[test] #[cfg_attr(miri, ignore)] // Miri is too slow -fn cased() { - test_boolean_property(test_data::CASED, unicode_data::cased::lookup); - test_boolean_property(test_data::CASED, char::is_cased); +fn lt() { + test_boolean_property(test_data::LT, unicode_data::lt::lookup); + test_boolean_property(test_data::LT, char::is_titlecase); } #[test] diff --git a/library/coretests/tests/unicode/test_data.rs b/library/coretests/tests/unicode/test_data.rs index 3071aedcae07a..962770a0ff830 100644 --- a/library/coretests/tests/unicode/test_data.rs +++ b/library/coretests/tests/unicode/test_data.rs @@ -392,60 +392,6 @@ pub(super) static CASE_IGNORABLE: &[RangeInclusive; 459] = &[ '\u{e0100}'..='\u{e01ef}', ]; -#[rustfmt::skip] -pub(super) static CASED: &[RangeInclusive; 156] = &[ - '\u{aa}'..='\u{aa}', '\u{b5}'..='\u{b5}', '\u{ba}'..='\u{ba}', '\u{c0}'..='\u{d6}', - '\u{d8}'..='\u{f6}', '\u{f8}'..='\u{1ba}', '\u{1bc}'..='\u{1bf}', '\u{1c4}'..='\u{293}', - '\u{296}'..='\u{2b8}', '\u{2c0}'..='\u{2c1}', '\u{2e0}'..='\u{2e4}', '\u{345}'..='\u{345}', - '\u{370}'..='\u{373}', '\u{376}'..='\u{377}', '\u{37a}'..='\u{37d}', '\u{37f}'..='\u{37f}', - '\u{386}'..='\u{386}', '\u{388}'..='\u{38a}', '\u{38c}'..='\u{38c}', '\u{38e}'..='\u{3a1}', - '\u{3a3}'..='\u{3f5}', '\u{3f7}'..='\u{481}', '\u{48a}'..='\u{52f}', '\u{531}'..='\u{556}', - '\u{560}'..='\u{588}', '\u{10a0}'..='\u{10c5}', '\u{10c7}'..='\u{10c7}', - '\u{10cd}'..='\u{10cd}', '\u{10d0}'..='\u{10fa}', '\u{10fc}'..='\u{10ff}', - '\u{13a0}'..='\u{13f5}', '\u{13f8}'..='\u{13fd}', '\u{1c80}'..='\u{1c8a}', - '\u{1c90}'..='\u{1cba}', '\u{1cbd}'..='\u{1cbf}', '\u{1d00}'..='\u{1dbf}', - '\u{1e00}'..='\u{1f15}', '\u{1f18}'..='\u{1f1d}', '\u{1f20}'..='\u{1f45}', - '\u{1f48}'..='\u{1f4d}', '\u{1f50}'..='\u{1f57}', '\u{1f59}'..='\u{1f59}', - '\u{1f5b}'..='\u{1f5b}', '\u{1f5d}'..='\u{1f5d}', '\u{1f5f}'..='\u{1f7d}', - '\u{1f80}'..='\u{1fb4}', '\u{1fb6}'..='\u{1fbc}', '\u{1fbe}'..='\u{1fbe}', - '\u{1fc2}'..='\u{1fc4}', '\u{1fc6}'..='\u{1fcc}', '\u{1fd0}'..='\u{1fd3}', - '\u{1fd6}'..='\u{1fdb}', '\u{1fe0}'..='\u{1fec}', '\u{1ff2}'..='\u{1ff4}', - '\u{1ff6}'..='\u{1ffc}', '\u{2071}'..='\u{2071}', '\u{207f}'..='\u{207f}', - '\u{2090}'..='\u{209c}', '\u{2102}'..='\u{2102}', '\u{2107}'..='\u{2107}', - '\u{210a}'..='\u{2113}', '\u{2115}'..='\u{2115}', '\u{2119}'..='\u{211d}', - '\u{2124}'..='\u{2124}', '\u{2126}'..='\u{2126}', '\u{2128}'..='\u{2128}', - '\u{212a}'..='\u{212d}', '\u{212f}'..='\u{2134}', '\u{2139}'..='\u{2139}', - '\u{213c}'..='\u{213f}', '\u{2145}'..='\u{2149}', '\u{214e}'..='\u{214e}', - '\u{2160}'..='\u{217f}', '\u{2183}'..='\u{2184}', '\u{24b6}'..='\u{24e9}', - '\u{2c00}'..='\u{2ce4}', '\u{2ceb}'..='\u{2cee}', '\u{2cf2}'..='\u{2cf3}', - '\u{2d00}'..='\u{2d25}', '\u{2d27}'..='\u{2d27}', '\u{2d2d}'..='\u{2d2d}', - '\u{a640}'..='\u{a66d}', '\u{a680}'..='\u{a69d}', '\u{a722}'..='\u{a787}', - '\u{a78b}'..='\u{a78e}', '\u{a790}'..='\u{a7dc}', '\u{a7f1}'..='\u{a7f6}', - '\u{a7f8}'..='\u{a7fa}', '\u{ab30}'..='\u{ab5a}', '\u{ab5c}'..='\u{ab69}', - '\u{ab70}'..='\u{abbf}', '\u{fb00}'..='\u{fb06}', '\u{fb13}'..='\u{fb17}', - '\u{ff21}'..='\u{ff3a}', '\u{ff41}'..='\u{ff5a}', '\u{10400}'..='\u{1044f}', - '\u{104b0}'..='\u{104d3}', '\u{104d8}'..='\u{104fb}', '\u{10570}'..='\u{1057a}', - '\u{1057c}'..='\u{1058a}', '\u{1058c}'..='\u{10592}', '\u{10594}'..='\u{10595}', - '\u{10597}'..='\u{105a1}', '\u{105a3}'..='\u{105b1}', '\u{105b3}'..='\u{105b9}', - '\u{105bb}'..='\u{105bc}', '\u{10780}'..='\u{10780}', '\u{10783}'..='\u{10785}', - '\u{10787}'..='\u{107b0}', '\u{107b2}'..='\u{107ba}', '\u{10c80}'..='\u{10cb2}', - '\u{10cc0}'..='\u{10cf2}', '\u{10d50}'..='\u{10d65}', '\u{10d70}'..='\u{10d85}', - '\u{118a0}'..='\u{118df}', '\u{16e40}'..='\u{16e7f}', '\u{16ea0}'..='\u{16eb8}', - '\u{16ebb}'..='\u{16ed3}', '\u{1d400}'..='\u{1d454}', '\u{1d456}'..='\u{1d49c}', - '\u{1d49e}'..='\u{1d49f}', '\u{1d4a2}'..='\u{1d4a2}', '\u{1d4a5}'..='\u{1d4a6}', - '\u{1d4a9}'..='\u{1d4ac}', '\u{1d4ae}'..='\u{1d4b9}', '\u{1d4bb}'..='\u{1d4bb}', - '\u{1d4bd}'..='\u{1d4c3}', '\u{1d4c5}'..='\u{1d505}', '\u{1d507}'..='\u{1d50a}', - '\u{1d50d}'..='\u{1d514}', '\u{1d516}'..='\u{1d51c}', '\u{1d51e}'..='\u{1d539}', - '\u{1d53b}'..='\u{1d53e}', '\u{1d540}'..='\u{1d544}', '\u{1d546}'..='\u{1d546}', - '\u{1d54a}'..='\u{1d550}', '\u{1d552}'..='\u{1d6a5}', '\u{1d6a8}'..='\u{1d6c0}', - '\u{1d6c2}'..='\u{1d6da}', '\u{1d6dc}'..='\u{1d6fa}', '\u{1d6fc}'..='\u{1d714}', - '\u{1d716}'..='\u{1d734}', '\u{1d736}'..='\u{1d74e}', '\u{1d750}'..='\u{1d76e}', - '\u{1d770}'..='\u{1d788}', '\u{1d78a}'..='\u{1d7a8}', '\u{1d7aa}'..='\u{1d7c2}', - '\u{1d7c4}'..='\u{1d7cb}', '\u{1df00}'..='\u{1df09}', '\u{1df0b}'..='\u{1df1e}', - '\u{1df25}'..='\u{1df2a}', '\u{1e030}'..='\u{1e06d}', '\u{1e900}'..='\u{1e943}', - '\u{1f130}'..='\u{1f149}', '\u{1f150}'..='\u{1f169}', '\u{1f170}'..='\u{1f189}', -]; - #[rustfmt::skip] pub(super) static GRAPHEME_EXTEND: &[RangeInclusive; 383] = &[ '\u{300}'..='\u{36f}', '\u{483}'..='\u{489}', '\u{591}'..='\u{5bd}', '\u{5bf}'..='\u{5bf}', @@ -776,6 +722,13 @@ pub(super) static LOWERCASE: &[RangeInclusive; 676] = &[ '\u{1e030}'..='\u{1e06d}', '\u{1e922}'..='\u{1e943}', ]; +#[rustfmt::skip] +pub(super) static LT: &[RangeInclusive; 10] = &[ + '\u{1c5}'..='\u{1c5}', '\u{1c8}'..='\u{1c8}', '\u{1cb}'..='\u{1cb}', '\u{1f2}'..='\u{1f2}', + '\u{1f88}'..='\u{1f8f}', '\u{1f98}'..='\u{1f9f}', '\u{1fa8}'..='\u{1faf}', + '\u{1fbc}'..='\u{1fbc}', '\u{1fcc}'..='\u{1fcc}', '\u{1ffc}'..='\u{1ffc}', +]; + #[rustfmt::skip] pub(super) static N: &[RangeInclusive; 145] = &[ '\u{b2}'..='\u{b3}', '\u{b9}'..='\u{b9}', '\u{bc}'..='\u{be}', '\u{660}'..='\u{669}', diff --git a/src/tools/unicode-table-generator/src/main.rs b/src/tools/unicode-table-generator/src/main.rs index cdd137ff56a52..398b4c7b7ec5a 100644 --- a/src/tools/unicode-table-generator/src/main.rs +++ b/src/tools/unicode-table-generator/src/main.rs @@ -91,11 +91,11 @@ static PROPERTIES: &[&str] = &[ "Alphabetic", "Lowercase", "Uppercase", - "Cased", "Case_Ignorable", "Grapheme_Extend", "White_Space", "N", + "Lt", ]; struct UnicodeData { From 617d9de4e8d4f0e2c945a6faf2a0e758fba624ab Mon Sep 17 00:00:00 2001 From: Shivendra Sharma Date: Wed, 8 Apr 2026 03:30:00 +0530 Subject: [PATCH 05/38] rustdoc: preserve `doc(cfg)` on locally re-exported type aliases When a type alias is locally re-exported from a private module (an implicit inline), rustdoc drops its `cfg` attributes because it treats it like a standard un-inlined re-export. Since type aliases have no inner fields to carry the `cfg` badge (unlike structs or enums), the portability info is lost entirely. This patch explicitly preserves the target's `cfg` metadata when the generated item is a `TypeAliasItem`, ensuring the portability badge renders correctly without breaking standard cross-crate re-export behavior. --- src/librustdoc/clean/mod.rs | 3 +- .../reexport/type-alias-reexport.rs | 32 +++++++++++++++++++ 2 files changed, 34 insertions(+), 1 deletion(-) create mode 100644 tests/rustdoc-html/reexport/type-alias-reexport.rs diff --git a/src/librustdoc/clean/mod.rs b/src/librustdoc/clean/mod.rs index 5366a0eca3293..d628889450a0c 100644 --- a/src/librustdoc/clean/mod.rs +++ b/src/librustdoc/clean/mod.rs @@ -205,7 +205,8 @@ fn generate_item_with_correct_attrs( attrs.extend(get_all_import_attributes(cx, import_id, def_id, is_inline)); is_inline = is_inline || import_is_inline; } - add_without_unwanted_attributes(&mut attrs, target_attrs, is_inline, None); + let keep_target_cfg = is_inline || matches!(kind, ItemKind::TypeAliasItem(..)); + add_without_unwanted_attributes(&mut attrs, target_attrs, keep_target_cfg, None); attrs } else { // We only keep the item's attributes. diff --git a/tests/rustdoc-html/reexport/type-alias-reexport.rs b/tests/rustdoc-html/reexport/type-alias-reexport.rs new file mode 100644 index 0000000000000..34e2d7208f88d --- /dev/null +++ b/tests/rustdoc-html/reexport/type-alias-reexport.rs @@ -0,0 +1,32 @@ +// Regression test for . +// This test ensures that auto-generated and explicit `doc(cfg)` attributes are correctly +// preserved for locally re-exported type aliases. + +#![crate_name = "foo"] +#![feature(doc_cfg)] + +mod inner { + #[cfg(target_os = "linux")] + pub type One = u32; + + #[doc(cfg(target_os = "linux"))] + pub type Two = u32; +} + +//@ has 'foo/index.html' +// There should be two items in the type aliases table. +//@ count - '//*[@class="item-table"]/dt' 2 +// Both of them should have the portability badge in the module index. +//@ count - '//*[@class="item-table"]/dt/*[@class="stab portability"]' 2 + +//@ has 'foo/type.One.html' +// Check that the individual type page has the portability badge. +//@ count - '//*[@id="main-content"]/*[@class="item-info"]/*[@class="stab portability"]' 1 +//@ has - '//*[@id="main-content"]/*[@class="item-info"]/*[@class="stab portability"]' 'Linux' + +//@ has 'foo/type.Two.html' +// Check the explicit doc(cfg) type page as well. +//@ count - '//*[@id="main-content"]/*[@class="item-info"]/*[@class="stab portability"]' 1 +//@ has - '//*[@id="main-content"]/*[@class="item-info"]/*[@class="stab portability"]' 'Linux' + +pub use self::inner::{One, Two}; From e9d0e320ec6b8f9b8040fcc10a426da6a0db1fa8 Mon Sep 17 00:00:00 2001 From: mejrs <59372212+mejrs@users.noreply.github.com> Date: Sun, 12 Apr 2026 20:39:25 +0200 Subject: [PATCH 06/38] Merge malformed diagnostic attribute lint --- .../src/attributes/diagnostic/mod.rs | 64 ++++++++----------- .../src/attributes/diagnostic/on_const.rs | 10 +-- .../attributes/diagnostic/on_unimplemented.rs | 5 +- .../src/attributes/diagnostic/on_unknown.rs | 5 +- compiler/rustc_lint/src/early/diagnostics.rs | 14 +--- compiler/rustc_lint/src/lints.rs | 43 +++---------- compiler/rustc_lint_defs/src/lib.rs | 12 +--- tests/ui/attributes/malformed-attrs.stderr | 2 +- .../report_warning_on_unknown_options.rs | 4 +- .../report_warning_on_unknown_options.stderr | 4 +- ...options_of_the_internal_rustc_attribute.rs | 8 +-- ...ons_of_the_internal_rustc_attribute.stderr | 8 +-- ...o_not_fail_parsing_on_invalid_options_1.rs | 10 +-- ...t_fail_parsing_on_invalid_options_1.stderr | 10 +-- .../on_unknown/malformed_attribute.rs | 2 +- .../on_unknown/malformed_attribute.stderr | 2 +- 16 files changed, 79 insertions(+), 124 deletions(-) diff --git a/compiler/rustc_attr_parsing/src/attributes/diagnostic/mod.rs b/compiler/rustc_attr_parsing/src/attributes/diagnostic/mod.rs index f68bed620f1b3..2ddbb8c603a51 100644 --- a/compiler/rustc_attr_parsing/src/attributes/diagnostic/mod.rs +++ b/compiler/rustc_attr_parsing/src/attributes/diagnostic/mod.rs @@ -40,6 +40,18 @@ pub(crate) enum Mode { DiagnosticOnUnknown, } +impl Mode { + fn as_str(&self) -> &'static str { + match self { + Self::RustcOnUnimplemented => "rustc_on_unimplemented", + Self::DiagnosticOnUnimplemented => "diagnostic::on_unimplemented", + Self::DiagnosticOnConst => "diagnostic::on_const", + Self::DiagnosticOnMove => "diagnostic::on_move", + Self::DiagnosticOnUnknown => "diagnostic::on_unknown", + } + } +} + fn merge_directives( cx: &mut AcceptContext<'_, '_, S>, first: &mut Option<(Span, Directive)>, @@ -100,38 +112,17 @@ fn parse_directive_items<'p, S: Stage>( let span = item.span(); macro malformed() {{ - match mode { - Mode::RustcOnUnimplemented => { - cx.emit_err(NoValueInOnUnimplemented { span: item.span() }); - } - Mode::DiagnosticOnUnimplemented => { - cx.emit_lint( - MALFORMED_DIAGNOSTIC_ATTRIBUTES, - AttributeLintKind::MalformedOnUnimplementedAttr { span }, + if matches!(mode, Mode::RustcOnUnimplemented) { + cx.emit_err(NoValueInOnUnimplemented { span: item.span() }); + } else { + cx.emit_lint( + MALFORMED_DIAGNOSTIC_ATTRIBUTES, + AttributeLintKind::MalFormedDiagnosticAttribute { + attribute: mode.as_str(), span, - ); - } - Mode::DiagnosticOnConst => { - cx.emit_lint( - MALFORMED_DIAGNOSTIC_ATTRIBUTES, - AttributeLintKind::MalformedOnConstAttr { span }, - span, - ); - } - Mode::DiagnosticOnMove => { - cx.emit_lint( - MALFORMED_DIAGNOSTIC_ATTRIBUTES, - AttributeLintKind::MalformedOnMoveAttr { span }, - span, - ); - } - Mode::DiagnosticOnUnknown => { - cx.emit_lint( - MALFORMED_DIAGNOSTIC_ATTRIBUTES, - AttributeLintKind::MalformedOnUnknownAttr { span }, - span, - ); - } + }, + span, + ); } continue; }} @@ -146,12 +137,10 @@ fn parse_directive_items<'p, S: Stage>( }} macro duplicate($name: ident, $($first_span:tt)*) {{ - match mode { - Mode::RustcOnUnimplemented => { - cx.emit_err(NoValueInOnUnimplemented { span: item.span() }); - } - Mode::DiagnosticOnUnimplemented |Mode::DiagnosticOnConst | Mode::DiagnosticOnMove | Mode::DiagnosticOnUnknown => { - cx.emit_lint( + if matches!(mode, Mode::RustcOnUnimplemented) { + cx.emit_err(NoValueInOnUnimplemented { span: item.span() }); + }else{ + cx.emit_lint( MALFORMED_DIAGNOSTIC_ATTRIBUTES, AttributeLintKind::IgnoredDiagnosticOption { first_span: $($first_span)*, @@ -160,7 +149,6 @@ fn parse_directive_items<'p, S: Stage>( }, span, ); - } } }} diff --git a/compiler/rustc_attr_parsing/src/attributes/diagnostic/on_const.rs b/compiler/rustc_attr_parsing/src/attributes/diagnostic/on_const.rs index def4069f6b477..cfa140b848a1b 100644 --- a/compiler/rustc_attr_parsing/src/attributes/diagnostic/on_const.rs +++ b/compiler/rustc_attr_parsing/src/attributes/diagnostic/on_const.rs @@ -22,6 +22,7 @@ impl AttributeParser for OnConstParser { let span = cx.attr_span; this.span = Some(span); + let mode = Mode::DiagnosticOnConst; let items = match args { ArgParser::List(items) if items.len() != 0 => items, @@ -36,16 +37,17 @@ impl AttributeParser for OnConstParser { ArgParser::NameValue(_) => { cx.emit_lint( MALFORMED_DIAGNOSTIC_ATTRIBUTES, - AttributeLintKind::MalformedOnConstAttr { span }, + AttributeLintKind::MalFormedDiagnosticAttribute { + attribute: mode.as_str(), + span, + }, span, ); return; } }; - let Some(directive) = - parse_directive_items(cx, Mode::DiagnosticOnConst, items.mixed(), true) - else { + let Some(directive) = parse_directive_items(cx, mode, items.mixed(), true) else { return; }; merge_directives(cx, &mut this.directive, (span, directive)); diff --git a/compiler/rustc_attr_parsing/src/attributes/diagnostic/on_unimplemented.rs b/compiler/rustc_attr_parsing/src/attributes/diagnostic/on_unimplemented.rs index 12028059b7d40..52cb86678b7d0 100644 --- a/compiler/rustc_attr_parsing/src/attributes/diagnostic/on_unimplemented.rs +++ b/compiler/rustc_attr_parsing/src/attributes/diagnostic/on_unimplemented.rs @@ -42,7 +42,10 @@ impl OnUnimplementedParser { ArgParser::NameValue(_) => { cx.emit_lint( MALFORMED_DIAGNOSTIC_ATTRIBUTES, - AttributeLintKind::MalformedOnUnimplementedAttr { span }, + AttributeLintKind::MalFormedDiagnosticAttribute { + attribute: mode.as_str(), + span, + }, span, ); return; diff --git a/compiler/rustc_attr_parsing/src/attributes/diagnostic/on_unknown.rs b/compiler/rustc_attr_parsing/src/attributes/diagnostic/on_unknown.rs index bd5eb4cbf82c7..8d50c0822b3fc 100644 --- a/compiler/rustc_attr_parsing/src/attributes/diagnostic/on_unknown.rs +++ b/compiler/rustc_attr_parsing/src/attributes/diagnostic/on_unknown.rs @@ -36,7 +36,10 @@ impl OnUnknownParser { ArgParser::NameValue(_) => { cx.emit_lint( MALFORMED_DIAGNOSTIC_ATTRIBUTES, - AttributeLintKind::MalformedOnUnknownAttr { span }, + AttributeLintKind::MalFormedDiagnosticAttribute { + attribute: mode.as_str(), + span, + }, span, ); return; diff --git a/compiler/rustc_lint/src/early/diagnostics.rs b/compiler/rustc_lint/src/early/diagnostics.rs index 1b31639c40785..ff4d810ef5d25 100644 --- a/compiler/rustc_lint/src/early/diagnostics.rs +++ b/compiler/rustc_lint/src/early/diagnostics.rs @@ -176,15 +176,10 @@ impl<'a> Diagnostic<'a, ()> for DecorateAttrLint<'_, '_, '_> { &AttributeLintKind::ExpectedNoArgs => lints::ExpectedNoArgs.into_diag(dcx, level), &AttributeLintKind::ExpectedNameValue => lints::ExpectedNameValue.into_diag(dcx, level), - &AttributeLintKind::MalformedOnUnimplementedAttr { span } => { - lints::MalformedOnUnimplementedAttrLint { span }.into_diag(dcx, level) - } - &AttributeLintKind::MalformedOnUnknownAttr { span } => { - lints::MalformedOnUnknownAttrLint { span }.into_diag(dcx, level) - } - &AttributeLintKind::MalformedOnConstAttr { span } => { - lints::MalformedOnConstAttrLint { span }.into_diag(dcx, level) + &AttributeLintKind::MalFormedDiagnosticAttribute { attribute, span } => { + lints::MalFormedDiagnosticAttributeLint { attribute, span }.into_diag(dcx, level) } + AttributeLintKind::MalformedDiagnosticFormat { warning } => match warning { FormatWarning::PositionalArgument { .. } => { lints::DisallowedPositionalArgument.into_diag(dcx, level) @@ -209,9 +204,6 @@ impl<'a> Diagnostic<'a, ()> for DecorateAttrLint<'_, '_, '_> { &AttributeLintKind::MissingOptionsForOnConst => { lints::MissingOptionsForOnConstAttr.into_diag(dcx, level) } - &AttributeLintKind::MalformedOnMoveAttr { span } => { - lints::MalformedOnMoveAttrLint { span }.into_diag(dcx, level) - } &AttributeLintKind::OnMoveMalformedFormatLiterals { name } => { lints::OnMoveMalformedFormatLiterals { name }.into_diag(dcx, level) } diff --git a/compiler/rustc_lint/src/lints.rs b/compiler/rustc_lint/src/lints.rs index 5e8081baff58b..3a2146a0e178a 100644 --- a/compiler/rustc_lint/src/lints.rs +++ b/compiler/rustc_lint/src/lints.rs @@ -3603,45 +3603,11 @@ pub(crate) struct MissingOptionsForOnConstAttr; #[help("at least one of the `message`, `note` and `label` options are expected")] pub(crate) struct MissingOptionsForOnMoveAttr; -#[derive(Diagnostic)] -#[diag("malformed `on_unimplemented` attribute")] -#[help("only `message`, `note` and `label` are allowed as options")] -pub(crate) struct MalformedOnUnimplementedAttrLint { - #[label("invalid option found here")] - pub span: Span, -} - -#[derive(Diagnostic)] -#[diag("malformed `on_unknown` attribute")] -#[help("only `message`, `note` and `label` are allowed as options")] -pub(crate) struct MalformedOnUnknownAttrLint { - #[label("invalid option found here")] - pub span: Span, -} - -#[derive(Diagnostic)] -#[diag("malformed `on_const` attribute")] -#[help("only `message`, `note` and `label` are allowed as options")] -pub(crate) struct MalformedOnConstAttrLint { - #[label("invalid option found here")] - pub span: Span, -} - #[derive(Diagnostic)] #[diag("`Eq::assert_receiver_is_total_eq` should never be implemented by hand")] #[note("this method was used to add checks to the `Eq` derive macro")] pub(crate) struct EqInternalMethodImplemented; -#[derive(Diagnostic)] -#[diag("unknown or malformed `on_move` attribute")] -#[help( - "only `message`, `note` and `label` are allowed as options. Their values must be string literals" -)] -pub(crate) struct MalformedOnMoveAttrLint { - #[label("invalid option found here")] - pub span: Span, -} - #[derive(Diagnostic)] #[diag("unknown parameter `{$name}`")] #[help("expect `Self` as format argument")] @@ -3655,3 +3621,12 @@ pub(crate) struct OnMoveMalformedFormatLiterals { "only literals are allowed as values for the `message`, `note` and `label` options. These options must be separated by a comma" )] pub(crate) struct OnMoveMalformedAttrExpectedLiteralOrDelimiter; + +#[derive(Diagnostic)] +#[diag("malformed `{$attribute}` attribute")] +#[help("only `message`, `note` and `label` are allowed as options")] +pub(crate) struct MalFormedDiagnosticAttributeLint { + pub attribute: &'static str, + #[label("invalid option found here")] + pub span: Span, +} diff --git a/compiler/rustc_lint_defs/src/lib.rs b/compiler/rustc_lint_defs/src/lib.rs index a77b7bc7d9483..d1dfcee08311d 100644 --- a/compiler/rustc_lint_defs/src/lib.rs +++ b/compiler/rustc_lint_defs/src/lib.rs @@ -733,16 +733,8 @@ pub enum AttributeLintKind { MalformedDoc, ExpectedNoArgs, ExpectedNameValue, - MalformedOnUnimplementedAttr { - span: Span, - }, - MalformedOnUnknownAttr { - span: Span, - }, - MalformedOnConstAttr { - span: Span, - }, - MalformedOnMoveAttr { + MalFormedDiagnosticAttribute { + attribute: &'static str, span: Span, }, MalformedDiagnosticFormat { diff --git a/tests/ui/attributes/malformed-attrs.stderr b/tests/ui/attributes/malformed-attrs.stderr index 4b64771eff80d..a5d8cd9cdf4c7 100644 --- a/tests/ui/attributes/malformed-attrs.stderr +++ b/tests/ui/attributes/malformed-attrs.stderr @@ -802,7 +802,7 @@ LL | #[diagnostic::on_unimplemented] = help: at least one of the `message`, `note` and `label` options are expected = note: `#[warn(malformed_diagnostic_attributes)]` (part of `#[warn(unknown_or_malformed_diagnostic_attributes)]`) on by default -warning: malformed `on_unimplemented` attribute +warning: malformed `diagnostic::on_unimplemented` attribute --> $DIR/malformed-attrs.rs:144:1 | LL | #[diagnostic::on_unimplemented = 1] diff --git a/tests/ui/diagnostic_namespace/on_move/report_warning_on_unknown_options.rs b/tests/ui/diagnostic_namespace/on_move/report_warning_on_unknown_options.rs index 651f6184cfac6..3f25b4e264b71 100644 --- a/tests/ui/diagnostic_namespace/on_move/report_warning_on_unknown_options.rs +++ b/tests/ui/diagnostic_namespace/on_move/report_warning_on_unknown_options.rs @@ -4,8 +4,8 @@ message = "Foo", label = "Bar", baz="Baz" - //~^WARN unknown or malformed `on_move` attribute - //~|HELP only `message`, `note` and `label` are allowed as options. Their values must be string literals + //~^WARN malformed `diagnostic::on_move` attribute + //~|HELP only `message`, `note` and `label` are allowed as options )] struct Foo; diff --git a/tests/ui/diagnostic_namespace/on_move/report_warning_on_unknown_options.stderr b/tests/ui/diagnostic_namespace/on_move/report_warning_on_unknown_options.stderr index a09b8a96d2d12..6af2e0850babf 100644 --- a/tests/ui/diagnostic_namespace/on_move/report_warning_on_unknown_options.stderr +++ b/tests/ui/diagnostic_namespace/on_move/report_warning_on_unknown_options.stderr @@ -1,10 +1,10 @@ -warning: unknown or malformed `on_move` attribute +warning: malformed `diagnostic::on_move` attribute --> $DIR/report_warning_on_unknown_options.rs:6:5 | LL | baz="Baz" | ^^^^^^^^^ invalid option found here | - = help: only `message`, `note` and `label` are allowed as options. Their values must be string literals + = help: only `message`, `note` and `label` are allowed as options = note: `#[warn(malformed_diagnostic_attributes)]` (part of `#[warn(unknown_or_malformed_diagnostic_attributes)]`) on by default error[E0382]: Foo diff --git a/tests/ui/diagnostic_namespace/on_unimplemented/do_not_accept_options_of_the_internal_rustc_attribute.rs b/tests/ui/diagnostic_namespace/on_unimplemented/do_not_accept_options_of_the_internal_rustc_attribute.rs index 09c2a05cd009f..e3c38c7f55c95 100644 --- a/tests/ui/diagnostic_namespace/on_unimplemented/do_not_accept_options_of_the_internal_rustc_attribute.rs +++ b/tests/ui/diagnostic_namespace/on_unimplemented/do_not_accept_options_of_the_internal_rustc_attribute.rs @@ -4,19 +4,19 @@ //@ reference: attributes.diagnostic.on_unimplemented.invalid-formats #[diagnostic::on_unimplemented( on(Self = "&str"), - //~^WARN malformed `on_unimplemented` attribute + //~^WARN malformed `diagnostic::on_unimplemented` attribute message = "trait has `{Self}` and `{T}` as params", label = "trait has `{Self}` and `{T}` as params", note = "trait has `{Self}` and `{T}` as params", parent_label = "in this scope", - //~^WARN malformed `on_unimplemented` attribute + //~^WARN malformed `diagnostic::on_unimplemented` attribute append_const_msg - //~^WARN malformed `on_unimplemented` attribute + //~^WARN malformed `diagnostic::on_unimplemented` attribute )] trait Foo {} #[diagnostic::on_unimplemented = "Message"] -//~^WARN malformed `on_unimplemented` attribute +//~^WARN malformed `diagnostic::on_unimplemented` attribute trait Bar {} #[diagnostic::on_unimplemented(message = "Not allowed to apply it on a impl")] diff --git a/tests/ui/diagnostic_namespace/on_unimplemented/do_not_accept_options_of_the_internal_rustc_attribute.stderr b/tests/ui/diagnostic_namespace/on_unimplemented/do_not_accept_options_of_the_internal_rustc_attribute.stderr index 58d2bdbfc4d6e..65d92e4592d01 100644 --- a/tests/ui/diagnostic_namespace/on_unimplemented/do_not_accept_options_of_the_internal_rustc_attribute.stderr +++ b/tests/ui/diagnostic_namespace/on_unimplemented/do_not_accept_options_of_the_internal_rustc_attribute.stderr @@ -119,7 +119,7 @@ LL | label = "{float}{_Self}{crate_local}{Trait}{ItemContext}{This}" | = help: expect either a generic argument name or `{Self}` as format argument -warning: malformed `on_unimplemented` attribute +warning: malformed `diagnostic::on_unimplemented` attribute --> $DIR/do_not_accept_options_of_the_internal_rustc_attribute.rs:6:5 | LL | on(Self = "&str"), @@ -128,7 +128,7 @@ LL | on(Self = "&str"), = help: only `message`, `note` and `label` are allowed as options = note: `#[warn(malformed_diagnostic_attributes)]` (part of `#[warn(unknown_or_malformed_diagnostic_attributes)]`) on by default -warning: malformed `on_unimplemented` attribute +warning: malformed `diagnostic::on_unimplemented` attribute --> $DIR/do_not_accept_options_of_the_internal_rustc_attribute.rs:11:5 | LL | parent_label = "in this scope", @@ -136,7 +136,7 @@ LL | parent_label = "in this scope", | = help: only `message`, `note` and `label` are allowed as options -warning: malformed `on_unimplemented` attribute +warning: malformed `diagnostic::on_unimplemented` attribute --> $DIR/do_not_accept_options_of_the_internal_rustc_attribute.rs:13:5 | LL | append_const_msg @@ -144,7 +144,7 @@ LL | append_const_msg | = help: only `message`, `note` and `label` are allowed as options -warning: malformed `on_unimplemented` attribute +warning: malformed `diagnostic::on_unimplemented` attribute --> $DIR/do_not_accept_options_of_the_internal_rustc_attribute.rs:18:1 | LL | #[diagnostic::on_unimplemented = "Message"] diff --git a/tests/ui/diagnostic_namespace/on_unimplemented/do_not_fail_parsing_on_invalid_options_1.rs b/tests/ui/diagnostic_namespace/on_unimplemented/do_not_fail_parsing_on_invalid_options_1.rs index c759acc12565c..fdad3a2eb94df 100644 --- a/tests/ui/diagnostic_namespace/on_unimplemented/do_not_fail_parsing_on_invalid_options_1.rs +++ b/tests/ui/diagnostic_namespace/on_unimplemented/do_not_fail_parsing_on_invalid_options_1.rs @@ -1,7 +1,7 @@ //@ reference: attributes.diagnostic.on_unimplemented.syntax //@ reference: attributes.diagnostic.on_unimplemented.unknown-keys #[diagnostic::on_unimplemented(unsupported = "foo")] -//~^WARN malformed `on_unimplemented` attribute +//~^WARN malformed `diagnostic::on_unimplemented` attribute trait Foo {} #[diagnostic::on_unimplemented(message = "Baz")] @@ -9,19 +9,19 @@ trait Foo {} struct Bar {} #[diagnostic::on_unimplemented(message = "Boom", unsupported = "Bar")] -//~^WARN malformed `on_unimplemented` attribute +//~^WARN malformed `diagnostic::on_unimplemented` attribute trait Baz {} #[diagnostic::on_unimplemented(message = "Boom", on(Self = "i32", message = "whatever"))] -//~^WARN malformed `on_unimplemented` attribute +//~^WARN malformed `diagnostic::on_unimplemented` attribute trait Boom {} #[diagnostic::on_unimplemented(message = "Boom", on(_Self = "i32", message = "whatever"))] -//~^WARN malformed `on_unimplemented` attribute +//~^WARN malformed `diagnostic::on_unimplemented` attribute trait _Self {} #[diagnostic::on_unimplemented = "boom"] -//~^WARN malformed `on_unimplemented` attribute +//~^WARN malformed `diagnostic::on_unimplemented` attribute trait Doom {} #[diagnostic::on_unimplemented] diff --git a/tests/ui/diagnostic_namespace/on_unimplemented/do_not_fail_parsing_on_invalid_options_1.stderr b/tests/ui/diagnostic_namespace/on_unimplemented/do_not_fail_parsing_on_invalid_options_1.stderr index 4361e3261a0c1..6415b7a2c28e1 100644 --- a/tests/ui/diagnostic_namespace/on_unimplemented/do_not_fail_parsing_on_invalid_options_1.stderr +++ b/tests/ui/diagnostic_namespace/on_unimplemented/do_not_fail_parsing_on_invalid_options_1.stderr @@ -15,7 +15,7 @@ LL | #[diagnostic::on_unimplemented(message = "{DoesNotExist}")] = help: expect either a generic argument name or `{Self}` as format argument = note: `#[warn(malformed_diagnostic_format_literals)]` (part of `#[warn(unknown_or_malformed_diagnostic_attributes)]`) on by default -warning: malformed `on_unimplemented` attribute +warning: malformed `diagnostic::on_unimplemented` attribute --> $DIR/do_not_fail_parsing_on_invalid_options_1.rs:3:32 | LL | #[diagnostic::on_unimplemented(unsupported = "foo")] @@ -24,7 +24,7 @@ LL | #[diagnostic::on_unimplemented(unsupported = "foo")] = help: only `message`, `note` and `label` are allowed as options = note: `#[warn(malformed_diagnostic_attributes)]` (part of `#[warn(unknown_or_malformed_diagnostic_attributes)]`) on by default -warning: malformed `on_unimplemented` attribute +warning: malformed `diagnostic::on_unimplemented` attribute --> $DIR/do_not_fail_parsing_on_invalid_options_1.rs:11:50 | LL | #[diagnostic::on_unimplemented(message = "Boom", unsupported = "Bar")] @@ -32,7 +32,7 @@ LL | #[diagnostic::on_unimplemented(message = "Boom", unsupported = "Bar")] | = help: only `message`, `note` and `label` are allowed as options -warning: malformed `on_unimplemented` attribute +warning: malformed `diagnostic::on_unimplemented` attribute --> $DIR/do_not_fail_parsing_on_invalid_options_1.rs:15:50 | LL | #[diagnostic::on_unimplemented(message = "Boom", on(Self = "i32", message = "whatever"))] @@ -40,7 +40,7 @@ LL | #[diagnostic::on_unimplemented(message = "Boom", on(Self = "i32", message = | = help: only `message`, `note` and `label` are allowed as options -warning: malformed `on_unimplemented` attribute +warning: malformed `diagnostic::on_unimplemented` attribute --> $DIR/do_not_fail_parsing_on_invalid_options_1.rs:19:50 | LL | #[diagnostic::on_unimplemented(message = "Boom", on(_Self = "i32", message = "whatever"))] @@ -48,7 +48,7 @@ LL | #[diagnostic::on_unimplemented(message = "Boom", on(_Self = "i32", message | = help: only `message`, `note` and `label` are allowed as options -warning: malformed `on_unimplemented` attribute +warning: malformed `diagnostic::on_unimplemented` attribute --> $DIR/do_not_fail_parsing_on_invalid_options_1.rs:23:1 | LL | #[diagnostic::on_unimplemented = "boom"] diff --git a/tests/ui/diagnostic_namespace/on_unknown/malformed_attribute.rs b/tests/ui/diagnostic_namespace/on_unknown/malformed_attribute.rs index d8fcd1336bce1..d9d7df486b889 100644 --- a/tests/ui/diagnostic_namespace/on_unknown/malformed_attribute.rs +++ b/tests/ui/diagnostic_namespace/on_unknown/malformed_attribute.rs @@ -4,7 +4,7 @@ use std::str::FromStr; #[diagnostic::on_unknown(foo = "bar", message = "foo")] -//~^WARN malformed `on_unknown` attribute +//~^WARN malformed `diagnostic::on_unknown` attribute use std::str::Bytes; #[diagnostic::on_unknown(label = "foo", label = "bar")] diff --git a/tests/ui/diagnostic_namespace/on_unknown/malformed_attribute.stderr b/tests/ui/diagnostic_namespace/on_unknown/malformed_attribute.stderr index 319d45c88c429..4c2bfca1ba565 100644 --- a/tests/ui/diagnostic_namespace/on_unknown/malformed_attribute.stderr +++ b/tests/ui/diagnostic_namespace/on_unknown/malformed_attribute.stderr @@ -15,7 +15,7 @@ LL | #[diagnostic::on_unknown] = help: at least one of the `message`, `note` and `label` options are expected = note: `#[warn(malformed_diagnostic_attributes)]` (part of `#[warn(unknown_or_malformed_diagnostic_attributes)]`) on by default -warning: malformed `on_unknown` attribute +warning: malformed `diagnostic::on_unknown` attribute --> $DIR/malformed_attribute.rs:6:26 | LL | #[diagnostic::on_unknown(foo = "bar", message = "foo")] From 57fd9747fb6619aeeec25a843e60865175fc8a8c Mon Sep 17 00:00:00 2001 From: mejrs <59372212+mejrs@users.noreply.github.com> Date: Sun, 12 Apr 2026 21:37:45 +0200 Subject: [PATCH 07/38] Merge "missing options" lints for diagnostic attributes --- .../src/attributes/diagnostic/on_const.rs | 4 +++- .../src/attributes/diagnostic/on_move.rs | 4 +++- .../attributes/diagnostic/on_unimplemented.rs | 4 +++- .../src/attributes/diagnostic/on_unknown.rs | 4 +++- compiler/rustc_lint/src/early/diagnostics.rs | 13 ++---------- compiler/rustc_lint/src/lints.rs | 21 ++++--------------- compiler/rustc_lint_defs/src/lib.rs | 7 +++---- tests/ui/attributes/malformed-attrs.rs | 2 +- tests/ui/attributes/malformed-attrs.stderr | 2 +- ...ort_warning_on_invalid_meta_item_syntax.rs | 2 +- ...warning_on_invalid_meta_item_syntax.stderr | 2 +- .../report_warning_on_missing_options.rs | 2 +- .../report_warning_on_missing_options.stderr | 2 +- ...o_not_fail_parsing_on_invalid_options_1.rs | 2 +- ...t_fail_parsing_on_invalid_options_1.stderr | 2 +- .../on_unknown/malformed_attribute.rs | 2 +- .../on_unknown/malformed_attribute.stderr | 2 +- tests/ui/on-unimplemented/bad-annotation.rs | 2 +- .../ui/on-unimplemented/bad-annotation.stderr | 2 +- 19 files changed, 33 insertions(+), 48 deletions(-) diff --git a/compiler/rustc_attr_parsing/src/attributes/diagnostic/on_const.rs b/compiler/rustc_attr_parsing/src/attributes/diagnostic/on_const.rs index cfa140b848a1b..70ba724734cd8 100644 --- a/compiler/rustc_attr_parsing/src/attributes/diagnostic/on_const.rs +++ b/compiler/rustc_attr_parsing/src/attributes/diagnostic/on_const.rs @@ -29,7 +29,9 @@ impl AttributeParser for OnConstParser { ArgParser::NoArgs | ArgParser::List(_) => { cx.emit_lint( MALFORMED_DIAGNOSTIC_ATTRIBUTES, - AttributeLintKind::MissingOptionsForOnConst, + AttributeLintKind::MissingOptionsForDiagnosticAttribute { + attribute: mode.as_str(), + }, span, ); return; diff --git a/compiler/rustc_attr_parsing/src/attributes/diagnostic/on_move.rs b/compiler/rustc_attr_parsing/src/attributes/diagnostic/on_move.rs index 006b3b66658e0..3cdf424e2e963 100644 --- a/compiler/rustc_attr_parsing/src/attributes/diagnostic/on_move.rs +++ b/compiler/rustc_attr_parsing/src/attributes/diagnostic/on_move.rs @@ -32,7 +32,9 @@ impl OnMoveParser { let Some(list) = args.list() else { cx.emit_lint( MALFORMED_DIAGNOSTIC_ATTRIBUTES, - AttributeLintKind::MissingOptionsForOnMove, + AttributeLintKind::MissingOptionsForDiagnosticAttribute { + attribute: mode.as_str(), + }, span, ); return; diff --git a/compiler/rustc_attr_parsing/src/attributes/diagnostic/on_unimplemented.rs b/compiler/rustc_attr_parsing/src/attributes/diagnostic/on_unimplemented.rs index 52cb86678b7d0..0bfa34709d995 100644 --- a/compiler/rustc_attr_parsing/src/attributes/diagnostic/on_unimplemented.rs +++ b/compiler/rustc_attr_parsing/src/attributes/diagnostic/on_unimplemented.rs @@ -34,7 +34,9 @@ impl OnUnimplementedParser { ArgParser::NoArgs | ArgParser::List(_) => { cx.emit_lint( MALFORMED_DIAGNOSTIC_ATTRIBUTES, - AttributeLintKind::MissingOptionsForOnUnimplemented, + AttributeLintKind::MissingOptionsForDiagnosticAttribute { + attribute: mode.as_str(), + }, span, ); return; diff --git a/compiler/rustc_attr_parsing/src/attributes/diagnostic/on_unknown.rs b/compiler/rustc_attr_parsing/src/attributes/diagnostic/on_unknown.rs index 8d50c0822b3fc..f8d98b69c9343 100644 --- a/compiler/rustc_attr_parsing/src/attributes/diagnostic/on_unknown.rs +++ b/compiler/rustc_attr_parsing/src/attributes/diagnostic/on_unknown.rs @@ -28,7 +28,9 @@ impl OnUnknownParser { ArgParser::NoArgs | ArgParser::List(_) => { cx.emit_lint( MALFORMED_DIAGNOSTIC_ATTRIBUTES, - AttributeLintKind::MissingOptionsForOnUnknown, + AttributeLintKind::MissingOptionsForDiagnosticAttribute { + attribute: mode.as_str(), + }, span, ); return; diff --git a/compiler/rustc_lint/src/early/diagnostics.rs b/compiler/rustc_lint/src/early/diagnostics.rs index ff4d810ef5d25..9d942f2735c6b 100644 --- a/compiler/rustc_lint/src/early/diagnostics.rs +++ b/compiler/rustc_lint/src/early/diagnostics.rs @@ -198,11 +198,8 @@ impl<'a> Diagnostic<'a, ()> for DecorateAttrLint<'_, '_, '_> { lints::IgnoredDiagnosticOption { option_name, first_span, later_span } .into_diag(dcx, level) } - &AttributeLintKind::MissingOptionsForOnUnimplemented => { - lints::MissingOptionsForOnUnimplementedAttr.into_diag(dcx, level) - } - &AttributeLintKind::MissingOptionsForOnConst => { - lints::MissingOptionsForOnConstAttr.into_diag(dcx, level) + &AttributeLintKind::MissingOptionsForDiagnosticAttribute { attribute } => { + lints::MissingOptionsForDiagnosticAttribute { attribute }.into_diag(dcx, level) } &AttributeLintKind::OnMoveMalformedFormatLiterals { name } => { lints::OnMoveMalformedFormatLiterals { name }.into_diag(dcx, level) @@ -210,12 +207,6 @@ impl<'a> Diagnostic<'a, ()> for DecorateAttrLint<'_, '_, '_> { &AttributeLintKind::OnMoveMalformedAttrExpectedLiteralOrDelimiter => { lints::OnMoveMalformedAttrExpectedLiteralOrDelimiter.into_diag(dcx, level) } - &AttributeLintKind::MissingOptionsForOnMove => { - lints::MissingOptionsForOnMoveAttr.into_diag(dcx, level) - } - &AttributeLintKind::MissingOptionsForOnUnknown => { - lints::MissingOptionsForOnUnknownAttr.into_diag(dcx, level) - } } } } diff --git a/compiler/rustc_lint/src/lints.rs b/compiler/rustc_lint/src/lints.rs index 3a2146a0e178a..7de96a5a42495 100644 --- a/compiler/rustc_lint/src/lints.rs +++ b/compiler/rustc_lint/src/lints.rs @@ -3584,24 +3584,11 @@ pub(crate) struct IgnoredDiagnosticOption { } #[derive(Diagnostic)] -#[diag("missing options for `on_unimplemented` attribute")] +#[diag("missing options for `{$attribute}` attribute")] #[help("at least one of the `message`, `note` and `label` options are expected")] -pub(crate) struct MissingOptionsForOnUnimplementedAttr; - -#[derive(Diagnostic)] -#[diag("missing options for `on_unknown` attribute")] -#[help("at least one of the `message`, `note` and `label` options are expected")] -pub(crate) struct MissingOptionsForOnUnknownAttr; - -#[derive(Diagnostic)] -#[diag("missing options for `on_const` attribute")] -#[help("at least one of the `message`, `note` and `label` options are expected")] -pub(crate) struct MissingOptionsForOnConstAttr; - -#[derive(Diagnostic)] -#[diag("missing options for `on_move` attribute")] -#[help("at least one of the `message`, `note` and `label` options are expected")] -pub(crate) struct MissingOptionsForOnMoveAttr; +pub(crate) struct MissingOptionsForDiagnosticAttribute { + pub attribute: &'static str, +} #[derive(Diagnostic)] #[diag("`Eq::assert_receiver_is_total_eq` should never be implemented by hand")] diff --git a/compiler/rustc_lint_defs/src/lib.rs b/compiler/rustc_lint_defs/src/lib.rs index d1dfcee08311d..d348663c8b57b 100644 --- a/compiler/rustc_lint_defs/src/lib.rs +++ b/compiler/rustc_lint_defs/src/lib.rs @@ -750,10 +750,9 @@ pub enum AttributeLintKind { first_span: Span, later_span: Span, }, - MissingOptionsForOnUnimplemented, - MissingOptionsForOnConst, - MissingOptionsForOnUnknown, - MissingOptionsForOnMove, + MissingOptionsForDiagnosticAttribute { + attribute: &'static str, + }, OnMoveMalformedFormatLiterals { name: Symbol, }, diff --git a/tests/ui/attributes/malformed-attrs.rs b/tests/ui/attributes/malformed-attrs.rs index 6193a101918bd..9dcdb9a69272b 100644 --- a/tests/ui/attributes/malformed-attrs.rs +++ b/tests/ui/attributes/malformed-attrs.rs @@ -140,7 +140,7 @@ pub fn test3() {} struct Test; #[diagnostic::on_unimplemented] -//~^ WARN missing options for `on_unimplemented` attribute +//~^ WARN missing options for `diagnostic::on_unimplemented` attribute #[diagnostic::on_unimplemented = 1] //~^ WARN malformed trait Hey { diff --git a/tests/ui/attributes/malformed-attrs.stderr b/tests/ui/attributes/malformed-attrs.stderr index a5d8cd9cdf4c7..7e3c3fac42da9 100644 --- a/tests/ui/attributes/malformed-attrs.stderr +++ b/tests/ui/attributes/malformed-attrs.stderr @@ -793,7 +793,7 @@ LL | #[no_implicit_prelude = 23] = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! = help: `#[no_implicit_prelude]` can be applied to crates and modules -warning: missing options for `on_unimplemented` attribute +warning: missing options for `diagnostic::on_unimplemented` attribute --> $DIR/malformed-attrs.rs:142:1 | LL | #[diagnostic::on_unimplemented] diff --git a/tests/ui/diagnostic_namespace/on_move/report_warning_on_invalid_meta_item_syntax.rs b/tests/ui/diagnostic_namespace/on_move/report_warning_on_invalid_meta_item_syntax.rs index 2050403210d58..d88eee1c84ce3 100644 --- a/tests/ui/diagnostic_namespace/on_move/report_warning_on_invalid_meta_item_syntax.rs +++ b/tests/ui/diagnostic_namespace/on_move/report_warning_on_invalid_meta_item_syntax.rs @@ -1,7 +1,7 @@ #![feature(diagnostic_on_move)] #[diagnostic::on_move = "foo"] -//~^WARN missing options for `on_move` attribute [malformed_diagnostic_attributes] +//~^WARN missing options for `diagnostic::on_move` attribute [malformed_diagnostic_attributes] struct Foo; fn takes_foo(_: Foo) {} diff --git a/tests/ui/diagnostic_namespace/on_move/report_warning_on_invalid_meta_item_syntax.stderr b/tests/ui/diagnostic_namespace/on_move/report_warning_on_invalid_meta_item_syntax.stderr index 39992b02e5804..5957b1336bf88 100644 --- a/tests/ui/diagnostic_namespace/on_move/report_warning_on_invalid_meta_item_syntax.stderr +++ b/tests/ui/diagnostic_namespace/on_move/report_warning_on_invalid_meta_item_syntax.stderr @@ -1,4 +1,4 @@ -warning: missing options for `on_move` attribute +warning: missing options for `diagnostic::on_move` attribute --> $DIR/report_warning_on_invalid_meta_item_syntax.rs:3:1 | LL | #[diagnostic::on_move = "foo"] diff --git a/tests/ui/diagnostic_namespace/on_move/report_warning_on_missing_options.rs b/tests/ui/diagnostic_namespace/on_move/report_warning_on_missing_options.rs index e5603fd24ec98..efe728d43195b 100644 --- a/tests/ui/diagnostic_namespace/on_move/report_warning_on_missing_options.rs +++ b/tests/ui/diagnostic_namespace/on_move/report_warning_on_missing_options.rs @@ -1,7 +1,7 @@ #![feature(diagnostic_on_move)] #[diagnostic::on_move] -//~^WARN missing options for `on_move` attribute [malformed_diagnostic_attributes] +//~^WARN missing options for `diagnostic::on_move` attribute [malformed_diagnostic_attributes] struct Foo; fn takes_foo(_: Foo) {} diff --git a/tests/ui/diagnostic_namespace/on_move/report_warning_on_missing_options.stderr b/tests/ui/diagnostic_namespace/on_move/report_warning_on_missing_options.stderr index f4e6d69faecb9..b885d72028c4c 100644 --- a/tests/ui/diagnostic_namespace/on_move/report_warning_on_missing_options.stderr +++ b/tests/ui/diagnostic_namespace/on_move/report_warning_on_missing_options.stderr @@ -1,4 +1,4 @@ -warning: missing options for `on_move` attribute +warning: missing options for `diagnostic::on_move` attribute --> $DIR/report_warning_on_missing_options.rs:3:1 | LL | #[diagnostic::on_move] diff --git a/tests/ui/diagnostic_namespace/on_unimplemented/do_not_fail_parsing_on_invalid_options_1.rs b/tests/ui/diagnostic_namespace/on_unimplemented/do_not_fail_parsing_on_invalid_options_1.rs index fdad3a2eb94df..14763d21a2bea 100644 --- a/tests/ui/diagnostic_namespace/on_unimplemented/do_not_fail_parsing_on_invalid_options_1.rs +++ b/tests/ui/diagnostic_namespace/on_unimplemented/do_not_fail_parsing_on_invalid_options_1.rs @@ -25,7 +25,7 @@ trait _Self {} trait Doom {} #[diagnostic::on_unimplemented] -//~^WARN missing options for `on_unimplemented` attribute +//~^WARN missing options for `diagnostic::on_unimplemented` attribute trait Whatever {} #[diagnostic::on_unimplemented(message = "{DoesNotExist}")] diff --git a/tests/ui/diagnostic_namespace/on_unimplemented/do_not_fail_parsing_on_invalid_options_1.stderr b/tests/ui/diagnostic_namespace/on_unimplemented/do_not_fail_parsing_on_invalid_options_1.stderr index 6415b7a2c28e1..14d3c0db1ec9f 100644 --- a/tests/ui/diagnostic_namespace/on_unimplemented/do_not_fail_parsing_on_invalid_options_1.stderr +++ b/tests/ui/diagnostic_namespace/on_unimplemented/do_not_fail_parsing_on_invalid_options_1.stderr @@ -56,7 +56,7 @@ LL | #[diagnostic::on_unimplemented = "boom"] | = help: only `message`, `note` and `label` are allowed as options -warning: missing options for `on_unimplemented` attribute +warning: missing options for `diagnostic::on_unimplemented` attribute --> $DIR/do_not_fail_parsing_on_invalid_options_1.rs:27:1 | LL | #[diagnostic::on_unimplemented] diff --git a/tests/ui/diagnostic_namespace/on_unknown/malformed_attribute.rs b/tests/ui/diagnostic_namespace/on_unknown/malformed_attribute.rs index d9d7df486b889..ee91eb7c73001 100644 --- a/tests/ui/diagnostic_namespace/on_unknown/malformed_attribute.rs +++ b/tests/ui/diagnostic_namespace/on_unknown/malformed_attribute.rs @@ -1,6 +1,6 @@ #![feature(diagnostic_on_unknown)] #[diagnostic::on_unknown] -//~^WARN missing options for `on_unknown` attribute +//~^WARN missing options for `diagnostic::on_unknown` attribute use std::str::FromStr; #[diagnostic::on_unknown(foo = "bar", message = "foo")] diff --git a/tests/ui/diagnostic_namespace/on_unknown/malformed_attribute.stderr b/tests/ui/diagnostic_namespace/on_unknown/malformed_attribute.stderr index 4c2bfca1ba565..a949ace4198d0 100644 --- a/tests/ui/diagnostic_namespace/on_unknown/malformed_attribute.stderr +++ b/tests/ui/diagnostic_namespace/on_unknown/malformed_attribute.stderr @@ -6,7 +6,7 @@ LL | use std::str::NotExisting; | = note: unresolved import `std::str::NotExisting` -warning: missing options for `on_unknown` attribute +warning: missing options for `diagnostic::on_unknown` attribute --> $DIR/malformed_attribute.rs:2:1 | LL | #[diagnostic::on_unknown] diff --git a/tests/ui/on-unimplemented/bad-annotation.rs b/tests/ui/on-unimplemented/bad-annotation.rs index c8d846a2273df..1efaea8883926 100644 --- a/tests/ui/on-unimplemented/bad-annotation.rs +++ b/tests/ui/on-unimplemented/bad-annotation.rs @@ -13,7 +13,7 @@ trait MyFromIterator { } #[rustc_on_unimplemented] -//~^ WARN missing options for `on_unimplemented` attribute +//~^ WARN missing options for `rustc_on_unimplemented` attribute //~| NOTE part of trait NoContent {} diff --git a/tests/ui/on-unimplemented/bad-annotation.stderr b/tests/ui/on-unimplemented/bad-annotation.stderr index 6316dd6aa2d27..a85956a89231e 100644 --- a/tests/ui/on-unimplemented/bad-annotation.stderr +++ b/tests/ui/on-unimplemented/bad-annotation.stderr @@ -126,7 +126,7 @@ warning: there is no parameter `abc` on trait `InvalidName2` LL | #[rustc_on_unimplemented(on(abc = "y", message = "y"))] | ^^^^^^^^^ -warning: missing options for `on_unimplemented` attribute +warning: missing options for `rustc_on_unimplemented` attribute --> $DIR/bad-annotation.rs:15:1 | LL | #[rustc_on_unimplemented] From 217c0739624f560ea9835d3249775bb6fc58f834 Mon Sep 17 00:00:00 2001 From: mejrs <59372212+mejrs@users.noreply.github.com> Date: Sun, 12 Apr 2026 23:24:44 +0200 Subject: [PATCH 08/38] move list parsing into its own function --- .../src/attributes/diagnostic/mod.rs | 38 +++++++++++++++++++ .../src/attributes/diagnostic/on_const.rs | 27 +------------ .../src/attributes/diagnostic/on_move.rs | 23 +---------- .../attributes/diagnostic/on_unimplemented.rs | 27 +------------ .../src/attributes/diagnostic/on_unknown.rs | 26 +------------ compiler/rustc_lint/src/early/diagnostics.rs | 4 +- compiler/rustc_lint/src/lints.rs | 2 +- compiler/rustc_lint_defs/src/lib.rs | 2 +- ...ort_warning_on_invalid_meta_item_syntax.rs | 2 +- ...warning_on_invalid_meta_item_syntax.stderr | 6 +-- 10 files changed, 51 insertions(+), 106 deletions(-) diff --git a/compiler/rustc_attr_parsing/src/attributes/diagnostic/mod.rs b/compiler/rustc_attr_parsing/src/attributes/diagnostic/mod.rs index 2ddbb8c603a51..7a790e58534e5 100644 --- a/compiler/rustc_attr_parsing/src/attributes/diagnostic/mod.rs +++ b/compiler/rustc_attr_parsing/src/attributes/diagnostic/mod.rs @@ -95,6 +95,44 @@ fn merge( } } +fn parse_list<'p, S: Stage>( + cx: &mut AcceptContext<'_, '_, S>, + args: &'p ArgParser, + mode: Mode, +) -> Option<&'p MetaItemListParser> { + let span = cx.attr_span; + match args { + ArgParser::List(items) if items.len() != 0 => return Some(items), + ArgParser::List(list) => { + // We're dealing with `#[diagnostic::attr()]`. + // This can be because that is what the user typed, but that's also what we'd see + // if the user used non-metaitem syntax. See `ArgParser::from_attr_args`. + cx.emit_lint( + MALFORMED_DIAGNOSTIC_ATTRIBUTES, + AttributeLintKind::NonMetaItemDiagnosticAttribute, + list.span, + ); + } + ArgParser::NoArgs => { + cx.emit_lint( + MALFORMED_DIAGNOSTIC_ATTRIBUTES, + AttributeLintKind::MissingOptionsForDiagnosticAttribute { + attribute: mode.as_str(), + }, + span, + ); + } + ArgParser::NameValue(_) => { + cx.emit_lint( + MALFORMED_DIAGNOSTIC_ATTRIBUTES, + AttributeLintKind::MalFormedDiagnosticAttribute { attribute: mode.as_str(), span }, + span, + ); + } + } + None +} + fn parse_directive_items<'p, S: Stage>( cx: &mut AcceptContext<'_, '_, S>, mode: Mode, diff --git a/compiler/rustc_attr_parsing/src/attributes/diagnostic/on_const.rs b/compiler/rustc_attr_parsing/src/attributes/diagnostic/on_const.rs index 70ba724734cd8..7686065334d9d 100644 --- a/compiler/rustc_attr_parsing/src/attributes/diagnostic/on_const.rs +++ b/compiler/rustc_attr_parsing/src/attributes/diagnostic/on_const.rs @@ -1,6 +1,4 @@ use rustc_hir::attrs::diagnostic::Directive; -use rustc_hir::lints::AttributeLintKind; -use rustc_session::lint::builtin::MALFORMED_DIAGNOSTIC_ATTRIBUTES; use crate::attributes::diagnostic::*; use crate::attributes::prelude::*; @@ -24,30 +22,7 @@ impl AttributeParser for OnConstParser { this.span = Some(span); let mode = Mode::DiagnosticOnConst; - let items = match args { - ArgParser::List(items) if items.len() != 0 => items, - ArgParser::NoArgs | ArgParser::List(_) => { - cx.emit_lint( - MALFORMED_DIAGNOSTIC_ATTRIBUTES, - AttributeLintKind::MissingOptionsForDiagnosticAttribute { - attribute: mode.as_str(), - }, - span, - ); - return; - } - ArgParser::NameValue(_) => { - cx.emit_lint( - MALFORMED_DIAGNOSTIC_ATTRIBUTES, - AttributeLintKind::MalFormedDiagnosticAttribute { - attribute: mode.as_str(), - span, - }, - span, - ); - return; - } - }; + let Some(items) = parse_list(cx, args, mode) else { return }; let Some(directive) = parse_directive_items(cx, mode, items.mixed(), true) else { return; diff --git a/compiler/rustc_attr_parsing/src/attributes/diagnostic/on_move.rs b/compiler/rustc_attr_parsing/src/attributes/diagnostic/on_move.rs index 3cdf424e2e963..575e573e90e57 100644 --- a/compiler/rustc_attr_parsing/src/attributes/diagnostic/on_move.rs +++ b/compiler/rustc_attr_parsing/src/attributes/diagnostic/on_move.rs @@ -1,7 +1,5 @@ use rustc_feature::template; use rustc_hir::attrs::AttributeKind; -use rustc_hir::lints::AttributeLintKind; -use rustc_session::lint::builtin::MALFORMED_DIAGNOSTIC_ATTRIBUTES; use rustc_span::sym; use crate::attributes::diagnostic::*; @@ -29,27 +27,10 @@ impl OnMoveParser { let span = cx.attr_span; self.span = Some(span); - let Some(list) = args.list() else { - cx.emit_lint( - MALFORMED_DIAGNOSTIC_ATTRIBUTES, - AttributeLintKind::MissingOptionsForDiagnosticAttribute { - attribute: mode.as_str(), - }, - span, - ); - return; - }; - if list.is_empty() { - cx.emit_lint( - MALFORMED_DIAGNOSTIC_ATTRIBUTES, - AttributeLintKind::OnMoveMalformedAttrExpectedLiteralOrDelimiter, - list.span, - ); - return; - } + let Some(items) = parse_list(cx, args, mode) else { return }; - if let Some(directive) = parse_directive_items(cx, mode, list.mixed(), true) { + if let Some(directive) = parse_directive_items(cx, mode, items.mixed(), true) { merge_directives(cx, &mut self.directive, (span, directive)); } } diff --git a/compiler/rustc_attr_parsing/src/attributes/diagnostic/on_unimplemented.rs b/compiler/rustc_attr_parsing/src/attributes/diagnostic/on_unimplemented.rs index 0bfa34709d995..dce3226670a15 100644 --- a/compiler/rustc_attr_parsing/src/attributes/diagnostic/on_unimplemented.rs +++ b/compiler/rustc_attr_parsing/src/attributes/diagnostic/on_unimplemented.rs @@ -1,6 +1,4 @@ use rustc_hir::attrs::diagnostic::Directive; -use rustc_hir::lints::AttributeLintKind; -use rustc_session::lint::builtin::MALFORMED_DIAGNOSTIC_ATTRIBUTES; use crate::attributes::diagnostic::*; use crate::attributes::prelude::*; @@ -29,30 +27,7 @@ impl OnUnimplementedParser { return; } - let items = match args { - ArgParser::List(items) if items.len() != 0 => items, - ArgParser::NoArgs | ArgParser::List(_) => { - cx.emit_lint( - MALFORMED_DIAGNOSTIC_ATTRIBUTES, - AttributeLintKind::MissingOptionsForDiagnosticAttribute { - attribute: mode.as_str(), - }, - span, - ); - return; - } - ArgParser::NameValue(_) => { - cx.emit_lint( - MALFORMED_DIAGNOSTIC_ATTRIBUTES, - AttributeLintKind::MalFormedDiagnosticAttribute { - attribute: mode.as_str(), - span, - }, - span, - ); - return; - } - }; + let Some(items) = parse_list(cx, args, mode) else { return }; if let Some(directive) = parse_directive_items(cx, mode, items.mixed(), true) { merge_directives(cx, &mut self.directive, (span, directive)); diff --git a/compiler/rustc_attr_parsing/src/attributes/diagnostic/on_unknown.rs b/compiler/rustc_attr_parsing/src/attributes/diagnostic/on_unknown.rs index f8d98b69c9343..3fd334ce2d38a 100644 --- a/compiler/rustc_attr_parsing/src/attributes/diagnostic/on_unknown.rs +++ b/compiler/rustc_attr_parsing/src/attributes/diagnostic/on_unknown.rs @@ -1,5 +1,4 @@ use rustc_hir::attrs::diagnostic::Directive; -use rustc_session::lint::builtin::MALFORMED_DIAGNOSTIC_ATTRIBUTES; use crate::attributes::diagnostic::*; use crate::attributes::prelude::*; @@ -23,30 +22,7 @@ impl OnUnknownParser { let span = cx.attr_span; self.span = Some(span); - let items = match args { - ArgParser::List(items) if !items.is_empty() => items, - ArgParser::NoArgs | ArgParser::List(_) => { - cx.emit_lint( - MALFORMED_DIAGNOSTIC_ATTRIBUTES, - AttributeLintKind::MissingOptionsForDiagnosticAttribute { - attribute: mode.as_str(), - }, - span, - ); - return; - } - ArgParser::NameValue(_) => { - cx.emit_lint( - MALFORMED_DIAGNOSTIC_ATTRIBUTES, - AttributeLintKind::MalFormedDiagnosticAttribute { - attribute: mode.as_str(), - span, - }, - span, - ); - return; - } - }; + let Some(items) = parse_list(cx, args, mode) else { return }; if let Some(directive) = parse_directive_items(cx, mode, items.mixed(), true) { merge_directives(cx, &mut self.directive, (span, directive)); diff --git a/compiler/rustc_lint/src/early/diagnostics.rs b/compiler/rustc_lint/src/early/diagnostics.rs index 9d942f2735c6b..8bca496e6935a 100644 --- a/compiler/rustc_lint/src/early/diagnostics.rs +++ b/compiler/rustc_lint/src/early/diagnostics.rs @@ -204,8 +204,8 @@ impl<'a> Diagnostic<'a, ()> for DecorateAttrLint<'_, '_, '_> { &AttributeLintKind::OnMoveMalformedFormatLiterals { name } => { lints::OnMoveMalformedFormatLiterals { name }.into_diag(dcx, level) } - &AttributeLintKind::OnMoveMalformedAttrExpectedLiteralOrDelimiter => { - lints::OnMoveMalformedAttrExpectedLiteralOrDelimiter.into_diag(dcx, level) + &AttributeLintKind::NonMetaItemDiagnosticAttribute => { + lints::NonMetaItemDiagnosticAttribute.into_diag(dcx, level) } } } diff --git a/compiler/rustc_lint/src/lints.rs b/compiler/rustc_lint/src/lints.rs index 7de96a5a42495..fba51c105d36c 100644 --- a/compiler/rustc_lint/src/lints.rs +++ b/compiler/rustc_lint/src/lints.rs @@ -3607,7 +3607,7 @@ pub(crate) struct OnMoveMalformedFormatLiterals { #[help( "only literals are allowed as values for the `message`, `note` and `label` options. These options must be separated by a comma" )] -pub(crate) struct OnMoveMalformedAttrExpectedLiteralOrDelimiter; +pub(crate) struct NonMetaItemDiagnosticAttribute; #[derive(Diagnostic)] #[diag("malformed `{$attribute}` attribute")] diff --git a/compiler/rustc_lint_defs/src/lib.rs b/compiler/rustc_lint_defs/src/lib.rs index d348663c8b57b..7f2310da3fce1 100644 --- a/compiler/rustc_lint_defs/src/lib.rs +++ b/compiler/rustc_lint_defs/src/lib.rs @@ -756,7 +756,7 @@ pub enum AttributeLintKind { OnMoveMalformedFormatLiterals { name: Symbol, }, - OnMoveMalformedAttrExpectedLiteralOrDelimiter, + NonMetaItemDiagnosticAttribute, } #[derive(Debug, Clone, HashStable_Generic)] diff --git a/tests/ui/diagnostic_namespace/on_move/report_warning_on_invalid_meta_item_syntax.rs b/tests/ui/diagnostic_namespace/on_move/report_warning_on_invalid_meta_item_syntax.rs index d88eee1c84ce3..2118adc57c451 100644 --- a/tests/ui/diagnostic_namespace/on_move/report_warning_on_invalid_meta_item_syntax.rs +++ b/tests/ui/diagnostic_namespace/on_move/report_warning_on_invalid_meta_item_syntax.rs @@ -1,7 +1,7 @@ #![feature(diagnostic_on_move)] #[diagnostic::on_move = "foo"] -//~^WARN missing options for `diagnostic::on_move` attribute [malformed_diagnostic_attributes] +//~^WARN malformed `diagnostic::on_move` attribute [malformed_diagnostic_attributes] struct Foo; fn takes_foo(_: Foo) {} diff --git a/tests/ui/diagnostic_namespace/on_move/report_warning_on_invalid_meta_item_syntax.stderr b/tests/ui/diagnostic_namespace/on_move/report_warning_on_invalid_meta_item_syntax.stderr index 5957b1336bf88..ba53ad3a92718 100644 --- a/tests/ui/diagnostic_namespace/on_move/report_warning_on_invalid_meta_item_syntax.stderr +++ b/tests/ui/diagnostic_namespace/on_move/report_warning_on_invalid_meta_item_syntax.stderr @@ -1,10 +1,10 @@ -warning: missing options for `diagnostic::on_move` attribute +warning: malformed `diagnostic::on_move` attribute --> $DIR/report_warning_on_invalid_meta_item_syntax.rs:3:1 | LL | #[diagnostic::on_move = "foo"] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ invalid option found here | - = help: at least one of the `message`, `note` and `label` options are expected + = help: only `message`, `note` and `label` are allowed as options = note: `#[warn(malformed_diagnostic_attributes)]` (part of `#[warn(unknown_or_malformed_diagnostic_attributes)]`) on by default error[E0382]: use of moved value: `foo` From 0dd591aeab869dbc17ef5c0775d61ce5210f2080 Mon Sep 17 00:00:00 2001 From: mejrs <59372212+mejrs@users.noreply.github.com> Date: Sun, 12 Apr 2026 23:42:10 +0200 Subject: [PATCH 09/38] Delete unused `AttributeLintKind` variant --- compiler/rustc_lint/src/early/diagnostics.rs | 3 --- compiler/rustc_lint/src/lints.rs | 7 ------- compiler/rustc_lint_defs/src/lib.rs | 3 --- 3 files changed, 13 deletions(-) diff --git a/compiler/rustc_lint/src/early/diagnostics.rs b/compiler/rustc_lint/src/early/diagnostics.rs index 8bca496e6935a..1e91b76854219 100644 --- a/compiler/rustc_lint/src/early/diagnostics.rs +++ b/compiler/rustc_lint/src/early/diagnostics.rs @@ -201,9 +201,6 @@ impl<'a> Diagnostic<'a, ()> for DecorateAttrLint<'_, '_, '_> { &AttributeLintKind::MissingOptionsForDiagnosticAttribute { attribute } => { lints::MissingOptionsForDiagnosticAttribute { attribute }.into_diag(dcx, level) } - &AttributeLintKind::OnMoveMalformedFormatLiterals { name } => { - lints::OnMoveMalformedFormatLiterals { name }.into_diag(dcx, level) - } &AttributeLintKind::NonMetaItemDiagnosticAttribute => { lints::NonMetaItemDiagnosticAttribute.into_diag(dcx, level) } diff --git a/compiler/rustc_lint/src/lints.rs b/compiler/rustc_lint/src/lints.rs index fba51c105d36c..8859e4880fd65 100644 --- a/compiler/rustc_lint/src/lints.rs +++ b/compiler/rustc_lint/src/lints.rs @@ -3595,13 +3595,6 @@ pub(crate) struct MissingOptionsForDiagnosticAttribute { #[note("this method was used to add checks to the `Eq` derive macro")] pub(crate) struct EqInternalMethodImplemented; -#[derive(Diagnostic)] -#[diag("unknown parameter `{$name}`")] -#[help("expect `Self` as format argument")] -pub(crate) struct OnMoveMalformedFormatLiterals { - pub name: Symbol, -} - #[derive(Diagnostic)] #[diag("expected a literal or missing delimiter")] #[help( diff --git a/compiler/rustc_lint_defs/src/lib.rs b/compiler/rustc_lint_defs/src/lib.rs index 7f2310da3fce1..cd307739af52c 100644 --- a/compiler/rustc_lint_defs/src/lib.rs +++ b/compiler/rustc_lint_defs/src/lib.rs @@ -753,9 +753,6 @@ pub enum AttributeLintKind { MissingOptionsForDiagnosticAttribute { attribute: &'static str, }, - OnMoveMalformedFormatLiterals { - name: Symbol, - }, NonMetaItemDiagnosticAttribute, } From f468cef3db009c36fec8f97aa911e90e8738850d Mon Sep 17 00:00:00 2001 From: mejrs <59372212+mejrs@users.noreply.github.com> Date: Mon, 13 Apr 2026 00:02:09 +0200 Subject: [PATCH 10/38] Format the duplicate macro --- .../src/attributes/diagnostic/mod.rs | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/compiler/rustc_attr_parsing/src/attributes/diagnostic/mod.rs b/compiler/rustc_attr_parsing/src/attributes/diagnostic/mod.rs index 7a790e58534e5..0e64135951664 100644 --- a/compiler/rustc_attr_parsing/src/attributes/diagnostic/mod.rs +++ b/compiler/rustc_attr_parsing/src/attributes/diagnostic/mod.rs @@ -177,16 +177,16 @@ fn parse_directive_items<'p, S: Stage>( macro duplicate($name: ident, $($first_span:tt)*) {{ if matches!(mode, Mode::RustcOnUnimplemented) { cx.emit_err(NoValueInOnUnimplemented { span: item.span() }); - }else{ + } else { cx.emit_lint( - MALFORMED_DIAGNOSTIC_ATTRIBUTES, - AttributeLintKind::IgnoredDiagnosticOption { - first_span: $($first_span)*, - later_span: span, - option_name: $name, - }, - span, - ); + MALFORMED_DIAGNOSTIC_ATTRIBUTES, + AttributeLintKind::IgnoredDiagnosticOption { + first_span: $($first_span)*, + later_span: span, + option_name: $name, + }, + span, + ); } }} From c79fcfcca872ffc8261663549cd2371da4be92f7 Mon Sep 17 00:00:00 2001 From: Zalathar Date: Fri, 3 Apr 2026 15:44:58 +1100 Subject: [PATCH 11/38] Fix some irrelevant warnings in `tests/incremental` This avoids having to add several unhelpful annotations when enabling diagnostic checks for `cpass` and `rpass` revisions. --- src/tools/compiletest/src/runtest.rs | 1 + tests/incremental/const-generics/change-const-param-gat.rs | 1 - tests/incremental/krate_reassign_34991/main.rs | 4 ++-- tests/incremental/rlib_cross_crate/b.rs | 4 ++-- tests/incremental/split_debuginfo_mode.rs | 1 + tests/incremental/static_cycle/b.rs | 4 ++-- tests/incremental/struct_add_field.rs | 6 +++--- tests/incremental/struct_change_field_name.rs | 6 +++--- tests/incremental/struct_change_field_type.rs | 6 +++--- tests/incremental/struct_change_field_type_cross_crate/b.rs | 6 +++--- tests/incremental/struct_change_nothing.rs | 6 +++--- tests/incremental/struct_remove_field.rs | 6 +++--- tests/incremental/type_alias_cross_crate/b.rs | 4 ++-- 13 files changed, 28 insertions(+), 27 deletions(-) diff --git a/src/tools/compiletest/src/runtest.rs b/src/tools/compiletest/src/runtest.rs index 6b5147cea6626..455d7204d40eb 100644 --- a/src/tools/compiletest/src/runtest.rs +++ b/src/tools/compiletest/src/runtest.rs @@ -995,6 +995,7 @@ impl<'test> TestCx<'test> { AllowUnused::No } } + TestMode::Incremental => AllowUnused::Yes, _ => AllowUnused::No, }; diff --git a/tests/incremental/const-generics/change-const-param-gat.rs b/tests/incremental/const-generics/change-const-param-gat.rs index 0aa628f4bd6b8..7e9009e84b832 100644 --- a/tests/incremental/const-generics/change-const-param-gat.rs +++ b/tests/incremental/const-generics/change-const-param-gat.rs @@ -1,7 +1,6 @@ //@ revisions: rpass1 rpass2 rpass3 //@ compile-flags: -Zincremental-ignore-spans //@ ignore-backends: gcc -#![feature(generic_associated_types)] // This test unsures that with_opt_const_param returns the // def_id of the N param in the Foo::Assoc GAT. diff --git a/tests/incremental/krate_reassign_34991/main.rs b/tests/incremental/krate_reassign_34991/main.rs index 2aa77377f5dae..1c237df827bdc 100644 --- a/tests/incremental/krate_reassign_34991/main.rs +++ b/tests/incremental/krate_reassign_34991/main.rs @@ -8,13 +8,13 @@ extern crate a; #[cfg(rpass1)] -pub fn use_X() -> u32 { +pub fn use_x() -> u32 { let x: a::X = 22; x as u32 } #[cfg(rpass2)] -pub fn use_X() -> u32 { +pub fn use_x() -> u32 { 22 } diff --git a/tests/incremental/rlib_cross_crate/b.rs b/tests/incremental/rlib_cross_crate/b.rs index c60e1c52f7ed4..17f4a0d11500c 100644 --- a/tests/incremental/rlib_cross_crate/b.rs +++ b/tests/incremental/rlib_cross_crate/b.rs @@ -15,14 +15,14 @@ extern crate a; #[rustc_clean(except="typeck_root,optimized_mir", cfg="rpass2")] #[rustc_clean(cfg="rpass3")] -pub fn use_X() -> u32 { +pub fn use_x() -> u32 { let x: a::X = 22; x as u32 } #[rustc_clean(cfg="rpass2")] #[rustc_clean(cfg="rpass3")] -pub fn use_Y() { +pub fn use_y() { let x: a::Y = 'c'; } diff --git a/tests/incremental/split_debuginfo_mode.rs b/tests/incremental/split_debuginfo_mode.rs index d994e24cd5875..e3c1f03f5b76a 100644 --- a/tests/incremental/split_debuginfo_mode.rs +++ b/tests/incremental/split_debuginfo_mode.rs @@ -5,6 +5,7 @@ // ignore-tidy-linelength //@ only-x86_64-unknown-linux-gnu //@ revisions:rpass1 rpass2 rpass3 rpass4 +//@ ignore-backends: gcc //@ [rpass1]compile-flags: -Zquery-dep-graph -Csplit-debuginfo=unpacked -Zsplit-dwarf-kind=single -Zsplit-dwarf-inlining=on //@ [rpass2]compile-flags: -Zquery-dep-graph -Csplit-debuginfo=packed -Zsplit-dwarf-kind=single -Zsplit-dwarf-inlining=on diff --git a/tests/incremental/static_cycle/b.rs b/tests/incremental/static_cycle/b.rs index c8243cb5328c5..98d640ad8f8de 100644 --- a/tests/incremental/static_cycle/b.rs +++ b/tests/incremental/static_cycle/b.rs @@ -3,8 +3,8 @@ #![cfg_attr(rpass2, warn(dead_code))] -pub static mut BAA: *const i8 = unsafe { &BOO as *const _ as *const i8 }; +pub static mut BAA: *const i8 = unsafe { &raw const BOO as *const i8 }; -pub static mut BOO: *const i8 = unsafe { &BAA as *const _ as *const i8 }; +pub static mut BOO: *const i8 = unsafe { &raw const BAA as *const i8 }; fn main() {} diff --git a/tests/incremental/struct_add_field.rs b/tests/incremental/struct_add_field.rs index e39935c0231a3..8deee224b77de 100644 --- a/tests/incremental/struct_add_field.rs +++ b/tests/incremental/struct_add_field.rs @@ -23,17 +23,17 @@ pub struct Y { } #[rustc_clean(except="fn_sig,typeck_root", cfg="rpass2")] -pub fn use_X(x: X) -> u32 { +pub fn use_x(x: X) -> u32 { x.x as u32 } #[rustc_clean(except="typeck_root", cfg="rpass2")] -pub fn use_EmbedX(embed: EmbedX) -> u32 { +pub fn use_embed_x(embed: EmbedX) -> u32 { embed.x.x as u32 } #[rustc_clean(cfg="rpass2")] -pub fn use_Y() { +pub fn use_y() { let x: Y = Y { y: 'c' }; } diff --git a/tests/incremental/struct_change_field_name.rs b/tests/incremental/struct_change_field_name.rs index 76f42b68c5c8c..70615a5b2a137 100644 --- a/tests/incremental/struct_change_field_name.rs +++ b/tests/incremental/struct_change_field_name.rs @@ -27,7 +27,7 @@ pub struct Y { } #[rustc_clean(except="typeck_root", cfg="cfail2")] -pub fn use_X() -> u32 { +pub fn use_x() -> u32 { let x: X = X { x: 22 }; //[cfail2]~^ ERROR struct `X` has no field named `x` x.x as u32 @@ -35,13 +35,13 @@ pub fn use_X() -> u32 { } #[rustc_clean(except="typeck_root", cfg="cfail2")] -pub fn use_EmbedX(embed: EmbedX) -> u32 { +pub fn use_embed_x(embed: EmbedX) -> u32 { embed.x.x as u32 //[cfail2]~^ ERROR no field `x` on type `X` } #[rustc_clean(cfg="cfail2")] -pub fn use_Y() { +pub fn use_y() { let x: Y = Y { y: 'c' }; } diff --git a/tests/incremental/struct_change_field_type.rs b/tests/incremental/struct_change_field_type.rs index 9414790303b35..a17550a412a5c 100644 --- a/tests/incremental/struct_change_field_type.rs +++ b/tests/incremental/struct_change_field_type.rs @@ -26,19 +26,19 @@ pub struct Y { } #[rustc_clean(except="typeck_root", cfg="rpass2")] -pub fn use_X() -> u32 { +pub fn use_x() -> u32 { let x: X = X { x: 22 }; x.x as u32 } #[rustc_clean(except="typeck_root", cfg="rpass2")] -pub fn use_EmbedX(x: EmbedX) -> u32 { +pub fn use_embed_x(x: EmbedX) -> u32 { let x: X = X { x: 22 }; x.x as u32 } #[rustc_clean(cfg="rpass2")] -pub fn use_Y() { +pub fn use_y() { let x: Y = Y { y: 'c' }; } diff --git a/tests/incremental/struct_change_field_type_cross_crate/b.rs b/tests/incremental/struct_change_field_type_cross_crate/b.rs index ccd6047173891..ecb2fae926393 100644 --- a/tests/incremental/struct_change_field_type_cross_crate/b.rs +++ b/tests/incremental/struct_change_field_type_cross_crate/b.rs @@ -10,18 +10,18 @@ extern crate a; use a::*; #[rustc_clean(except="typeck_root", cfg="rpass2")] -pub fn use_X() -> u32 { +pub fn use_x() -> u32 { let x: X = X { x: 22 }; x.x as u32 } #[rustc_clean(except="typeck_root", cfg="rpass2")] -pub fn use_EmbedX(embed: EmbedX) -> u32 { +pub fn use_embed_x(embed: EmbedX) -> u32 { embed.x.x as u32 } #[rustc_clean(cfg="rpass2")] -pub fn use_Y() { +pub fn use_y() { let x: Y = Y { y: 'c' }; } diff --git a/tests/incremental/struct_change_nothing.rs b/tests/incremental/struct_change_nothing.rs index fd8c4882e1b2d..2c67192a9f538 100644 --- a/tests/incremental/struct_change_nothing.rs +++ b/tests/incremental/struct_change_nothing.rs @@ -26,19 +26,19 @@ pub struct Y { } #[rustc_clean(cfg="rpass2")] -pub fn use_X() -> u32 { +pub fn use_x() -> u32 { let x: X = X { x: 22 }; x.x as u32 } #[rustc_clean(cfg="rpass2")] -pub fn use_EmbedX(x: EmbedX) -> u32 { +pub fn use_embed_x(x: EmbedX) -> u32 { let x: X = X { x: 22 }; x.x as u32 } #[rustc_clean(cfg="rpass2")] -pub fn use_Y() { +pub fn use_y() { let x: Y = Y { y: 'c' }; } diff --git a/tests/incremental/struct_remove_field.rs b/tests/incremental/struct_remove_field.rs index eeb0dff8f422a..5804d90ed84da 100644 --- a/tests/incremental/struct_remove_field.rs +++ b/tests/incremental/struct_remove_field.rs @@ -27,17 +27,17 @@ pub struct Y { } #[rustc_clean(except="typeck_root,fn_sig", cfg="rpass2")] -pub fn use_X(x: X) -> u32 { +pub fn use_x(x: X) -> u32 { x.x as u32 } #[rustc_clean(except="typeck_root", cfg="rpass2")] -pub fn use_EmbedX(embed: EmbedX) -> u32 { +pub fn use_embed_x(embed: EmbedX) -> u32 { embed.x.x as u32 } #[rustc_clean(cfg="rpass2")] -pub fn use_Y() { +pub fn use_y() { let x: Y = Y { y: 'c' }; } diff --git a/tests/incremental/type_alias_cross_crate/b.rs b/tests/incremental/type_alias_cross_crate/b.rs index 095312c6cfe83..25e988b0a1eae 100644 --- a/tests/incremental/type_alias_cross_crate/b.rs +++ b/tests/incremental/type_alias_cross_crate/b.rs @@ -9,14 +9,14 @@ extern crate a; #[rustc_clean(except="typeck_root", cfg="rpass2")] #[rustc_clean(cfg="rpass3")] -pub fn use_X() -> u32 { +pub fn use_x() -> u32 { let x: a::X = 22; x as u32 } #[rustc_clean(cfg="rpass2")] #[rustc_clean(cfg="rpass3")] -pub fn use_Y() { +pub fn use_y() { let x: a::Y = 'c'; } From 8565c4a5dee22b23a40899d436dae7bd3642ce1c Mon Sep 17 00:00:00 2001 From: Zalathar Date: Fri, 3 Apr 2026 16:00:39 +1100 Subject: [PATCH 12/38] Extract `check_compiler_output_for_incr` --- src/tools/compiletest/src/runtest/incremental.rs | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/tools/compiletest/src/runtest/incremental.rs b/src/tools/compiletest/src/runtest/incremental.rs index 75e43006486ec..0c773c49b6049 100644 --- a/src/tools/compiletest/src/runtest/incremental.rs +++ b/src/tools/compiletest/src/runtest/incremental.rs @@ -1,4 +1,4 @@ -use super::{FailMode, TestCx, WillExecute}; +use super::{FailMode, ProcRes, TestCx, WillExecute}; use crate::errors; impl TestCx<'_> { @@ -93,16 +93,20 @@ impl TestCx<'_> { self.check_if_test_should_compile(Some(FailMode::Build), pm, &proc_res); self.check_no_compiler_crash(&proc_res, self.props.should_ice); - let output_to_check = self.get_output(&proc_res); - self.check_expected_errors(&proc_res); - self.check_all_error_patterns(&output_to_check, &proc_res); + self.check_compiler_output_for_incr(&proc_res); + if self.props.should_ice { match proc_res.status.code() { Some(101) => (), _ => self.fatal("expected ICE"), } } + } - self.check_forbid_output(&output_to_check, &proc_res); + fn check_compiler_output_for_incr(&self, proc_res: &ProcRes) { + let output_to_check = self.get_output(proc_res); + self.check_expected_errors(&proc_res); + self.check_all_error_patterns(&output_to_check, proc_res); + self.check_forbid_output(&output_to_check, proc_res); } } From 316fcbd217b2edfbc78220b10b4f603a4fc0bdff Mon Sep 17 00:00:00 2001 From: Zalathar Date: Fri, 3 Apr 2026 15:34:22 +1100 Subject: [PATCH 13/38] Check diagnostic output in incremental `cpass` and `rpass` revisions This allows warnings to be annotated, and verifies that no unexpected warnings occur. --- src/tools/compiletest/src/runtest/incremental.rs | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/src/tools/compiletest/src/runtest/incremental.rs b/src/tools/compiletest/src/runtest/incremental.rs index 0c773c49b6049..812f63625f983 100644 --- a/src/tools/compiletest/src/runtest/incremental.rs +++ b/src/tools/compiletest/src/runtest/incremental.rs @@ -1,5 +1,4 @@ use super::{FailMode, ProcRes, TestCx, WillExecute}; -use crate::errors; impl TestCx<'_> { pub(super) fn run_incremental_test(&self) { @@ -57,10 +56,7 @@ impl TestCx<'_> { self.fatal_proc_rec("compilation failed!", &proc_res); } - // FIXME(#41968): Move this check to tidy? - if !errors::load_errors(&self.testpaths.file, self.revision).is_empty() { - self.fatal("build-pass tests with expected warnings should be moved to ui/"); - } + self.check_compiler_output_for_incr(&proc_res); } fn run_rpass_test(&self) { @@ -72,10 +68,7 @@ impl TestCx<'_> { self.fatal_proc_rec("compilation failed!", &proc_res); } - // FIXME(#41968): Move this check to tidy? - if !errors::load_errors(&self.testpaths.file, self.revision).is_empty() { - self.fatal("run-pass tests with expected warnings should be moved to ui/"); - } + self.check_compiler_output_for_incr(&proc_res); if let WillExecute::Disabled = should_run { return; From 7c4cf965877567449e901ad9c963ee46ec02641d Mon Sep 17 00:00:00 2001 From: Folkert de Vries Date: Mon, 30 Mar 2026 18:14:01 +0200 Subject: [PATCH 14/38] report the `varargs_without_pattern` lint in deps --- compiler/rustc_lint_defs/src/builtin.rs | 9 ++- tests/ui/c-variadic/parse-errors.e2015.stderr | 57 ++++++++++++++ tests/ui/c-variadic/parse-errors.e2018.stderr | 76 +++++++++++++++++++ tests/ui/thir-print/c-variadic.stderr | 12 +++ 4 files changed, 150 insertions(+), 4 deletions(-) create mode 100644 tests/ui/thir-print/c-variadic.stderr diff --git a/compiler/rustc_lint_defs/src/builtin.rs b/compiler/rustc_lint_defs/src/builtin.rs index 4aff294aeac61..2079162e781d7 100644 --- a/compiler/rustc_lint_defs/src/builtin.rs +++ b/compiler/rustc_lint_defs/src/builtin.rs @@ -5558,7 +5558,8 @@ declare_lint! { /// /// ### Example /// - /// ```rust + #[cfg_attr(bootstrap, doc = "```rust")] + #[cfg_attr(not(bootstrap), doc = "```rust,compile_fail")] /// // Using `...` in non-foreign function definitions is unstable, however stability is /// // currently only checked after attributes are expanded, so using `#[cfg(false)]` here will /// // allow this to compile on stable Rust. @@ -5566,7 +5567,7 @@ declare_lint! { /// fn foo(...) { /// /// } - /// ``` + #[doc = "```"] /// /// {{produces}} /// @@ -5590,10 +5591,10 @@ declare_lint! { /// /// [future-incompatible]: ../index.md#future-incompatible-lints pub VARARGS_WITHOUT_PATTERN, - Warn, + Deny, "detects usage of `...` arguments without a pattern in non-foreign items", @future_incompatible = FutureIncompatibleInfo { reason: fcw!(FutureReleaseError #145544), - report_in_deps: false, + report_in_deps: true, }; } diff --git a/tests/ui/c-variadic/parse-errors.e2015.stderr b/tests/ui/c-variadic/parse-errors.e2015.stderr index de9362c4380de..e4939cb4b0e91 100644 --- a/tests/ui/c-variadic/parse-errors.e2015.stderr +++ b/tests/ui/c-variadic/parse-errors.e2015.stderr @@ -44,3 +44,60 @@ LL | unsafe extern "C" fn f(_: ...) {} error: aborting due to 3 previous errors +Future incompatibility report: Future breakage diagnostic: +error: missing pattern for `...` argument + --> $DIR/parse-errors.rs:11:28 + | +LL | unsafe extern "C" fn f(...) { + | ^^^ + | + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #145544 +note: the lint level is defined here + --> $DIR/parse-errors.rs:7:9 + | +LL | #![deny(varargs_without_pattern)] + | ^^^^^^^^^^^^^^^^^^^^^^^ +help: name the argument, or use `_` to continue ignoring it + | +LL | unsafe extern "C" fn f(_: ...) { + | ++ + +Future breakage diagnostic: +error: missing pattern for `...` argument + --> $DIR/parse-errors.rs:14:32 + | +LL | unsafe extern "C" fn f(...) {} + | ^^^ + | + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #145544 +note: the lint level is defined here + --> $DIR/parse-errors.rs:7:9 + | +LL | #![deny(varargs_without_pattern)] + | ^^^^^^^^^^^^^^^^^^^^^^^ +help: name the argument, or use `_` to continue ignoring it + | +LL | unsafe extern "C" fn f(_: ...) {} + | ++ + +Future breakage diagnostic: +error: missing pattern for `...` argument + --> $DIR/parse-errors.rs:20:32 + | +LL | unsafe extern "C" fn f(...) {} + | ^^^ + | + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #145544 +note: the lint level is defined here + --> $DIR/parse-errors.rs:7:9 + | +LL | #![deny(varargs_without_pattern)] + | ^^^^^^^^^^^^^^^^^^^^^^^ +help: name the argument, or use `_` to continue ignoring it + | +LL | unsafe extern "C" fn f(_: ...) {} + | ++ + diff --git a/tests/ui/c-variadic/parse-errors.e2018.stderr b/tests/ui/c-variadic/parse-errors.e2018.stderr index a7d5f79bf1339..eac0f6f07311a 100644 --- a/tests/ui/c-variadic/parse-errors.e2018.stderr +++ b/tests/ui/c-variadic/parse-errors.e2018.stderr @@ -57,3 +57,79 @@ LL | unsafe extern "C" fn f(_: ...) {} error: aborting due to 4 previous errors +Future incompatibility report: Future breakage diagnostic: +error: missing pattern for `...` argument + --> $DIR/parse-errors.rs:11:28 + | +LL | unsafe extern "C" fn f(...) { + | ^^^ + | + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #145544 +note: the lint level is defined here + --> $DIR/parse-errors.rs:7:9 + | +LL | #![deny(varargs_without_pattern)] + | ^^^^^^^^^^^^^^^^^^^^^^^ +help: name the argument, or use `_` to continue ignoring it + | +LL | unsafe extern "C" fn f(_: ...) { + | ++ + +Future breakage diagnostic: +error: missing pattern for `...` argument + --> $DIR/parse-errors.rs:14:32 + | +LL | unsafe extern "C" fn f(...) {} + | ^^^ + | + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #145544 +note: the lint level is defined here + --> $DIR/parse-errors.rs:7:9 + | +LL | #![deny(varargs_without_pattern)] + | ^^^^^^^^^^^^^^^^^^^^^^^ +help: name the argument, or use `_` to continue ignoring it + | +LL | unsafe extern "C" fn f(_: ...) {} + | ++ + +Future breakage diagnostic: +error: missing pattern for `...` argument + --> $DIR/parse-errors.rs:20:32 + | +LL | unsafe extern "C" fn f(...) {} + | ^^^ + | + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #145544 +note: the lint level is defined here + --> $DIR/parse-errors.rs:7:9 + | +LL | #![deny(varargs_without_pattern)] + | ^^^^^^^^^^^^^^^^^^^^^^^ +help: name the argument, or use `_` to continue ignoring it + | +LL | unsafe extern "C" fn f(_: ...) {} + | ++ + +Future breakage diagnostic: +error: missing pattern for `...` argument + --> $DIR/parse-errors.rs:26:32 + | +LL | unsafe extern "C" fn f(...) {} + | ^^^ + | + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #145544 +note: the lint level is defined here + --> $DIR/parse-errors.rs:7:9 + | +LL | #![deny(varargs_without_pattern)] + | ^^^^^^^^^^^^^^^^^^^^^^^ +help: name the argument, or use `_` to continue ignoring it + | +LL | unsafe extern "C" fn f(_: ...) {} + | ++ + diff --git a/tests/ui/thir-print/c-variadic.stderr b/tests/ui/thir-print/c-variadic.stderr new file mode 100644 index 0000000000000..a4050695944d4 --- /dev/null +++ b/tests/ui/thir-print/c-variadic.stderr @@ -0,0 +1,12 @@ +Future incompatibility report: Future breakage diagnostic: +warning: missing pattern for `...` argument + --> $DIR/c-variadic.rs:7:34 + | +LL | unsafe extern "C" fn foo(_: i32, ...) {} + | ^^^ + | +help: name the argument, or use `_` to continue ignoring it + | +LL | unsafe extern "C" fn foo(_: i32, _: ...) {} + | ++ + From edee654e0807d5a7d5c6fc6162ccfd28c50e0d9e Mon Sep 17 00:00:00 2001 From: Mark Rousskov Date: Mon, 13 Apr 2026 19:59:10 -0400 Subject: [PATCH 15/38] Adjust release notes for post-merge feedback * Adds musl CVE fix to compiler section * Removes Cargo section per feedback in the PR --- RELEASES.md | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/RELEASES.md b/RELEASES.md index c1cf337ea8d2a..87c7d3576b47c 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -18,8 +18,9 @@ Language Compiler -------- -- [Stabilize `--remap-path-scope` for controlling the scoping of how paths get remapped in the resulting binary](https://github.com/rust-lang/rust/pull/147611) +- [Stabilize `--remap-path-scope` for controlling the scoping of how paths get remapped in the resulting binary](https://github.com/rust-lang/rust/pull/147611) +- [Apply patches for CVE-2026-6042 and CVE-2026-40200 to vendored musl](https://github.com/rust-lang/rust/pull/155171) @@ -79,24 +80,19 @@ Stabilized APIs - [`<*mut T>::as_ref_unchecked`](https://doc.rust-lang.org/stable/std/primitive.pointer.html#method.as_ref_unchecked-1) - [`<*mut T>::as_mut_unchecked`](https://doc.rust-lang.org/stable/std/primitive.pointer.html#method.as_mut_unchecked) - These previously stable APIs are now stable in const contexts: - [`fmt::from_fn`](https://doc.rust-lang.org/stable/std/fmt/fn.from_fn.html) - [`ControlFlow::is_break`](https://doc.rust-lang.org/stable/core/ops/enum.ControlFlow.html#method.is_break) - [`ControlFlow::is_continue`](https://doc.rust-lang.org/stable/core/ops/enum.ControlFlow.html#method.is_continue) - - - -Cargo ------ -- [docs(report): enhance man pages for `cargo report *`](https://github.com/rust-lang/cargo/pull/16430/) + Rustdoc ----- - [In search results, rank unstable items lower](https://github.com/rust-lang/rust/pull/149460) - [Add new "hide deprecated items" setting in rustdoc](https://github.com/rust-lang/rust/pull/151091) + Compatibility Notes @@ -116,7 +112,6 @@ Compatibility Notes - [JSON target specs](https://doc.rust-lang.org/rustc/targets/custom.html) have been destabilized and now require `-Z unstable-options` to use. Previously, they could not be used without the standard library, which has no stable build mechanism. In preparation for the `build-std` project adding that support, JSON target specs are being proactively gated to ensure they remain unstable even if `build-std` is stabilized. Cargo now includes the `-Z json-target-spec` CLI flag to automatically pass `-Z unstable-options` to the compiler when needed. See [#150151](https://github.com/rust-lang/rust/pull/150151), [#151534](https://github.com/rust-lang/rust/pull/150151), and [rust-lang/cargo#16557](https://github.com/rust-lang/cargo/pull/16557). - [The arguments of `#[feature]` attributes on invalid targets are now checked](https://github.com/rust-lang/rust/issues/153764) - Internal Changes From 58af51e2435f81f2a6a2bc99556a21e047421bed Mon Sep 17 00:00:00 2001 From: mu001999 Date: Mon, 30 Mar 2026 22:59:56 +0800 Subject: [PATCH 16/38] Emit fatal on invalid const args with nested defs --- compiler/rustc_ast_lowering/src/expr.rs | 26 +++++++++---------- compiler/rustc_ast_lowering/src/lib.rs | 13 ++++++---- .../mgca/array-expr-complex.r1.stderr | 8 ++++++ .../mgca/array-expr-complex.r2.stderr | 8 ++++++ .../mgca/array-expr-complex.r3.stderr | 8 ++++++ .../const-generics/mgca/array-expr-complex.rs | 11 +++++--- .../mgca/array-expr-complex.stderr | 20 -------------- .../mgca/bad-const-arg-fn-154539.rs | 12 +++++++++ .../mgca/bad-const-arg-fn-154539.stderr | 11 ++++++++ 9 files changed, 76 insertions(+), 41 deletions(-) create mode 100644 tests/ui/const-generics/mgca/array-expr-complex.r1.stderr create mode 100644 tests/ui/const-generics/mgca/array-expr-complex.r2.stderr create mode 100644 tests/ui/const-generics/mgca/array-expr-complex.r3.stderr delete mode 100644 tests/ui/const-generics/mgca/array-expr-complex.stderr create mode 100644 tests/ui/const-generics/mgca/bad-const-arg-fn-154539.rs create mode 100644 tests/ui/const-generics/mgca/bad-const-arg-fn-154539.stderr diff --git a/compiler/rustc_ast_lowering/src/expr.rs b/compiler/rustc_ast_lowering/src/expr.rs index b6bc122051cbc..e0ec8ba3dcb9d 100644 --- a/compiler/rustc_ast_lowering/src/expr.rs +++ b/compiler/rustc_ast_lowering/src/expr.rs @@ -29,7 +29,7 @@ use super::{ use crate::errors::{InvalidLegacyConstGenericArg, UseConstGenericArg, YieldInClosure}; use crate::{AllowReturnTypeNotation, FnDeclKind, ImplTraitPosition, TryBlockScope}; -struct WillCreateDefIdsVisitor {} +pub(super) struct WillCreateDefIdsVisitor; impl<'v> rustc_ast::visit::Visitor<'v> for WillCreateDefIdsVisitor { type Result = ControlFlow; @@ -479,18 +479,18 @@ impl<'hir, R: ResolverAstLoweringExt<'hir>> LoweringContext<'_, 'hir, R> { DefPathData::LateAnonConst, f.span, ); - let mut visitor = WillCreateDefIdsVisitor {}; - let const_value = if let ControlFlow::Break(span) = visitor.visit_expr(&arg) { - Box::new(Expr { - id: self.next_node_id(), - kind: ExprKind::Err(invalid_expr_error(self.tcx, span)), - span: f.span, - attrs: [].into(), - tokens: None, - }) - } else { - arg - }; + let const_value = + if let ControlFlow::Break(span) = WillCreateDefIdsVisitor.visit_expr(&arg) { + Box::new(Expr { + id: self.next_node_id(), + kind: ExprKind::Err(invalid_expr_error(self.tcx, span)), + span: f.span, + attrs: [].into(), + tokens: None, + }) + } else { + arg + }; let anon_const = AnonConst { id: node_id, diff --git a/compiler/rustc_ast_lowering/src/lib.rs b/compiler/rustc_ast_lowering/src/lib.rs index 6d9fe9870c42e..9e830e29be033 100644 --- a/compiler/rustc_ast_lowering/src/lib.rs +++ b/compiler/rustc_ast_lowering/src/lib.rs @@ -39,6 +39,7 @@ use std::mem; use std::sync::Arc; use rustc_ast::node_id::NodeMap; +use rustc_ast::visit::Visitor; use rustc_ast::{self as ast, *}; use rustc_attr_parsing::{AttributeParser, Late, OmitDoc}; use rustc_data_structures::fingerprint::Fingerprint; @@ -2563,12 +2564,14 @@ impl<'hir, R: ResolverAstLoweringExt<'hir>> LoweringContext<'_, 'hir, R> { let span = self.lower_span(expr.span); let overly_complex_const = |this: &mut Self| { - let e = this.dcx().struct_span_err( - expr.span, - "complex const arguments must be placed inside of a `const` block", - ); + let msg = "complex const arguments must be placed inside of a `const` block"; + let e = if expr::WillCreateDefIdsVisitor.visit_expr(expr).is_break() { + this.dcx().struct_span_fatal(expr.span, msg).emit() + } else { + this.dcx().struct_span_err(expr.span, msg).emit() + }; - ConstArg { hir_id: this.next_id(), kind: hir::ConstArgKind::Error(e.emit()), span } + ConstArg { hir_id: this.next_id(), kind: hir::ConstArgKind::Error(e), span } }; match &expr.kind { diff --git a/tests/ui/const-generics/mgca/array-expr-complex.r1.stderr b/tests/ui/const-generics/mgca/array-expr-complex.r1.stderr new file mode 100644 index 0000000000000..0c931af8d8b1c --- /dev/null +++ b/tests/ui/const-generics/mgca/array-expr-complex.r1.stderr @@ -0,0 +1,8 @@ +error: complex const arguments must be placed inside of a `const` block + --> $DIR/array-expr-complex.rs:11:28 + | +LL | takes_array::<{ [1, 2, 1 + 2] }>(); + | ^^^^^ + +error: aborting due to 1 previous error + diff --git a/tests/ui/const-generics/mgca/array-expr-complex.r2.stderr b/tests/ui/const-generics/mgca/array-expr-complex.r2.stderr new file mode 100644 index 0000000000000..335af9235e0c9 --- /dev/null +++ b/tests/ui/const-generics/mgca/array-expr-complex.r2.stderr @@ -0,0 +1,8 @@ +error: complex const arguments must be placed inside of a `const` block + --> $DIR/array-expr-complex.rs:14:21 + | +LL | takes_array::<{ [X; 3] }>(); + | ^^^^^^ + +error: aborting due to 1 previous error + diff --git a/tests/ui/const-generics/mgca/array-expr-complex.r3.stderr b/tests/ui/const-generics/mgca/array-expr-complex.r3.stderr new file mode 100644 index 0000000000000..02d74c1b5d0c5 --- /dev/null +++ b/tests/ui/const-generics/mgca/array-expr-complex.r3.stderr @@ -0,0 +1,8 @@ +error: complex const arguments must be placed inside of a `const` block + --> $DIR/array-expr-complex.rs:17:21 + | +LL | takes_array::<{ [0; Y] }>(); + | ^^^^^^ + +error: aborting due to 1 previous error + diff --git a/tests/ui/const-generics/mgca/array-expr-complex.rs b/tests/ui/const-generics/mgca/array-expr-complex.rs index 3e8320bc94de2..26f4700b5885c 100644 --- a/tests/ui/const-generics/mgca/array-expr-complex.rs +++ b/tests/ui/const-generics/mgca/array-expr-complex.rs @@ -1,3 +1,5 @@ +//@ revisions: r1 r2 r3 + #![expect(incomplete_features)] #![feature(min_generic_const_args, adt_const_params)] @@ -5,12 +7,15 @@ fn takes_array() {} fn generic_caller() { // not supported yet + #[cfg(r1)] takes_array::<{ [1, 2, 1 + 2] }>(); - //~^ ERROR: complex const arguments must be placed inside of a `const` block + //[r1]~^ ERROR: complex const arguments must be placed inside of a `const` block + #[cfg(r2)] takes_array::<{ [X; 3] }>(); - //~^ ERROR: complex const arguments must be placed inside of a `const` block + //[r2]~^ ERROR: complex const arguments must be placed inside of a `const` block + #[cfg(r3)] takes_array::<{ [0; Y] }>(); - //~^ ERROR: complex const arguments must be placed inside of a `const` block + //[r3]~^ ERROR: complex const arguments must be placed inside of a `const` block } fn main() {} diff --git a/tests/ui/const-generics/mgca/array-expr-complex.stderr b/tests/ui/const-generics/mgca/array-expr-complex.stderr deleted file mode 100644 index 544b0f05b4e44..0000000000000 --- a/tests/ui/const-generics/mgca/array-expr-complex.stderr +++ /dev/null @@ -1,20 +0,0 @@ -error: complex const arguments must be placed inside of a `const` block - --> $DIR/array-expr-complex.rs:8:28 - | -LL | takes_array::<{ [1, 2, 1 + 2] }>(); - | ^^^^^ - -error: complex const arguments must be placed inside of a `const` block - --> $DIR/array-expr-complex.rs:10:21 - | -LL | takes_array::<{ [X; 3] }>(); - | ^^^^^^ - -error: complex const arguments must be placed inside of a `const` block - --> $DIR/array-expr-complex.rs:12:21 - | -LL | takes_array::<{ [0; Y] }>(); - | ^^^^^^ - -error: aborting due to 3 previous errors - diff --git a/tests/ui/const-generics/mgca/bad-const-arg-fn-154539.rs b/tests/ui/const-generics/mgca/bad-const-arg-fn-154539.rs new file mode 100644 index 0000000000000..7c7ffd9a9bd5f --- /dev/null +++ b/tests/ui/const-generics/mgca/bad-const-arg-fn-154539.rs @@ -0,0 +1,12 @@ +#![feature(min_generic_const_args)] + +trait Iter< + const FN: fn() = { + || { //~ ERROR complex const arguments must be placed inside of a `const` block + use std::io::*; + write!(_, "") + } + }, +> +{ +} diff --git a/tests/ui/const-generics/mgca/bad-const-arg-fn-154539.stderr b/tests/ui/const-generics/mgca/bad-const-arg-fn-154539.stderr new file mode 100644 index 0000000000000..60774c4a3efea --- /dev/null +++ b/tests/ui/const-generics/mgca/bad-const-arg-fn-154539.stderr @@ -0,0 +1,11 @@ +error: complex const arguments must be placed inside of a `const` block + --> $DIR/bad-const-arg-fn-154539.rs:5:9 + | +LL | / || { +LL | | use std::io::*; +LL | | write!(_, "") +LL | | } + | |_________^ + +error: aborting due to 1 previous error + From 6f1d601ca59c3dc05a13e7006b26d4d8cd0b3f7b Mon Sep 17 00:00:00 2001 From: mu001999 Date: Tue, 14 Apr 2026 12:28:19 +0800 Subject: [PATCH 17/38] Update test with revisions --- ...ems-before-lowering-ices.ice_155125.stderr | 23 +++++ ...ems-before-lowering-ices.ice_155127.stderr | 12 +++ ...ems-before-lowering-ices.ice_155128.stderr | 24 +++++ ...ems-before-lowering-ices.ice_155164.stderr | 13 +++ ...ems-before-lowering-ices.ice_155202.stderr | 16 ++++ .../hir-crate-items-before-lowering-ices.rs | 24 +++-- ...ir-crate-items-before-lowering-ices.stderr | 89 ------------------- 7 files changed, 103 insertions(+), 98 deletions(-) create mode 100644 tests/ui/delegation/hir-crate-items-before-lowering-ices.ice_155125.stderr create mode 100644 tests/ui/delegation/hir-crate-items-before-lowering-ices.ice_155127.stderr create mode 100644 tests/ui/delegation/hir-crate-items-before-lowering-ices.ice_155128.stderr create mode 100644 tests/ui/delegation/hir-crate-items-before-lowering-ices.ice_155164.stderr create mode 100644 tests/ui/delegation/hir-crate-items-before-lowering-ices.ice_155202.stderr delete mode 100644 tests/ui/delegation/hir-crate-items-before-lowering-ices.stderr diff --git a/tests/ui/delegation/hir-crate-items-before-lowering-ices.ice_155125.stderr b/tests/ui/delegation/hir-crate-items-before-lowering-ices.ice_155125.stderr new file mode 100644 index 0000000000000..e8a32e340f3e5 --- /dev/null +++ b/tests/ui/delegation/hir-crate-items-before-lowering-ices.ice_155125.stderr @@ -0,0 +1,23 @@ +error[E0428]: the name `foo` is defined multiple times + --> $DIR/hir-crate-items-before-lowering-ices.rs:13:17 + | +LL | fn foo() {} + | -------- previous definition of the value `foo` here +LL | reuse foo; + | ^^^^^^^^^^ `foo` redefined here + | + = note: `foo` must be defined only once in the value namespace of this block + +error: complex const arguments must be placed inside of a `const` block + --> $DIR/hir-crate-items-before-lowering-ices.rs:11:13 + | +LL | / { +LL | | fn foo() {} +LL | | reuse foo; +LL | | 2 +LL | | }, + | |_____________^ + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0428`. diff --git a/tests/ui/delegation/hir-crate-items-before-lowering-ices.ice_155127.stderr b/tests/ui/delegation/hir-crate-items-before-lowering-ices.ice_155127.stderr new file mode 100644 index 0000000000000..132e4e3034c4e --- /dev/null +++ b/tests/ui/delegation/hir-crate-items-before-lowering-ices.ice_155127.stderr @@ -0,0 +1,12 @@ +error: `#[deprecated]` attribute cannot be used on delegations + --> $DIR/hir-crate-items-before-lowering-ices.rs:27:9 + | +LL | #[deprecated] + | ^^^^^^^^^^^^^ + | + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = help: `#[deprecated]` can be applied to associated consts, associated types, constants, crates, data types, enum variants, foreign statics, functions, inherent impl blocks, macro defs, modules, statics, struct fields, traits, type aliases, and use statements + = note: `#[deny(useless_deprecated)]` on by default + +error: aborting due to 1 previous error + diff --git a/tests/ui/delegation/hir-crate-items-before-lowering-ices.ice_155128.stderr b/tests/ui/delegation/hir-crate-items-before-lowering-ices.ice_155128.stderr new file mode 100644 index 0000000000000..0a1b2c5a472c7 --- /dev/null +++ b/tests/ui/delegation/hir-crate-items-before-lowering-ices.ice_155128.stderr @@ -0,0 +1,24 @@ +error[E0061]: this function takes 0 arguments but 1 argument was supplied + --> $DIR/hir-crate-items-before-lowering-ices.rs:37:11 + | +LL | reuse a as b { + | ___________^______- +LL | | fn foo() {}; +LL | | foo +LL | | } + | |_____- unexpected argument of type `fn() {foo::<_>}` + | +note: function defined here + --> $DIR/hir-crate-items-before-lowering-ices.rs:35:8 + | +LL | fn a() {} + | ^ +help: remove the extra argument + | +LL - reuse a as b { +LL + reuse { + | + +error: aborting due to 1 previous error + +For more information about this error, try `rustc --explain E0061`. diff --git a/tests/ui/delegation/hir-crate-items-before-lowering-ices.ice_155164.stderr b/tests/ui/delegation/hir-crate-items-before-lowering-ices.ice_155164.stderr new file mode 100644 index 0000000000000..34d1a92ccd225 --- /dev/null +++ b/tests/ui/delegation/hir-crate-items-before-lowering-ices.ice_155164.stderr @@ -0,0 +1,13 @@ +error: complex const arguments must be placed inside of a `const` block + --> $DIR/hir-crate-items-before-lowering-ices.rs:47:13 + | +LL | / { +LL | | +LL | | struct W; +LL | | impl W { +... | +LL | | }, + | |_____________^ + +error: aborting due to 1 previous error + diff --git a/tests/ui/delegation/hir-crate-items-before-lowering-ices.ice_155202.stderr b/tests/ui/delegation/hir-crate-items-before-lowering-ices.ice_155202.stderr new file mode 100644 index 0000000000000..28f045ca69442 --- /dev/null +++ b/tests/ui/delegation/hir-crate-items-before-lowering-ices.ice_155202.stderr @@ -0,0 +1,16 @@ +error[E0425]: cannot find value `async` in this scope + --> $DIR/hir-crate-items-before-lowering-ices.rs:66:13 + | +LL | async || {}; + | ^^^^^ not found in this scope + +error[E0308]: mismatched types + --> $DIR/hir-crate-items-before-lowering-ices.rs:66:22 + | +LL | async || {}; + | ^^ expected `bool`, found `()` + +error: aborting due to 2 previous errors + +Some errors have detailed explanations: E0308, E0425. +For more information about an error, try `rustc --explain E0308`. diff --git a/tests/ui/delegation/hir-crate-items-before-lowering-ices.rs b/tests/ui/delegation/hir-crate-items-before-lowering-ices.rs index 1dc2f2f8a2634..6c16a1ae22d38 100644 --- a/tests/ui/delegation/hir-crate-items-before-lowering-ices.rs +++ b/tests/ui/delegation/hir-crate-items-before-lowering-ices.rs @@ -1,13 +1,16 @@ +//@ revisions: ice_155125 ice_155127 ice_155128 ice_155164 ice_155202 + #![feature(min_generic_const_args, fn_delegation)] #![allow(incomplete_features)] +#[cfg(ice_155125)] mod ice_155125 { struct S; impl S< - { //~ ERROR: complex const arguments must be placed inside of a `const` block + { //[ice_155125]~ ERROR: complex const arguments must be placed inside of a `const` block fn foo() {} - reuse foo; //~ ERROR: the name `foo` is defined multiple times + reuse foo; //[ice_155125]~ ERROR: the name `foo` is defined multiple times 2 }, > @@ -15,32 +18,34 @@ mod ice_155125 { } } +#[cfg(ice_155127)] mod ice_155127 { struct S; fn foo() {} impl S { - #[deprecated] //~ ERROR: `#[deprecated]` attribute cannot be used on delegations - //~^ WARN: this was previously accepted by the compiler but is being phased out; + #[deprecated] //[ice_155127]~ ERROR: `#[deprecated]` attribute cannot be used on delegations + //[ice_155127]~^ WARN: this was previously accepted by the compiler but is being phased out; reuse foo; } } +#[cfg(ice_155128)] mod ice_155128 { fn a() {} - reuse a as b { //~ ERROR: this function takes 0 arguments but 1 argument was supplied + reuse a as b { //[ice_155128]~ ERROR: this function takes 0 arguments but 1 argument was supplied fn foo() {}; foo } } +#[cfg(ice_155164)] mod ice_155164 { struct X { inner: std::iter::Map< { - //~^ ERROR: complex const arguments must be placed inside of a `const` block - //~| ERROR: constant provided when a type was expected + //[ice_155164]~^ ERROR: complex const arguments must be placed inside of a `const` block struct W; impl W { reuse Iterator::fold; @@ -51,14 +56,15 @@ mod ice_155164 { } } +#[cfg(ice_155202)] mod ice_155202 { trait Trait { fn bar(self); } impl Trait for () { reuse Trait::bar { - async || {}; //~ ERROR: mismatched types - //~^ ERROR: cannot find value `async` in this scope + async || {}; //[ice_155202]~ ERROR: mismatched types + //[ice_155202]~^ ERROR: cannot find value `async` in this scope } } } diff --git a/tests/ui/delegation/hir-crate-items-before-lowering-ices.stderr b/tests/ui/delegation/hir-crate-items-before-lowering-ices.stderr deleted file mode 100644 index 1bc4c1f7de4e5..0000000000000 --- a/tests/ui/delegation/hir-crate-items-before-lowering-ices.stderr +++ /dev/null @@ -1,89 +0,0 @@ -error[E0428]: the name `foo` is defined multiple times - --> $DIR/hir-crate-items-before-lowering-ices.rs:10:17 - | -LL | fn foo() {} - | -------- previous definition of the value `foo` here -LL | reuse foo; - | ^^^^^^^^^^ `foo` redefined here - | - = note: `foo` must be defined only once in the value namespace of this block - -error[E0425]: cannot find value `async` in this scope - --> $DIR/hir-crate-items-before-lowering-ices.rs:60:13 - | -LL | async || {}; - | ^^^^^ not found in this scope - -error: complex const arguments must be placed inside of a `const` block - --> $DIR/hir-crate-items-before-lowering-ices.rs:8:13 - | -LL | / { -LL | | fn foo() {} -LL | | reuse foo; -LL | | 2 -LL | | }, - | |_____________^ - -error: complex const arguments must be placed inside of a `const` block - --> $DIR/hir-crate-items-before-lowering-ices.rs:41:13 - | -LL | / { -LL | | -LL | | -LL | | struct W; -... | -LL | | }, - | |_____________^ - -error: `#[deprecated]` attribute cannot be used on delegations - --> $DIR/hir-crate-items-before-lowering-ices.rs:23:9 - | -LL | #[deprecated] - | ^^^^^^^^^^^^^ - | - = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! - = help: `#[deprecated]` can be applied to associated consts, associated types, constants, crates, data types, enum variants, foreign statics, functions, inherent impl blocks, macro defs, modules, statics, struct fields, traits, type aliases, and use statements - = note: `#[deny(useless_deprecated)]` on by default - -error[E0747]: constant provided when a type was expected - --> $DIR/hir-crate-items-before-lowering-ices.rs:41:13 - | -LL | / { -LL | | -LL | | -LL | | struct W; -... | -LL | | }, - | |_____________^ - -error[E0061]: this function takes 0 arguments but 1 argument was supplied - --> $DIR/hir-crate-items-before-lowering-ices.rs:32:11 - | -LL | reuse a as b { - | ___________^______- -LL | | fn foo() {}; -LL | | foo -LL | | } - | |_____- unexpected argument of type `fn() {b::foo::<_>}` - | -note: function defined here - --> $DIR/hir-crate-items-before-lowering-ices.rs:30:8 - | -LL | fn a() {} - | ^ -help: remove the extra argument - | -LL - reuse a as b { -LL + reuse { - | - -error[E0308]: mismatched types - --> $DIR/hir-crate-items-before-lowering-ices.rs:60:22 - | -LL | async || {}; - | ^^ expected `bool`, found `()` - -error: aborting due to 8 previous errors - -Some errors have detailed explanations: E0061, E0308, E0425, E0428, E0747. -For more information about an error, try `rustc --explain E0061`. From 75273e21c95f8ed0bbb5ce67be54152131acd6ba Mon Sep 17 00:00:00 2001 From: mejrs <59372212+mejrs@users.noreply.github.com> Date: Tue, 14 Apr 2026 23:37:13 +0200 Subject: [PATCH 18/38] Warn instead of error for some ructs_on_unimplemented errors --- .../src/attributes/diagnostic/mod.rs | 49 +++---- tests/ui/on-unimplemented/bad-annotation.rs | 31 ++--- .../ui/on-unimplemented/bad-annotation.stderr | 122 +++++++++--------- 3 files changed, 90 insertions(+), 112 deletions(-) diff --git a/compiler/rustc_attr_parsing/src/attributes/diagnostic/mod.rs b/compiler/rustc_attr_parsing/src/attributes/diagnostic/mod.rs index 0e64135951664..8b69bbb903741 100644 --- a/compiler/rustc_attr_parsing/src/attributes/diagnostic/mod.rs +++ b/compiler/rustc_attr_parsing/src/attributes/diagnostic/mod.rs @@ -150,18 +150,14 @@ fn parse_directive_items<'p, S: Stage>( let span = item.span(); macro malformed() {{ - if matches!(mode, Mode::RustcOnUnimplemented) { - cx.emit_err(NoValueInOnUnimplemented { span: item.span() }); - } else { - cx.emit_lint( - MALFORMED_DIAGNOSTIC_ATTRIBUTES, - AttributeLintKind::MalFormedDiagnosticAttribute { - attribute: mode.as_str(), - span, - }, + cx.emit_lint( + MALFORMED_DIAGNOSTIC_ATTRIBUTES, + AttributeLintKind::MalFormedDiagnosticAttribute { + attribute: mode.as_str(), span, - ); - } + }, + span, + ); continue; }} @@ -175,19 +171,15 @@ fn parse_directive_items<'p, S: Stage>( }} macro duplicate($name: ident, $($first_span:tt)*) {{ - if matches!(mode, Mode::RustcOnUnimplemented) { - cx.emit_err(NoValueInOnUnimplemented { span: item.span() }); - } else { - cx.emit_lint( - MALFORMED_DIAGNOSTIC_ATTRIBUTES, - AttributeLintKind::IgnoredDiagnosticOption { - first_span: $($first_span)*, - later_span: span, - option_name: $name, - }, - span, - ); - } + cx.emit_lint( + MALFORMED_DIAGNOSTIC_ATTRIBUTES, + AttributeLintKind::IgnoredDiagnosticOption { + first_span: $($first_span)*, + later_span: span, + option_name: $name, + }, + span, + ); }} let item: &MetaItemParser = or_malformed!(item.meta_item()?); @@ -566,15 +558,6 @@ pub(crate) enum InvalidOnClause { }, } -#[derive(Diagnostic)] -#[diag("this attribute must have a value", code = E0232)] -#[note("e.g. `#[rustc_on_unimplemented(message=\"foo\")]`")] -pub(crate) struct NoValueInOnUnimplemented { - #[primary_span] - #[label("expected value here")] - pub span: Span, -} - #[derive(Diagnostic)] #[diag( "using multiple `rustc_on_unimplemented` (or mixing it with `diagnostic::on_unimplemented`) is not supported" diff --git a/tests/ui/on-unimplemented/bad-annotation.rs b/tests/ui/on-unimplemented/bad-annotation.rs index 1efaea8883926..5350bf91de94a 100644 --- a/tests/ui/on-unimplemented/bad-annotation.rs +++ b/tests/ui/on-unimplemented/bad-annotation.rs @@ -27,21 +27,19 @@ trait ParameterNotPresent {} trait NoPositionalArgs {} #[rustc_on_unimplemented(lorem = "")] -//~^ ERROR this attribute must have a value -//~^^ NOTE e.g. `#[rustc_on_unimplemented(message="foo")]` -//~^^^ NOTE expected value here +//~^WARN malformed `rustc_on_unimplemented` attribute +//~|NOTE invalid option found here trait EmptyMessage {} #[rustc_on_unimplemented(lorem(ipsum(dolor)))] -//~^ ERROR this attribute must have a value -//~^^ NOTE e.g. `#[rustc_on_unimplemented(message="foo")]` -//~^^^ NOTE expected value here +//~^WARN malformed `rustc_on_unimplemented` attribute +//~|NOTE invalid option found here trait Invalid {} #[rustc_on_unimplemented(message = "x", message = "y")] -//~^ ERROR this attribute must have a value -//~^^ NOTE e.g. `#[rustc_on_unimplemented(message="foo")]` -//~^^^ NOTE expected value here +//~^WARN `message` is ignored due to previous definition of `message` +//~|NOTE `message` is first declared here +//~|NOTE `message` is later redundantly declared here trait DuplicateMessage {} #[rustc_on_unimplemented(message = "x", on(desugared, message = "y"))] @@ -55,21 +53,18 @@ trait OnInWrongPosition {} trait EmptyOn {} #[rustc_on_unimplemented(on = "x", message = "y")] -//~^ ERROR this attribute must have a value -//~^^ NOTE e.g. `#[rustc_on_unimplemented(message="foo")]` -//~^^^ NOTE expected value here +//~^WARN malformed `rustc_on_unimplemented` attribute +//~|NOTE invalid option found here trait ExpectedPredicateInOn {} #[rustc_on_unimplemented(on(Self = "y"), message = "y")] -//~^ ERROR this attribute must have a value -//~| NOTE expected value here -//~| NOTE e.g. `#[rustc_on_unimplemented(message="foo")]` +//~^WARN malformed `rustc_on_unimplemented` attribute +//~|NOTE invalid option found here trait OnWithoutDirectives {} #[rustc_on_unimplemented(on(from_desugaring, on(from_desugaring, message = "x")), message = "y")] -//~^ ERROR this attribute must have a value -//~^^ NOTE e.g. `#[rustc_on_unimplemented(message="foo")]` -//~^^^ NOTE expected value here +//~^WARN malformed `rustc_on_unimplemented` attribute +//~|NOTE invalid option found here trait NestedOn {} #[rustc_on_unimplemented(on("y", message = "y"))] diff --git a/tests/ui/on-unimplemented/bad-annotation.stderr b/tests/ui/on-unimplemented/bad-annotation.stderr index a85956a89231e..25f30247f5800 100644 --- a/tests/ui/on-unimplemented/bad-annotation.stderr +++ b/tests/ui/on-unimplemented/bad-annotation.stderr @@ -1,107 +1,59 @@ -error[E0232]: this attribute must have a value - --> $DIR/bad-annotation.rs:29:26 - | -LL | #[rustc_on_unimplemented(lorem = "")] - | ^^^^^^^^^^ expected value here - | - = note: e.g. `#[rustc_on_unimplemented(message="foo")]` - -error[E0232]: this attribute must have a value - --> $DIR/bad-annotation.rs:35:26 - | -LL | #[rustc_on_unimplemented(lorem(ipsum(dolor)))] - | ^^^^^^^^^^^^^^^^^^^ expected value here - | - = note: e.g. `#[rustc_on_unimplemented(message="foo")]` - -error[E0232]: this attribute must have a value - --> $DIR/bad-annotation.rs:41:41 - | -LL | #[rustc_on_unimplemented(message = "x", message = "y")] - | ^^^^^^^^^^^^^ expected value here - | - = note: e.g. `#[rustc_on_unimplemented(message="foo")]` - error[E0232]: invalid flag in `on`-clause - --> $DIR/bad-annotation.rs:47:44 + --> $DIR/bad-annotation.rs:45:44 | LL | #[rustc_on_unimplemented(message = "x", on(desugared, message = "y"))] | ^^^^^^^^^ expected one of the `crate_local`, `direct` or `from_desugaring` flags, not `desugared` error[E0232]: empty `on`-clause in `#[rustc_on_unimplemented]` - --> $DIR/bad-annotation.rs:52:26 + --> $DIR/bad-annotation.rs:50:26 | LL | #[rustc_on_unimplemented(on(), message = "y")] | ^^^^ empty `on`-clause here -error[E0232]: this attribute must have a value - --> $DIR/bad-annotation.rs:57:26 - | -LL | #[rustc_on_unimplemented(on = "x", message = "y")] - | ^^^^^^^^ expected value here - | - = note: e.g. `#[rustc_on_unimplemented(message="foo")]` - -error[E0232]: this attribute must have a value - --> $DIR/bad-annotation.rs:63:26 - | -LL | #[rustc_on_unimplemented(on(Self = "y"), message = "y")] - | ^^^^^^^^^^^^^^ expected value here - | - = note: e.g. `#[rustc_on_unimplemented(message="foo")]` - -error[E0232]: this attribute must have a value - --> $DIR/bad-annotation.rs:69:46 - | -LL | #[rustc_on_unimplemented(on(from_desugaring, on(from_desugaring, message = "x")), message = "y")] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected value here - | - = note: e.g. `#[rustc_on_unimplemented(message="foo")]` - error[E0232]: literals inside `on`-clauses are not supported - --> $DIR/bad-annotation.rs:75:29 + --> $DIR/bad-annotation.rs:70:29 | LL | #[rustc_on_unimplemented(on("y", message = "y"))] | ^^^ unexpected literal here error[E0232]: literals inside `on`-clauses are not supported - --> $DIR/bad-annotation.rs:80:29 + --> $DIR/bad-annotation.rs:75:29 | LL | #[rustc_on_unimplemented(on(42, message = "y"))] | ^^ unexpected literal here error[E0232]: expected a single predicate in `not(..)` - --> $DIR/bad-annotation.rs:85:32 + --> $DIR/bad-annotation.rs:80:32 | LL | #[rustc_on_unimplemented(on(not(a, b), message = "y"))] | ^^^^^^ unexpected quantity of predicates here error[E0232]: expected a single predicate in `not(..)` - --> $DIR/bad-annotation.rs:90:32 + --> $DIR/bad-annotation.rs:85:32 | LL | #[rustc_on_unimplemented(on(not(), message = "y"))] | ^^ unexpected quantity of predicates here error[E0232]: expected an identifier inside this `on`-clause - --> $DIR/bad-annotation.rs:95:29 + --> $DIR/bad-annotation.rs:90:29 | LL | #[rustc_on_unimplemented(on(thing::What, message = "y"))] | ^^^^^^^^^^^ expected an identifier here, not `thing::What` error[E0232]: expected an identifier inside this `on`-clause - --> $DIR/bad-annotation.rs:100:29 + --> $DIR/bad-annotation.rs:95:29 | LL | #[rustc_on_unimplemented(on(thing::What = "value", message = "y"))] | ^^^^^^^^^^^ expected an identifier here, not `thing::What` error[E0232]: this predicate is invalid - --> $DIR/bad-annotation.rs:105:29 + --> $DIR/bad-annotation.rs:100:29 | LL | #[rustc_on_unimplemented(on(aaaaaaaaaaaaaa(a, b), message = "y"))] | ^^^^^^^^^^^^^^ expected one of `any`, `all` or `not` here, not `aaaaaaaaaaaaaa` error[E0232]: invalid flag in `on`-clause - --> $DIR/bad-annotation.rs:110:29 + --> $DIR/bad-annotation.rs:105:29 | LL | #[rustc_on_unimplemented(on(something, message = "y"))] | ^^^^^^^^^ expected one of the `crate_local`, `direct` or `from_desugaring` flags, not `something` @@ -115,13 +67,13 @@ LL | #[rustc_on_unimplemented(label = "Unimplemented error on `{Self}` with para = note: `#[warn(malformed_diagnostic_format_literals)]` (part of `#[warn(unknown_or_malformed_diagnostic_attributes)]`) on by default warning: there is no parameter `_Self` on trait `InvalidName` - --> $DIR/bad-annotation.rs:115:29 + --> $DIR/bad-annotation.rs:110:29 | LL | #[rustc_on_unimplemented(on(_Self = "y", message = "y"))] | ^^^^^^^^^^^ warning: there is no parameter `abc` on trait `InvalidName2` - --> $DIR/bad-annotation.rs:119:29 + --> $DIR/bad-annotation.rs:114:29 | LL | #[rustc_on_unimplemented(on(abc = "y", message = "y"))] | ^^^^^^^^^ @@ -143,6 +95,54 @@ LL | #[rustc_on_unimplemented(label = "Unimplemented error on `{Self}` with para | = help: only named format arguments with the name of one of the generic types are allowed in this context -error: aborting due to 16 previous errors; 5 warnings emitted +warning: malformed `rustc_on_unimplemented` attribute + --> $DIR/bad-annotation.rs:29:26 + | +LL | #[rustc_on_unimplemented(lorem = "")] + | ^^^^^^^^^^ invalid option found here + | + = help: only `message`, `note` and `label` are allowed as options + +warning: malformed `rustc_on_unimplemented` attribute + --> $DIR/bad-annotation.rs:34:26 + | +LL | #[rustc_on_unimplemented(lorem(ipsum(dolor)))] + | ^^^^^^^^^^^^^^^^^^^ invalid option found here + | + = help: only `message`, `note` and `label` are allowed as options + +warning: `message` is ignored due to previous definition of `message` + --> $DIR/bad-annotation.rs:39:41 + | +LL | #[rustc_on_unimplemented(message = "x", message = "y")] + | ------------- ^^^^^^^^^^^^^ `message` is later redundantly declared here + | | + | `message` is first declared here + +warning: malformed `rustc_on_unimplemented` attribute + --> $DIR/bad-annotation.rs:55:26 + | +LL | #[rustc_on_unimplemented(on = "x", message = "y")] + | ^^^^^^^^ invalid option found here + | + = help: only `message`, `note` and `label` are allowed as options + +warning: malformed `rustc_on_unimplemented` attribute + --> $DIR/bad-annotation.rs:60:26 + | +LL | #[rustc_on_unimplemented(on(Self = "y"), message = "y")] + | ^^^^^^^^^^^^^^ invalid option found here + | + = help: only `message`, `note` and `label` are allowed as options + +warning: malformed `rustc_on_unimplemented` attribute + --> $DIR/bad-annotation.rs:65:46 + | +LL | #[rustc_on_unimplemented(on(from_desugaring, on(from_desugaring, message = "x")), message = "y")] + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ invalid option found here + | + = help: only `message`, `note` and `label` are allowed as options + +error: aborting due to 10 previous errors; 11 warnings emitted For more information about this error, try `rustc --explain E0232`. From 72db94ff177596802fb6fe7e6ab02420f543c92b Mon Sep 17 00:00:00 2001 From: mejrs <59372212+mejrs@users.noreply.github.com> Date: Wed, 15 Apr 2026 00:24:17 +0200 Subject: [PATCH 19/38] Pass allowed options as parameter to diagnostic lints --- .../src/attributes/diagnostic/mod.rs | 37 ++++++++++++++++++- compiler/rustc_lint/src/early/diagnostics.rs | 10 +++-- compiler/rustc_lint/src/lints.rs | 6 ++- compiler/rustc_lint_defs/src/lib.rs | 2 + .../ui/on-unimplemented/bad-annotation.stderr | 12 +++--- 5 files changed, 53 insertions(+), 14 deletions(-) diff --git a/compiler/rustc_attr_parsing/src/attributes/diagnostic/mod.rs b/compiler/rustc_attr_parsing/src/attributes/diagnostic/mod.rs index 8b69bbb903741..ea5e81c3db816 100644 --- a/compiler/rustc_attr_parsing/src/attributes/diagnostic/mod.rs +++ b/compiler/rustc_attr_parsing/src/attributes/diagnostic/mod.rs @@ -50,6 +50,33 @@ impl Mode { Self::DiagnosticOnUnknown => "diagnostic::on_unknown", } } + + fn expected_options(&self) -> &'static str { + const DEFAULT: &str = + "at least one of the `message`, `note` and `label` options are expected"; + match self { + Self::RustcOnUnimplemented => { + "see " + } + Self::DiagnosticOnUnimplemented => DEFAULT, + Self::DiagnosticOnConst => DEFAULT, + Self::DiagnosticOnMove => DEFAULT, + Self::DiagnosticOnUnknown => DEFAULT, + } + } + + fn allowed_options(&self) -> &'static str { + const DEFAULT: &str = "only `message`, `note` and `label` are allowed as options"; + match self { + Self::RustcOnUnimplemented => { + "see " + } + Self::DiagnosticOnUnimplemented => DEFAULT, + Self::DiagnosticOnConst => DEFAULT, + Self::DiagnosticOnMove => DEFAULT, + Self::DiagnosticOnUnknown => DEFAULT, + } + } } fn merge_directives( @@ -118,6 +145,7 @@ fn parse_list<'p, S: Stage>( MALFORMED_DIAGNOSTIC_ATTRIBUTES, AttributeLintKind::MissingOptionsForDiagnosticAttribute { attribute: mode.as_str(), + options: mode.expected_options(), }, span, ); @@ -125,7 +153,11 @@ fn parse_list<'p, S: Stage>( ArgParser::NameValue(_) => { cx.emit_lint( MALFORMED_DIAGNOSTIC_ATTRIBUTES, - AttributeLintKind::MalFormedDiagnosticAttribute { attribute: mode.as_str(), span }, + AttributeLintKind::MalFormedDiagnosticAttribute { + attribute: mode.as_str(), + options: mode.allowed_options(), + span, + }, span, ); } @@ -153,7 +185,8 @@ fn parse_directive_items<'p, S: Stage>( cx.emit_lint( MALFORMED_DIAGNOSTIC_ATTRIBUTES, AttributeLintKind::MalFormedDiagnosticAttribute { - attribute: mode.as_str(), + attribute: mode.as_str(), + options: mode.allowed_options(), span, }, span, diff --git a/compiler/rustc_lint/src/early/diagnostics.rs b/compiler/rustc_lint/src/early/diagnostics.rs index 1e91b76854219..361ba4989dda3 100644 --- a/compiler/rustc_lint/src/early/diagnostics.rs +++ b/compiler/rustc_lint/src/early/diagnostics.rs @@ -176,8 +176,9 @@ impl<'a> Diagnostic<'a, ()> for DecorateAttrLint<'_, '_, '_> { &AttributeLintKind::ExpectedNoArgs => lints::ExpectedNoArgs.into_diag(dcx, level), &AttributeLintKind::ExpectedNameValue => lints::ExpectedNameValue.into_diag(dcx, level), - &AttributeLintKind::MalFormedDiagnosticAttribute { attribute, span } => { - lints::MalFormedDiagnosticAttributeLint { attribute, span }.into_diag(dcx, level) + &AttributeLintKind::MalFormedDiagnosticAttribute { attribute, options, span } => { + lints::MalFormedDiagnosticAttributeLint { attribute, options, span } + .into_diag(dcx, level) } AttributeLintKind::MalformedDiagnosticFormat { warning } => match warning { @@ -198,8 +199,9 @@ impl<'a> Diagnostic<'a, ()> for DecorateAttrLint<'_, '_, '_> { lints::IgnoredDiagnosticOption { option_name, first_span, later_span } .into_diag(dcx, level) } - &AttributeLintKind::MissingOptionsForDiagnosticAttribute { attribute } => { - lints::MissingOptionsForDiagnosticAttribute { attribute }.into_diag(dcx, level) + &AttributeLintKind::MissingOptionsForDiagnosticAttribute { attribute, options } => { + lints::MissingOptionsForDiagnosticAttribute { attribute, options } + .into_diag(dcx, level) } &AttributeLintKind::NonMetaItemDiagnosticAttribute => { lints::NonMetaItemDiagnosticAttribute.into_diag(dcx, level) diff --git a/compiler/rustc_lint/src/lints.rs b/compiler/rustc_lint/src/lints.rs index 8859e4880fd65..099e918f70a43 100644 --- a/compiler/rustc_lint/src/lints.rs +++ b/compiler/rustc_lint/src/lints.rs @@ -3585,9 +3585,10 @@ pub(crate) struct IgnoredDiagnosticOption { #[derive(Diagnostic)] #[diag("missing options for `{$attribute}` attribute")] -#[help("at least one of the `message`, `note` and `label` options are expected")] +#[help("{$options}")] pub(crate) struct MissingOptionsForDiagnosticAttribute { pub attribute: &'static str, + pub options: &'static str, } #[derive(Diagnostic)] @@ -3604,9 +3605,10 @@ pub(crate) struct NonMetaItemDiagnosticAttribute; #[derive(Diagnostic)] #[diag("malformed `{$attribute}` attribute")] -#[help("only `message`, `note` and `label` are allowed as options")] +#[help("{$options}")] pub(crate) struct MalFormedDiagnosticAttributeLint { pub attribute: &'static str, + pub options: &'static str, #[label("invalid option found here")] pub span: Span, } diff --git a/compiler/rustc_lint_defs/src/lib.rs b/compiler/rustc_lint_defs/src/lib.rs index cd307739af52c..731d3ca426038 100644 --- a/compiler/rustc_lint_defs/src/lib.rs +++ b/compiler/rustc_lint_defs/src/lib.rs @@ -735,6 +735,7 @@ pub enum AttributeLintKind { ExpectedNameValue, MalFormedDiagnosticAttribute { attribute: &'static str, + options: &'static str, span: Span, }, MalformedDiagnosticFormat { @@ -752,6 +753,7 @@ pub enum AttributeLintKind { }, MissingOptionsForDiagnosticAttribute { attribute: &'static str, + options: &'static str, }, NonMetaItemDiagnosticAttribute, } diff --git a/tests/ui/on-unimplemented/bad-annotation.stderr b/tests/ui/on-unimplemented/bad-annotation.stderr index 25f30247f5800..058014fd4e081 100644 --- a/tests/ui/on-unimplemented/bad-annotation.stderr +++ b/tests/ui/on-unimplemented/bad-annotation.stderr @@ -84,7 +84,7 @@ warning: missing options for `rustc_on_unimplemented` attribute LL | #[rustc_on_unimplemented] | ^^^^^^^^^^^^^^^^^^^^^^^^^ | - = help: at least one of the `message`, `note` and `label` options are expected + = help: see = note: `#[warn(malformed_diagnostic_attributes)]` (part of `#[warn(unknown_or_malformed_diagnostic_attributes)]`) on by default warning: positional format arguments are not allowed here @@ -101,7 +101,7 @@ warning: malformed `rustc_on_unimplemented` attribute LL | #[rustc_on_unimplemented(lorem = "")] | ^^^^^^^^^^ invalid option found here | - = help: only `message`, `note` and `label` are allowed as options + = help: see warning: malformed `rustc_on_unimplemented` attribute --> $DIR/bad-annotation.rs:34:26 @@ -109,7 +109,7 @@ warning: malformed `rustc_on_unimplemented` attribute LL | #[rustc_on_unimplemented(lorem(ipsum(dolor)))] | ^^^^^^^^^^^^^^^^^^^ invalid option found here | - = help: only `message`, `note` and `label` are allowed as options + = help: see warning: `message` is ignored due to previous definition of `message` --> $DIR/bad-annotation.rs:39:41 @@ -125,7 +125,7 @@ warning: malformed `rustc_on_unimplemented` attribute LL | #[rustc_on_unimplemented(on = "x", message = "y")] | ^^^^^^^^ invalid option found here | - = help: only `message`, `note` and `label` are allowed as options + = help: see warning: malformed `rustc_on_unimplemented` attribute --> $DIR/bad-annotation.rs:60:26 @@ -133,7 +133,7 @@ warning: malformed `rustc_on_unimplemented` attribute LL | #[rustc_on_unimplemented(on(Self = "y"), message = "y")] | ^^^^^^^^^^^^^^ invalid option found here | - = help: only `message`, `note` and `label` are allowed as options + = help: see warning: malformed `rustc_on_unimplemented` attribute --> $DIR/bad-annotation.rs:65:46 @@ -141,7 +141,7 @@ warning: malformed `rustc_on_unimplemented` attribute LL | #[rustc_on_unimplemented(on(from_desugaring, on(from_desugaring, message = "x")), message = "y")] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ invalid option found here | - = help: only `message`, `note` and `label` are allowed as options + = help: see error: aborting due to 10 previous errors; 11 warnings emitted From 3ce3436fd6504c6d34760608d6f85159714343f0 Mon Sep 17 00:00:00 2001 From: Nicholas Nethercote Date: Wed, 15 Apr 2026 14:56:59 +1000 Subject: [PATCH 20/38] Disallow ZST allocations with `TypedArena`. `DroplessArena::alloc` already disallows ZST allocation. `TypedArena::alloc` allows it but: - (a) it's never used, and - (b) writing to `NonNull::dangling()` seems dubious, even if the write is zero-sized. This commit just changes it to panic on a ZST. This eliminates an untested code path, and we shouldn't be allocating ZSTs anyway. It also eliminates an unused ZST code path in `clear_last_chunk`. Tests are also updated accordingly. --- compiler/rustc_arena/src/lib.rs | 36 +++++++++++-------------------- compiler/rustc_arena/src/tests.rs | 18 +++------------- 2 files changed, 15 insertions(+), 39 deletions(-) diff --git a/compiler/rustc_arena/src/lib.rs b/compiler/rustc_arena/src/lib.rs index 0785942d13a38..24ade7300c33b 100644 --- a/compiler/rustc_arena/src/lib.rs +++ b/compiler/rustc_arena/src/lib.rs @@ -140,25 +140,19 @@ impl TypedArena { /// Allocates an object in the `TypedArena`, returning a reference to it. #[inline] pub fn alloc(&self, object: T) -> &mut T { + assert!(size_of::() != 0); + if self.ptr == self.end { self.grow(1) } unsafe { - if size_of::() == 0 { - self.ptr.set(self.ptr.get().wrapping_byte_add(1)); - let ptr = ptr::NonNull::::dangling().as_ptr(); - // Don't drop the object. This `write` is equivalent to `forget`. - ptr::write(ptr, object); - &mut *ptr - } else { - let ptr = self.ptr.get(); - // Advance the pointer. - self.ptr.set(self.ptr.get().add(1)); - // Write into uninitialized memory. - ptr::write(ptr, object); - &mut *ptr - } + let ptr = self.ptr.get(); + // Advance the pointer. + self.ptr.set(self.ptr.get().add(1)); + // Write into uninitialized memory. + ptr::write(ptr, object); + &mut *ptr } } @@ -302,16 +296,10 @@ impl TypedArena { let end = self.ptr.get().addr(); // We then calculate the number of elements to be dropped in the last chunk, // which is the filled area's length. - let diff = if size_of::() == 0 { - // `T` is ZST. It can't have a drop flag, so the value here doesn't matter. We get - // the number of zero-sized values in the last and only chunk, just out of caution. - // Recall that `end` was incremented for each allocated value. - end - start - } else { - // FIXME: this should *likely* use `offset_from`, but more - // investigation is needed (including running tests in miri). - (end - start) / size_of::() - }; + assert_ne!(size_of::(), 0); + // FIXME: this should *likely* use `offset_from`, but more + // investigation is needed (including running tests in miri). + let diff = (end - start) / size_of::(); // Pass that to the `destroy` method. unsafe { last_chunk.destroy(diff); diff --git a/compiler/rustc_arena/src/tests.rs b/compiler/rustc_arena/src/tests.rs index eb9406d691b10..751ddd80408a8 100644 --- a/compiler/rustc_arena/src/tests.rs +++ b/compiler/rustc_arena/src/tests.rs @@ -22,7 +22,6 @@ impl TypedArena { if let Some(last_chunk) = chunks_borrow.last_mut() { self.clear_last_chunk(last_chunk); let len = chunks_borrow.len(); - // If `T` is ZST, code below has no effect. for mut chunk in chunks_borrow.drain(..len - 1) { chunk.destroy(chunk.entries); } @@ -117,18 +116,6 @@ fn test_noncopy() { } } -#[test] -fn test_typed_arena_zero_sized() { - let arena = TypedArena::default(); - #[cfg(not(miri))] - const N: usize = 100000; - #[cfg(miri)] - const N: usize = 1000; - for _ in 0..N { - arena.alloc(()); - } -} - #[test] fn test_typed_arena_clear() { let mut arena = TypedArena::default(); @@ -207,7 +194,8 @@ thread_local! { static DROP_COUNTER: Cell = Cell::new(0) } -struct SmallDroppable; +#[allow(unused)] +struct SmallDroppable(u8); impl Drop for SmallDroppable { fn drop(&mut self) { @@ -222,7 +210,7 @@ fn test_typed_arena_drop_small_count() { let arena: TypedArena = TypedArena::default(); for _ in 0..100 { // Allocate something with drop glue to make sure it doesn't leak. - arena.alloc(SmallDroppable); + arena.alloc(SmallDroppable(0)); } // dropping }; From 81cab931a1a8569a9fa6ce7d8465dc343a426ea0 Mon Sep 17 00:00:00 2001 From: Shun Sakai Date: Wed, 15 Apr 2026 19:03:49 +0900 Subject: [PATCH 21/38] docs: Use `0b1` instead of `NonZero::MIN` in `NonZero::bit_width` doctests --- library/core/src/num/nonzero.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library/core/src/num/nonzero.rs b/library/core/src/num/nonzero.rs index 9a330fe592230..7cb022b082902 100644 --- a/library/core/src/num/nonzero.rs +++ b/library/core/src/num/nonzero.rs @@ -1950,7 +1950,7 @@ macro_rules! nonzero_integer_signedness_dependent_methods { /// # /// # fn main() { test().unwrap(); } /// # fn test() -> Option<()> { - #[doc = concat!("assert_eq!(NonZero::<", stringify!($Int), ">::MIN.bit_width(), NonZero::new(1)?);")] + #[doc = concat!("assert_eq!(NonZero::<", stringify!($Int), ">::new(0b1)?.bit_width(), NonZero::new(1)?);")] #[doc = concat!("assert_eq!(NonZero::<", stringify!($Int), ">::new(0b111)?.bit_width(), NonZero::new(3)?);")] #[doc = concat!("assert_eq!(NonZero::<", stringify!($Int), ">::new(0b1110)?.bit_width(), NonZero::new(4)?);")] /// # Some(()) From d6bccac835837a36827a61269cd463f143e0b60e Mon Sep 17 00:00:00 2001 From: mejrs <59372212+mejrs@users.noreply.github.com> Date: Wed, 15 Apr 2026 13:50:43 +0200 Subject: [PATCH 22/38] Fix error code example --- .../rustc_error_codes/src/error_codes/E0232.md | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/compiler/rustc_error_codes/src/error_codes/E0232.md b/compiler/rustc_error_codes/src/error_codes/E0232.md index 0e50cf589ee69..cb0797006092a 100644 --- a/compiler/rustc_error_codes/src/error_codes/E0232.md +++ b/compiler/rustc_error_codes/src/error_codes/E0232.md @@ -1,19 +1,14 @@ The `#[rustc_on_unimplemented]` attribute lets you specify a custom error message for when a particular trait isn't implemented on a type placed in a -position that needs that trait. For example, when the following code is -compiled: +position that needs that trait. The attribute will let you filter on +various types, with `on`: ```compile_fail,E0232 #![feature(rustc_attrs)] #![allow(internal_features)] -#[rustc_on_unimplemented(lorem="")] // error! +#[rustc_on_unimplemented(on(blah, message = "foo"))] // error! trait BadAnnotation {} ``` - -there will be an error about `bool` not implementing `Index`, followed by a -note saying "the type `bool` cannot be indexed by `u8`". - -For this to work, some note must be specified. An empty attribute will not do -anything, please remove the attribute or add some helpful note for users of the -trait. +For this to work a cfg-like predicate must be supplied. A malformed filter +will not do anything. From 82545d7d797fb1a36111a26066456a93d4fea654 Mon Sep 17 00:00:00 2001 From: Oli Scherer Date: Wed, 15 Apr 2026 14:16:18 +0200 Subject: [PATCH 23/38] Add regression test --- tests/ui/transmute/raw-ptr-non-null.rs | 11 +++++++++++ tests/ui/transmute/raw-ptr-non-null.stderr | 12 ++++++++++++ 2 files changed, 23 insertions(+) create mode 100644 tests/ui/transmute/raw-ptr-non-null.rs create mode 100644 tests/ui/transmute/raw-ptr-non-null.stderr diff --git a/tests/ui/transmute/raw-ptr-non-null.rs b/tests/ui/transmute/raw-ptr-non-null.rs new file mode 100644 index 0000000000000..6e60a6db0eb3e --- /dev/null +++ b/tests/ui/transmute/raw-ptr-non-null.rs @@ -0,0 +1,11 @@ +//! After the use of pattern types inside `NonNull`, +//! transmuting between a niche optimized enum wrapping a +//! generic `NonNull` and raw pointers stopped working. + +use std::ptr::NonNull; +pub const fn is_null<'a, T: ?Sized>(ptr: *const T) -> bool { + unsafe { matches!(core::mem::transmute::<*const T, Option>>(ptr), None) } + //~^ ERROR: cannot transmute +} + +fn main() {} diff --git a/tests/ui/transmute/raw-ptr-non-null.stderr b/tests/ui/transmute/raw-ptr-non-null.stderr new file mode 100644 index 0000000000000..0e3993da89786 --- /dev/null +++ b/tests/ui/transmute/raw-ptr-non-null.stderr @@ -0,0 +1,12 @@ +error[E0512]: cannot transmute between types of different sizes, or dependently-sized types + --> $DIR/raw-ptr-non-null.rs:7:23 + | +LL | unsafe { matches!(core::mem::transmute::<*const T, Option>>(ptr), None) } + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: source type: `*const T` (pointer to `T`) + = note: target type: `Option>` (size can vary because of ::Metadata) + +error: aborting due to 1 previous error + +For more information about this error, try `rustc --explain E0512`. From 8d642647bd32c4f1566086e19ac7192484d9b2eb Mon Sep 17 00:00:00 2001 From: Oli Scherer Date: Wed, 15 Apr 2026 14:26:06 +0200 Subject: [PATCH 24/38] Handle non-null pattern types in size skeleton --- compiler/rustc_middle/src/ty/layout.rs | 17 +++++++++++++++-- tests/ui/transmute/raw-ptr-non-null.rs | 2 +- tests/ui/transmute/raw-ptr-non-null.stderr | 12 ------------ 3 files changed, 16 insertions(+), 15 deletions(-) delete mode 100644 tests/ui/transmute/raw-ptr-non-null.stderr diff --git a/compiler/rustc_middle/src/ty/layout.rs b/compiler/rustc_middle/src/ty/layout.rs index 969d654941800..f04b4873f395c 100644 --- a/compiler/rustc_middle/src/ty/layout.rs +++ b/compiler/rustc_middle/src/ty/layout.rs @@ -508,8 +508,21 @@ impl<'tcx> SizeSkeleton<'tcx> { } } - // Pattern types are always the same size as their base. - ty::Pat(base, _) => SizeSkeleton::compute(base, tcx, typing_env), + ty::Pat(base, pat) => { + // Pattern types are always the same size as their base. + let base = SizeSkeleton::compute(base, tcx, typing_env); + match *pat { + ty::PatternKind::Range { .. } | ty::PatternKind::Or(_) => base, + // But in the case of `!null` patterns we need to note that in the + // raw pointer. + ty::PatternKind::NotNull => match base? { + SizeSkeleton::Known(..) | SizeSkeleton::Generic(_) => base, + SizeSkeleton::Pointer { non_zero: _, tail } => { + Ok(SizeSkeleton::Pointer { non_zero: true, tail }) + } + }, + } + } _ => Err(err), } diff --git a/tests/ui/transmute/raw-ptr-non-null.rs b/tests/ui/transmute/raw-ptr-non-null.rs index 6e60a6db0eb3e..af518095b3fbd 100644 --- a/tests/ui/transmute/raw-ptr-non-null.rs +++ b/tests/ui/transmute/raw-ptr-non-null.rs @@ -1,11 +1,11 @@ //! After the use of pattern types inside `NonNull`, //! transmuting between a niche optimized enum wrapping a //! generic `NonNull` and raw pointers stopped working. +//@ check-pass use std::ptr::NonNull; pub const fn is_null<'a, T: ?Sized>(ptr: *const T) -> bool { unsafe { matches!(core::mem::transmute::<*const T, Option>>(ptr), None) } - //~^ ERROR: cannot transmute } fn main() {} diff --git a/tests/ui/transmute/raw-ptr-non-null.stderr b/tests/ui/transmute/raw-ptr-non-null.stderr deleted file mode 100644 index 0e3993da89786..0000000000000 --- a/tests/ui/transmute/raw-ptr-non-null.stderr +++ /dev/null @@ -1,12 +0,0 @@ -error[E0512]: cannot transmute between types of different sizes, or dependently-sized types - --> $DIR/raw-ptr-non-null.rs:7:23 - | -LL | unsafe { matches!(core::mem::transmute::<*const T, Option>>(ptr), None) } - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | - = note: source type: `*const T` (pointer to `T`) - = note: target type: `Option>` (size can vary because of ::Metadata) - -error: aborting due to 1 previous error - -For more information about this error, try `rustc --explain E0512`. From 1fca34d15da42d3ef69bd1f6179477cd474c0591 Mon Sep 17 00:00:00 2001 From: mu001999 Date: Tue, 31 Mar 2026 22:32:02 +0800 Subject: [PATCH 25/38] Emit fatal on defaults for generic params in binders if with nested defs --- compiler/rustc_ast_lowering/src/lib.rs | 17 +++++++----- tests/crashes/123629.rs | 10 ------- ...ults-for-generic-param-in-binder-123629.rs | 12 +++++++++ ...-for-generic-param-in-binder-123629.stderr | 26 +++++++++++++++++++ 4 files changed, 49 insertions(+), 16 deletions(-) delete mode 100644 tests/crashes/123629.rs create mode 100644 tests/ui/const-generics/generic_const_exprs/bad-defaults-for-generic-param-in-binder-123629.rs create mode 100644 tests/ui/const-generics/generic_const_exprs/bad-defaults-for-generic-param-in-binder-123629.stderr diff --git a/compiler/rustc_ast_lowering/src/lib.rs b/compiler/rustc_ast_lowering/src/lib.rs index 9e830e29be033..ab4289d9c0be9 100644 --- a/compiler/rustc_ast_lowering/src/lib.rs +++ b/compiler/rustc_ast_lowering/src/lib.rs @@ -2220,14 +2220,19 @@ impl<'hir, R: ResolverAstLoweringExt<'hir>> LoweringContext<'_, 'hir, R> { // since later compiler stages cannot handle them (and shouldn't need to be able to). let default = default .as_ref() - .filter(|_| match source { + .filter(|anon_const| match source { hir::GenericParamSource::Generics => true, hir::GenericParamSource::Binder => { - self.dcx().emit_err(errors::GenericParamDefaultInBinder { - span: param.span(), - }); - - false + let err = errors::GenericParamDefaultInBinder { span: param.span() }; + if expr::WillCreateDefIdsVisitor + .visit_expr(&anon_const.value) + .is_break() + { + self.dcx().emit_fatal(err) + } else { + self.dcx().emit_err(err); + false + } } }) .map(|def| self.lower_anon_const_to_const_arg_and_alloc(def)); diff --git a/tests/crashes/123629.rs b/tests/crashes/123629.rs deleted file mode 100644 index 615323218067d..0000000000000 --- a/tests/crashes/123629.rs +++ /dev/null @@ -1,10 +0,0 @@ -//@ known-bug: #123629 -#![feature(generic_assert)] - -fn foo() -where - for ():, -{ -} - -fn main() {} diff --git a/tests/ui/const-generics/generic_const_exprs/bad-defaults-for-generic-param-in-binder-123629.rs b/tests/ui/const-generics/generic_const_exprs/bad-defaults-for-generic-param-in-binder-123629.rs new file mode 100644 index 0000000000000..c45f59a8d896e --- /dev/null +++ b/tests/ui/const-generics/generic_const_exprs/bad-defaults-for-generic-param-in-binder-123629.rs @@ -0,0 +1,12 @@ +#![feature(generic_assert)] + +fn foo() +where + for ():, + //~^ ERROR cannot find value `u` in this scope + //~^^ ERROR only lifetime parameters can be used in this context + //~^^^ ERROR defaults for generic parameters are not allowed in `for<...>` binders +{ +} + +fn main() {} diff --git a/tests/ui/const-generics/generic_const_exprs/bad-defaults-for-generic-param-in-binder-123629.stderr b/tests/ui/const-generics/generic_const_exprs/bad-defaults-for-generic-param-in-binder-123629.stderr new file mode 100644 index 0000000000000..9092c83d95121 --- /dev/null +++ b/tests/ui/const-generics/generic_const_exprs/bad-defaults-for-generic-param-in-binder-123629.stderr @@ -0,0 +1,26 @@ +error[E0425]: cannot find value `u` in this scope + --> $DIR/bad-defaults-for-generic-param-in-binder-123629.rs:5:36 + | +LL | for ():, + | ^ not found in this scope + +error[E0658]: only lifetime parameters can be used in this context + --> $DIR/bad-defaults-for-generic-param-in-binder-123629.rs:5:15 + | +LL | for ():, + | ^ + | + = note: see issue #108185 for more information + = help: add `#![feature(non_lifetime_binders)]` to the crate attributes to enable + = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date + +error: defaults for generic parameters are not allowed in `for<...>` binders + --> $DIR/bad-defaults-for-generic-param-in-binder-123629.rs:5:9 + | +LL | for ():, + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: aborting due to 3 previous errors + +Some errors have detailed explanations: E0425, E0658. +For more information about an error, try `rustc --explain E0425`. From 77419b45dcbc49e54a66a72f17c3a99539e84841 Mon Sep 17 00:00:00 2001 From: mu001999 Date: Wed, 15 Apr 2026 21:52:11 +0800 Subject: [PATCH 26/38] Add FIXME for the fatal errors --- compiler/rustc_ast_lowering/src/lib.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/compiler/rustc_ast_lowering/src/lib.rs b/compiler/rustc_ast_lowering/src/lib.rs index ab4289d9c0be9..229b6c10759d6 100644 --- a/compiler/rustc_ast_lowering/src/lib.rs +++ b/compiler/rustc_ast_lowering/src/lib.rs @@ -2228,6 +2228,9 @@ impl<'hir, R: ResolverAstLoweringExt<'hir>> LoweringContext<'_, 'hir, R> { .visit_expr(&anon_const.value) .is_break() { + // FIXME(mgca): make this non-fatal once we have a better way + // to handle nested items in anno const from binder + // Issue: https://github.com/rust-lang/rust/issues/123629 self.dcx().emit_fatal(err) } else { self.dcx().emit_err(err); @@ -2571,6 +2574,9 @@ impl<'hir, R: ResolverAstLoweringExt<'hir>> LoweringContext<'_, 'hir, R> { let overly_complex_const = |this: &mut Self| { let msg = "complex const arguments must be placed inside of a `const` block"; let e = if expr::WillCreateDefIdsVisitor.visit_expr(expr).is_break() { + // FIXME(mgca): make this non-fatal once we have a better way to handle + // nested items in const args + // Issue: https://github.com/rust-lang/rust/issues/154539 this.dcx().struct_span_fatal(expr.span, msg).emit() } else { this.dcx().struct_span_err(expr.span, msg).emit() From e910c38861f5bd75946b96040e2611084e6501cb Mon Sep 17 00:00:00 2001 From: Balt <59123926+balt-dev@users.noreply.github.com> Date: Wed, 15 Apr 2026 11:32:54 -0500 Subject: [PATCH 27/38] Add push_mut to release notes --- RELEASES.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/RELEASES.md b/RELEASES.md index c1cf337ea8d2a..1ceb40b872af5 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -78,6 +78,12 @@ Stabilized APIs - [`<*const T>::as_ref_unchecked`](https://doc.rust-lang.org/stable/std/primitive.pointer.html#method.as_ref_unchecked) - [`<*mut T>::as_ref_unchecked`](https://doc.rust-lang.org/stable/std/primitive.pointer.html#method.as_ref_unchecked-1) - [`<*mut T>::as_mut_unchecked`](https://doc.rust-lang.org/stable/std/primitive.pointer.html#method.as_mut_unchecked) +- [`Vec::push_mut`](https://doc.rust-lang.org/stable/std/vec/struct.Vec.html#method.push_mut) +- [`VecDeque::push_front_mut`](https://doc.rust-lang.org/stable/std/collections/struct.VecDeque.html#method.push_front_mut) +- [`VecDeque::push_back_mut`](https://doc.rust-lang.org/stable/std/collections/struct.VecDeque.html#method.push_back_mut) +- [`VecDeque::insert_mut`](https://doc.rust-lang.org/stable/std/collections/struct.VecDeque.html#method.insert_mut) +- [`LinkedList::push_front_mut`](https://doc.rust-lang.org/stable/std/collections/struct.LinkedList.html#method.push_front_mut) +- [`LinkedList::push_back_mut`](https://doc.rust-lang.org/stable/std/collections/struct.LinkedList.html#method.push_back_mut) These previously stable APIs are now stable in const contexts: From fba9ef8702763b1149866247b673a8de42c59e26 Mon Sep 17 00:00:00 2001 From: Balt <59123926+balt-dev@users.noreply.github.com> Date: Wed, 15 Apr 2026 11:38:59 -0500 Subject: [PATCH 28/38] Add insert_mut to release notes Co-authored-by: Josh Stone --- RELEASES.md | 1 + 1 file changed, 1 insertion(+) diff --git a/RELEASES.md b/RELEASES.md index 1ceb40b872af5..d69fea0f0bf64 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -79,6 +79,7 @@ Stabilized APIs - [`<*mut T>::as_ref_unchecked`](https://doc.rust-lang.org/stable/std/primitive.pointer.html#method.as_ref_unchecked-1) - [`<*mut T>::as_mut_unchecked`](https://doc.rust-lang.org/stable/std/primitive.pointer.html#method.as_mut_unchecked) - [`Vec::push_mut`](https://doc.rust-lang.org/stable/std/vec/struct.Vec.html#method.push_mut) +- [`Vec::insert_mut`](https://doc.rust-lang.org/stable/std/vec/struct.Vec.html#method.insert_mut) - [`VecDeque::push_front_mut`](https://doc.rust-lang.org/stable/std/collections/struct.VecDeque.html#method.push_front_mut) - [`VecDeque::push_back_mut`](https://doc.rust-lang.org/stable/std/collections/struct.VecDeque.html#method.push_back_mut) - [`VecDeque::insert_mut`](https://doc.rust-lang.org/stable/std/collections/struct.VecDeque.html#method.insert_mut) From f52f12501b2ff74ccc338db794393e084029aa78 Mon Sep 17 00:00:00 2001 From: Erick Tryzelaar Date: Wed, 25 Feb 2026 18:59:38 +0000 Subject: [PATCH 29/38] Add `--quiet` flag to x.py and bootstrap to suppress output This adds a `--quiet` flag to x.py and bootstrap to suppress some of the output when compiling Rust. It conflicts with `--verbose`, matching the behavior of `cargo` which does not allow `--verbose` and `--quiet`. It works by passing quiet flags down to the underlying cargo, or LLVM build processes. Note that for LLVM, we only can suppress logs when we explicitly configure it with ninja. Otherwise we won't know what flag to pass along to whichever build system cmake decides to use. This can be helpful with AI workloads in the Rust codebase to help shrink down the output to reduce token usage, which can help prevent context pollution and lower costs. This patch was partially generated with Gemini, but I've reviewed the changes it made. --- src/bootstrap/bootstrap.py | 41 +++--- src/bootstrap/src/core/build_steps/llvm.rs | 12 ++ src/bootstrap/src/core/builder/cargo.rs | 5 + src/bootstrap/src/core/config/config.rs | 3 + src/bootstrap/src/core/config/flags.rs | 5 +- src/etc/completions/x.fish | 29 +++- src/etc/completions/x.ps1 | 54 +++++++ src/etc/completions/x.py.fish | 29 +++- src/etc/completions/x.py.ps1 | 54 +++++++ src/etc/completions/x.py.sh | 54 +++---- src/etc/completions/x.py.zsh | 162 ++++++++++++++------- src/etc/completions/x.sh | 54 +++---- src/etc/completions/x.zsh | 162 ++++++++++++++------- src/etc/xhelp | 2 + 14 files changed, 484 insertions(+), 182 deletions(-) diff --git a/src/bootstrap/bootstrap.py b/src/bootstrap/bootstrap.py index b893bb3f58213..28d432736ed66 100644 --- a/src/bootstrap/bootstrap.py +++ b/src/bootstrap/bootstrap.py @@ -49,7 +49,7 @@ def eprint(*args, **kwargs): print(*args, **kwargs) -def get(base, url, path, checksums, verbose=False): +def get(base, url, path, checksums, verbose=0): with tempfile.NamedTemporaryFile(delete=False) as temp_file: temp_path = temp_file.name @@ -66,11 +66,11 @@ def get(base, url, path, checksums, verbose=False): sha256 = checksums[url] if os.path.exists(path): if verify(path, sha256, False): - if verbose: + if verbose > 0: eprint("using already-download file", path) return else: - if verbose: + if verbose > 0: eprint( "ignoring already-download file", path, @@ -80,12 +80,12 @@ def get(base, url, path, checksums, verbose=False): download(temp_path, "{}/{}".format(base, url), True, verbose) if not verify(temp_path, sha256, verbose): raise RuntimeError("failed verification") - if verbose: + if verbose > 0: eprint("moving {} to {}".format(temp_path, path)) shutil.move(temp_path, path) finally: if os.path.isfile(temp_path): - if verbose: + if verbose > 0: eprint("removing", temp_path) os.unlink(temp_path) @@ -113,11 +113,11 @@ def _download(path, url, probably_big, verbose, exception): # If an error occurs: # - If we are on win32 fallback to powershell # - Otherwise raise the error if appropriate - if probably_big or verbose: + if probably_big or verbose > 0: eprint("downloading {}".format(url)) try: - if (probably_big or verbose) and "GITHUB_ACTIONS" not in os.environ: + if (probably_big or verbose > 0) and "GITHUB_ACTIONS" not in os.environ: option = "--progress-bar" else: option = "--silent" @@ -180,7 +180,7 @@ def _download(path, url, probably_big, verbose, exception): def verify(path, expected, verbose): """Check if the sha256 sum of the given path is valid""" - if verbose: + if verbose > 0: eprint("verifying", path) with open(path, "rb") as source: found = hashlib.sha256(source.read()).hexdigest() @@ -194,7 +194,7 @@ def verify(path, expected, verbose): return verified -def unpack(tarball, tarball_suffix, dst, verbose=False, match=None): +def unpack(tarball, tarball_suffix, dst, verbose=0, match=None): """Unpack the given tarball file""" eprint("extracting", tarball) fname = os.path.basename(tarball).replace(tarball_suffix, "") @@ -208,7 +208,7 @@ def unpack(tarball, tarball_suffix, dst, verbose=False, match=None): name = name[len(match) + 1 :] dst_path = os.path.join(dst, name) - if verbose: + if verbose > 0: eprint(" extracting", member) tar.extract(member, dst) src_path = os.path.join(dst, member) @@ -218,9 +218,9 @@ def unpack(tarball, tarball_suffix, dst, verbose=False, match=None): shutil.rmtree(os.path.join(dst, fname)) -def run(args, verbose=False, exception=False, is_bootstrap=False, **kwargs): +def run(args, verbose=0, exception=False, is_bootstrap=False, **kwargs): """Run a child program in a new process""" - if verbose: + if verbose > 0: eprint("running: " + " ".join(args)) sys.stdout.flush() # Ensure that the .exe is used on Windows just in case a Linux ELF has been @@ -233,7 +233,7 @@ def run(args, verbose=False, exception=False, is_bootstrap=False, **kwargs): code = ret.wait() if code != 0: err = "failed to run: " + " ".join(args) - if verbose or exception: + if verbose > 0 or exception: raise RuntimeError(err) # For most failures, we definitely do want to print this error, or the user will have no # idea what went wrong. But when we've successfully built bootstrap and it failed, it will @@ -293,13 +293,13 @@ def default_build_triple(verbose): version = version.decode(default_encoding) host = next(x for x in version.split("\n") if x.startswith("host: ")) triple = host.split("host: ")[1] - if verbose: + if verbose > 0: eprint( "detected default triple {} from pre-installed rustc".format(triple) ) return triple except Exception as e: - if verbose: + if verbose > 0: eprint("pre-installed rustc not detected: {}".format(e)) eprint("falling back to auto-detect") @@ -699,7 +699,7 @@ def download_toolchain(self): # Unpack the tarballs in parallel. # In Python 2.7, Pool cannot be used as a context manager. pool_size = min(len(tarballs_download_info), get_cpus()) - if self.verbose: + if self.verbose > 0: print( "Choosing a pool size of", pool_size, @@ -1126,6 +1126,8 @@ def build_bootstrap_cmd(self, env): ] # verbose cargo output is very noisy, so only enable it with -vv args.extend("--verbose" for _ in range(self.verbose - 1)) + if self.verbose < 0: + args.append("--quiet") target_features = [] if self.get_toml("crt-static", build_section) == "true": @@ -1275,7 +1277,12 @@ def parse_args(args): parser.add_argument( "--warnings", choices=["deny", "warn", "default"], default="default" ) - parser.add_argument("-v", "--verbose", action="count", default=0) + group = parser.add_mutually_exclusive_group() + group.add_argument("-v", "--verbose", action="count", default=0) + # Note that we're storing the `--quiet` value in `verbose`. That way we don't need to thread + # `self.quiet` throughout the code. That could be error prone, which could let some output + # through that should have been suppressed. + group.add_argument("-q", "--quiet", action="store_const", const=-1, dest="verbose") return parser.parse_known_args(args)[0] diff --git a/src/bootstrap/src/core/build_steps/llvm.rs b/src/bootstrap/src/core/build_steps/llvm.rs index a2cf801afa11a..087a395a067f0 100644 --- a/src/bootstrap/src/core/build_steps/llvm.rs +++ b/src/bootstrap/src/core/build_steps/llvm.rs @@ -651,6 +651,18 @@ fn configure_cmake( // LLVM and LLD builds can produce a lot of those and hit CI limits on log size. cfg.define("CMAKE_INSTALL_MESSAGE", "LAZY"); + if builder.config.quiet { + // Only log errors and warnings from `cmake`. + cfg.define("CMAKE_MESSAGE_LOG_LEVEL", "WARNING"); + + // If we're configuring llvm to build with `ninja`, we can suppress output from it with + // `--quiet`. Otherwise don't add anything since we don't know which build system is going + // to use. + if builder.ninja() { + cfg.build_arg("--quiet"); + } + } + // Do not allow the user's value of DESTDIR to influence where // LLVM will install itself. LLVM must always be installed in our // own build directories. diff --git a/src/bootstrap/src/core/builder/cargo.rs b/src/bootstrap/src/core/builder/cargo.rs index f785254d90dae..e9659f0176fc5 100644 --- a/src/bootstrap/src/core/builder/cargo.rs +++ b/src/bootstrap/src/core/builder/cargo.rs @@ -509,6 +509,11 @@ impl Builder<'_> { } }; + // Optionally suppress cargo output. + if self.config.quiet { + cargo.arg("--quiet"); + } + // Run cargo from the source root so it can find .cargo/config. // This matters when using vendoring and the working directory is outside the repository. cargo.current_dir(&self.src); diff --git a/src/bootstrap/src/core/config/config.rs b/src/bootstrap/src/core/config/config.rs index 36e6432ee82ad..04f020e44dd12 100644 --- a/src/bootstrap/src/core/config/config.rs +++ b/src/bootstrap/src/core/config/config.rs @@ -140,6 +140,7 @@ pub struct Config { pub config: Option, pub jobs: Option, pub cmd: Subcommand, + pub quiet: bool, pub incremental: bool, pub dump_bootstrap_shims: bool, /// Arguments appearing after `--` to be forwarded to tools, @@ -369,6 +370,7 @@ impl Config { let Flags { cmd: flags_cmd, verbose: flags_verbose, + quiet: flags_quiet, incremental: flags_incremental, config: flags_config, build_dir: flags_build_dir, @@ -1433,6 +1435,7 @@ impl Config { print_step_timings: build_print_step_timings.unwrap_or(false), profiler: build_profiler.unwrap_or(false), python: build_python.map(PathBuf::from), + quiet: flags_quiet, reproducible_artifacts: flags_reproducible_artifact, reuse: build_reuse.map(PathBuf::from), rust_analyzer_info, diff --git a/src/bootstrap/src/core/config/flags.rs b/src/bootstrap/src/core/config/flags.rs index e1b8aa9810c3d..dce8a4c09a7e4 100644 --- a/src/bootstrap/src/core/config/flags.rs +++ b/src/bootstrap/src/core/config/flags.rs @@ -46,9 +46,12 @@ pub struct Flags { #[command(subcommand)] pub cmd: Subcommand, - #[arg(global = true, short, long, action = clap::ArgAction::Count)] + #[arg(global = true, short, long, action = clap::ArgAction::Count, conflicts_with = "quiet")] /// use verbose output (-vv for very verbose) pub verbose: u8, // each extra -v after the first is passed to Cargo + #[arg(global = true, short, long, conflicts_with = "verbose")] + /// use quiet output + pub quiet: bool, #[arg(global = true, short, long)] /// use incremental compilation pub incremental: bool, diff --git a/src/etc/completions/x.fish b/src/etc/completions/x.fish index 689a13452e1bc..0b50ee19f8a57 100644 --- a/src/etc/completions/x.fish +++ b/src/etc/completions/x.fish @@ -1,6 +1,6 @@ # Print an optspec for argparse to handle cmd's options that are independent of any subcommand. function __fish_x_global_optspecs - string join \n v/verbose i/incremental config= build-dir= build= host= target= exclude= skip= include-default-paths rustc-error-format= on-fail= dry-run dump-bootstrap-shims stage= keep-stage= keep-stage-std= src= j/jobs= warnings= json-output compile-time-deps color= bypass-bootstrap-lock rust-profile-generate= rust-profile-use= llvm-profile-use= llvm-profile-generate enable-bolt-settings skip-stage0-validation reproducible-artifact= set= ci= skip-std-check-if-no-download-rustc h/help + string join \n v/verbose q/quiet i/incremental config= build-dir= build= host= target= exclude= skip= include-default-paths rustc-error-format= on-fail= dry-run dump-bootstrap-shims stage= keep-stage= keep-stage-std= src= j/jobs= warnings= json-output compile-time-deps color= bypass-bootstrap-lock rust-profile-generate= rust-profile-use= llvm-profile-use= llvm-profile-generate enable-bolt-settings skip-stage0-validation reproducible-artifact= set= ci= skip-std-check-if-no-download-rustc h/help end function __fish_x_needs_command @@ -47,6 +47,7 @@ complete -c x -n "__fish_x_needs_command" -l reproducible-artifact -d 'Additiona complete -c x -n "__fish_x_needs_command" -l set -d 'override options in bootstrap.toml' -r -f complete -c x -n "__fish_x_needs_command" -l ci -d 'Make bootstrap to behave as it\'s running on the CI environment or not' -r -f -a "{true\t'',false\t''}" complete -c x -n "__fish_x_needs_command" -s v -l verbose -d 'use verbose output (-vv for very verbose)' +complete -c x -n "__fish_x_needs_command" -s q -l quiet -d 'use quiet output' complete -c x -n "__fish_x_needs_command" -s i -l incremental -d 'use incremental compilation' complete -c x -n "__fish_x_needs_command" -l include-default-paths -d 'include default paths in addition to the provided ones' complete -c x -n "__fish_x_needs_command" -l dry-run -d 'dry run; don\'t build anything' @@ -104,6 +105,7 @@ complete -c x -n "__fish_x_using_subcommand build" -l set -d 'override options i complete -c x -n "__fish_x_using_subcommand build" -l ci -d 'Make bootstrap to behave as it\'s running on the CI environment or not' -r -f -a "{true\t'',false\t''}" complete -c x -n "__fish_x_using_subcommand build" -l timings -d 'Pass `--timings` to Cargo to get crate build timings' complete -c x -n "__fish_x_using_subcommand build" -s v -l verbose -d 'use verbose output (-vv for very verbose)' +complete -c x -n "__fish_x_using_subcommand build" -s q -l quiet -d 'use quiet output' complete -c x -n "__fish_x_using_subcommand build" -s i -l incremental -d 'use incremental compilation' complete -c x -n "__fish_x_using_subcommand build" -l include-default-paths -d 'include default paths in addition to the provided ones' complete -c x -n "__fish_x_using_subcommand build" -l dry-run -d 'dry run; don\'t build anything' @@ -140,6 +142,7 @@ complete -c x -n "__fish_x_using_subcommand b" -l set -d 'override options in bo complete -c x -n "__fish_x_using_subcommand b" -l ci -d 'Make bootstrap to behave as it\'s running on the CI environment or not' -r -f -a "{true\t'',false\t''}" complete -c x -n "__fish_x_using_subcommand b" -l timings -d 'Pass `--timings` to Cargo to get crate build timings' complete -c x -n "__fish_x_using_subcommand b" -s v -l verbose -d 'use verbose output (-vv for very verbose)' +complete -c x -n "__fish_x_using_subcommand b" -s q -l quiet -d 'use quiet output' complete -c x -n "__fish_x_using_subcommand b" -s i -l incremental -d 'use incremental compilation' complete -c x -n "__fish_x_using_subcommand b" -l include-default-paths -d 'include default paths in addition to the provided ones' complete -c x -n "__fish_x_using_subcommand b" -l dry-run -d 'dry run; don\'t build anything' @@ -177,6 +180,7 @@ complete -c x -n "__fish_x_using_subcommand check" -l ci -d 'Make bootstrap to b complete -c x -n "__fish_x_using_subcommand check" -l all-targets -d 'Check all targets' complete -c x -n "__fish_x_using_subcommand check" -l timings -d 'Pass `--timings` to Cargo to get crate build timings' complete -c x -n "__fish_x_using_subcommand check" -s v -l verbose -d 'use verbose output (-vv for very verbose)' +complete -c x -n "__fish_x_using_subcommand check" -s q -l quiet -d 'use quiet output' complete -c x -n "__fish_x_using_subcommand check" -s i -l incremental -d 'use incremental compilation' complete -c x -n "__fish_x_using_subcommand check" -l include-default-paths -d 'include default paths in addition to the provided ones' complete -c x -n "__fish_x_using_subcommand check" -l dry-run -d 'dry run; don\'t build anything' @@ -214,6 +218,7 @@ complete -c x -n "__fish_x_using_subcommand c" -l ci -d 'Make bootstrap to behav complete -c x -n "__fish_x_using_subcommand c" -l all-targets -d 'Check all targets' complete -c x -n "__fish_x_using_subcommand c" -l timings -d 'Pass `--timings` to Cargo to get crate build timings' complete -c x -n "__fish_x_using_subcommand c" -s v -l verbose -d 'use verbose output (-vv for very verbose)' +complete -c x -n "__fish_x_using_subcommand c" -s q -l quiet -d 'use quiet output' complete -c x -n "__fish_x_using_subcommand c" -s i -l incremental -d 'use incremental compilation' complete -c x -n "__fish_x_using_subcommand c" -l include-default-paths -d 'include default paths in addition to the provided ones' complete -c x -n "__fish_x_using_subcommand c" -l dry-run -d 'dry run; don\'t build anything' @@ -256,6 +261,7 @@ complete -c x -n "__fish_x_using_subcommand clippy" -l fix complete -c x -n "__fish_x_using_subcommand clippy" -l allow-dirty complete -c x -n "__fish_x_using_subcommand clippy" -l allow-staged complete -c x -n "__fish_x_using_subcommand clippy" -s v -l verbose -d 'use verbose output (-vv for very verbose)' +complete -c x -n "__fish_x_using_subcommand clippy" -s q -l quiet -d 'use quiet output' complete -c x -n "__fish_x_using_subcommand clippy" -s i -l incremental -d 'use incremental compilation' complete -c x -n "__fish_x_using_subcommand clippy" -l include-default-paths -d 'include default paths in addition to the provided ones' complete -c x -n "__fish_x_using_subcommand clippy" -l dry-run -d 'dry run; don\'t build anything' @@ -291,6 +297,7 @@ complete -c x -n "__fish_x_using_subcommand fix" -l reproducible-artifact -d 'Ad complete -c x -n "__fish_x_using_subcommand fix" -l set -d 'override options in bootstrap.toml' -r -f complete -c x -n "__fish_x_using_subcommand fix" -l ci -d 'Make bootstrap to behave as it\'s running on the CI environment or not' -r -f -a "{true\t'',false\t''}" complete -c x -n "__fish_x_using_subcommand fix" -s v -l verbose -d 'use verbose output (-vv for very verbose)' +complete -c x -n "__fish_x_using_subcommand fix" -s q -l quiet -d 'use quiet output' complete -c x -n "__fish_x_using_subcommand fix" -s i -l incremental -d 'use incremental compilation' complete -c x -n "__fish_x_using_subcommand fix" -l include-default-paths -d 'include default paths in addition to the provided ones' complete -c x -n "__fish_x_using_subcommand fix" -l dry-run -d 'dry run; don\'t build anything' @@ -328,6 +335,7 @@ complete -c x -n "__fish_x_using_subcommand fmt" -l ci -d 'Make bootstrap to beh complete -c x -n "__fish_x_using_subcommand fmt" -l check -d 'check formatting instead of applying' complete -c x -n "__fish_x_using_subcommand fmt" -l all -d 'apply to all appropriate files, not just those that have been modified' complete -c x -n "__fish_x_using_subcommand fmt" -s v -l verbose -d 'use verbose output (-vv for very verbose)' +complete -c x -n "__fish_x_using_subcommand fmt" -s q -l quiet -d 'use quiet output' complete -c x -n "__fish_x_using_subcommand fmt" -s i -l incremental -d 'use incremental compilation' complete -c x -n "__fish_x_using_subcommand fmt" -l include-default-paths -d 'include default paths in addition to the provided ones' complete -c x -n "__fish_x_using_subcommand fmt" -l dry-run -d 'dry run; don\'t build anything' @@ -365,6 +373,7 @@ complete -c x -n "__fish_x_using_subcommand doc" -l ci -d 'Make bootstrap to beh complete -c x -n "__fish_x_using_subcommand doc" -l open -d 'open the docs in a browser' complete -c x -n "__fish_x_using_subcommand doc" -l json -d 'render the documentation in JSON format in addition to the usual HTML format' complete -c x -n "__fish_x_using_subcommand doc" -s v -l verbose -d 'use verbose output (-vv for very verbose)' +complete -c x -n "__fish_x_using_subcommand doc" -s q -l quiet -d 'use quiet output' complete -c x -n "__fish_x_using_subcommand doc" -s i -l incremental -d 'use incremental compilation' complete -c x -n "__fish_x_using_subcommand doc" -l include-default-paths -d 'include default paths in addition to the provided ones' complete -c x -n "__fish_x_using_subcommand doc" -l dry-run -d 'dry run; don\'t build anything' @@ -402,6 +411,7 @@ complete -c x -n "__fish_x_using_subcommand d" -l ci -d 'Make bootstrap to behav complete -c x -n "__fish_x_using_subcommand d" -l open -d 'open the docs in a browser' complete -c x -n "__fish_x_using_subcommand d" -l json -d 'render the documentation in JSON format in addition to the usual HTML format' complete -c x -n "__fish_x_using_subcommand d" -s v -l verbose -d 'use verbose output (-vv for very verbose)' +complete -c x -n "__fish_x_using_subcommand d" -s q -l quiet -d 'use quiet output' complete -c x -n "__fish_x_using_subcommand d" -s i -l incremental -d 'use incremental compilation' complete -c x -n "__fish_x_using_subcommand d" -l include-default-paths -d 'include default paths in addition to the provided ones' complete -c x -n "__fish_x_using_subcommand d" -l dry-run -d 'dry run; don\'t build anything' @@ -456,6 +466,7 @@ complete -c x -n "__fish_x_using_subcommand test" -l no-capture -d 'don\'t captu complete -c x -n "__fish_x_using_subcommand test" -l bypass-ignore-backends -d 'Ignore `//@ ignore-backends` directives' complete -c x -n "__fish_x_using_subcommand test" -l no-doc -d 'Deprecated. Use `--all-targets` or `--tests` instead' complete -c x -n "__fish_x_using_subcommand test" -s v -l verbose -d 'use verbose output (-vv for very verbose)' +complete -c x -n "__fish_x_using_subcommand test" -s q -l quiet -d 'use quiet output' complete -c x -n "__fish_x_using_subcommand test" -s i -l incremental -d 'use incremental compilation' complete -c x -n "__fish_x_using_subcommand test" -l include-default-paths -d 'include default paths in addition to the provided ones' complete -c x -n "__fish_x_using_subcommand test" -l dry-run -d 'dry run; don\'t build anything' @@ -510,6 +521,7 @@ complete -c x -n "__fish_x_using_subcommand t" -l no-capture -d 'don\'t capture complete -c x -n "__fish_x_using_subcommand t" -l bypass-ignore-backends -d 'Ignore `//@ ignore-backends` directives' complete -c x -n "__fish_x_using_subcommand t" -l no-doc -d 'Deprecated. Use `--all-targets` or `--tests` instead' complete -c x -n "__fish_x_using_subcommand t" -s v -l verbose -d 'use verbose output (-vv for very verbose)' +complete -c x -n "__fish_x_using_subcommand t" -s q -l quiet -d 'use quiet output' complete -c x -n "__fish_x_using_subcommand t" -s i -l incremental -d 'use incremental compilation' complete -c x -n "__fish_x_using_subcommand t" -l include-default-paths -d 'include default paths in addition to the provided ones' complete -c x -n "__fish_x_using_subcommand t" -l dry-run -d 'dry run; don\'t build anything' @@ -551,6 +563,7 @@ complete -c x -n "__fish_x_using_subcommand miri" -l doc -d 'Only run doc tests' complete -c x -n "__fish_x_using_subcommand miri" -l tests -d 'Only run unit and integration tests' complete -c x -n "__fish_x_using_subcommand miri" -l no-doc -d 'Deprecated. Use `--all-targets` or `--tests` instead' complete -c x -n "__fish_x_using_subcommand miri" -s v -l verbose -d 'use verbose output (-vv for very verbose)' +complete -c x -n "__fish_x_using_subcommand miri" -s q -l quiet -d 'use quiet output' complete -c x -n "__fish_x_using_subcommand miri" -s i -l incremental -d 'use incremental compilation' complete -c x -n "__fish_x_using_subcommand miri" -l include-default-paths -d 'include default paths in addition to the provided ones' complete -c x -n "__fish_x_using_subcommand miri" -l dry-run -d 'dry run; don\'t build anything' @@ -587,6 +600,7 @@ complete -c x -n "__fish_x_using_subcommand bench" -l reproducible-artifact -d ' complete -c x -n "__fish_x_using_subcommand bench" -l set -d 'override options in bootstrap.toml' -r -f complete -c x -n "__fish_x_using_subcommand bench" -l ci -d 'Make bootstrap to behave as it\'s running on the CI environment or not' -r -f -a "{true\t'',false\t''}" complete -c x -n "__fish_x_using_subcommand bench" -s v -l verbose -d 'use verbose output (-vv for very verbose)' +complete -c x -n "__fish_x_using_subcommand bench" -s q -l quiet -d 'use quiet output' complete -c x -n "__fish_x_using_subcommand bench" -s i -l incremental -d 'use incremental compilation' complete -c x -n "__fish_x_using_subcommand bench" -l include-default-paths -d 'include default paths in addition to the provided ones' complete -c x -n "__fish_x_using_subcommand bench" -l dry-run -d 'dry run; don\'t build anything' @@ -623,6 +637,7 @@ complete -c x -n "__fish_x_using_subcommand clean" -l set -d 'override options i complete -c x -n "__fish_x_using_subcommand clean" -l ci -d 'Make bootstrap to behave as it\'s running on the CI environment or not' -r -f -a "{true\t'',false\t''}" complete -c x -n "__fish_x_using_subcommand clean" -l all -d 'Clean the entire build directory (not used by default)' complete -c x -n "__fish_x_using_subcommand clean" -s v -l verbose -d 'use verbose output (-vv for very verbose)' +complete -c x -n "__fish_x_using_subcommand clean" -s q -l quiet -d 'use quiet output' complete -c x -n "__fish_x_using_subcommand clean" -s i -l incremental -d 'use incremental compilation' complete -c x -n "__fish_x_using_subcommand clean" -l include-default-paths -d 'include default paths in addition to the provided ones' complete -c x -n "__fish_x_using_subcommand clean" -l dry-run -d 'dry run; don\'t build anything' @@ -658,6 +673,7 @@ complete -c x -n "__fish_x_using_subcommand dist" -l reproducible-artifact -d 'A complete -c x -n "__fish_x_using_subcommand dist" -l set -d 'override options in bootstrap.toml' -r -f complete -c x -n "__fish_x_using_subcommand dist" -l ci -d 'Make bootstrap to behave as it\'s running on the CI environment or not' -r -f -a "{true\t'',false\t''}" complete -c x -n "__fish_x_using_subcommand dist" -s v -l verbose -d 'use verbose output (-vv for very verbose)' +complete -c x -n "__fish_x_using_subcommand dist" -s q -l quiet -d 'use quiet output' complete -c x -n "__fish_x_using_subcommand dist" -s i -l incremental -d 'use incremental compilation' complete -c x -n "__fish_x_using_subcommand dist" -l include-default-paths -d 'include default paths in addition to the provided ones' complete -c x -n "__fish_x_using_subcommand dist" -l dry-run -d 'dry run; don\'t build anything' @@ -693,6 +709,7 @@ complete -c x -n "__fish_x_using_subcommand install" -l reproducible-artifact -d complete -c x -n "__fish_x_using_subcommand install" -l set -d 'override options in bootstrap.toml' -r -f complete -c x -n "__fish_x_using_subcommand install" -l ci -d 'Make bootstrap to behave as it\'s running on the CI environment or not' -r -f -a "{true\t'',false\t''}" complete -c x -n "__fish_x_using_subcommand install" -s v -l verbose -d 'use verbose output (-vv for very verbose)' +complete -c x -n "__fish_x_using_subcommand install" -s q -l quiet -d 'use quiet output' complete -c x -n "__fish_x_using_subcommand install" -s i -l incremental -d 'use incremental compilation' complete -c x -n "__fish_x_using_subcommand install" -l include-default-paths -d 'include default paths in addition to the provided ones' complete -c x -n "__fish_x_using_subcommand install" -l dry-run -d 'dry run; don\'t build anything' @@ -729,6 +746,7 @@ complete -c x -n "__fish_x_using_subcommand run" -l reproducible-artifact -d 'Ad complete -c x -n "__fish_x_using_subcommand run" -l set -d 'override options in bootstrap.toml' -r -f complete -c x -n "__fish_x_using_subcommand run" -l ci -d 'Make bootstrap to behave as it\'s running on the CI environment or not' -r -f -a "{true\t'',false\t''}" complete -c x -n "__fish_x_using_subcommand run" -s v -l verbose -d 'use verbose output (-vv for very verbose)' +complete -c x -n "__fish_x_using_subcommand run" -s q -l quiet -d 'use quiet output' complete -c x -n "__fish_x_using_subcommand run" -s i -l incremental -d 'use incremental compilation' complete -c x -n "__fish_x_using_subcommand run" -l include-default-paths -d 'include default paths in addition to the provided ones' complete -c x -n "__fish_x_using_subcommand run" -l dry-run -d 'dry run; don\'t build anything' @@ -765,6 +783,7 @@ complete -c x -n "__fish_x_using_subcommand r" -l reproducible-artifact -d 'Addi complete -c x -n "__fish_x_using_subcommand r" -l set -d 'override options in bootstrap.toml' -r -f complete -c x -n "__fish_x_using_subcommand r" -l ci -d 'Make bootstrap to behave as it\'s running on the CI environment or not' -r -f -a "{true\t'',false\t''}" complete -c x -n "__fish_x_using_subcommand r" -s v -l verbose -d 'use verbose output (-vv for very verbose)' +complete -c x -n "__fish_x_using_subcommand r" -s q -l quiet -d 'use quiet output' complete -c x -n "__fish_x_using_subcommand r" -s i -l incremental -d 'use incremental compilation' complete -c x -n "__fish_x_using_subcommand r" -l include-default-paths -d 'include default paths in addition to the provided ones' complete -c x -n "__fish_x_using_subcommand r" -l dry-run -d 'dry run; don\'t build anything' @@ -800,6 +819,7 @@ complete -c x -n "__fish_x_using_subcommand setup" -l reproducible-artifact -d ' complete -c x -n "__fish_x_using_subcommand setup" -l set -d 'override options in bootstrap.toml' -r -f complete -c x -n "__fish_x_using_subcommand setup" -l ci -d 'Make bootstrap to behave as it\'s running on the CI environment or not' -r -f -a "{true\t'',false\t''}" complete -c x -n "__fish_x_using_subcommand setup" -s v -l verbose -d 'use verbose output (-vv for very verbose)' +complete -c x -n "__fish_x_using_subcommand setup" -s q -l quiet -d 'use quiet output' complete -c x -n "__fish_x_using_subcommand setup" -s i -l incremental -d 'use incremental compilation' complete -c x -n "__fish_x_using_subcommand setup" -l include-default-paths -d 'include default paths in addition to the provided ones' complete -c x -n "__fish_x_using_subcommand setup" -l dry-run -d 'dry run; don\'t build anything' @@ -837,6 +857,7 @@ complete -c x -n "__fish_x_using_subcommand vendor" -l set -d 'override options complete -c x -n "__fish_x_using_subcommand vendor" -l ci -d 'Make bootstrap to behave as it\'s running on the CI environment or not' -r -f -a "{true\t'',false\t''}" complete -c x -n "__fish_x_using_subcommand vendor" -l versioned-dirs -d 'Always include version in subdir name' complete -c x -n "__fish_x_using_subcommand vendor" -s v -l verbose -d 'use verbose output (-vv for very verbose)' +complete -c x -n "__fish_x_using_subcommand vendor" -s q -l quiet -d 'use quiet output' complete -c x -n "__fish_x_using_subcommand vendor" -s i -l incremental -d 'use incremental compilation' complete -c x -n "__fish_x_using_subcommand vendor" -l include-default-paths -d 'include default paths in addition to the provided ones' complete -c x -n "__fish_x_using_subcommand vendor" -l dry-run -d 'dry run; don\'t build anything' @@ -872,6 +893,7 @@ complete -c x -n "__fish_x_using_subcommand perf; and not __fish_seen_subcommand complete -c x -n "__fish_x_using_subcommand perf; and not __fish_seen_subcommand_from eprintln samply cachegrind benchmark compare" -l set -d 'override options in bootstrap.toml' -r -f complete -c x -n "__fish_x_using_subcommand perf; and not __fish_seen_subcommand_from eprintln samply cachegrind benchmark compare" -l ci -d 'Make bootstrap to behave as it\'s running on the CI environment or not' -r -f -a "{true\t'',false\t''}" complete -c x -n "__fish_x_using_subcommand perf; and not __fish_seen_subcommand_from eprintln samply cachegrind benchmark compare" -s v -l verbose -d 'use verbose output (-vv for very verbose)' +complete -c x -n "__fish_x_using_subcommand perf; and not __fish_seen_subcommand_from eprintln samply cachegrind benchmark compare" -s q -l quiet -d 'use quiet output' complete -c x -n "__fish_x_using_subcommand perf; and not __fish_seen_subcommand_from eprintln samply cachegrind benchmark compare" -s i -l incremental -d 'use incremental compilation' complete -c x -n "__fish_x_using_subcommand perf; and not __fish_seen_subcommand_from eprintln samply cachegrind benchmark compare" -l include-default-paths -d 'include default paths in addition to the provided ones' complete -c x -n "__fish_x_using_subcommand perf; and not __fish_seen_subcommand_from eprintln samply cachegrind benchmark compare" -l dry-run -d 'dry run; don\'t build anything' @@ -915,6 +937,7 @@ complete -c x -n "__fish_x_using_subcommand perf; and __fish_seen_subcommand_fro complete -c x -n "__fish_x_using_subcommand perf; and __fish_seen_subcommand_from eprintln" -l set -d 'override options in bootstrap.toml' -r -f complete -c x -n "__fish_x_using_subcommand perf; and __fish_seen_subcommand_from eprintln" -l ci -d 'Make bootstrap to behave as it\'s running on the CI environment or not' -r -f -a "{true\t'',false\t''}" complete -c x -n "__fish_x_using_subcommand perf; and __fish_seen_subcommand_from eprintln" -s v -l verbose -d 'use verbose output (-vv for very verbose)' +complete -c x -n "__fish_x_using_subcommand perf; and __fish_seen_subcommand_from eprintln" -s q -l quiet -d 'use quiet output' complete -c x -n "__fish_x_using_subcommand perf; and __fish_seen_subcommand_from eprintln" -s i -l incremental -d 'use incremental compilation' complete -c x -n "__fish_x_using_subcommand perf; and __fish_seen_subcommand_from eprintln" -l include-default-paths -d 'include default paths in addition to the provided ones' complete -c x -n "__fish_x_using_subcommand perf; and __fish_seen_subcommand_from eprintln" -l dry-run -d 'dry run; don\'t build anything' @@ -953,6 +976,7 @@ complete -c x -n "__fish_x_using_subcommand perf; and __fish_seen_subcommand_fro complete -c x -n "__fish_x_using_subcommand perf; and __fish_seen_subcommand_from samply" -l set -d 'override options in bootstrap.toml' -r -f complete -c x -n "__fish_x_using_subcommand perf; and __fish_seen_subcommand_from samply" -l ci -d 'Make bootstrap to behave as it\'s running on the CI environment or not' -r -f -a "{true\t'',false\t''}" complete -c x -n "__fish_x_using_subcommand perf; and __fish_seen_subcommand_from samply" -s v -l verbose -d 'use verbose output (-vv for very verbose)' +complete -c x -n "__fish_x_using_subcommand perf; and __fish_seen_subcommand_from samply" -s q -l quiet -d 'use quiet output' complete -c x -n "__fish_x_using_subcommand perf; and __fish_seen_subcommand_from samply" -s i -l incremental -d 'use incremental compilation' complete -c x -n "__fish_x_using_subcommand perf; and __fish_seen_subcommand_from samply" -l include-default-paths -d 'include default paths in addition to the provided ones' complete -c x -n "__fish_x_using_subcommand perf; and __fish_seen_subcommand_from samply" -l dry-run -d 'dry run; don\'t build anything' @@ -991,6 +1015,7 @@ complete -c x -n "__fish_x_using_subcommand perf; and __fish_seen_subcommand_fro complete -c x -n "__fish_x_using_subcommand perf; and __fish_seen_subcommand_from cachegrind" -l set -d 'override options in bootstrap.toml' -r -f complete -c x -n "__fish_x_using_subcommand perf; and __fish_seen_subcommand_from cachegrind" -l ci -d 'Make bootstrap to behave as it\'s running on the CI environment or not' -r -f -a "{true\t'',false\t''}" complete -c x -n "__fish_x_using_subcommand perf; and __fish_seen_subcommand_from cachegrind" -s v -l verbose -d 'use verbose output (-vv for very verbose)' +complete -c x -n "__fish_x_using_subcommand perf; and __fish_seen_subcommand_from cachegrind" -s q -l quiet -d 'use quiet output' complete -c x -n "__fish_x_using_subcommand perf; and __fish_seen_subcommand_from cachegrind" -s i -l incremental -d 'use incremental compilation' complete -c x -n "__fish_x_using_subcommand perf; and __fish_seen_subcommand_from cachegrind" -l include-default-paths -d 'include default paths in addition to the provided ones' complete -c x -n "__fish_x_using_subcommand perf; and __fish_seen_subcommand_from cachegrind" -l dry-run -d 'dry run; don\'t build anything' @@ -1029,6 +1054,7 @@ complete -c x -n "__fish_x_using_subcommand perf; and __fish_seen_subcommand_fro complete -c x -n "__fish_x_using_subcommand perf; and __fish_seen_subcommand_from benchmark" -l set -d 'override options in bootstrap.toml' -r -f complete -c x -n "__fish_x_using_subcommand perf; and __fish_seen_subcommand_from benchmark" -l ci -d 'Make bootstrap to behave as it\'s running on the CI environment or not' -r -f -a "{true\t'',false\t''}" complete -c x -n "__fish_x_using_subcommand perf; and __fish_seen_subcommand_from benchmark" -s v -l verbose -d 'use verbose output (-vv for very verbose)' +complete -c x -n "__fish_x_using_subcommand perf; and __fish_seen_subcommand_from benchmark" -s q -l quiet -d 'use quiet output' complete -c x -n "__fish_x_using_subcommand perf; and __fish_seen_subcommand_from benchmark" -s i -l incremental -d 'use incremental compilation' complete -c x -n "__fish_x_using_subcommand perf; and __fish_seen_subcommand_from benchmark" -l include-default-paths -d 'include default paths in addition to the provided ones' complete -c x -n "__fish_x_using_subcommand perf; and __fish_seen_subcommand_from benchmark" -l dry-run -d 'dry run; don\'t build anything' @@ -1064,6 +1090,7 @@ complete -c x -n "__fish_x_using_subcommand perf; and __fish_seen_subcommand_fro complete -c x -n "__fish_x_using_subcommand perf; and __fish_seen_subcommand_from compare" -l set -d 'override options in bootstrap.toml' -r -f complete -c x -n "__fish_x_using_subcommand perf; and __fish_seen_subcommand_from compare" -l ci -d 'Make bootstrap to behave as it\'s running on the CI environment or not' -r -f -a "{true\t'',false\t''}" complete -c x -n "__fish_x_using_subcommand perf; and __fish_seen_subcommand_from compare" -s v -l verbose -d 'use verbose output (-vv for very verbose)' +complete -c x -n "__fish_x_using_subcommand perf; and __fish_seen_subcommand_from compare" -s q -l quiet -d 'use quiet output' complete -c x -n "__fish_x_using_subcommand perf; and __fish_seen_subcommand_from compare" -s i -l incremental -d 'use incremental compilation' complete -c x -n "__fish_x_using_subcommand perf; and __fish_seen_subcommand_from compare" -l include-default-paths -d 'include default paths in addition to the provided ones' complete -c x -n "__fish_x_using_subcommand perf; and __fish_seen_subcommand_from compare" -l dry-run -d 'dry run; don\'t build anything' diff --git a/src/etc/completions/x.ps1 b/src/etc/completions/x.ps1 index e99ef27c2abca..e03994f4acaf0 100644 --- a/src/etc/completions/x.ps1 +++ b/src/etc/completions/x.ps1 @@ -46,6 +46,8 @@ Register-ArgumentCompleter -Native -CommandName 'x' -ScriptBlock { [CompletionResult]::new('--ci', '--ci', [CompletionResultType]::ParameterName, 'Make bootstrap to behave as it''s running on the CI environment or not') [CompletionResult]::new('-v', '-v', [CompletionResultType]::ParameterName, 'use verbose output (-vv for very verbose)') [CompletionResult]::new('--verbose', '--verbose', [CompletionResultType]::ParameterName, 'use verbose output (-vv for very verbose)') + [CompletionResult]::new('-q', '-q', [CompletionResultType]::ParameterName, 'use quiet output') + [CompletionResult]::new('--quiet', '--quiet', [CompletionResultType]::ParameterName, 'use quiet output') [CompletionResult]::new('-i', '-i', [CompletionResultType]::ParameterName, 'use incremental compilation') [CompletionResult]::new('--incremental', '--incremental', [CompletionResultType]::ParameterName, 'use incremental compilation') [CompletionResult]::new('--include-default-paths', '--include-default-paths', [CompletionResultType]::ParameterName, 'include default paths in addition to the provided ones') @@ -110,6 +112,8 @@ Register-ArgumentCompleter -Native -CommandName 'x' -ScriptBlock { [CompletionResult]::new('--timings', '--timings', [CompletionResultType]::ParameterName, 'Pass `--timings` to Cargo to get crate build timings') [CompletionResult]::new('-v', '-v', [CompletionResultType]::ParameterName, 'use verbose output (-vv for very verbose)') [CompletionResult]::new('--verbose', '--verbose', [CompletionResultType]::ParameterName, 'use verbose output (-vv for very verbose)') + [CompletionResult]::new('-q', '-q', [CompletionResultType]::ParameterName, 'use quiet output') + [CompletionResult]::new('--quiet', '--quiet', [CompletionResultType]::ParameterName, 'use quiet output') [CompletionResult]::new('-i', '-i', [CompletionResultType]::ParameterName, 'use incremental compilation') [CompletionResult]::new('--incremental', '--incremental', [CompletionResultType]::ParameterName, 'use incremental compilation') [CompletionResult]::new('--include-default-paths', '--include-default-paths', [CompletionResultType]::ParameterName, 'include default paths in addition to the provided ones') @@ -153,6 +157,8 @@ Register-ArgumentCompleter -Native -CommandName 'x' -ScriptBlock { [CompletionResult]::new('--timings', '--timings', [CompletionResultType]::ParameterName, 'Pass `--timings` to Cargo to get crate build timings') [CompletionResult]::new('-v', '-v', [CompletionResultType]::ParameterName, 'use verbose output (-vv for very verbose)') [CompletionResult]::new('--verbose', '--verbose', [CompletionResultType]::ParameterName, 'use verbose output (-vv for very verbose)') + [CompletionResult]::new('-q', '-q', [CompletionResultType]::ParameterName, 'use quiet output') + [CompletionResult]::new('--quiet', '--quiet', [CompletionResultType]::ParameterName, 'use quiet output') [CompletionResult]::new('-i', '-i', [CompletionResultType]::ParameterName, 'use incremental compilation') [CompletionResult]::new('--incremental', '--incremental', [CompletionResultType]::ParameterName, 'use incremental compilation') [CompletionResult]::new('--include-default-paths', '--include-default-paths', [CompletionResultType]::ParameterName, 'include default paths in addition to the provided ones') @@ -197,6 +203,8 @@ Register-ArgumentCompleter -Native -CommandName 'x' -ScriptBlock { [CompletionResult]::new('--timings', '--timings', [CompletionResultType]::ParameterName, 'Pass `--timings` to Cargo to get crate build timings') [CompletionResult]::new('-v', '-v', [CompletionResultType]::ParameterName, 'use verbose output (-vv for very verbose)') [CompletionResult]::new('--verbose', '--verbose', [CompletionResultType]::ParameterName, 'use verbose output (-vv for very verbose)') + [CompletionResult]::new('-q', '-q', [CompletionResultType]::ParameterName, 'use quiet output') + [CompletionResult]::new('--quiet', '--quiet', [CompletionResultType]::ParameterName, 'use quiet output') [CompletionResult]::new('-i', '-i', [CompletionResultType]::ParameterName, 'use incremental compilation') [CompletionResult]::new('--incremental', '--incremental', [CompletionResultType]::ParameterName, 'use incremental compilation') [CompletionResult]::new('--include-default-paths', '--include-default-paths', [CompletionResultType]::ParameterName, 'include default paths in addition to the provided ones') @@ -241,6 +249,8 @@ Register-ArgumentCompleter -Native -CommandName 'x' -ScriptBlock { [CompletionResult]::new('--timings', '--timings', [CompletionResultType]::ParameterName, 'Pass `--timings` to Cargo to get crate build timings') [CompletionResult]::new('-v', '-v', [CompletionResultType]::ParameterName, 'use verbose output (-vv for very verbose)') [CompletionResult]::new('--verbose', '--verbose', [CompletionResultType]::ParameterName, 'use verbose output (-vv for very verbose)') + [CompletionResult]::new('-q', '-q', [CompletionResultType]::ParameterName, 'use quiet output') + [CompletionResult]::new('--quiet', '--quiet', [CompletionResultType]::ParameterName, 'use quiet output') [CompletionResult]::new('-i', '-i', [CompletionResultType]::ParameterName, 'use incremental compilation') [CompletionResult]::new('--incremental', '--incremental', [CompletionResultType]::ParameterName, 'use incremental compilation') [CompletionResult]::new('--include-default-paths', '--include-default-paths', [CompletionResultType]::ParameterName, 'include default paths in addition to the provided ones') @@ -290,6 +300,8 @@ Register-ArgumentCompleter -Native -CommandName 'x' -ScriptBlock { [CompletionResult]::new('--allow-staged', '--allow-staged', [CompletionResultType]::ParameterName, 'allow-staged') [CompletionResult]::new('-v', '-v', [CompletionResultType]::ParameterName, 'use verbose output (-vv for very verbose)') [CompletionResult]::new('--verbose', '--verbose', [CompletionResultType]::ParameterName, 'use verbose output (-vv for very verbose)') + [CompletionResult]::new('-q', '-q', [CompletionResultType]::ParameterName, 'use quiet output') + [CompletionResult]::new('--quiet', '--quiet', [CompletionResultType]::ParameterName, 'use quiet output') [CompletionResult]::new('-i', '-i', [CompletionResultType]::ParameterName, 'use incremental compilation') [CompletionResult]::new('--incremental', '--incremental', [CompletionResultType]::ParameterName, 'use incremental compilation') [CompletionResult]::new('--include-default-paths', '--include-default-paths', [CompletionResultType]::ParameterName, 'include default paths in addition to the provided ones') @@ -332,6 +344,8 @@ Register-ArgumentCompleter -Native -CommandName 'x' -ScriptBlock { [CompletionResult]::new('--ci', '--ci', [CompletionResultType]::ParameterName, 'Make bootstrap to behave as it''s running on the CI environment or not') [CompletionResult]::new('-v', '-v', [CompletionResultType]::ParameterName, 'use verbose output (-vv for very verbose)') [CompletionResult]::new('--verbose', '--verbose', [CompletionResultType]::ParameterName, 'use verbose output (-vv for very verbose)') + [CompletionResult]::new('-q', '-q', [CompletionResultType]::ParameterName, 'use quiet output') + [CompletionResult]::new('--quiet', '--quiet', [CompletionResultType]::ParameterName, 'use quiet output') [CompletionResult]::new('-i', '-i', [CompletionResultType]::ParameterName, 'use incremental compilation') [CompletionResult]::new('--incremental', '--incremental', [CompletionResultType]::ParameterName, 'use incremental compilation') [CompletionResult]::new('--include-default-paths', '--include-default-paths', [CompletionResultType]::ParameterName, 'include default paths in addition to the provided ones') @@ -376,6 +390,8 @@ Register-ArgumentCompleter -Native -CommandName 'x' -ScriptBlock { [CompletionResult]::new('--all', '--all', [CompletionResultType]::ParameterName, 'apply to all appropriate files, not just those that have been modified') [CompletionResult]::new('-v', '-v', [CompletionResultType]::ParameterName, 'use verbose output (-vv for very verbose)') [CompletionResult]::new('--verbose', '--verbose', [CompletionResultType]::ParameterName, 'use verbose output (-vv for very verbose)') + [CompletionResult]::new('-q', '-q', [CompletionResultType]::ParameterName, 'use quiet output') + [CompletionResult]::new('--quiet', '--quiet', [CompletionResultType]::ParameterName, 'use quiet output') [CompletionResult]::new('-i', '-i', [CompletionResultType]::ParameterName, 'use incremental compilation') [CompletionResult]::new('--incremental', '--incremental', [CompletionResultType]::ParameterName, 'use incremental compilation') [CompletionResult]::new('--include-default-paths', '--include-default-paths', [CompletionResultType]::ParameterName, 'include default paths in addition to the provided ones') @@ -420,6 +436,8 @@ Register-ArgumentCompleter -Native -CommandName 'x' -ScriptBlock { [CompletionResult]::new('--json', '--json', [CompletionResultType]::ParameterName, 'render the documentation in JSON format in addition to the usual HTML format') [CompletionResult]::new('-v', '-v', [CompletionResultType]::ParameterName, 'use verbose output (-vv for very verbose)') [CompletionResult]::new('--verbose', '--verbose', [CompletionResultType]::ParameterName, 'use verbose output (-vv for very verbose)') + [CompletionResult]::new('-q', '-q', [CompletionResultType]::ParameterName, 'use quiet output') + [CompletionResult]::new('--quiet', '--quiet', [CompletionResultType]::ParameterName, 'use quiet output') [CompletionResult]::new('-i', '-i', [CompletionResultType]::ParameterName, 'use incremental compilation') [CompletionResult]::new('--incremental', '--incremental', [CompletionResultType]::ParameterName, 'use incremental compilation') [CompletionResult]::new('--include-default-paths', '--include-default-paths', [CompletionResultType]::ParameterName, 'include default paths in addition to the provided ones') @@ -464,6 +482,8 @@ Register-ArgumentCompleter -Native -CommandName 'x' -ScriptBlock { [CompletionResult]::new('--json', '--json', [CompletionResultType]::ParameterName, 'render the documentation in JSON format in addition to the usual HTML format') [CompletionResult]::new('-v', '-v', [CompletionResultType]::ParameterName, 'use verbose output (-vv for very verbose)') [CompletionResult]::new('--verbose', '--verbose', [CompletionResultType]::ParameterName, 'use verbose output (-vv for very verbose)') + [CompletionResult]::new('-q', '-q', [CompletionResultType]::ParameterName, 'use quiet output') + [CompletionResult]::new('--quiet', '--quiet', [CompletionResultType]::ParameterName, 'use quiet output') [CompletionResult]::new('-i', '-i', [CompletionResultType]::ParameterName, 'use incremental compilation') [CompletionResult]::new('--incremental', '--incremental', [CompletionResultType]::ParameterName, 'use incremental compilation') [CompletionResult]::new('--include-default-paths', '--include-default-paths', [CompletionResultType]::ParameterName, 'include default paths in addition to the provided ones') @@ -525,6 +545,8 @@ Register-ArgumentCompleter -Native -CommandName 'x' -ScriptBlock { [CompletionResult]::new('--no-doc', '--no-doc', [CompletionResultType]::ParameterName, 'Deprecated. Use `--all-targets` or `--tests` instead') [CompletionResult]::new('-v', '-v', [CompletionResultType]::ParameterName, 'use verbose output (-vv for very verbose)') [CompletionResult]::new('--verbose', '--verbose', [CompletionResultType]::ParameterName, 'use verbose output (-vv for very verbose)') + [CompletionResult]::new('-q', '-q', [CompletionResultType]::ParameterName, 'use quiet output') + [CompletionResult]::new('--quiet', '--quiet', [CompletionResultType]::ParameterName, 'use quiet output') [CompletionResult]::new('-i', '-i', [CompletionResultType]::ParameterName, 'use incremental compilation') [CompletionResult]::new('--incremental', '--incremental', [CompletionResultType]::ParameterName, 'use incremental compilation') [CompletionResult]::new('--include-default-paths', '--include-default-paths', [CompletionResultType]::ParameterName, 'include default paths in addition to the provided ones') @@ -586,6 +608,8 @@ Register-ArgumentCompleter -Native -CommandName 'x' -ScriptBlock { [CompletionResult]::new('--no-doc', '--no-doc', [CompletionResultType]::ParameterName, 'Deprecated. Use `--all-targets` or `--tests` instead') [CompletionResult]::new('-v', '-v', [CompletionResultType]::ParameterName, 'use verbose output (-vv for very verbose)') [CompletionResult]::new('--verbose', '--verbose', [CompletionResultType]::ParameterName, 'use verbose output (-vv for very verbose)') + [CompletionResult]::new('-q', '-q', [CompletionResultType]::ParameterName, 'use quiet output') + [CompletionResult]::new('--quiet', '--quiet', [CompletionResultType]::ParameterName, 'use quiet output') [CompletionResult]::new('-i', '-i', [CompletionResultType]::ParameterName, 'use incremental compilation') [CompletionResult]::new('--incremental', '--incremental', [CompletionResultType]::ParameterName, 'use incremental compilation') [CompletionResult]::new('--include-default-paths', '--include-default-paths', [CompletionResultType]::ParameterName, 'include default paths in addition to the provided ones') @@ -634,6 +658,8 @@ Register-ArgumentCompleter -Native -CommandName 'x' -ScriptBlock { [CompletionResult]::new('--no-doc', '--no-doc', [CompletionResultType]::ParameterName, 'Deprecated. Use `--all-targets` or `--tests` instead') [CompletionResult]::new('-v', '-v', [CompletionResultType]::ParameterName, 'use verbose output (-vv for very verbose)') [CompletionResult]::new('--verbose', '--verbose', [CompletionResultType]::ParameterName, 'use verbose output (-vv for very verbose)') + [CompletionResult]::new('-q', '-q', [CompletionResultType]::ParameterName, 'use quiet output') + [CompletionResult]::new('--quiet', '--quiet', [CompletionResultType]::ParameterName, 'use quiet output') [CompletionResult]::new('-i', '-i', [CompletionResultType]::ParameterName, 'use incremental compilation') [CompletionResult]::new('--incremental', '--incremental', [CompletionResultType]::ParameterName, 'use incremental compilation') [CompletionResult]::new('--include-default-paths', '--include-default-paths', [CompletionResultType]::ParameterName, 'include default paths in addition to the provided ones') @@ -677,6 +703,8 @@ Register-ArgumentCompleter -Native -CommandName 'x' -ScriptBlock { [CompletionResult]::new('--ci', '--ci', [CompletionResultType]::ParameterName, 'Make bootstrap to behave as it''s running on the CI environment or not') [CompletionResult]::new('-v', '-v', [CompletionResultType]::ParameterName, 'use verbose output (-vv for very verbose)') [CompletionResult]::new('--verbose', '--verbose', [CompletionResultType]::ParameterName, 'use verbose output (-vv for very verbose)') + [CompletionResult]::new('-q', '-q', [CompletionResultType]::ParameterName, 'use quiet output') + [CompletionResult]::new('--quiet', '--quiet', [CompletionResultType]::ParameterName, 'use quiet output') [CompletionResult]::new('-i', '-i', [CompletionResultType]::ParameterName, 'use incremental compilation') [CompletionResult]::new('--incremental', '--incremental', [CompletionResultType]::ParameterName, 'use incremental compilation') [CompletionResult]::new('--include-default-paths', '--include-default-paths', [CompletionResultType]::ParameterName, 'include default paths in addition to the provided ones') @@ -720,6 +748,8 @@ Register-ArgumentCompleter -Native -CommandName 'x' -ScriptBlock { [CompletionResult]::new('--all', '--all', [CompletionResultType]::ParameterName, 'Clean the entire build directory (not used by default)') [CompletionResult]::new('-v', '-v', [CompletionResultType]::ParameterName, 'use verbose output (-vv for very verbose)') [CompletionResult]::new('--verbose', '--verbose', [CompletionResultType]::ParameterName, 'use verbose output (-vv for very verbose)') + [CompletionResult]::new('-q', '-q', [CompletionResultType]::ParameterName, 'use quiet output') + [CompletionResult]::new('--quiet', '--quiet', [CompletionResultType]::ParameterName, 'use quiet output') [CompletionResult]::new('-i', '-i', [CompletionResultType]::ParameterName, 'use incremental compilation') [CompletionResult]::new('--incremental', '--incremental', [CompletionResultType]::ParameterName, 'use incremental compilation') [CompletionResult]::new('--include-default-paths', '--include-default-paths', [CompletionResultType]::ParameterName, 'include default paths in addition to the provided ones') @@ -762,6 +792,8 @@ Register-ArgumentCompleter -Native -CommandName 'x' -ScriptBlock { [CompletionResult]::new('--ci', '--ci', [CompletionResultType]::ParameterName, 'Make bootstrap to behave as it''s running on the CI environment or not') [CompletionResult]::new('-v', '-v', [CompletionResultType]::ParameterName, 'use verbose output (-vv for very verbose)') [CompletionResult]::new('--verbose', '--verbose', [CompletionResultType]::ParameterName, 'use verbose output (-vv for very verbose)') + [CompletionResult]::new('-q', '-q', [CompletionResultType]::ParameterName, 'use quiet output') + [CompletionResult]::new('--quiet', '--quiet', [CompletionResultType]::ParameterName, 'use quiet output') [CompletionResult]::new('-i', '-i', [CompletionResultType]::ParameterName, 'use incremental compilation') [CompletionResult]::new('--incremental', '--incremental', [CompletionResultType]::ParameterName, 'use incremental compilation') [CompletionResult]::new('--include-default-paths', '--include-default-paths', [CompletionResultType]::ParameterName, 'include default paths in addition to the provided ones') @@ -804,6 +836,8 @@ Register-ArgumentCompleter -Native -CommandName 'x' -ScriptBlock { [CompletionResult]::new('--ci', '--ci', [CompletionResultType]::ParameterName, 'Make bootstrap to behave as it''s running on the CI environment or not') [CompletionResult]::new('-v', '-v', [CompletionResultType]::ParameterName, 'use verbose output (-vv for very verbose)') [CompletionResult]::new('--verbose', '--verbose', [CompletionResultType]::ParameterName, 'use verbose output (-vv for very verbose)') + [CompletionResult]::new('-q', '-q', [CompletionResultType]::ParameterName, 'use quiet output') + [CompletionResult]::new('--quiet', '--quiet', [CompletionResultType]::ParameterName, 'use quiet output') [CompletionResult]::new('-i', '-i', [CompletionResultType]::ParameterName, 'use incremental compilation') [CompletionResult]::new('--incremental', '--incremental', [CompletionResultType]::ParameterName, 'use incremental compilation') [CompletionResult]::new('--include-default-paths', '--include-default-paths', [CompletionResultType]::ParameterName, 'include default paths in addition to the provided ones') @@ -847,6 +881,8 @@ Register-ArgumentCompleter -Native -CommandName 'x' -ScriptBlock { [CompletionResult]::new('--ci', '--ci', [CompletionResultType]::ParameterName, 'Make bootstrap to behave as it''s running on the CI environment or not') [CompletionResult]::new('-v', '-v', [CompletionResultType]::ParameterName, 'use verbose output (-vv for very verbose)') [CompletionResult]::new('--verbose', '--verbose', [CompletionResultType]::ParameterName, 'use verbose output (-vv for very verbose)') + [CompletionResult]::new('-q', '-q', [CompletionResultType]::ParameterName, 'use quiet output') + [CompletionResult]::new('--quiet', '--quiet', [CompletionResultType]::ParameterName, 'use quiet output') [CompletionResult]::new('-i', '-i', [CompletionResultType]::ParameterName, 'use incremental compilation') [CompletionResult]::new('--incremental', '--incremental', [CompletionResultType]::ParameterName, 'use incremental compilation') [CompletionResult]::new('--include-default-paths', '--include-default-paths', [CompletionResultType]::ParameterName, 'include default paths in addition to the provided ones') @@ -890,6 +926,8 @@ Register-ArgumentCompleter -Native -CommandName 'x' -ScriptBlock { [CompletionResult]::new('--ci', '--ci', [CompletionResultType]::ParameterName, 'Make bootstrap to behave as it''s running on the CI environment or not') [CompletionResult]::new('-v', '-v', [CompletionResultType]::ParameterName, 'use verbose output (-vv for very verbose)') [CompletionResult]::new('--verbose', '--verbose', [CompletionResultType]::ParameterName, 'use verbose output (-vv for very verbose)') + [CompletionResult]::new('-q', '-q', [CompletionResultType]::ParameterName, 'use quiet output') + [CompletionResult]::new('--quiet', '--quiet', [CompletionResultType]::ParameterName, 'use quiet output') [CompletionResult]::new('-i', '-i', [CompletionResultType]::ParameterName, 'use incremental compilation') [CompletionResult]::new('--incremental', '--incremental', [CompletionResultType]::ParameterName, 'use incremental compilation') [CompletionResult]::new('--include-default-paths', '--include-default-paths', [CompletionResultType]::ParameterName, 'include default paths in addition to the provided ones') @@ -932,6 +970,8 @@ Register-ArgumentCompleter -Native -CommandName 'x' -ScriptBlock { [CompletionResult]::new('--ci', '--ci', [CompletionResultType]::ParameterName, 'Make bootstrap to behave as it''s running on the CI environment or not') [CompletionResult]::new('-v', '-v', [CompletionResultType]::ParameterName, 'use verbose output (-vv for very verbose)') [CompletionResult]::new('--verbose', '--verbose', [CompletionResultType]::ParameterName, 'use verbose output (-vv for very verbose)') + [CompletionResult]::new('-q', '-q', [CompletionResultType]::ParameterName, 'use quiet output') + [CompletionResult]::new('--quiet', '--quiet', [CompletionResultType]::ParameterName, 'use quiet output') [CompletionResult]::new('-i', '-i', [CompletionResultType]::ParameterName, 'use incremental compilation') [CompletionResult]::new('--incremental', '--incremental', [CompletionResultType]::ParameterName, 'use incremental compilation') [CompletionResult]::new('--include-default-paths', '--include-default-paths', [CompletionResultType]::ParameterName, 'include default paths in addition to the provided ones') @@ -976,6 +1016,8 @@ Register-ArgumentCompleter -Native -CommandName 'x' -ScriptBlock { [CompletionResult]::new('--versioned-dirs', '--versioned-dirs', [CompletionResultType]::ParameterName, 'Always include version in subdir name') [CompletionResult]::new('-v', '-v', [CompletionResultType]::ParameterName, 'use verbose output (-vv for very verbose)') [CompletionResult]::new('--verbose', '--verbose', [CompletionResultType]::ParameterName, 'use verbose output (-vv for very verbose)') + [CompletionResult]::new('-q', '-q', [CompletionResultType]::ParameterName, 'use quiet output') + [CompletionResult]::new('--quiet', '--quiet', [CompletionResultType]::ParameterName, 'use quiet output') [CompletionResult]::new('-i', '-i', [CompletionResultType]::ParameterName, 'use incremental compilation') [CompletionResult]::new('--incremental', '--incremental', [CompletionResultType]::ParameterName, 'use incremental compilation') [CompletionResult]::new('--include-default-paths', '--include-default-paths', [CompletionResultType]::ParameterName, 'include default paths in addition to the provided ones') @@ -1018,6 +1060,8 @@ Register-ArgumentCompleter -Native -CommandName 'x' -ScriptBlock { [CompletionResult]::new('--ci', '--ci', [CompletionResultType]::ParameterName, 'Make bootstrap to behave as it''s running on the CI environment or not') [CompletionResult]::new('-v', '-v', [CompletionResultType]::ParameterName, 'use verbose output (-vv for very verbose)') [CompletionResult]::new('--verbose', '--verbose', [CompletionResultType]::ParameterName, 'use verbose output (-vv for very verbose)') + [CompletionResult]::new('-q', '-q', [CompletionResultType]::ParameterName, 'use quiet output') + [CompletionResult]::new('--quiet', '--quiet', [CompletionResultType]::ParameterName, 'use quiet output') [CompletionResult]::new('-i', '-i', [CompletionResultType]::ParameterName, 'use incremental compilation') [CompletionResult]::new('--incremental', '--incremental', [CompletionResultType]::ParameterName, 'use incremental compilation') [CompletionResult]::new('--include-default-paths', '--include-default-paths', [CompletionResultType]::ParameterName, 'include default paths in addition to the provided ones') @@ -1068,6 +1112,8 @@ Register-ArgumentCompleter -Native -CommandName 'x' -ScriptBlock { [CompletionResult]::new('--ci', '--ci', [CompletionResultType]::ParameterName, 'Make bootstrap to behave as it''s running on the CI environment or not') [CompletionResult]::new('-v', '-v', [CompletionResultType]::ParameterName, 'use verbose output (-vv for very verbose)') [CompletionResult]::new('--verbose', '--verbose', [CompletionResultType]::ParameterName, 'use verbose output (-vv for very verbose)') + [CompletionResult]::new('-q', '-q', [CompletionResultType]::ParameterName, 'use quiet output') + [CompletionResult]::new('--quiet', '--quiet', [CompletionResultType]::ParameterName, 'use quiet output') [CompletionResult]::new('-i', '-i', [CompletionResultType]::ParameterName, 'use incremental compilation') [CompletionResult]::new('--incremental', '--incremental', [CompletionResultType]::ParameterName, 'use incremental compilation') [CompletionResult]::new('--include-default-paths', '--include-default-paths', [CompletionResultType]::ParameterName, 'include default paths in addition to the provided ones') @@ -1113,6 +1159,8 @@ Register-ArgumentCompleter -Native -CommandName 'x' -ScriptBlock { [CompletionResult]::new('--ci', '--ci', [CompletionResultType]::ParameterName, 'Make bootstrap to behave as it''s running on the CI environment or not') [CompletionResult]::new('-v', '-v', [CompletionResultType]::ParameterName, 'use verbose output (-vv for very verbose)') [CompletionResult]::new('--verbose', '--verbose', [CompletionResultType]::ParameterName, 'use verbose output (-vv for very verbose)') + [CompletionResult]::new('-q', '-q', [CompletionResultType]::ParameterName, 'use quiet output') + [CompletionResult]::new('--quiet', '--quiet', [CompletionResultType]::ParameterName, 'use quiet output') [CompletionResult]::new('-i', '-i', [CompletionResultType]::ParameterName, 'use incremental compilation') [CompletionResult]::new('--incremental', '--incremental', [CompletionResultType]::ParameterName, 'use incremental compilation') [CompletionResult]::new('--include-default-paths', '--include-default-paths', [CompletionResultType]::ParameterName, 'include default paths in addition to the provided ones') @@ -1158,6 +1206,8 @@ Register-ArgumentCompleter -Native -CommandName 'x' -ScriptBlock { [CompletionResult]::new('--ci', '--ci', [CompletionResultType]::ParameterName, 'Make bootstrap to behave as it''s running on the CI environment or not') [CompletionResult]::new('-v', '-v', [CompletionResultType]::ParameterName, 'use verbose output (-vv for very verbose)') [CompletionResult]::new('--verbose', '--verbose', [CompletionResultType]::ParameterName, 'use verbose output (-vv for very verbose)') + [CompletionResult]::new('-q', '-q', [CompletionResultType]::ParameterName, 'use quiet output') + [CompletionResult]::new('--quiet', '--quiet', [CompletionResultType]::ParameterName, 'use quiet output') [CompletionResult]::new('-i', '-i', [CompletionResultType]::ParameterName, 'use incremental compilation') [CompletionResult]::new('--incremental', '--incremental', [CompletionResultType]::ParameterName, 'use incremental compilation') [CompletionResult]::new('--include-default-paths', '--include-default-paths', [CompletionResultType]::ParameterName, 'include default paths in addition to the provided ones') @@ -1203,6 +1253,8 @@ Register-ArgumentCompleter -Native -CommandName 'x' -ScriptBlock { [CompletionResult]::new('--ci', '--ci', [CompletionResultType]::ParameterName, 'Make bootstrap to behave as it''s running on the CI environment or not') [CompletionResult]::new('-v', '-v', [CompletionResultType]::ParameterName, 'use verbose output (-vv for very verbose)') [CompletionResult]::new('--verbose', '--verbose', [CompletionResultType]::ParameterName, 'use verbose output (-vv for very verbose)') + [CompletionResult]::new('-q', '-q', [CompletionResultType]::ParameterName, 'use quiet output') + [CompletionResult]::new('--quiet', '--quiet', [CompletionResultType]::ParameterName, 'use quiet output') [CompletionResult]::new('-i', '-i', [CompletionResultType]::ParameterName, 'use incremental compilation') [CompletionResult]::new('--incremental', '--incremental', [CompletionResultType]::ParameterName, 'use incremental compilation') [CompletionResult]::new('--include-default-paths', '--include-default-paths', [CompletionResultType]::ParameterName, 'include default paths in addition to the provided ones') @@ -1245,6 +1297,8 @@ Register-ArgumentCompleter -Native -CommandName 'x' -ScriptBlock { [CompletionResult]::new('--ci', '--ci', [CompletionResultType]::ParameterName, 'Make bootstrap to behave as it''s running on the CI environment or not') [CompletionResult]::new('-v', '-v', [CompletionResultType]::ParameterName, 'use verbose output (-vv for very verbose)') [CompletionResult]::new('--verbose', '--verbose', [CompletionResultType]::ParameterName, 'use verbose output (-vv for very verbose)') + [CompletionResult]::new('-q', '-q', [CompletionResultType]::ParameterName, 'use quiet output') + [CompletionResult]::new('--quiet', '--quiet', [CompletionResultType]::ParameterName, 'use quiet output') [CompletionResult]::new('-i', '-i', [CompletionResultType]::ParameterName, 'use incremental compilation') [CompletionResult]::new('--incremental', '--incremental', [CompletionResultType]::ParameterName, 'use incremental compilation') [CompletionResult]::new('--include-default-paths', '--include-default-paths', [CompletionResultType]::ParameterName, 'include default paths in addition to the provided ones') diff --git a/src/etc/completions/x.py.fish b/src/etc/completions/x.py.fish index a852df8a7753e..8e3bec4fdd925 100644 --- a/src/etc/completions/x.py.fish +++ b/src/etc/completions/x.py.fish @@ -1,6 +1,6 @@ # Print an optspec for argparse to handle cmd's options that are independent of any subcommand. function __fish_x.py_global_optspecs - string join \n v/verbose i/incremental config= build-dir= build= host= target= exclude= skip= include-default-paths rustc-error-format= on-fail= dry-run dump-bootstrap-shims stage= keep-stage= keep-stage-std= src= j/jobs= warnings= json-output compile-time-deps color= bypass-bootstrap-lock rust-profile-generate= rust-profile-use= llvm-profile-use= llvm-profile-generate enable-bolt-settings skip-stage0-validation reproducible-artifact= set= ci= skip-std-check-if-no-download-rustc h/help + string join \n v/verbose q/quiet i/incremental config= build-dir= build= host= target= exclude= skip= include-default-paths rustc-error-format= on-fail= dry-run dump-bootstrap-shims stage= keep-stage= keep-stage-std= src= j/jobs= warnings= json-output compile-time-deps color= bypass-bootstrap-lock rust-profile-generate= rust-profile-use= llvm-profile-use= llvm-profile-generate enable-bolt-settings skip-stage0-validation reproducible-artifact= set= ci= skip-std-check-if-no-download-rustc h/help end function __fish_x.py_needs_command @@ -47,6 +47,7 @@ complete -c x.py -n "__fish_x.py_needs_command" -l reproducible-artifact -d 'Add complete -c x.py -n "__fish_x.py_needs_command" -l set -d 'override options in bootstrap.toml' -r -f complete -c x.py -n "__fish_x.py_needs_command" -l ci -d 'Make bootstrap to behave as it\'s running on the CI environment or not' -r -f -a "{true\t'',false\t''}" complete -c x.py -n "__fish_x.py_needs_command" -s v -l verbose -d 'use verbose output (-vv for very verbose)' +complete -c x.py -n "__fish_x.py_needs_command" -s q -l quiet -d 'use quiet output' complete -c x.py -n "__fish_x.py_needs_command" -s i -l incremental -d 'use incremental compilation' complete -c x.py -n "__fish_x.py_needs_command" -l include-default-paths -d 'include default paths in addition to the provided ones' complete -c x.py -n "__fish_x.py_needs_command" -l dry-run -d 'dry run; don\'t build anything' @@ -104,6 +105,7 @@ complete -c x.py -n "__fish_x.py_using_subcommand build" -l set -d 'override opt complete -c x.py -n "__fish_x.py_using_subcommand build" -l ci -d 'Make bootstrap to behave as it\'s running on the CI environment or not' -r -f -a "{true\t'',false\t''}" complete -c x.py -n "__fish_x.py_using_subcommand build" -l timings -d 'Pass `--timings` to Cargo to get crate build timings' complete -c x.py -n "__fish_x.py_using_subcommand build" -s v -l verbose -d 'use verbose output (-vv for very verbose)' +complete -c x.py -n "__fish_x.py_using_subcommand build" -s q -l quiet -d 'use quiet output' complete -c x.py -n "__fish_x.py_using_subcommand build" -s i -l incremental -d 'use incremental compilation' complete -c x.py -n "__fish_x.py_using_subcommand build" -l include-default-paths -d 'include default paths in addition to the provided ones' complete -c x.py -n "__fish_x.py_using_subcommand build" -l dry-run -d 'dry run; don\'t build anything' @@ -140,6 +142,7 @@ complete -c x.py -n "__fish_x.py_using_subcommand b" -l set -d 'override options complete -c x.py -n "__fish_x.py_using_subcommand b" -l ci -d 'Make bootstrap to behave as it\'s running on the CI environment or not' -r -f -a "{true\t'',false\t''}" complete -c x.py -n "__fish_x.py_using_subcommand b" -l timings -d 'Pass `--timings` to Cargo to get crate build timings' complete -c x.py -n "__fish_x.py_using_subcommand b" -s v -l verbose -d 'use verbose output (-vv for very verbose)' +complete -c x.py -n "__fish_x.py_using_subcommand b" -s q -l quiet -d 'use quiet output' complete -c x.py -n "__fish_x.py_using_subcommand b" -s i -l incremental -d 'use incremental compilation' complete -c x.py -n "__fish_x.py_using_subcommand b" -l include-default-paths -d 'include default paths in addition to the provided ones' complete -c x.py -n "__fish_x.py_using_subcommand b" -l dry-run -d 'dry run; don\'t build anything' @@ -177,6 +180,7 @@ complete -c x.py -n "__fish_x.py_using_subcommand check" -l ci -d 'Make bootstra complete -c x.py -n "__fish_x.py_using_subcommand check" -l all-targets -d 'Check all targets' complete -c x.py -n "__fish_x.py_using_subcommand check" -l timings -d 'Pass `--timings` to Cargo to get crate build timings' complete -c x.py -n "__fish_x.py_using_subcommand check" -s v -l verbose -d 'use verbose output (-vv for very verbose)' +complete -c x.py -n "__fish_x.py_using_subcommand check" -s q -l quiet -d 'use quiet output' complete -c x.py -n "__fish_x.py_using_subcommand check" -s i -l incremental -d 'use incremental compilation' complete -c x.py -n "__fish_x.py_using_subcommand check" -l include-default-paths -d 'include default paths in addition to the provided ones' complete -c x.py -n "__fish_x.py_using_subcommand check" -l dry-run -d 'dry run; don\'t build anything' @@ -214,6 +218,7 @@ complete -c x.py -n "__fish_x.py_using_subcommand c" -l ci -d 'Make bootstrap to complete -c x.py -n "__fish_x.py_using_subcommand c" -l all-targets -d 'Check all targets' complete -c x.py -n "__fish_x.py_using_subcommand c" -l timings -d 'Pass `--timings` to Cargo to get crate build timings' complete -c x.py -n "__fish_x.py_using_subcommand c" -s v -l verbose -d 'use verbose output (-vv for very verbose)' +complete -c x.py -n "__fish_x.py_using_subcommand c" -s q -l quiet -d 'use quiet output' complete -c x.py -n "__fish_x.py_using_subcommand c" -s i -l incremental -d 'use incremental compilation' complete -c x.py -n "__fish_x.py_using_subcommand c" -l include-default-paths -d 'include default paths in addition to the provided ones' complete -c x.py -n "__fish_x.py_using_subcommand c" -l dry-run -d 'dry run; don\'t build anything' @@ -256,6 +261,7 @@ complete -c x.py -n "__fish_x.py_using_subcommand clippy" -l fix complete -c x.py -n "__fish_x.py_using_subcommand clippy" -l allow-dirty complete -c x.py -n "__fish_x.py_using_subcommand clippy" -l allow-staged complete -c x.py -n "__fish_x.py_using_subcommand clippy" -s v -l verbose -d 'use verbose output (-vv for very verbose)' +complete -c x.py -n "__fish_x.py_using_subcommand clippy" -s q -l quiet -d 'use quiet output' complete -c x.py -n "__fish_x.py_using_subcommand clippy" -s i -l incremental -d 'use incremental compilation' complete -c x.py -n "__fish_x.py_using_subcommand clippy" -l include-default-paths -d 'include default paths in addition to the provided ones' complete -c x.py -n "__fish_x.py_using_subcommand clippy" -l dry-run -d 'dry run; don\'t build anything' @@ -291,6 +297,7 @@ complete -c x.py -n "__fish_x.py_using_subcommand fix" -l reproducible-artifact complete -c x.py -n "__fish_x.py_using_subcommand fix" -l set -d 'override options in bootstrap.toml' -r -f complete -c x.py -n "__fish_x.py_using_subcommand fix" -l ci -d 'Make bootstrap to behave as it\'s running on the CI environment or not' -r -f -a "{true\t'',false\t''}" complete -c x.py -n "__fish_x.py_using_subcommand fix" -s v -l verbose -d 'use verbose output (-vv for very verbose)' +complete -c x.py -n "__fish_x.py_using_subcommand fix" -s q -l quiet -d 'use quiet output' complete -c x.py -n "__fish_x.py_using_subcommand fix" -s i -l incremental -d 'use incremental compilation' complete -c x.py -n "__fish_x.py_using_subcommand fix" -l include-default-paths -d 'include default paths in addition to the provided ones' complete -c x.py -n "__fish_x.py_using_subcommand fix" -l dry-run -d 'dry run; don\'t build anything' @@ -328,6 +335,7 @@ complete -c x.py -n "__fish_x.py_using_subcommand fmt" -l ci -d 'Make bootstrap complete -c x.py -n "__fish_x.py_using_subcommand fmt" -l check -d 'check formatting instead of applying' complete -c x.py -n "__fish_x.py_using_subcommand fmt" -l all -d 'apply to all appropriate files, not just those that have been modified' complete -c x.py -n "__fish_x.py_using_subcommand fmt" -s v -l verbose -d 'use verbose output (-vv for very verbose)' +complete -c x.py -n "__fish_x.py_using_subcommand fmt" -s q -l quiet -d 'use quiet output' complete -c x.py -n "__fish_x.py_using_subcommand fmt" -s i -l incremental -d 'use incremental compilation' complete -c x.py -n "__fish_x.py_using_subcommand fmt" -l include-default-paths -d 'include default paths in addition to the provided ones' complete -c x.py -n "__fish_x.py_using_subcommand fmt" -l dry-run -d 'dry run; don\'t build anything' @@ -365,6 +373,7 @@ complete -c x.py -n "__fish_x.py_using_subcommand doc" -l ci -d 'Make bootstrap complete -c x.py -n "__fish_x.py_using_subcommand doc" -l open -d 'open the docs in a browser' complete -c x.py -n "__fish_x.py_using_subcommand doc" -l json -d 'render the documentation in JSON format in addition to the usual HTML format' complete -c x.py -n "__fish_x.py_using_subcommand doc" -s v -l verbose -d 'use verbose output (-vv for very verbose)' +complete -c x.py -n "__fish_x.py_using_subcommand doc" -s q -l quiet -d 'use quiet output' complete -c x.py -n "__fish_x.py_using_subcommand doc" -s i -l incremental -d 'use incremental compilation' complete -c x.py -n "__fish_x.py_using_subcommand doc" -l include-default-paths -d 'include default paths in addition to the provided ones' complete -c x.py -n "__fish_x.py_using_subcommand doc" -l dry-run -d 'dry run; don\'t build anything' @@ -402,6 +411,7 @@ complete -c x.py -n "__fish_x.py_using_subcommand d" -l ci -d 'Make bootstrap to complete -c x.py -n "__fish_x.py_using_subcommand d" -l open -d 'open the docs in a browser' complete -c x.py -n "__fish_x.py_using_subcommand d" -l json -d 'render the documentation in JSON format in addition to the usual HTML format' complete -c x.py -n "__fish_x.py_using_subcommand d" -s v -l verbose -d 'use verbose output (-vv for very verbose)' +complete -c x.py -n "__fish_x.py_using_subcommand d" -s q -l quiet -d 'use quiet output' complete -c x.py -n "__fish_x.py_using_subcommand d" -s i -l incremental -d 'use incremental compilation' complete -c x.py -n "__fish_x.py_using_subcommand d" -l include-default-paths -d 'include default paths in addition to the provided ones' complete -c x.py -n "__fish_x.py_using_subcommand d" -l dry-run -d 'dry run; don\'t build anything' @@ -456,6 +466,7 @@ complete -c x.py -n "__fish_x.py_using_subcommand test" -l no-capture -d 'don\'t complete -c x.py -n "__fish_x.py_using_subcommand test" -l bypass-ignore-backends -d 'Ignore `//@ ignore-backends` directives' complete -c x.py -n "__fish_x.py_using_subcommand test" -l no-doc -d 'Deprecated. Use `--all-targets` or `--tests` instead' complete -c x.py -n "__fish_x.py_using_subcommand test" -s v -l verbose -d 'use verbose output (-vv for very verbose)' +complete -c x.py -n "__fish_x.py_using_subcommand test" -s q -l quiet -d 'use quiet output' complete -c x.py -n "__fish_x.py_using_subcommand test" -s i -l incremental -d 'use incremental compilation' complete -c x.py -n "__fish_x.py_using_subcommand test" -l include-default-paths -d 'include default paths in addition to the provided ones' complete -c x.py -n "__fish_x.py_using_subcommand test" -l dry-run -d 'dry run; don\'t build anything' @@ -510,6 +521,7 @@ complete -c x.py -n "__fish_x.py_using_subcommand t" -l no-capture -d 'don\'t ca complete -c x.py -n "__fish_x.py_using_subcommand t" -l bypass-ignore-backends -d 'Ignore `//@ ignore-backends` directives' complete -c x.py -n "__fish_x.py_using_subcommand t" -l no-doc -d 'Deprecated. Use `--all-targets` or `--tests` instead' complete -c x.py -n "__fish_x.py_using_subcommand t" -s v -l verbose -d 'use verbose output (-vv for very verbose)' +complete -c x.py -n "__fish_x.py_using_subcommand t" -s q -l quiet -d 'use quiet output' complete -c x.py -n "__fish_x.py_using_subcommand t" -s i -l incremental -d 'use incremental compilation' complete -c x.py -n "__fish_x.py_using_subcommand t" -l include-default-paths -d 'include default paths in addition to the provided ones' complete -c x.py -n "__fish_x.py_using_subcommand t" -l dry-run -d 'dry run; don\'t build anything' @@ -551,6 +563,7 @@ complete -c x.py -n "__fish_x.py_using_subcommand miri" -l doc -d 'Only run doc complete -c x.py -n "__fish_x.py_using_subcommand miri" -l tests -d 'Only run unit and integration tests' complete -c x.py -n "__fish_x.py_using_subcommand miri" -l no-doc -d 'Deprecated. Use `--all-targets` or `--tests` instead' complete -c x.py -n "__fish_x.py_using_subcommand miri" -s v -l verbose -d 'use verbose output (-vv for very verbose)' +complete -c x.py -n "__fish_x.py_using_subcommand miri" -s q -l quiet -d 'use quiet output' complete -c x.py -n "__fish_x.py_using_subcommand miri" -s i -l incremental -d 'use incremental compilation' complete -c x.py -n "__fish_x.py_using_subcommand miri" -l include-default-paths -d 'include default paths in addition to the provided ones' complete -c x.py -n "__fish_x.py_using_subcommand miri" -l dry-run -d 'dry run; don\'t build anything' @@ -587,6 +600,7 @@ complete -c x.py -n "__fish_x.py_using_subcommand bench" -l reproducible-artifac complete -c x.py -n "__fish_x.py_using_subcommand bench" -l set -d 'override options in bootstrap.toml' -r -f complete -c x.py -n "__fish_x.py_using_subcommand bench" -l ci -d 'Make bootstrap to behave as it\'s running on the CI environment or not' -r -f -a "{true\t'',false\t''}" complete -c x.py -n "__fish_x.py_using_subcommand bench" -s v -l verbose -d 'use verbose output (-vv for very verbose)' +complete -c x.py -n "__fish_x.py_using_subcommand bench" -s q -l quiet -d 'use quiet output' complete -c x.py -n "__fish_x.py_using_subcommand bench" -s i -l incremental -d 'use incremental compilation' complete -c x.py -n "__fish_x.py_using_subcommand bench" -l include-default-paths -d 'include default paths in addition to the provided ones' complete -c x.py -n "__fish_x.py_using_subcommand bench" -l dry-run -d 'dry run; don\'t build anything' @@ -623,6 +637,7 @@ complete -c x.py -n "__fish_x.py_using_subcommand clean" -l set -d 'override opt complete -c x.py -n "__fish_x.py_using_subcommand clean" -l ci -d 'Make bootstrap to behave as it\'s running on the CI environment or not' -r -f -a "{true\t'',false\t''}" complete -c x.py -n "__fish_x.py_using_subcommand clean" -l all -d 'Clean the entire build directory (not used by default)' complete -c x.py -n "__fish_x.py_using_subcommand clean" -s v -l verbose -d 'use verbose output (-vv for very verbose)' +complete -c x.py -n "__fish_x.py_using_subcommand clean" -s q -l quiet -d 'use quiet output' complete -c x.py -n "__fish_x.py_using_subcommand clean" -s i -l incremental -d 'use incremental compilation' complete -c x.py -n "__fish_x.py_using_subcommand clean" -l include-default-paths -d 'include default paths in addition to the provided ones' complete -c x.py -n "__fish_x.py_using_subcommand clean" -l dry-run -d 'dry run; don\'t build anything' @@ -658,6 +673,7 @@ complete -c x.py -n "__fish_x.py_using_subcommand dist" -l reproducible-artifact complete -c x.py -n "__fish_x.py_using_subcommand dist" -l set -d 'override options in bootstrap.toml' -r -f complete -c x.py -n "__fish_x.py_using_subcommand dist" -l ci -d 'Make bootstrap to behave as it\'s running on the CI environment or not' -r -f -a "{true\t'',false\t''}" complete -c x.py -n "__fish_x.py_using_subcommand dist" -s v -l verbose -d 'use verbose output (-vv for very verbose)' +complete -c x.py -n "__fish_x.py_using_subcommand dist" -s q -l quiet -d 'use quiet output' complete -c x.py -n "__fish_x.py_using_subcommand dist" -s i -l incremental -d 'use incremental compilation' complete -c x.py -n "__fish_x.py_using_subcommand dist" -l include-default-paths -d 'include default paths in addition to the provided ones' complete -c x.py -n "__fish_x.py_using_subcommand dist" -l dry-run -d 'dry run; don\'t build anything' @@ -693,6 +709,7 @@ complete -c x.py -n "__fish_x.py_using_subcommand install" -l reproducible-artif complete -c x.py -n "__fish_x.py_using_subcommand install" -l set -d 'override options in bootstrap.toml' -r -f complete -c x.py -n "__fish_x.py_using_subcommand install" -l ci -d 'Make bootstrap to behave as it\'s running on the CI environment or not' -r -f -a "{true\t'',false\t''}" complete -c x.py -n "__fish_x.py_using_subcommand install" -s v -l verbose -d 'use verbose output (-vv for very verbose)' +complete -c x.py -n "__fish_x.py_using_subcommand install" -s q -l quiet -d 'use quiet output' complete -c x.py -n "__fish_x.py_using_subcommand install" -s i -l incremental -d 'use incremental compilation' complete -c x.py -n "__fish_x.py_using_subcommand install" -l include-default-paths -d 'include default paths in addition to the provided ones' complete -c x.py -n "__fish_x.py_using_subcommand install" -l dry-run -d 'dry run; don\'t build anything' @@ -729,6 +746,7 @@ complete -c x.py -n "__fish_x.py_using_subcommand run" -l reproducible-artifact complete -c x.py -n "__fish_x.py_using_subcommand run" -l set -d 'override options in bootstrap.toml' -r -f complete -c x.py -n "__fish_x.py_using_subcommand run" -l ci -d 'Make bootstrap to behave as it\'s running on the CI environment or not' -r -f -a "{true\t'',false\t''}" complete -c x.py -n "__fish_x.py_using_subcommand run" -s v -l verbose -d 'use verbose output (-vv for very verbose)' +complete -c x.py -n "__fish_x.py_using_subcommand run" -s q -l quiet -d 'use quiet output' complete -c x.py -n "__fish_x.py_using_subcommand run" -s i -l incremental -d 'use incremental compilation' complete -c x.py -n "__fish_x.py_using_subcommand run" -l include-default-paths -d 'include default paths in addition to the provided ones' complete -c x.py -n "__fish_x.py_using_subcommand run" -l dry-run -d 'dry run; don\'t build anything' @@ -765,6 +783,7 @@ complete -c x.py -n "__fish_x.py_using_subcommand r" -l reproducible-artifact -d complete -c x.py -n "__fish_x.py_using_subcommand r" -l set -d 'override options in bootstrap.toml' -r -f complete -c x.py -n "__fish_x.py_using_subcommand r" -l ci -d 'Make bootstrap to behave as it\'s running on the CI environment or not' -r -f -a "{true\t'',false\t''}" complete -c x.py -n "__fish_x.py_using_subcommand r" -s v -l verbose -d 'use verbose output (-vv for very verbose)' +complete -c x.py -n "__fish_x.py_using_subcommand r" -s q -l quiet -d 'use quiet output' complete -c x.py -n "__fish_x.py_using_subcommand r" -s i -l incremental -d 'use incremental compilation' complete -c x.py -n "__fish_x.py_using_subcommand r" -l include-default-paths -d 'include default paths in addition to the provided ones' complete -c x.py -n "__fish_x.py_using_subcommand r" -l dry-run -d 'dry run; don\'t build anything' @@ -800,6 +819,7 @@ complete -c x.py -n "__fish_x.py_using_subcommand setup" -l reproducible-artifac complete -c x.py -n "__fish_x.py_using_subcommand setup" -l set -d 'override options in bootstrap.toml' -r -f complete -c x.py -n "__fish_x.py_using_subcommand setup" -l ci -d 'Make bootstrap to behave as it\'s running on the CI environment or not' -r -f -a "{true\t'',false\t''}" complete -c x.py -n "__fish_x.py_using_subcommand setup" -s v -l verbose -d 'use verbose output (-vv for very verbose)' +complete -c x.py -n "__fish_x.py_using_subcommand setup" -s q -l quiet -d 'use quiet output' complete -c x.py -n "__fish_x.py_using_subcommand setup" -s i -l incremental -d 'use incremental compilation' complete -c x.py -n "__fish_x.py_using_subcommand setup" -l include-default-paths -d 'include default paths in addition to the provided ones' complete -c x.py -n "__fish_x.py_using_subcommand setup" -l dry-run -d 'dry run; don\'t build anything' @@ -837,6 +857,7 @@ complete -c x.py -n "__fish_x.py_using_subcommand vendor" -l set -d 'override op complete -c x.py -n "__fish_x.py_using_subcommand vendor" -l ci -d 'Make bootstrap to behave as it\'s running on the CI environment or not' -r -f -a "{true\t'',false\t''}" complete -c x.py -n "__fish_x.py_using_subcommand vendor" -l versioned-dirs -d 'Always include version in subdir name' complete -c x.py -n "__fish_x.py_using_subcommand vendor" -s v -l verbose -d 'use verbose output (-vv for very verbose)' +complete -c x.py -n "__fish_x.py_using_subcommand vendor" -s q -l quiet -d 'use quiet output' complete -c x.py -n "__fish_x.py_using_subcommand vendor" -s i -l incremental -d 'use incremental compilation' complete -c x.py -n "__fish_x.py_using_subcommand vendor" -l include-default-paths -d 'include default paths in addition to the provided ones' complete -c x.py -n "__fish_x.py_using_subcommand vendor" -l dry-run -d 'dry run; don\'t build anything' @@ -872,6 +893,7 @@ complete -c x.py -n "__fish_x.py_using_subcommand perf; and not __fish_seen_subc complete -c x.py -n "__fish_x.py_using_subcommand perf; and not __fish_seen_subcommand_from eprintln samply cachegrind benchmark compare" -l set -d 'override options in bootstrap.toml' -r -f complete -c x.py -n "__fish_x.py_using_subcommand perf; and not __fish_seen_subcommand_from eprintln samply cachegrind benchmark compare" -l ci -d 'Make bootstrap to behave as it\'s running on the CI environment or not' -r -f -a "{true\t'',false\t''}" complete -c x.py -n "__fish_x.py_using_subcommand perf; and not __fish_seen_subcommand_from eprintln samply cachegrind benchmark compare" -s v -l verbose -d 'use verbose output (-vv for very verbose)' +complete -c x.py -n "__fish_x.py_using_subcommand perf; and not __fish_seen_subcommand_from eprintln samply cachegrind benchmark compare" -s q -l quiet -d 'use quiet output' complete -c x.py -n "__fish_x.py_using_subcommand perf; and not __fish_seen_subcommand_from eprintln samply cachegrind benchmark compare" -s i -l incremental -d 'use incremental compilation' complete -c x.py -n "__fish_x.py_using_subcommand perf; and not __fish_seen_subcommand_from eprintln samply cachegrind benchmark compare" -l include-default-paths -d 'include default paths in addition to the provided ones' complete -c x.py -n "__fish_x.py_using_subcommand perf; and not __fish_seen_subcommand_from eprintln samply cachegrind benchmark compare" -l dry-run -d 'dry run; don\'t build anything' @@ -915,6 +937,7 @@ complete -c x.py -n "__fish_x.py_using_subcommand perf; and __fish_seen_subcomma complete -c x.py -n "__fish_x.py_using_subcommand perf; and __fish_seen_subcommand_from eprintln" -l set -d 'override options in bootstrap.toml' -r -f complete -c x.py -n "__fish_x.py_using_subcommand perf; and __fish_seen_subcommand_from eprintln" -l ci -d 'Make bootstrap to behave as it\'s running on the CI environment or not' -r -f -a "{true\t'',false\t''}" complete -c x.py -n "__fish_x.py_using_subcommand perf; and __fish_seen_subcommand_from eprintln" -s v -l verbose -d 'use verbose output (-vv for very verbose)' +complete -c x.py -n "__fish_x.py_using_subcommand perf; and __fish_seen_subcommand_from eprintln" -s q -l quiet -d 'use quiet output' complete -c x.py -n "__fish_x.py_using_subcommand perf; and __fish_seen_subcommand_from eprintln" -s i -l incremental -d 'use incremental compilation' complete -c x.py -n "__fish_x.py_using_subcommand perf; and __fish_seen_subcommand_from eprintln" -l include-default-paths -d 'include default paths in addition to the provided ones' complete -c x.py -n "__fish_x.py_using_subcommand perf; and __fish_seen_subcommand_from eprintln" -l dry-run -d 'dry run; don\'t build anything' @@ -953,6 +976,7 @@ complete -c x.py -n "__fish_x.py_using_subcommand perf; and __fish_seen_subcomma complete -c x.py -n "__fish_x.py_using_subcommand perf; and __fish_seen_subcommand_from samply" -l set -d 'override options in bootstrap.toml' -r -f complete -c x.py -n "__fish_x.py_using_subcommand perf; and __fish_seen_subcommand_from samply" -l ci -d 'Make bootstrap to behave as it\'s running on the CI environment or not' -r -f -a "{true\t'',false\t''}" complete -c x.py -n "__fish_x.py_using_subcommand perf; and __fish_seen_subcommand_from samply" -s v -l verbose -d 'use verbose output (-vv for very verbose)' +complete -c x.py -n "__fish_x.py_using_subcommand perf; and __fish_seen_subcommand_from samply" -s q -l quiet -d 'use quiet output' complete -c x.py -n "__fish_x.py_using_subcommand perf; and __fish_seen_subcommand_from samply" -s i -l incremental -d 'use incremental compilation' complete -c x.py -n "__fish_x.py_using_subcommand perf; and __fish_seen_subcommand_from samply" -l include-default-paths -d 'include default paths in addition to the provided ones' complete -c x.py -n "__fish_x.py_using_subcommand perf; and __fish_seen_subcommand_from samply" -l dry-run -d 'dry run; don\'t build anything' @@ -991,6 +1015,7 @@ complete -c x.py -n "__fish_x.py_using_subcommand perf; and __fish_seen_subcomma complete -c x.py -n "__fish_x.py_using_subcommand perf; and __fish_seen_subcommand_from cachegrind" -l set -d 'override options in bootstrap.toml' -r -f complete -c x.py -n "__fish_x.py_using_subcommand perf; and __fish_seen_subcommand_from cachegrind" -l ci -d 'Make bootstrap to behave as it\'s running on the CI environment or not' -r -f -a "{true\t'',false\t''}" complete -c x.py -n "__fish_x.py_using_subcommand perf; and __fish_seen_subcommand_from cachegrind" -s v -l verbose -d 'use verbose output (-vv for very verbose)' +complete -c x.py -n "__fish_x.py_using_subcommand perf; and __fish_seen_subcommand_from cachegrind" -s q -l quiet -d 'use quiet output' complete -c x.py -n "__fish_x.py_using_subcommand perf; and __fish_seen_subcommand_from cachegrind" -s i -l incremental -d 'use incremental compilation' complete -c x.py -n "__fish_x.py_using_subcommand perf; and __fish_seen_subcommand_from cachegrind" -l include-default-paths -d 'include default paths in addition to the provided ones' complete -c x.py -n "__fish_x.py_using_subcommand perf; and __fish_seen_subcommand_from cachegrind" -l dry-run -d 'dry run; don\'t build anything' @@ -1029,6 +1054,7 @@ complete -c x.py -n "__fish_x.py_using_subcommand perf; and __fish_seen_subcomma complete -c x.py -n "__fish_x.py_using_subcommand perf; and __fish_seen_subcommand_from benchmark" -l set -d 'override options in bootstrap.toml' -r -f complete -c x.py -n "__fish_x.py_using_subcommand perf; and __fish_seen_subcommand_from benchmark" -l ci -d 'Make bootstrap to behave as it\'s running on the CI environment or not' -r -f -a "{true\t'',false\t''}" complete -c x.py -n "__fish_x.py_using_subcommand perf; and __fish_seen_subcommand_from benchmark" -s v -l verbose -d 'use verbose output (-vv for very verbose)' +complete -c x.py -n "__fish_x.py_using_subcommand perf; and __fish_seen_subcommand_from benchmark" -s q -l quiet -d 'use quiet output' complete -c x.py -n "__fish_x.py_using_subcommand perf; and __fish_seen_subcommand_from benchmark" -s i -l incremental -d 'use incremental compilation' complete -c x.py -n "__fish_x.py_using_subcommand perf; and __fish_seen_subcommand_from benchmark" -l include-default-paths -d 'include default paths in addition to the provided ones' complete -c x.py -n "__fish_x.py_using_subcommand perf; and __fish_seen_subcommand_from benchmark" -l dry-run -d 'dry run; don\'t build anything' @@ -1064,6 +1090,7 @@ complete -c x.py -n "__fish_x.py_using_subcommand perf; and __fish_seen_subcomma complete -c x.py -n "__fish_x.py_using_subcommand perf; and __fish_seen_subcommand_from compare" -l set -d 'override options in bootstrap.toml' -r -f complete -c x.py -n "__fish_x.py_using_subcommand perf; and __fish_seen_subcommand_from compare" -l ci -d 'Make bootstrap to behave as it\'s running on the CI environment or not' -r -f -a "{true\t'',false\t''}" complete -c x.py -n "__fish_x.py_using_subcommand perf; and __fish_seen_subcommand_from compare" -s v -l verbose -d 'use verbose output (-vv for very verbose)' +complete -c x.py -n "__fish_x.py_using_subcommand perf; and __fish_seen_subcommand_from compare" -s q -l quiet -d 'use quiet output' complete -c x.py -n "__fish_x.py_using_subcommand perf; and __fish_seen_subcommand_from compare" -s i -l incremental -d 'use incremental compilation' complete -c x.py -n "__fish_x.py_using_subcommand perf; and __fish_seen_subcommand_from compare" -l include-default-paths -d 'include default paths in addition to the provided ones' complete -c x.py -n "__fish_x.py_using_subcommand perf; and __fish_seen_subcommand_from compare" -l dry-run -d 'dry run; don\'t build anything' diff --git a/src/etc/completions/x.py.ps1 b/src/etc/completions/x.py.ps1 index 665cb812f2df9..edcc5d0bb5ef1 100644 --- a/src/etc/completions/x.py.ps1 +++ b/src/etc/completions/x.py.ps1 @@ -46,6 +46,8 @@ Register-ArgumentCompleter -Native -CommandName 'x.py' -ScriptBlock { [CompletionResult]::new('--ci', '--ci', [CompletionResultType]::ParameterName, 'Make bootstrap to behave as it''s running on the CI environment or not') [CompletionResult]::new('-v', '-v', [CompletionResultType]::ParameterName, 'use verbose output (-vv for very verbose)') [CompletionResult]::new('--verbose', '--verbose', [CompletionResultType]::ParameterName, 'use verbose output (-vv for very verbose)') + [CompletionResult]::new('-q', '-q', [CompletionResultType]::ParameterName, 'use quiet output') + [CompletionResult]::new('--quiet', '--quiet', [CompletionResultType]::ParameterName, 'use quiet output') [CompletionResult]::new('-i', '-i', [CompletionResultType]::ParameterName, 'use incremental compilation') [CompletionResult]::new('--incremental', '--incremental', [CompletionResultType]::ParameterName, 'use incremental compilation') [CompletionResult]::new('--include-default-paths', '--include-default-paths', [CompletionResultType]::ParameterName, 'include default paths in addition to the provided ones') @@ -110,6 +112,8 @@ Register-ArgumentCompleter -Native -CommandName 'x.py' -ScriptBlock { [CompletionResult]::new('--timings', '--timings', [CompletionResultType]::ParameterName, 'Pass `--timings` to Cargo to get crate build timings') [CompletionResult]::new('-v', '-v', [CompletionResultType]::ParameterName, 'use verbose output (-vv for very verbose)') [CompletionResult]::new('--verbose', '--verbose', [CompletionResultType]::ParameterName, 'use verbose output (-vv for very verbose)') + [CompletionResult]::new('-q', '-q', [CompletionResultType]::ParameterName, 'use quiet output') + [CompletionResult]::new('--quiet', '--quiet', [CompletionResultType]::ParameterName, 'use quiet output') [CompletionResult]::new('-i', '-i', [CompletionResultType]::ParameterName, 'use incremental compilation') [CompletionResult]::new('--incremental', '--incremental', [CompletionResultType]::ParameterName, 'use incremental compilation') [CompletionResult]::new('--include-default-paths', '--include-default-paths', [CompletionResultType]::ParameterName, 'include default paths in addition to the provided ones') @@ -153,6 +157,8 @@ Register-ArgumentCompleter -Native -CommandName 'x.py' -ScriptBlock { [CompletionResult]::new('--timings', '--timings', [CompletionResultType]::ParameterName, 'Pass `--timings` to Cargo to get crate build timings') [CompletionResult]::new('-v', '-v', [CompletionResultType]::ParameterName, 'use verbose output (-vv for very verbose)') [CompletionResult]::new('--verbose', '--verbose', [CompletionResultType]::ParameterName, 'use verbose output (-vv for very verbose)') + [CompletionResult]::new('-q', '-q', [CompletionResultType]::ParameterName, 'use quiet output') + [CompletionResult]::new('--quiet', '--quiet', [CompletionResultType]::ParameterName, 'use quiet output') [CompletionResult]::new('-i', '-i', [CompletionResultType]::ParameterName, 'use incremental compilation') [CompletionResult]::new('--incremental', '--incremental', [CompletionResultType]::ParameterName, 'use incremental compilation') [CompletionResult]::new('--include-default-paths', '--include-default-paths', [CompletionResultType]::ParameterName, 'include default paths in addition to the provided ones') @@ -197,6 +203,8 @@ Register-ArgumentCompleter -Native -CommandName 'x.py' -ScriptBlock { [CompletionResult]::new('--timings', '--timings', [CompletionResultType]::ParameterName, 'Pass `--timings` to Cargo to get crate build timings') [CompletionResult]::new('-v', '-v', [CompletionResultType]::ParameterName, 'use verbose output (-vv for very verbose)') [CompletionResult]::new('--verbose', '--verbose', [CompletionResultType]::ParameterName, 'use verbose output (-vv for very verbose)') + [CompletionResult]::new('-q', '-q', [CompletionResultType]::ParameterName, 'use quiet output') + [CompletionResult]::new('--quiet', '--quiet', [CompletionResultType]::ParameterName, 'use quiet output') [CompletionResult]::new('-i', '-i', [CompletionResultType]::ParameterName, 'use incremental compilation') [CompletionResult]::new('--incremental', '--incremental', [CompletionResultType]::ParameterName, 'use incremental compilation') [CompletionResult]::new('--include-default-paths', '--include-default-paths', [CompletionResultType]::ParameterName, 'include default paths in addition to the provided ones') @@ -241,6 +249,8 @@ Register-ArgumentCompleter -Native -CommandName 'x.py' -ScriptBlock { [CompletionResult]::new('--timings', '--timings', [CompletionResultType]::ParameterName, 'Pass `--timings` to Cargo to get crate build timings') [CompletionResult]::new('-v', '-v', [CompletionResultType]::ParameterName, 'use verbose output (-vv for very verbose)') [CompletionResult]::new('--verbose', '--verbose', [CompletionResultType]::ParameterName, 'use verbose output (-vv for very verbose)') + [CompletionResult]::new('-q', '-q', [CompletionResultType]::ParameterName, 'use quiet output') + [CompletionResult]::new('--quiet', '--quiet', [CompletionResultType]::ParameterName, 'use quiet output') [CompletionResult]::new('-i', '-i', [CompletionResultType]::ParameterName, 'use incremental compilation') [CompletionResult]::new('--incremental', '--incremental', [CompletionResultType]::ParameterName, 'use incremental compilation') [CompletionResult]::new('--include-default-paths', '--include-default-paths', [CompletionResultType]::ParameterName, 'include default paths in addition to the provided ones') @@ -290,6 +300,8 @@ Register-ArgumentCompleter -Native -CommandName 'x.py' -ScriptBlock { [CompletionResult]::new('--allow-staged', '--allow-staged', [CompletionResultType]::ParameterName, 'allow-staged') [CompletionResult]::new('-v', '-v', [CompletionResultType]::ParameterName, 'use verbose output (-vv for very verbose)') [CompletionResult]::new('--verbose', '--verbose', [CompletionResultType]::ParameterName, 'use verbose output (-vv for very verbose)') + [CompletionResult]::new('-q', '-q', [CompletionResultType]::ParameterName, 'use quiet output') + [CompletionResult]::new('--quiet', '--quiet', [CompletionResultType]::ParameterName, 'use quiet output') [CompletionResult]::new('-i', '-i', [CompletionResultType]::ParameterName, 'use incremental compilation') [CompletionResult]::new('--incremental', '--incremental', [CompletionResultType]::ParameterName, 'use incremental compilation') [CompletionResult]::new('--include-default-paths', '--include-default-paths', [CompletionResultType]::ParameterName, 'include default paths in addition to the provided ones') @@ -332,6 +344,8 @@ Register-ArgumentCompleter -Native -CommandName 'x.py' -ScriptBlock { [CompletionResult]::new('--ci', '--ci', [CompletionResultType]::ParameterName, 'Make bootstrap to behave as it''s running on the CI environment or not') [CompletionResult]::new('-v', '-v', [CompletionResultType]::ParameterName, 'use verbose output (-vv for very verbose)') [CompletionResult]::new('--verbose', '--verbose', [CompletionResultType]::ParameterName, 'use verbose output (-vv for very verbose)') + [CompletionResult]::new('-q', '-q', [CompletionResultType]::ParameterName, 'use quiet output') + [CompletionResult]::new('--quiet', '--quiet', [CompletionResultType]::ParameterName, 'use quiet output') [CompletionResult]::new('-i', '-i', [CompletionResultType]::ParameterName, 'use incremental compilation') [CompletionResult]::new('--incremental', '--incremental', [CompletionResultType]::ParameterName, 'use incremental compilation') [CompletionResult]::new('--include-default-paths', '--include-default-paths', [CompletionResultType]::ParameterName, 'include default paths in addition to the provided ones') @@ -376,6 +390,8 @@ Register-ArgumentCompleter -Native -CommandName 'x.py' -ScriptBlock { [CompletionResult]::new('--all', '--all', [CompletionResultType]::ParameterName, 'apply to all appropriate files, not just those that have been modified') [CompletionResult]::new('-v', '-v', [CompletionResultType]::ParameterName, 'use verbose output (-vv for very verbose)') [CompletionResult]::new('--verbose', '--verbose', [CompletionResultType]::ParameterName, 'use verbose output (-vv for very verbose)') + [CompletionResult]::new('-q', '-q', [CompletionResultType]::ParameterName, 'use quiet output') + [CompletionResult]::new('--quiet', '--quiet', [CompletionResultType]::ParameterName, 'use quiet output') [CompletionResult]::new('-i', '-i', [CompletionResultType]::ParameterName, 'use incremental compilation') [CompletionResult]::new('--incremental', '--incremental', [CompletionResultType]::ParameterName, 'use incremental compilation') [CompletionResult]::new('--include-default-paths', '--include-default-paths', [CompletionResultType]::ParameterName, 'include default paths in addition to the provided ones') @@ -420,6 +436,8 @@ Register-ArgumentCompleter -Native -CommandName 'x.py' -ScriptBlock { [CompletionResult]::new('--json', '--json', [CompletionResultType]::ParameterName, 'render the documentation in JSON format in addition to the usual HTML format') [CompletionResult]::new('-v', '-v', [CompletionResultType]::ParameterName, 'use verbose output (-vv for very verbose)') [CompletionResult]::new('--verbose', '--verbose', [CompletionResultType]::ParameterName, 'use verbose output (-vv for very verbose)') + [CompletionResult]::new('-q', '-q', [CompletionResultType]::ParameterName, 'use quiet output') + [CompletionResult]::new('--quiet', '--quiet', [CompletionResultType]::ParameterName, 'use quiet output') [CompletionResult]::new('-i', '-i', [CompletionResultType]::ParameterName, 'use incremental compilation') [CompletionResult]::new('--incremental', '--incremental', [CompletionResultType]::ParameterName, 'use incremental compilation') [CompletionResult]::new('--include-default-paths', '--include-default-paths', [CompletionResultType]::ParameterName, 'include default paths in addition to the provided ones') @@ -464,6 +482,8 @@ Register-ArgumentCompleter -Native -CommandName 'x.py' -ScriptBlock { [CompletionResult]::new('--json', '--json', [CompletionResultType]::ParameterName, 'render the documentation in JSON format in addition to the usual HTML format') [CompletionResult]::new('-v', '-v', [CompletionResultType]::ParameterName, 'use verbose output (-vv for very verbose)') [CompletionResult]::new('--verbose', '--verbose', [CompletionResultType]::ParameterName, 'use verbose output (-vv for very verbose)') + [CompletionResult]::new('-q', '-q', [CompletionResultType]::ParameterName, 'use quiet output') + [CompletionResult]::new('--quiet', '--quiet', [CompletionResultType]::ParameterName, 'use quiet output') [CompletionResult]::new('-i', '-i', [CompletionResultType]::ParameterName, 'use incremental compilation') [CompletionResult]::new('--incremental', '--incremental', [CompletionResultType]::ParameterName, 'use incremental compilation') [CompletionResult]::new('--include-default-paths', '--include-default-paths', [CompletionResultType]::ParameterName, 'include default paths in addition to the provided ones') @@ -525,6 +545,8 @@ Register-ArgumentCompleter -Native -CommandName 'x.py' -ScriptBlock { [CompletionResult]::new('--no-doc', '--no-doc', [CompletionResultType]::ParameterName, 'Deprecated. Use `--all-targets` or `--tests` instead') [CompletionResult]::new('-v', '-v', [CompletionResultType]::ParameterName, 'use verbose output (-vv for very verbose)') [CompletionResult]::new('--verbose', '--verbose', [CompletionResultType]::ParameterName, 'use verbose output (-vv for very verbose)') + [CompletionResult]::new('-q', '-q', [CompletionResultType]::ParameterName, 'use quiet output') + [CompletionResult]::new('--quiet', '--quiet', [CompletionResultType]::ParameterName, 'use quiet output') [CompletionResult]::new('-i', '-i', [CompletionResultType]::ParameterName, 'use incremental compilation') [CompletionResult]::new('--incremental', '--incremental', [CompletionResultType]::ParameterName, 'use incremental compilation') [CompletionResult]::new('--include-default-paths', '--include-default-paths', [CompletionResultType]::ParameterName, 'include default paths in addition to the provided ones') @@ -586,6 +608,8 @@ Register-ArgumentCompleter -Native -CommandName 'x.py' -ScriptBlock { [CompletionResult]::new('--no-doc', '--no-doc', [CompletionResultType]::ParameterName, 'Deprecated. Use `--all-targets` or `--tests` instead') [CompletionResult]::new('-v', '-v', [CompletionResultType]::ParameterName, 'use verbose output (-vv for very verbose)') [CompletionResult]::new('--verbose', '--verbose', [CompletionResultType]::ParameterName, 'use verbose output (-vv for very verbose)') + [CompletionResult]::new('-q', '-q', [CompletionResultType]::ParameterName, 'use quiet output') + [CompletionResult]::new('--quiet', '--quiet', [CompletionResultType]::ParameterName, 'use quiet output') [CompletionResult]::new('-i', '-i', [CompletionResultType]::ParameterName, 'use incremental compilation') [CompletionResult]::new('--incremental', '--incremental', [CompletionResultType]::ParameterName, 'use incremental compilation') [CompletionResult]::new('--include-default-paths', '--include-default-paths', [CompletionResultType]::ParameterName, 'include default paths in addition to the provided ones') @@ -634,6 +658,8 @@ Register-ArgumentCompleter -Native -CommandName 'x.py' -ScriptBlock { [CompletionResult]::new('--no-doc', '--no-doc', [CompletionResultType]::ParameterName, 'Deprecated. Use `--all-targets` or `--tests` instead') [CompletionResult]::new('-v', '-v', [CompletionResultType]::ParameterName, 'use verbose output (-vv for very verbose)') [CompletionResult]::new('--verbose', '--verbose', [CompletionResultType]::ParameterName, 'use verbose output (-vv for very verbose)') + [CompletionResult]::new('-q', '-q', [CompletionResultType]::ParameterName, 'use quiet output') + [CompletionResult]::new('--quiet', '--quiet', [CompletionResultType]::ParameterName, 'use quiet output') [CompletionResult]::new('-i', '-i', [CompletionResultType]::ParameterName, 'use incremental compilation') [CompletionResult]::new('--incremental', '--incremental', [CompletionResultType]::ParameterName, 'use incremental compilation') [CompletionResult]::new('--include-default-paths', '--include-default-paths', [CompletionResultType]::ParameterName, 'include default paths in addition to the provided ones') @@ -677,6 +703,8 @@ Register-ArgumentCompleter -Native -CommandName 'x.py' -ScriptBlock { [CompletionResult]::new('--ci', '--ci', [CompletionResultType]::ParameterName, 'Make bootstrap to behave as it''s running on the CI environment or not') [CompletionResult]::new('-v', '-v', [CompletionResultType]::ParameterName, 'use verbose output (-vv for very verbose)') [CompletionResult]::new('--verbose', '--verbose', [CompletionResultType]::ParameterName, 'use verbose output (-vv for very verbose)') + [CompletionResult]::new('-q', '-q', [CompletionResultType]::ParameterName, 'use quiet output') + [CompletionResult]::new('--quiet', '--quiet', [CompletionResultType]::ParameterName, 'use quiet output') [CompletionResult]::new('-i', '-i', [CompletionResultType]::ParameterName, 'use incremental compilation') [CompletionResult]::new('--incremental', '--incremental', [CompletionResultType]::ParameterName, 'use incremental compilation') [CompletionResult]::new('--include-default-paths', '--include-default-paths', [CompletionResultType]::ParameterName, 'include default paths in addition to the provided ones') @@ -720,6 +748,8 @@ Register-ArgumentCompleter -Native -CommandName 'x.py' -ScriptBlock { [CompletionResult]::new('--all', '--all', [CompletionResultType]::ParameterName, 'Clean the entire build directory (not used by default)') [CompletionResult]::new('-v', '-v', [CompletionResultType]::ParameterName, 'use verbose output (-vv for very verbose)') [CompletionResult]::new('--verbose', '--verbose', [CompletionResultType]::ParameterName, 'use verbose output (-vv for very verbose)') + [CompletionResult]::new('-q', '-q', [CompletionResultType]::ParameterName, 'use quiet output') + [CompletionResult]::new('--quiet', '--quiet', [CompletionResultType]::ParameterName, 'use quiet output') [CompletionResult]::new('-i', '-i', [CompletionResultType]::ParameterName, 'use incremental compilation') [CompletionResult]::new('--incremental', '--incremental', [CompletionResultType]::ParameterName, 'use incremental compilation') [CompletionResult]::new('--include-default-paths', '--include-default-paths', [CompletionResultType]::ParameterName, 'include default paths in addition to the provided ones') @@ -762,6 +792,8 @@ Register-ArgumentCompleter -Native -CommandName 'x.py' -ScriptBlock { [CompletionResult]::new('--ci', '--ci', [CompletionResultType]::ParameterName, 'Make bootstrap to behave as it''s running on the CI environment or not') [CompletionResult]::new('-v', '-v', [CompletionResultType]::ParameterName, 'use verbose output (-vv for very verbose)') [CompletionResult]::new('--verbose', '--verbose', [CompletionResultType]::ParameterName, 'use verbose output (-vv for very verbose)') + [CompletionResult]::new('-q', '-q', [CompletionResultType]::ParameterName, 'use quiet output') + [CompletionResult]::new('--quiet', '--quiet', [CompletionResultType]::ParameterName, 'use quiet output') [CompletionResult]::new('-i', '-i', [CompletionResultType]::ParameterName, 'use incremental compilation') [CompletionResult]::new('--incremental', '--incremental', [CompletionResultType]::ParameterName, 'use incremental compilation') [CompletionResult]::new('--include-default-paths', '--include-default-paths', [CompletionResultType]::ParameterName, 'include default paths in addition to the provided ones') @@ -804,6 +836,8 @@ Register-ArgumentCompleter -Native -CommandName 'x.py' -ScriptBlock { [CompletionResult]::new('--ci', '--ci', [CompletionResultType]::ParameterName, 'Make bootstrap to behave as it''s running on the CI environment or not') [CompletionResult]::new('-v', '-v', [CompletionResultType]::ParameterName, 'use verbose output (-vv for very verbose)') [CompletionResult]::new('--verbose', '--verbose', [CompletionResultType]::ParameterName, 'use verbose output (-vv for very verbose)') + [CompletionResult]::new('-q', '-q', [CompletionResultType]::ParameterName, 'use quiet output') + [CompletionResult]::new('--quiet', '--quiet', [CompletionResultType]::ParameterName, 'use quiet output') [CompletionResult]::new('-i', '-i', [CompletionResultType]::ParameterName, 'use incremental compilation') [CompletionResult]::new('--incremental', '--incremental', [CompletionResultType]::ParameterName, 'use incremental compilation') [CompletionResult]::new('--include-default-paths', '--include-default-paths', [CompletionResultType]::ParameterName, 'include default paths in addition to the provided ones') @@ -847,6 +881,8 @@ Register-ArgumentCompleter -Native -CommandName 'x.py' -ScriptBlock { [CompletionResult]::new('--ci', '--ci', [CompletionResultType]::ParameterName, 'Make bootstrap to behave as it''s running on the CI environment or not') [CompletionResult]::new('-v', '-v', [CompletionResultType]::ParameterName, 'use verbose output (-vv for very verbose)') [CompletionResult]::new('--verbose', '--verbose', [CompletionResultType]::ParameterName, 'use verbose output (-vv for very verbose)') + [CompletionResult]::new('-q', '-q', [CompletionResultType]::ParameterName, 'use quiet output') + [CompletionResult]::new('--quiet', '--quiet', [CompletionResultType]::ParameterName, 'use quiet output') [CompletionResult]::new('-i', '-i', [CompletionResultType]::ParameterName, 'use incremental compilation') [CompletionResult]::new('--incremental', '--incremental', [CompletionResultType]::ParameterName, 'use incremental compilation') [CompletionResult]::new('--include-default-paths', '--include-default-paths', [CompletionResultType]::ParameterName, 'include default paths in addition to the provided ones') @@ -890,6 +926,8 @@ Register-ArgumentCompleter -Native -CommandName 'x.py' -ScriptBlock { [CompletionResult]::new('--ci', '--ci', [CompletionResultType]::ParameterName, 'Make bootstrap to behave as it''s running on the CI environment or not') [CompletionResult]::new('-v', '-v', [CompletionResultType]::ParameterName, 'use verbose output (-vv for very verbose)') [CompletionResult]::new('--verbose', '--verbose', [CompletionResultType]::ParameterName, 'use verbose output (-vv for very verbose)') + [CompletionResult]::new('-q', '-q', [CompletionResultType]::ParameterName, 'use quiet output') + [CompletionResult]::new('--quiet', '--quiet', [CompletionResultType]::ParameterName, 'use quiet output') [CompletionResult]::new('-i', '-i', [CompletionResultType]::ParameterName, 'use incremental compilation') [CompletionResult]::new('--incremental', '--incremental', [CompletionResultType]::ParameterName, 'use incremental compilation') [CompletionResult]::new('--include-default-paths', '--include-default-paths', [CompletionResultType]::ParameterName, 'include default paths in addition to the provided ones') @@ -932,6 +970,8 @@ Register-ArgumentCompleter -Native -CommandName 'x.py' -ScriptBlock { [CompletionResult]::new('--ci', '--ci', [CompletionResultType]::ParameterName, 'Make bootstrap to behave as it''s running on the CI environment or not') [CompletionResult]::new('-v', '-v', [CompletionResultType]::ParameterName, 'use verbose output (-vv for very verbose)') [CompletionResult]::new('--verbose', '--verbose', [CompletionResultType]::ParameterName, 'use verbose output (-vv for very verbose)') + [CompletionResult]::new('-q', '-q', [CompletionResultType]::ParameterName, 'use quiet output') + [CompletionResult]::new('--quiet', '--quiet', [CompletionResultType]::ParameterName, 'use quiet output') [CompletionResult]::new('-i', '-i', [CompletionResultType]::ParameterName, 'use incremental compilation') [CompletionResult]::new('--incremental', '--incremental', [CompletionResultType]::ParameterName, 'use incremental compilation') [CompletionResult]::new('--include-default-paths', '--include-default-paths', [CompletionResultType]::ParameterName, 'include default paths in addition to the provided ones') @@ -976,6 +1016,8 @@ Register-ArgumentCompleter -Native -CommandName 'x.py' -ScriptBlock { [CompletionResult]::new('--versioned-dirs', '--versioned-dirs', [CompletionResultType]::ParameterName, 'Always include version in subdir name') [CompletionResult]::new('-v', '-v', [CompletionResultType]::ParameterName, 'use verbose output (-vv for very verbose)') [CompletionResult]::new('--verbose', '--verbose', [CompletionResultType]::ParameterName, 'use verbose output (-vv for very verbose)') + [CompletionResult]::new('-q', '-q', [CompletionResultType]::ParameterName, 'use quiet output') + [CompletionResult]::new('--quiet', '--quiet', [CompletionResultType]::ParameterName, 'use quiet output') [CompletionResult]::new('-i', '-i', [CompletionResultType]::ParameterName, 'use incremental compilation') [CompletionResult]::new('--incremental', '--incremental', [CompletionResultType]::ParameterName, 'use incremental compilation') [CompletionResult]::new('--include-default-paths', '--include-default-paths', [CompletionResultType]::ParameterName, 'include default paths in addition to the provided ones') @@ -1018,6 +1060,8 @@ Register-ArgumentCompleter -Native -CommandName 'x.py' -ScriptBlock { [CompletionResult]::new('--ci', '--ci', [CompletionResultType]::ParameterName, 'Make bootstrap to behave as it''s running on the CI environment or not') [CompletionResult]::new('-v', '-v', [CompletionResultType]::ParameterName, 'use verbose output (-vv for very verbose)') [CompletionResult]::new('--verbose', '--verbose', [CompletionResultType]::ParameterName, 'use verbose output (-vv for very verbose)') + [CompletionResult]::new('-q', '-q', [CompletionResultType]::ParameterName, 'use quiet output') + [CompletionResult]::new('--quiet', '--quiet', [CompletionResultType]::ParameterName, 'use quiet output') [CompletionResult]::new('-i', '-i', [CompletionResultType]::ParameterName, 'use incremental compilation') [CompletionResult]::new('--incremental', '--incremental', [CompletionResultType]::ParameterName, 'use incremental compilation') [CompletionResult]::new('--include-default-paths', '--include-default-paths', [CompletionResultType]::ParameterName, 'include default paths in addition to the provided ones') @@ -1068,6 +1112,8 @@ Register-ArgumentCompleter -Native -CommandName 'x.py' -ScriptBlock { [CompletionResult]::new('--ci', '--ci', [CompletionResultType]::ParameterName, 'Make bootstrap to behave as it''s running on the CI environment or not') [CompletionResult]::new('-v', '-v', [CompletionResultType]::ParameterName, 'use verbose output (-vv for very verbose)') [CompletionResult]::new('--verbose', '--verbose', [CompletionResultType]::ParameterName, 'use verbose output (-vv for very verbose)') + [CompletionResult]::new('-q', '-q', [CompletionResultType]::ParameterName, 'use quiet output') + [CompletionResult]::new('--quiet', '--quiet', [CompletionResultType]::ParameterName, 'use quiet output') [CompletionResult]::new('-i', '-i', [CompletionResultType]::ParameterName, 'use incremental compilation') [CompletionResult]::new('--incremental', '--incremental', [CompletionResultType]::ParameterName, 'use incremental compilation') [CompletionResult]::new('--include-default-paths', '--include-default-paths', [CompletionResultType]::ParameterName, 'include default paths in addition to the provided ones') @@ -1113,6 +1159,8 @@ Register-ArgumentCompleter -Native -CommandName 'x.py' -ScriptBlock { [CompletionResult]::new('--ci', '--ci', [CompletionResultType]::ParameterName, 'Make bootstrap to behave as it''s running on the CI environment or not') [CompletionResult]::new('-v', '-v', [CompletionResultType]::ParameterName, 'use verbose output (-vv for very verbose)') [CompletionResult]::new('--verbose', '--verbose', [CompletionResultType]::ParameterName, 'use verbose output (-vv for very verbose)') + [CompletionResult]::new('-q', '-q', [CompletionResultType]::ParameterName, 'use quiet output') + [CompletionResult]::new('--quiet', '--quiet', [CompletionResultType]::ParameterName, 'use quiet output') [CompletionResult]::new('-i', '-i', [CompletionResultType]::ParameterName, 'use incremental compilation') [CompletionResult]::new('--incremental', '--incremental', [CompletionResultType]::ParameterName, 'use incremental compilation') [CompletionResult]::new('--include-default-paths', '--include-default-paths', [CompletionResultType]::ParameterName, 'include default paths in addition to the provided ones') @@ -1158,6 +1206,8 @@ Register-ArgumentCompleter -Native -CommandName 'x.py' -ScriptBlock { [CompletionResult]::new('--ci', '--ci', [CompletionResultType]::ParameterName, 'Make bootstrap to behave as it''s running on the CI environment or not') [CompletionResult]::new('-v', '-v', [CompletionResultType]::ParameterName, 'use verbose output (-vv for very verbose)') [CompletionResult]::new('--verbose', '--verbose', [CompletionResultType]::ParameterName, 'use verbose output (-vv for very verbose)') + [CompletionResult]::new('-q', '-q', [CompletionResultType]::ParameterName, 'use quiet output') + [CompletionResult]::new('--quiet', '--quiet', [CompletionResultType]::ParameterName, 'use quiet output') [CompletionResult]::new('-i', '-i', [CompletionResultType]::ParameterName, 'use incremental compilation') [CompletionResult]::new('--incremental', '--incremental', [CompletionResultType]::ParameterName, 'use incremental compilation') [CompletionResult]::new('--include-default-paths', '--include-default-paths', [CompletionResultType]::ParameterName, 'include default paths in addition to the provided ones') @@ -1203,6 +1253,8 @@ Register-ArgumentCompleter -Native -CommandName 'x.py' -ScriptBlock { [CompletionResult]::new('--ci', '--ci', [CompletionResultType]::ParameterName, 'Make bootstrap to behave as it''s running on the CI environment or not') [CompletionResult]::new('-v', '-v', [CompletionResultType]::ParameterName, 'use verbose output (-vv for very verbose)') [CompletionResult]::new('--verbose', '--verbose', [CompletionResultType]::ParameterName, 'use verbose output (-vv for very verbose)') + [CompletionResult]::new('-q', '-q', [CompletionResultType]::ParameterName, 'use quiet output') + [CompletionResult]::new('--quiet', '--quiet', [CompletionResultType]::ParameterName, 'use quiet output') [CompletionResult]::new('-i', '-i', [CompletionResultType]::ParameterName, 'use incremental compilation') [CompletionResult]::new('--incremental', '--incremental', [CompletionResultType]::ParameterName, 'use incremental compilation') [CompletionResult]::new('--include-default-paths', '--include-default-paths', [CompletionResultType]::ParameterName, 'include default paths in addition to the provided ones') @@ -1245,6 +1297,8 @@ Register-ArgumentCompleter -Native -CommandName 'x.py' -ScriptBlock { [CompletionResult]::new('--ci', '--ci', [CompletionResultType]::ParameterName, 'Make bootstrap to behave as it''s running on the CI environment or not') [CompletionResult]::new('-v', '-v', [CompletionResultType]::ParameterName, 'use verbose output (-vv for very verbose)') [CompletionResult]::new('--verbose', '--verbose', [CompletionResultType]::ParameterName, 'use verbose output (-vv for very verbose)') + [CompletionResult]::new('-q', '-q', [CompletionResultType]::ParameterName, 'use quiet output') + [CompletionResult]::new('--quiet', '--quiet', [CompletionResultType]::ParameterName, 'use quiet output') [CompletionResult]::new('-i', '-i', [CompletionResultType]::ParameterName, 'use incremental compilation') [CompletionResult]::new('--incremental', '--incremental', [CompletionResultType]::ParameterName, 'use incremental compilation') [CompletionResult]::new('--include-default-paths', '--include-default-paths', [CompletionResultType]::ParameterName, 'include default paths in addition to the provided ones') diff --git a/src/etc/completions/x.py.sh b/src/etc/completions/x.py.sh index 5e6db9bcb5325..f32a078b2094d 100644 --- a/src/etc/completions/x.py.sh +++ b/src/etc/completions/x.py.sh @@ -97,7 +97,7 @@ _x.py() { case "${cmd}" in x.py) - opts="-v -i -j -h --verbose --incremental --config --build-dir --build --host --target --exclude --skip --include-default-paths --rustc-error-format --on-fail --dry-run --dump-bootstrap-shims --stage --keep-stage --keep-stage-std --src --jobs --warnings --json-output --compile-time-deps --color --bypass-bootstrap-lock --rust-profile-generate --rust-profile-use --llvm-profile-use --llvm-profile-generate --enable-bolt-settings --skip-stage0-validation --reproducible-artifact --set --ci --skip-std-check-if-no-download-rustc --help [PATHS]... [ARGS]... build b check c clippy fix fmt doc d test t miri bench clean dist install run r setup vendor perf" + opts="-v -q -i -j -h --verbose --quiet --incremental --config --build-dir --build --host --target --exclude --skip --include-default-paths --rustc-error-format --on-fail --dry-run --dump-bootstrap-shims --stage --keep-stage --keep-stage-std --src --jobs --warnings --json-output --compile-time-deps --color --bypass-bootstrap-lock --rust-profile-generate --rust-profile-use --llvm-profile-use --llvm-profile-generate --enable-bolt-settings --skip-stage0-validation --reproducible-artifact --set --ci --skip-std-check-if-no-download-rustc --help [PATHS]... [ARGS]... build b check c clippy fix fmt doc d test t miri bench clean dist install run r setup vendor perf" if [[ ${cur} == -* || ${COMP_CWORD} -eq 1 ]] ; then COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) return 0 @@ -283,7 +283,7 @@ _x.py() { return 0 ;; x.py__bench) - opts="-v -i -j -h --test-args --verbose --incremental --config --build-dir --build --host --target --exclude --skip --include-default-paths --rustc-error-format --on-fail --dry-run --dump-bootstrap-shims --stage --keep-stage --keep-stage-std --src --jobs --warnings --json-output --compile-time-deps --color --bypass-bootstrap-lock --rust-profile-generate --rust-profile-use --llvm-profile-use --llvm-profile-generate --enable-bolt-settings --skip-stage0-validation --reproducible-artifact --set --ci --skip-std-check-if-no-download-rustc --help [PATHS]... [ARGS]..." + opts="-v -q -i -j -h --test-args --verbose --quiet --incremental --config --build-dir --build --host --target --exclude --skip --include-default-paths --rustc-error-format --on-fail --dry-run --dump-bootstrap-shims --stage --keep-stage --keep-stage-std --src --jobs --warnings --json-output --compile-time-deps --color --bypass-bootstrap-lock --rust-profile-generate --rust-profile-use --llvm-profile-use --llvm-profile-generate --enable-bolt-settings --skip-stage0-validation --reproducible-artifact --set --ci --skip-std-check-if-no-download-rustc --help [PATHS]... [ARGS]..." if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) return 0 @@ -473,7 +473,7 @@ _x.py() { return 0 ;; x.py__build) - opts="-v -i -j -h --timings --verbose --incremental --config --build-dir --build --host --target --exclude --skip --include-default-paths --rustc-error-format --on-fail --dry-run --dump-bootstrap-shims --stage --keep-stage --keep-stage-std --src --jobs --warnings --json-output --compile-time-deps --color --bypass-bootstrap-lock --rust-profile-generate --rust-profile-use --llvm-profile-use --llvm-profile-generate --enable-bolt-settings --skip-stage0-validation --reproducible-artifact --set --ci --skip-std-check-if-no-download-rustc --help [PATHS]... [ARGS]..." + opts="-v -q -i -j -h --timings --verbose --quiet --incremental --config --build-dir --build --host --target --exclude --skip --include-default-paths --rustc-error-format --on-fail --dry-run --dump-bootstrap-shims --stage --keep-stage --keep-stage-std --src --jobs --warnings --json-output --compile-time-deps --color --bypass-bootstrap-lock --rust-profile-generate --rust-profile-use --llvm-profile-use --llvm-profile-generate --enable-bolt-settings --skip-stage0-validation --reproducible-artifact --set --ci --skip-std-check-if-no-download-rustc --help [PATHS]... [ARGS]..." if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) return 0 @@ -659,7 +659,7 @@ _x.py() { return 0 ;; x.py__build) - opts="-v -i -j -h --timings --verbose --incremental --config --build-dir --build --host --target --exclude --skip --include-default-paths --rustc-error-format --on-fail --dry-run --dump-bootstrap-shims --stage --keep-stage --keep-stage-std --src --jobs --warnings --json-output --compile-time-deps --color --bypass-bootstrap-lock --rust-profile-generate --rust-profile-use --llvm-profile-use --llvm-profile-generate --enable-bolt-settings --skip-stage0-validation --reproducible-artifact --set --ci --skip-std-check-if-no-download-rustc --help [PATHS]... [ARGS]..." + opts="-v -q -i -j -h --timings --verbose --quiet --incremental --config --build-dir --build --host --target --exclude --skip --include-default-paths --rustc-error-format --on-fail --dry-run --dump-bootstrap-shims --stage --keep-stage --keep-stage-std --src --jobs --warnings --json-output --compile-time-deps --color --bypass-bootstrap-lock --rust-profile-generate --rust-profile-use --llvm-profile-use --llvm-profile-generate --enable-bolt-settings --skip-stage0-validation --reproducible-artifact --set --ci --skip-std-check-if-no-download-rustc --help [PATHS]... [ARGS]..." if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) return 0 @@ -845,7 +845,7 @@ _x.py() { return 0 ;; x.py__check) - opts="-v -i -j -h --all-targets --timings --verbose --incremental --config --build-dir --build --host --target --exclude --skip --include-default-paths --rustc-error-format --on-fail --dry-run --dump-bootstrap-shims --stage --keep-stage --keep-stage-std --src --jobs --warnings --json-output --compile-time-deps --color --bypass-bootstrap-lock --rust-profile-generate --rust-profile-use --llvm-profile-use --llvm-profile-generate --enable-bolt-settings --skip-stage0-validation --reproducible-artifact --set --ci --skip-std-check-if-no-download-rustc --help [PATHS]... [ARGS]..." + opts="-v -q -i -j -h --all-targets --timings --verbose --quiet --incremental --config --build-dir --build --host --target --exclude --skip --include-default-paths --rustc-error-format --on-fail --dry-run --dump-bootstrap-shims --stage --keep-stage --keep-stage-std --src --jobs --warnings --json-output --compile-time-deps --color --bypass-bootstrap-lock --rust-profile-generate --rust-profile-use --llvm-profile-use --llvm-profile-generate --enable-bolt-settings --skip-stage0-validation --reproducible-artifact --set --ci --skip-std-check-if-no-download-rustc --help [PATHS]... [ARGS]..." if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) return 0 @@ -1031,7 +1031,7 @@ _x.py() { return 0 ;; x.py__check) - opts="-v -i -j -h --all-targets --timings --verbose --incremental --config --build-dir --build --host --target --exclude --skip --include-default-paths --rustc-error-format --on-fail --dry-run --dump-bootstrap-shims --stage --keep-stage --keep-stage-std --src --jobs --warnings --json-output --compile-time-deps --color --bypass-bootstrap-lock --rust-profile-generate --rust-profile-use --llvm-profile-use --llvm-profile-generate --enable-bolt-settings --skip-stage0-validation --reproducible-artifact --set --ci --skip-std-check-if-no-download-rustc --help [PATHS]... [ARGS]..." + opts="-v -q -i -j -h --all-targets --timings --verbose --quiet --incremental --config --build-dir --build --host --target --exclude --skip --include-default-paths --rustc-error-format --on-fail --dry-run --dump-bootstrap-shims --stage --keep-stage --keep-stage-std --src --jobs --warnings --json-output --compile-time-deps --color --bypass-bootstrap-lock --rust-profile-generate --rust-profile-use --llvm-profile-use --llvm-profile-generate --enable-bolt-settings --skip-stage0-validation --reproducible-artifact --set --ci --skip-std-check-if-no-download-rustc --help [PATHS]... [ARGS]..." if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) return 0 @@ -1217,7 +1217,7 @@ _x.py() { return 0 ;; x.py__clean) - opts="-v -i -j -h --all --stage --verbose --incremental --config --build-dir --build --host --target --exclude --skip --include-default-paths --rustc-error-format --on-fail --dry-run --dump-bootstrap-shims --keep-stage --keep-stage-std --src --jobs --warnings --json-output --compile-time-deps --color --bypass-bootstrap-lock --rust-profile-generate --rust-profile-use --llvm-profile-use --llvm-profile-generate --enable-bolt-settings --skip-stage0-validation --reproducible-artifact --set --ci --skip-std-check-if-no-download-rustc --help [PATHS]... [ARGS]..." + opts="-v -q -i -j -h --all --stage --verbose --quiet --incremental --config --build-dir --build --host --target --exclude --skip --include-default-paths --rustc-error-format --on-fail --dry-run --dump-bootstrap-shims --keep-stage --keep-stage-std --src --jobs --warnings --json-output --compile-time-deps --color --bypass-bootstrap-lock --rust-profile-generate --rust-profile-use --llvm-profile-use --llvm-profile-generate --enable-bolt-settings --skip-stage0-validation --reproducible-artifact --set --ci --skip-std-check-if-no-download-rustc --help [PATHS]... [ARGS]..." if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) return 0 @@ -1400,7 +1400,7 @@ _x.py() { return 0 ;; x.py__clippy) - opts="-A -D -W -F -v -i -j -h --fix --allow-dirty --allow-staged --verbose --incremental --config --build-dir --build --host --target --exclude --skip --include-default-paths --rustc-error-format --on-fail --dry-run --dump-bootstrap-shims --stage --keep-stage --keep-stage-std --src --jobs --warnings --json-output --compile-time-deps --color --bypass-bootstrap-lock --rust-profile-generate --rust-profile-use --llvm-profile-use --llvm-profile-generate --enable-bolt-settings --skip-stage0-validation --reproducible-artifact --set --ci --skip-std-check-if-no-download-rustc --help [PATHS]... [ARGS]..." + opts="-A -D -W -F -v -q -i -j -h --fix --allow-dirty --allow-staged --verbose --quiet --incremental --config --build-dir --build --host --target --exclude --skip --include-default-paths --rustc-error-format --on-fail --dry-run --dump-bootstrap-shims --stage --keep-stage --keep-stage-std --src --jobs --warnings --json-output --compile-time-deps --color --bypass-bootstrap-lock --rust-profile-generate --rust-profile-use --llvm-profile-use --llvm-profile-generate --enable-bolt-settings --skip-stage0-validation --reproducible-artifact --set --ci --skip-std-check-if-no-download-rustc --help [PATHS]... [ARGS]..." if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) return 0 @@ -1602,7 +1602,7 @@ _x.py() { return 0 ;; x.py__dist) - opts="-v -i -j -h --verbose --incremental --config --build-dir --build --host --target --exclude --skip --include-default-paths --rustc-error-format --on-fail --dry-run --dump-bootstrap-shims --stage --keep-stage --keep-stage-std --src --jobs --warnings --json-output --compile-time-deps --color --bypass-bootstrap-lock --rust-profile-generate --rust-profile-use --llvm-profile-use --llvm-profile-generate --enable-bolt-settings --skip-stage0-validation --reproducible-artifact --set --ci --skip-std-check-if-no-download-rustc --help [PATHS]... [ARGS]..." + opts="-v -q -i -j -h --verbose --quiet --incremental --config --build-dir --build --host --target --exclude --skip --include-default-paths --rustc-error-format --on-fail --dry-run --dump-bootstrap-shims --stage --keep-stage --keep-stage-std --src --jobs --warnings --json-output --compile-time-deps --color --bypass-bootstrap-lock --rust-profile-generate --rust-profile-use --llvm-profile-use --llvm-profile-generate --enable-bolt-settings --skip-stage0-validation --reproducible-artifact --set --ci --skip-std-check-if-no-download-rustc --help [PATHS]... [ARGS]..." if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) return 0 @@ -1788,7 +1788,7 @@ _x.py() { return 0 ;; x.py__doc) - opts="-v -i -j -h --open --json --verbose --incremental --config --build-dir --build --host --target --exclude --skip --include-default-paths --rustc-error-format --on-fail --dry-run --dump-bootstrap-shims --stage --keep-stage --keep-stage-std --src --jobs --warnings --json-output --compile-time-deps --color --bypass-bootstrap-lock --rust-profile-generate --rust-profile-use --llvm-profile-use --llvm-profile-generate --enable-bolt-settings --skip-stage0-validation --reproducible-artifact --set --ci --skip-std-check-if-no-download-rustc --help [PATHS]... [ARGS]..." + opts="-v -q -i -j -h --open --json --verbose --quiet --incremental --config --build-dir --build --host --target --exclude --skip --include-default-paths --rustc-error-format --on-fail --dry-run --dump-bootstrap-shims --stage --keep-stage --keep-stage-std --src --jobs --warnings --json-output --compile-time-deps --color --bypass-bootstrap-lock --rust-profile-generate --rust-profile-use --llvm-profile-use --llvm-profile-generate --enable-bolt-settings --skip-stage0-validation --reproducible-artifact --set --ci --skip-std-check-if-no-download-rustc --help [PATHS]... [ARGS]..." if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) return 0 @@ -1974,7 +1974,7 @@ _x.py() { return 0 ;; x.py__doc) - opts="-v -i -j -h --open --json --verbose --incremental --config --build-dir --build --host --target --exclude --skip --include-default-paths --rustc-error-format --on-fail --dry-run --dump-bootstrap-shims --stage --keep-stage --keep-stage-std --src --jobs --warnings --json-output --compile-time-deps --color --bypass-bootstrap-lock --rust-profile-generate --rust-profile-use --llvm-profile-use --llvm-profile-generate --enable-bolt-settings --skip-stage0-validation --reproducible-artifact --set --ci --skip-std-check-if-no-download-rustc --help [PATHS]... [ARGS]..." + opts="-v -q -i -j -h --open --json --verbose --quiet --incremental --config --build-dir --build --host --target --exclude --skip --include-default-paths --rustc-error-format --on-fail --dry-run --dump-bootstrap-shims --stage --keep-stage --keep-stage-std --src --jobs --warnings --json-output --compile-time-deps --color --bypass-bootstrap-lock --rust-profile-generate --rust-profile-use --llvm-profile-use --llvm-profile-generate --enable-bolt-settings --skip-stage0-validation --reproducible-artifact --set --ci --skip-std-check-if-no-download-rustc --help [PATHS]... [ARGS]..." if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) return 0 @@ -2160,7 +2160,7 @@ _x.py() { return 0 ;; x.py__fix) - opts="-v -i -j -h --verbose --incremental --config --build-dir --build --host --target --exclude --skip --include-default-paths --rustc-error-format --on-fail --dry-run --dump-bootstrap-shims --stage --keep-stage --keep-stage-std --src --jobs --warnings --json-output --compile-time-deps --color --bypass-bootstrap-lock --rust-profile-generate --rust-profile-use --llvm-profile-use --llvm-profile-generate --enable-bolt-settings --skip-stage0-validation --reproducible-artifact --set --ci --skip-std-check-if-no-download-rustc --help [PATHS]... [ARGS]..." + opts="-v -q -i -j -h --verbose --quiet --incremental --config --build-dir --build --host --target --exclude --skip --include-default-paths --rustc-error-format --on-fail --dry-run --dump-bootstrap-shims --stage --keep-stage --keep-stage-std --src --jobs --warnings --json-output --compile-time-deps --color --bypass-bootstrap-lock --rust-profile-generate --rust-profile-use --llvm-profile-use --llvm-profile-generate --enable-bolt-settings --skip-stage0-validation --reproducible-artifact --set --ci --skip-std-check-if-no-download-rustc --help [PATHS]... [ARGS]..." if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) return 0 @@ -2346,7 +2346,7 @@ _x.py() { return 0 ;; x.py__fmt) - opts="-v -i -j -h --check --all --verbose --incremental --config --build-dir --build --host --target --exclude --skip --include-default-paths --rustc-error-format --on-fail --dry-run --dump-bootstrap-shims --stage --keep-stage --keep-stage-std --src --jobs --warnings --json-output --compile-time-deps --color --bypass-bootstrap-lock --rust-profile-generate --rust-profile-use --llvm-profile-use --llvm-profile-generate --enable-bolt-settings --skip-stage0-validation --reproducible-artifact --set --ci --skip-std-check-if-no-download-rustc --help [PATHS]... [ARGS]..." + opts="-v -q -i -j -h --check --all --verbose --quiet --incremental --config --build-dir --build --host --target --exclude --skip --include-default-paths --rustc-error-format --on-fail --dry-run --dump-bootstrap-shims --stage --keep-stage --keep-stage-std --src --jobs --warnings --json-output --compile-time-deps --color --bypass-bootstrap-lock --rust-profile-generate --rust-profile-use --llvm-profile-use --llvm-profile-generate --enable-bolt-settings --skip-stage0-validation --reproducible-artifact --set --ci --skip-std-check-if-no-download-rustc --help [PATHS]... [ARGS]..." if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) return 0 @@ -2532,7 +2532,7 @@ _x.py() { return 0 ;; x.py__install) - opts="-v -i -j -h --verbose --incremental --config --build-dir --build --host --target --exclude --skip --include-default-paths --rustc-error-format --on-fail --dry-run --dump-bootstrap-shims --stage --keep-stage --keep-stage-std --src --jobs --warnings --json-output --compile-time-deps --color --bypass-bootstrap-lock --rust-profile-generate --rust-profile-use --llvm-profile-use --llvm-profile-generate --enable-bolt-settings --skip-stage0-validation --reproducible-artifact --set --ci --skip-std-check-if-no-download-rustc --help [PATHS]... [ARGS]..." + opts="-v -q -i -j -h --verbose --quiet --incremental --config --build-dir --build --host --target --exclude --skip --include-default-paths --rustc-error-format --on-fail --dry-run --dump-bootstrap-shims --stage --keep-stage --keep-stage-std --src --jobs --warnings --json-output --compile-time-deps --color --bypass-bootstrap-lock --rust-profile-generate --rust-profile-use --llvm-profile-use --llvm-profile-generate --enable-bolt-settings --skip-stage0-validation --reproducible-artifact --set --ci --skip-std-check-if-no-download-rustc --help [PATHS]... [ARGS]..." if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) return 0 @@ -2718,7 +2718,7 @@ _x.py() { return 0 ;; x.py__miri) - opts="-v -i -j -h --no-fail-fast --test-args --all-targets --doc --tests --no-doc --verbose --incremental --config --build-dir --build --host --target --exclude --skip --include-default-paths --rustc-error-format --on-fail --dry-run --dump-bootstrap-shims --stage --keep-stage --keep-stage-std --src --jobs --warnings --json-output --compile-time-deps --color --bypass-bootstrap-lock --rust-profile-generate --rust-profile-use --llvm-profile-use --llvm-profile-generate --enable-bolt-settings --skip-stage0-validation --reproducible-artifact --set --ci --skip-std-check-if-no-download-rustc --help [PATHS]... [ARGS]..." + opts="-v -q -i -j -h --no-fail-fast --test-args --all-targets --doc --tests --no-doc --verbose --quiet --incremental --config --build-dir --build --host --target --exclude --skip --include-default-paths --rustc-error-format --on-fail --dry-run --dump-bootstrap-shims --stage --keep-stage --keep-stage-std --src --jobs --warnings --json-output --compile-time-deps --color --bypass-bootstrap-lock --rust-profile-generate --rust-profile-use --llvm-profile-use --llvm-profile-generate --enable-bolt-settings --skip-stage0-validation --reproducible-artifact --set --ci --skip-std-check-if-no-download-rustc --help [PATHS]... [ARGS]..." if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) return 0 @@ -2908,7 +2908,7 @@ _x.py() { return 0 ;; x.py__perf) - opts="-v -i -j -h --verbose --incremental --config --build-dir --build --host --target --exclude --skip --include-default-paths --rustc-error-format --on-fail --dry-run --dump-bootstrap-shims --stage --keep-stage --keep-stage-std --src --jobs --warnings --json-output --compile-time-deps --color --bypass-bootstrap-lock --rust-profile-generate --rust-profile-use --llvm-profile-use --llvm-profile-generate --enable-bolt-settings --skip-stage0-validation --reproducible-artifact --set --ci --skip-std-check-if-no-download-rustc --help [PATHS]... [ARGS]... eprintln samply cachegrind benchmark compare" + opts="-v -q -i -j -h --verbose --quiet --incremental --config --build-dir --build --host --target --exclude --skip --include-default-paths --rustc-error-format --on-fail --dry-run --dump-bootstrap-shims --stage --keep-stage --keep-stage-std --src --jobs --warnings --json-output --compile-time-deps --color --bypass-bootstrap-lock --rust-profile-generate --rust-profile-use --llvm-profile-use --llvm-profile-generate --enable-bolt-settings --skip-stage0-validation --reproducible-artifact --set --ci --skip-std-check-if-no-download-rustc --help [PATHS]... [ARGS]... eprintln samply cachegrind benchmark compare" if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) return 0 @@ -3094,7 +3094,7 @@ _x.py() { return 0 ;; x.py__perf__benchmark) - opts="-v -i -j -h --include --exclude --scenarios --profiles --verbose --incremental --config --build-dir --build --host --target --skip --include-default-paths --rustc-error-format --on-fail --dry-run --dump-bootstrap-shims --stage --keep-stage --keep-stage-std --src --jobs --warnings --json-output --compile-time-deps --color --bypass-bootstrap-lock --rust-profile-generate --rust-profile-use --llvm-profile-use --llvm-profile-generate --enable-bolt-settings --skip-stage0-validation --reproducible-artifact --set --ci --skip-std-check-if-no-download-rustc --help [PATHS]... [ARGS]..." + opts="-v -q -i -j -h --include --exclude --scenarios --profiles --verbose --quiet --incremental --config --build-dir --build --host --target --skip --include-default-paths --rustc-error-format --on-fail --dry-run --dump-bootstrap-shims --stage --keep-stage --keep-stage-std --src --jobs --warnings --json-output --compile-time-deps --color --bypass-bootstrap-lock --rust-profile-generate --rust-profile-use --llvm-profile-use --llvm-profile-generate --enable-bolt-settings --skip-stage0-validation --reproducible-artifact --set --ci --skip-std-check-if-no-download-rustc --help [PATHS]... [ARGS]..." if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) return 0 @@ -3292,7 +3292,7 @@ _x.py() { return 0 ;; x.py__perf__cachegrind) - opts="-v -i -j -h --include --exclude --scenarios --profiles --verbose --incremental --config --build-dir --build --host --target --skip --include-default-paths --rustc-error-format --on-fail --dry-run --dump-bootstrap-shims --stage --keep-stage --keep-stage-std --src --jobs --warnings --json-output --compile-time-deps --color --bypass-bootstrap-lock --rust-profile-generate --rust-profile-use --llvm-profile-use --llvm-profile-generate --enable-bolt-settings --skip-stage0-validation --reproducible-artifact --set --ci --skip-std-check-if-no-download-rustc --help [PATHS]... [ARGS]..." + opts="-v -q -i -j -h --include --exclude --scenarios --profiles --verbose --quiet --incremental --config --build-dir --build --host --target --skip --include-default-paths --rustc-error-format --on-fail --dry-run --dump-bootstrap-shims --stage --keep-stage --keep-stage-std --src --jobs --warnings --json-output --compile-time-deps --color --bypass-bootstrap-lock --rust-profile-generate --rust-profile-use --llvm-profile-use --llvm-profile-generate --enable-bolt-settings --skip-stage0-validation --reproducible-artifact --set --ci --skip-std-check-if-no-download-rustc --help [PATHS]... [ARGS]..." if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) return 0 @@ -3490,7 +3490,7 @@ _x.py() { return 0 ;; x.py__perf__compare) - opts="-v -i -j -h --verbose --incremental --config --build-dir --build --host --target --exclude --skip --include-default-paths --rustc-error-format --on-fail --dry-run --dump-bootstrap-shims --stage --keep-stage --keep-stage-std --src --jobs --warnings --json-output --compile-time-deps --color --bypass-bootstrap-lock --rust-profile-generate --rust-profile-use --llvm-profile-use --llvm-profile-generate --enable-bolt-settings --skip-stage0-validation --reproducible-artifact --set --ci --skip-std-check-if-no-download-rustc --help [PATHS]... [ARGS]..." + opts="-v -q -i -j -h --verbose --quiet --incremental --config --build-dir --build --host --target --exclude --skip --include-default-paths --rustc-error-format --on-fail --dry-run --dump-bootstrap-shims --stage --keep-stage --keep-stage-std --src --jobs --warnings --json-output --compile-time-deps --color --bypass-bootstrap-lock --rust-profile-generate --rust-profile-use --llvm-profile-use --llvm-profile-generate --enable-bolt-settings --skip-stage0-validation --reproducible-artifact --set --ci --skip-std-check-if-no-download-rustc --help [PATHS]... [ARGS]..." if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) return 0 @@ -3676,7 +3676,7 @@ _x.py() { return 0 ;; x.py__perf__eprintln) - opts="-v -i -j -h --include --exclude --scenarios --profiles --verbose --incremental --config --build-dir --build --host --target --skip --include-default-paths --rustc-error-format --on-fail --dry-run --dump-bootstrap-shims --stage --keep-stage --keep-stage-std --src --jobs --warnings --json-output --compile-time-deps --color --bypass-bootstrap-lock --rust-profile-generate --rust-profile-use --llvm-profile-use --llvm-profile-generate --enable-bolt-settings --skip-stage0-validation --reproducible-artifact --set --ci --skip-std-check-if-no-download-rustc --help [PATHS]... [ARGS]..." + opts="-v -q -i -j -h --include --exclude --scenarios --profiles --verbose --quiet --incremental --config --build-dir --build --host --target --skip --include-default-paths --rustc-error-format --on-fail --dry-run --dump-bootstrap-shims --stage --keep-stage --keep-stage-std --src --jobs --warnings --json-output --compile-time-deps --color --bypass-bootstrap-lock --rust-profile-generate --rust-profile-use --llvm-profile-use --llvm-profile-generate --enable-bolt-settings --skip-stage0-validation --reproducible-artifact --set --ci --skip-std-check-if-no-download-rustc --help [PATHS]... [ARGS]..." if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) return 0 @@ -3874,7 +3874,7 @@ _x.py() { return 0 ;; x.py__perf__samply) - opts="-v -i -j -h --include --exclude --scenarios --profiles --verbose --incremental --config --build-dir --build --host --target --skip --include-default-paths --rustc-error-format --on-fail --dry-run --dump-bootstrap-shims --stage --keep-stage --keep-stage-std --src --jobs --warnings --json-output --compile-time-deps --color --bypass-bootstrap-lock --rust-profile-generate --rust-profile-use --llvm-profile-use --llvm-profile-generate --enable-bolt-settings --skip-stage0-validation --reproducible-artifact --set --ci --skip-std-check-if-no-download-rustc --help [PATHS]... [ARGS]..." + opts="-v -q -i -j -h --include --exclude --scenarios --profiles --verbose --quiet --incremental --config --build-dir --build --host --target --skip --include-default-paths --rustc-error-format --on-fail --dry-run --dump-bootstrap-shims --stage --keep-stage --keep-stage-std --src --jobs --warnings --json-output --compile-time-deps --color --bypass-bootstrap-lock --rust-profile-generate --rust-profile-use --llvm-profile-use --llvm-profile-generate --enable-bolt-settings --skip-stage0-validation --reproducible-artifact --set --ci --skip-std-check-if-no-download-rustc --help [PATHS]... [ARGS]..." if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) return 0 @@ -4072,7 +4072,7 @@ _x.py() { return 0 ;; x.py__run) - opts="-v -i -j -h --args --verbose --incremental --config --build-dir --build --host --target --exclude --skip --include-default-paths --rustc-error-format --on-fail --dry-run --dump-bootstrap-shims --stage --keep-stage --keep-stage-std --src --jobs --warnings --json-output --compile-time-deps --color --bypass-bootstrap-lock --rust-profile-generate --rust-profile-use --llvm-profile-use --llvm-profile-generate --enable-bolt-settings --skip-stage0-validation --reproducible-artifact --set --ci --skip-std-check-if-no-download-rustc --help [PATHS]... [ARGS]..." + opts="-v -q -i -j -h --args --verbose --quiet --incremental --config --build-dir --build --host --target --exclude --skip --include-default-paths --rustc-error-format --on-fail --dry-run --dump-bootstrap-shims --stage --keep-stage --keep-stage-std --src --jobs --warnings --json-output --compile-time-deps --color --bypass-bootstrap-lock --rust-profile-generate --rust-profile-use --llvm-profile-use --llvm-profile-generate --enable-bolt-settings --skip-stage0-validation --reproducible-artifact --set --ci --skip-std-check-if-no-download-rustc --help [PATHS]... [ARGS]..." if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) return 0 @@ -4262,7 +4262,7 @@ _x.py() { return 0 ;; x.py__run) - opts="-v -i -j -h --args --verbose --incremental --config --build-dir --build --host --target --exclude --skip --include-default-paths --rustc-error-format --on-fail --dry-run --dump-bootstrap-shims --stage --keep-stage --keep-stage-std --src --jobs --warnings --json-output --compile-time-deps --color --bypass-bootstrap-lock --rust-profile-generate --rust-profile-use --llvm-profile-use --llvm-profile-generate --enable-bolt-settings --skip-stage0-validation --reproducible-artifact --set --ci --skip-std-check-if-no-download-rustc --help [PATHS]... [ARGS]..." + opts="-v -q -i -j -h --args --verbose --quiet --incremental --config --build-dir --build --host --target --exclude --skip --include-default-paths --rustc-error-format --on-fail --dry-run --dump-bootstrap-shims --stage --keep-stage --keep-stage-std --src --jobs --warnings --json-output --compile-time-deps --color --bypass-bootstrap-lock --rust-profile-generate --rust-profile-use --llvm-profile-use --llvm-profile-generate --enable-bolt-settings --skip-stage0-validation --reproducible-artifact --set --ci --skip-std-check-if-no-download-rustc --help [PATHS]... [ARGS]..." if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) return 0 @@ -4452,7 +4452,7 @@ _x.py() { return 0 ;; x.py__setup) - opts="-v -i -j -h --verbose --incremental --config --build-dir --build --host --target --exclude --skip --include-default-paths --rustc-error-format --on-fail --dry-run --dump-bootstrap-shims --stage --keep-stage --keep-stage-std --src --jobs --warnings --json-output --compile-time-deps --color --bypass-bootstrap-lock --rust-profile-generate --rust-profile-use --llvm-profile-use --llvm-profile-generate --enable-bolt-settings --skip-stage0-validation --reproducible-artifact --set --ci --skip-std-check-if-no-download-rustc --help [|hook|editor|link] [PATHS]... [ARGS]..." + opts="-v -q -i -j -h --verbose --quiet --incremental --config --build-dir --build --host --target --exclude --skip --include-default-paths --rustc-error-format --on-fail --dry-run --dump-bootstrap-shims --stage --keep-stage --keep-stage-std --src --jobs --warnings --json-output --compile-time-deps --color --bypass-bootstrap-lock --rust-profile-generate --rust-profile-use --llvm-profile-use --llvm-profile-generate --enable-bolt-settings --skip-stage0-validation --reproducible-artifact --set --ci --skip-std-check-if-no-download-rustc --help [|hook|editor|link] [PATHS]... [ARGS]..." if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) return 0 @@ -4638,7 +4638,7 @@ _x.py() { return 0 ;; x.py__test) - opts="-v -i -j -h --no-fail-fast --test-args --compiletest-rustc-args --all-targets --doc --tests --bless --extra-checks --force-rerun --only-modified --compare-mode --pass --run --rustfix-coverage --no-capture --verbose-run-make-subprocess-output --test-codegen-backend --bypass-ignore-backends --no-doc --verbose --incremental --config --build-dir --build --host --target --exclude --skip --include-default-paths --rustc-error-format --on-fail --dry-run --dump-bootstrap-shims --stage --keep-stage --keep-stage-std --src --jobs --warnings --json-output --compile-time-deps --color --bypass-bootstrap-lock --rust-profile-generate --rust-profile-use --llvm-profile-use --llvm-profile-generate --enable-bolt-settings --skip-stage0-validation --reproducible-artifact --set --ci --skip-std-check-if-no-download-rustc --help [PATHS]... [ARGS]..." + opts="-v -q -i -j -h --no-fail-fast --test-args --compiletest-rustc-args --all-targets --doc --tests --bless --extra-checks --force-rerun --only-modified --compare-mode --pass --run --rustfix-coverage --no-capture --verbose-run-make-subprocess-output --test-codegen-backend --bypass-ignore-backends --no-doc --verbose --quiet --incremental --config --build-dir --build --host --target --exclude --skip --include-default-paths --rustc-error-format --on-fail --dry-run --dump-bootstrap-shims --stage --keep-stage --keep-stage-std --src --jobs --warnings --json-output --compile-time-deps --color --bypass-bootstrap-lock --rust-profile-generate --rust-profile-use --llvm-profile-use --llvm-profile-generate --enable-bolt-settings --skip-stage0-validation --reproducible-artifact --set --ci --skip-std-check-if-no-download-rustc --help [PATHS]... [ARGS]..." if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) return 0 @@ -4856,7 +4856,7 @@ _x.py() { return 0 ;; x.py__test) - opts="-v -i -j -h --no-fail-fast --test-args --compiletest-rustc-args --all-targets --doc --tests --bless --extra-checks --force-rerun --only-modified --compare-mode --pass --run --rustfix-coverage --no-capture --verbose-run-make-subprocess-output --test-codegen-backend --bypass-ignore-backends --no-doc --verbose --incremental --config --build-dir --build --host --target --exclude --skip --include-default-paths --rustc-error-format --on-fail --dry-run --dump-bootstrap-shims --stage --keep-stage --keep-stage-std --src --jobs --warnings --json-output --compile-time-deps --color --bypass-bootstrap-lock --rust-profile-generate --rust-profile-use --llvm-profile-use --llvm-profile-generate --enable-bolt-settings --skip-stage0-validation --reproducible-artifact --set --ci --skip-std-check-if-no-download-rustc --help [PATHS]... [ARGS]..." + opts="-v -q -i -j -h --no-fail-fast --test-args --compiletest-rustc-args --all-targets --doc --tests --bless --extra-checks --force-rerun --only-modified --compare-mode --pass --run --rustfix-coverage --no-capture --verbose-run-make-subprocess-output --test-codegen-backend --bypass-ignore-backends --no-doc --verbose --quiet --incremental --config --build-dir --build --host --target --exclude --skip --include-default-paths --rustc-error-format --on-fail --dry-run --dump-bootstrap-shims --stage --keep-stage --keep-stage-std --src --jobs --warnings --json-output --compile-time-deps --color --bypass-bootstrap-lock --rust-profile-generate --rust-profile-use --llvm-profile-use --llvm-profile-generate --enable-bolt-settings --skip-stage0-validation --reproducible-artifact --set --ci --skip-std-check-if-no-download-rustc --help [PATHS]... [ARGS]..." if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) return 0 @@ -5074,7 +5074,7 @@ _x.py() { return 0 ;; x.py__vendor) - opts="-v -i -j -h --sync --versioned-dirs --verbose --incremental --config --build-dir --build --host --target --exclude --skip --include-default-paths --rustc-error-format --on-fail --dry-run --dump-bootstrap-shims --stage --keep-stage --keep-stage-std --src --jobs --warnings --json-output --compile-time-deps --color --bypass-bootstrap-lock --rust-profile-generate --rust-profile-use --llvm-profile-use --llvm-profile-generate --enable-bolt-settings --skip-stage0-validation --reproducible-artifact --set --ci --skip-std-check-if-no-download-rustc --help [PATHS]... [ARGS]..." + opts="-v -q -i -j -h --sync --versioned-dirs --verbose --quiet --incremental --config --build-dir --build --host --target --exclude --skip --include-default-paths --rustc-error-format --on-fail --dry-run --dump-bootstrap-shims --stage --keep-stage --keep-stage-std --src --jobs --warnings --json-output --compile-time-deps --color --bypass-bootstrap-lock --rust-profile-generate --rust-profile-use --llvm-profile-use --llvm-profile-generate --enable-bolt-settings --skip-stage0-validation --reproducible-artifact --set --ci --skip-std-check-if-no-download-rustc --help [PATHS]... [ARGS]..." if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) return 0 diff --git a/src/etc/completions/x.py.zsh b/src/etc/completions/x.py.zsh index 1f8701c297baa..16fca305719ca 100644 --- a/src/etc/completions/x.py.zsh +++ b/src/etc/completions/x.py.zsh @@ -38,8 +38,10 @@ _x.py() { '*--reproducible-artifact=[Additional reproducible artifacts that should be added to the reproducible artifacts archive]:REPRODUCIBLE_ARTIFACT:_default' \ '*--set=[override options in bootstrap.toml]:section.option=value:' \ '--ci=[Make bootstrap to behave as it'\''s running on the CI environment or not]:bool:(true false)' \ -'*-v[use verbose output (-vv for very verbose)]' \ -'*--verbose[use verbose output (-vv for very verbose)]' \ +'(-q --quiet)*-v[use verbose output (-vv for very verbose)]' \ +'(-q --quiet)*--verbose[use verbose output (-vv for very verbose)]' \ +'(-v --verbose)-q[use quiet output]' \ +'(-v --verbose)--quiet[use quiet output]' \ '-i[use incremental compilation]' \ '--incremental[use incremental compilation]' \ '--include-default-paths[include default paths in addition to the provided ones]' \ @@ -91,8 +93,10 @@ _arguments "${_arguments_options[@]}" : \ '*--set=[override options in bootstrap.toml]:section.option=value:' \ '--ci=[Make bootstrap to behave as it'\''s running on the CI environment or not]:bool:(true false)' \ '--timings[Pass \`--timings\` to Cargo to get crate build timings]' \ -'*-v[use verbose output (-vv for very verbose)]' \ -'*--verbose[use verbose output (-vv for very verbose)]' \ +'(-q --quiet)*-v[use verbose output (-vv for very verbose)]' \ +'(-q --quiet)*--verbose[use verbose output (-vv for very verbose)]' \ +'(-v --verbose)-q[use quiet output]' \ +'(-v --verbose)--quiet[use quiet output]' \ '-i[use incremental compilation]' \ '--incremental[use incremental compilation]' \ '--include-default-paths[include default paths in addition to the provided ones]' \ @@ -136,8 +140,10 @@ _arguments "${_arguments_options[@]}" : \ '*--set=[override options in bootstrap.toml]:section.option=value:' \ '--ci=[Make bootstrap to behave as it'\''s running on the CI environment or not]:bool:(true false)' \ '--timings[Pass \`--timings\` to Cargo to get crate build timings]' \ -'*-v[use verbose output (-vv for very verbose)]' \ -'*--verbose[use verbose output (-vv for very verbose)]' \ +'(-q --quiet)*-v[use verbose output (-vv for very verbose)]' \ +'(-q --quiet)*--verbose[use verbose output (-vv for very verbose)]' \ +'(-v --verbose)-q[use quiet output]' \ +'(-v --verbose)--quiet[use quiet output]' \ '-i[use incremental compilation]' \ '--incremental[use incremental compilation]' \ '--include-default-paths[include default paths in addition to the provided ones]' \ @@ -182,8 +188,10 @@ _arguments "${_arguments_options[@]}" : \ '--ci=[Make bootstrap to behave as it'\''s running on the CI environment or not]:bool:(true false)' \ '--all-targets[Check all targets]' \ '--timings[Pass \`--timings\` to Cargo to get crate build timings]' \ -'*-v[use verbose output (-vv for very verbose)]' \ -'*--verbose[use verbose output (-vv for very verbose)]' \ +'(-q --quiet)*-v[use verbose output (-vv for very verbose)]' \ +'(-q --quiet)*--verbose[use verbose output (-vv for very verbose)]' \ +'(-v --verbose)-q[use quiet output]' \ +'(-v --verbose)--quiet[use quiet output]' \ '-i[use incremental compilation]' \ '--incremental[use incremental compilation]' \ '--include-default-paths[include default paths in addition to the provided ones]' \ @@ -228,8 +236,10 @@ _arguments "${_arguments_options[@]}" : \ '--ci=[Make bootstrap to behave as it'\''s running on the CI environment or not]:bool:(true false)' \ '--all-targets[Check all targets]' \ '--timings[Pass \`--timings\` to Cargo to get crate build timings]' \ -'*-v[use verbose output (-vv for very verbose)]' \ -'*--verbose[use verbose output (-vv for very verbose)]' \ +'(-q --quiet)*-v[use verbose output (-vv for very verbose)]' \ +'(-q --quiet)*--verbose[use verbose output (-vv for very verbose)]' \ +'(-v --verbose)-q[use quiet output]' \ +'(-v --verbose)--quiet[use quiet output]' \ '-i[use incremental compilation]' \ '--incremental[use incremental compilation]' \ '--include-default-paths[include default paths in addition to the provided ones]' \ @@ -279,8 +289,10 @@ _arguments "${_arguments_options[@]}" : \ '--fix[]' \ '--allow-dirty[]' \ '--allow-staged[]' \ -'*-v[use verbose output (-vv for very verbose)]' \ -'*--verbose[use verbose output (-vv for very verbose)]' \ +'(-q --quiet)*-v[use verbose output (-vv for very verbose)]' \ +'(-q --quiet)*--verbose[use verbose output (-vv for very verbose)]' \ +'(-v --verbose)-q[use quiet output]' \ +'(-v --verbose)--quiet[use quiet output]' \ '-i[use incremental compilation]' \ '--incremental[use incremental compilation]' \ '--include-default-paths[include default paths in addition to the provided ones]' \ @@ -323,8 +335,10 @@ _arguments "${_arguments_options[@]}" : \ '*--reproducible-artifact=[Additional reproducible artifacts that should be added to the reproducible artifacts archive]:REPRODUCIBLE_ARTIFACT:_default' \ '*--set=[override options in bootstrap.toml]:section.option=value:' \ '--ci=[Make bootstrap to behave as it'\''s running on the CI environment or not]:bool:(true false)' \ -'*-v[use verbose output (-vv for very verbose)]' \ -'*--verbose[use verbose output (-vv for very verbose)]' \ +'(-q --quiet)*-v[use verbose output (-vv for very verbose)]' \ +'(-q --quiet)*--verbose[use verbose output (-vv for very verbose)]' \ +'(-v --verbose)-q[use quiet output]' \ +'(-v --verbose)--quiet[use quiet output]' \ '-i[use incremental compilation]' \ '--incremental[use incremental compilation]' \ '--include-default-paths[include default paths in addition to the provided ones]' \ @@ -369,8 +383,10 @@ _arguments "${_arguments_options[@]}" : \ '--ci=[Make bootstrap to behave as it'\''s running on the CI environment or not]:bool:(true false)' \ '--check[check formatting instead of applying]' \ '--all[apply to all appropriate files, not just those that have been modified]' \ -'*-v[use verbose output (-vv for very verbose)]' \ -'*--verbose[use verbose output (-vv for very verbose)]' \ +'(-q --quiet)*-v[use verbose output (-vv for very verbose)]' \ +'(-q --quiet)*--verbose[use verbose output (-vv for very verbose)]' \ +'(-v --verbose)-q[use quiet output]' \ +'(-v --verbose)--quiet[use quiet output]' \ '-i[use incremental compilation]' \ '--incremental[use incremental compilation]' \ '--include-default-paths[include default paths in addition to the provided ones]' \ @@ -415,8 +431,10 @@ _arguments "${_arguments_options[@]}" : \ '--ci=[Make bootstrap to behave as it'\''s running on the CI environment or not]:bool:(true false)' \ '--open[open the docs in a browser]' \ '--json[render the documentation in JSON format in addition to the usual HTML format]' \ -'*-v[use verbose output (-vv for very verbose)]' \ -'*--verbose[use verbose output (-vv for very verbose)]' \ +'(-q --quiet)*-v[use verbose output (-vv for very verbose)]' \ +'(-q --quiet)*--verbose[use verbose output (-vv for very verbose)]' \ +'(-v --verbose)-q[use quiet output]' \ +'(-v --verbose)--quiet[use quiet output]' \ '-i[use incremental compilation]' \ '--incremental[use incremental compilation]' \ '--include-default-paths[include default paths in addition to the provided ones]' \ @@ -461,8 +479,10 @@ _arguments "${_arguments_options[@]}" : \ '--ci=[Make bootstrap to behave as it'\''s running on the CI environment or not]:bool:(true false)' \ '--open[open the docs in a browser]' \ '--json[render the documentation in JSON format in addition to the usual HTML format]' \ -'*-v[use verbose output (-vv for very verbose)]' \ -'*--verbose[use verbose output (-vv for very verbose)]' \ +'(-q --quiet)*-v[use verbose output (-vv for very verbose)]' \ +'(-q --quiet)*--verbose[use verbose output (-vv for very verbose)]' \ +'(-v --verbose)-q[use quiet output]' \ +'(-v --verbose)--quiet[use quiet output]' \ '-i[use incremental compilation]' \ '--incremental[use incremental compilation]' \ '--include-default-paths[include default paths in addition to the provided ones]' \ @@ -524,8 +544,10 @@ _arguments "${_arguments_options[@]}" : \ '--no-capture[don'\''t capture stdout/stderr of tests]' \ '--bypass-ignore-backends[Ignore \`//@ ignore-backends\` directives]' \ '--no-doc[Deprecated. Use \`--all-targets\` or \`--tests\` instead]' \ -'*-v[use verbose output (-vv for very verbose)]' \ -'*--verbose[use verbose output (-vv for very verbose)]' \ +'(-q --quiet)*-v[use verbose output (-vv for very verbose)]' \ +'(-q --quiet)*--verbose[use verbose output (-vv for very verbose)]' \ +'(-v --verbose)-q[use quiet output]' \ +'(-v --verbose)--quiet[use quiet output]' \ '-i[use incremental compilation]' \ '--incremental[use incremental compilation]' \ '--include-default-paths[include default paths in addition to the provided ones]' \ @@ -587,8 +609,10 @@ _arguments "${_arguments_options[@]}" : \ '--no-capture[don'\''t capture stdout/stderr of tests]' \ '--bypass-ignore-backends[Ignore \`//@ ignore-backends\` directives]' \ '--no-doc[Deprecated. Use \`--all-targets\` or \`--tests\` instead]' \ -'*-v[use verbose output (-vv for very verbose)]' \ -'*--verbose[use verbose output (-vv for very verbose)]' \ +'(-q --quiet)*-v[use verbose output (-vv for very verbose)]' \ +'(-q --quiet)*--verbose[use verbose output (-vv for very verbose)]' \ +'(-v --verbose)-q[use quiet output]' \ +'(-v --verbose)--quiet[use quiet output]' \ '-i[use incremental compilation]' \ '--incremental[use incremental compilation]' \ '--include-default-paths[include default paths in addition to the provided ones]' \ @@ -637,8 +661,10 @@ _arguments "${_arguments_options[@]}" : \ '--doc[Only run doc tests]' \ '--tests[Only run unit and integration tests]' \ '--no-doc[Deprecated. Use \`--all-targets\` or \`--tests\` instead]' \ -'*-v[use verbose output (-vv for very verbose)]' \ -'*--verbose[use verbose output (-vv for very verbose)]' \ +'(-q --quiet)*-v[use verbose output (-vv for very verbose)]' \ +'(-q --quiet)*--verbose[use verbose output (-vv for very verbose)]' \ +'(-v --verbose)-q[use quiet output]' \ +'(-v --verbose)--quiet[use quiet output]' \ '-i[use incremental compilation]' \ '--incremental[use incremental compilation]' \ '--include-default-paths[include default paths in addition to the provided ones]' \ @@ -682,8 +708,10 @@ _arguments "${_arguments_options[@]}" : \ '*--reproducible-artifact=[Additional reproducible artifacts that should be added to the reproducible artifacts archive]:REPRODUCIBLE_ARTIFACT:_default' \ '*--set=[override options in bootstrap.toml]:section.option=value:' \ '--ci=[Make bootstrap to behave as it'\''s running on the CI environment or not]:bool:(true false)' \ -'*-v[use verbose output (-vv for very verbose)]' \ -'*--verbose[use verbose output (-vv for very verbose)]' \ +'(-q --quiet)*-v[use verbose output (-vv for very verbose)]' \ +'(-q --quiet)*--verbose[use verbose output (-vv for very verbose)]' \ +'(-v --verbose)-q[use quiet output]' \ +'(-v --verbose)--quiet[use quiet output]' \ '-i[use incremental compilation]' \ '--incremental[use incremental compilation]' \ '--include-default-paths[include default paths in addition to the provided ones]' \ @@ -727,8 +755,10 @@ _arguments "${_arguments_options[@]}" : \ '*--set=[override options in bootstrap.toml]:section.option=value:' \ '--ci=[Make bootstrap to behave as it'\''s running on the CI environment or not]:bool:(true false)' \ '--all[Clean the entire build directory (not used by default)]' \ -'*-v[use verbose output (-vv for very verbose)]' \ -'*--verbose[use verbose output (-vv for very verbose)]' \ +'(-q --quiet)*-v[use verbose output (-vv for very verbose)]' \ +'(-q --quiet)*--verbose[use verbose output (-vv for very verbose)]' \ +'(-v --verbose)-q[use quiet output]' \ +'(-v --verbose)--quiet[use quiet output]' \ '-i[use incremental compilation]' \ '--incremental[use incremental compilation]' \ '--include-default-paths[include default paths in addition to the provided ones]' \ @@ -771,8 +801,10 @@ _arguments "${_arguments_options[@]}" : \ '*--reproducible-artifact=[Additional reproducible artifacts that should be added to the reproducible artifacts archive]:REPRODUCIBLE_ARTIFACT:_default' \ '*--set=[override options in bootstrap.toml]:section.option=value:' \ '--ci=[Make bootstrap to behave as it'\''s running on the CI environment or not]:bool:(true false)' \ -'*-v[use verbose output (-vv for very verbose)]' \ -'*--verbose[use verbose output (-vv for very verbose)]' \ +'(-q --quiet)*-v[use verbose output (-vv for very verbose)]' \ +'(-q --quiet)*--verbose[use verbose output (-vv for very verbose)]' \ +'(-v --verbose)-q[use quiet output]' \ +'(-v --verbose)--quiet[use quiet output]' \ '-i[use incremental compilation]' \ '--incremental[use incremental compilation]' \ '--include-default-paths[include default paths in addition to the provided ones]' \ @@ -815,8 +847,10 @@ _arguments "${_arguments_options[@]}" : \ '*--reproducible-artifact=[Additional reproducible artifacts that should be added to the reproducible artifacts archive]:REPRODUCIBLE_ARTIFACT:_default' \ '*--set=[override options in bootstrap.toml]:section.option=value:' \ '--ci=[Make bootstrap to behave as it'\''s running on the CI environment or not]:bool:(true false)' \ -'*-v[use verbose output (-vv for very verbose)]' \ -'*--verbose[use verbose output (-vv for very verbose)]' \ +'(-q --quiet)*-v[use verbose output (-vv for very verbose)]' \ +'(-q --quiet)*--verbose[use verbose output (-vv for very verbose)]' \ +'(-v --verbose)-q[use quiet output]' \ +'(-v --verbose)--quiet[use quiet output]' \ '-i[use incremental compilation]' \ '--incremental[use incremental compilation]' \ '--include-default-paths[include default paths in addition to the provided ones]' \ @@ -860,8 +894,10 @@ _arguments "${_arguments_options[@]}" : \ '*--reproducible-artifact=[Additional reproducible artifacts that should be added to the reproducible artifacts archive]:REPRODUCIBLE_ARTIFACT:_default' \ '*--set=[override options in bootstrap.toml]:section.option=value:' \ '--ci=[Make bootstrap to behave as it'\''s running on the CI environment or not]:bool:(true false)' \ -'*-v[use verbose output (-vv for very verbose)]' \ -'*--verbose[use verbose output (-vv for very verbose)]' \ +'(-q --quiet)*-v[use verbose output (-vv for very verbose)]' \ +'(-q --quiet)*--verbose[use verbose output (-vv for very verbose)]' \ +'(-v --verbose)-q[use quiet output]' \ +'(-v --verbose)--quiet[use quiet output]' \ '-i[use incremental compilation]' \ '--incremental[use incremental compilation]' \ '--include-default-paths[include default paths in addition to the provided ones]' \ @@ -905,8 +941,10 @@ _arguments "${_arguments_options[@]}" : \ '*--reproducible-artifact=[Additional reproducible artifacts that should be added to the reproducible artifacts archive]:REPRODUCIBLE_ARTIFACT:_default' \ '*--set=[override options in bootstrap.toml]:section.option=value:' \ '--ci=[Make bootstrap to behave as it'\''s running on the CI environment or not]:bool:(true false)' \ -'*-v[use verbose output (-vv for very verbose)]' \ -'*--verbose[use verbose output (-vv for very verbose)]' \ +'(-q --quiet)*-v[use verbose output (-vv for very verbose)]' \ +'(-q --quiet)*--verbose[use verbose output (-vv for very verbose)]' \ +'(-v --verbose)-q[use quiet output]' \ +'(-v --verbose)--quiet[use quiet output]' \ '-i[use incremental compilation]' \ '--incremental[use incremental compilation]' \ '--include-default-paths[include default paths in addition to the provided ones]' \ @@ -949,8 +987,10 @@ _arguments "${_arguments_options[@]}" : \ '*--reproducible-artifact=[Additional reproducible artifacts that should be added to the reproducible artifacts archive]:REPRODUCIBLE_ARTIFACT:_default' \ '*--set=[override options in bootstrap.toml]:section.option=value:' \ '--ci=[Make bootstrap to behave as it'\''s running on the CI environment or not]:bool:(true false)' \ -'*-v[use verbose output (-vv for very verbose)]' \ -'*--verbose[use verbose output (-vv for very verbose)]' \ +'(-q --quiet)*-v[use verbose output (-vv for very verbose)]' \ +'(-q --quiet)*--verbose[use verbose output (-vv for very verbose)]' \ +'(-v --verbose)-q[use quiet output]' \ +'(-v --verbose)--quiet[use quiet output]' \ '-i[use incremental compilation]' \ '--incremental[use incremental compilation]' \ '--include-default-paths[include default paths in addition to the provided ones]' \ @@ -996,8 +1036,10 @@ _arguments "${_arguments_options[@]}" : \ '*--set=[override options in bootstrap.toml]:section.option=value:' \ '--ci=[Make bootstrap to behave as it'\''s running on the CI environment or not]:bool:(true false)' \ '--versioned-dirs[Always include version in subdir name]' \ -'*-v[use verbose output (-vv for very verbose)]' \ -'*--verbose[use verbose output (-vv for very verbose)]' \ +'(-q --quiet)*-v[use verbose output (-vv for very verbose)]' \ +'(-q --quiet)*--verbose[use verbose output (-vv for very verbose)]' \ +'(-v --verbose)-q[use quiet output]' \ +'(-v --verbose)--quiet[use quiet output]' \ '-i[use incremental compilation]' \ '--incremental[use incremental compilation]' \ '--include-default-paths[include default paths in addition to the provided ones]' \ @@ -1040,8 +1082,10 @@ _arguments "${_arguments_options[@]}" : \ '*--reproducible-artifact=[Additional reproducible artifacts that should be added to the reproducible artifacts archive]:REPRODUCIBLE_ARTIFACT:_default' \ '*--set=[override options in bootstrap.toml]:section.option=value:' \ '--ci=[Make bootstrap to behave as it'\''s running on the CI environment or not]:bool:(true false)' \ -'*-v[use verbose output (-vv for very verbose)]' \ -'*--verbose[use verbose output (-vv for very verbose)]' \ +'(-q --quiet)*-v[use verbose output (-vv for very verbose)]' \ +'(-q --quiet)*--verbose[use verbose output (-vv for very verbose)]' \ +'(-v --verbose)-q[use quiet output]' \ +'(-v --verbose)--quiet[use quiet output]' \ '-i[use incremental compilation]' \ '--incremental[use incremental compilation]' \ '--include-default-paths[include default paths in addition to the provided ones]' \ @@ -1096,8 +1140,10 @@ _arguments "${_arguments_options[@]}" : \ '*--reproducible-artifact=[Additional reproducible artifacts that should be added to the reproducible artifacts archive]:REPRODUCIBLE_ARTIFACT:_default' \ '*--set=[override options in bootstrap.toml]:section.option=value:' \ '--ci=[Make bootstrap to behave as it'\''s running on the CI environment or not]:bool:(true false)' \ -'*-v[use verbose output (-vv for very verbose)]' \ -'*--verbose[use verbose output (-vv for very verbose)]' \ +'(-q --quiet)*-v[use verbose output (-vv for very verbose)]' \ +'(-q --quiet)*--verbose[use verbose output (-vv for very verbose)]' \ +'(-v --verbose)-q[use quiet output]' \ +'(-v --verbose)--quiet[use quiet output]' \ '-i[use incremental compilation]' \ '--incremental[use incremental compilation]' \ '--include-default-paths[include default paths in addition to the provided ones]' \ @@ -1143,8 +1189,10 @@ _arguments "${_arguments_options[@]}" : \ '*--reproducible-artifact=[Additional reproducible artifacts that should be added to the reproducible artifacts archive]:REPRODUCIBLE_ARTIFACT:_default' \ '*--set=[override options in bootstrap.toml]:section.option=value:' \ '--ci=[Make bootstrap to behave as it'\''s running on the CI environment or not]:bool:(true false)' \ -'*-v[use verbose output (-vv for very verbose)]' \ -'*--verbose[use verbose output (-vv for very verbose)]' \ +'(-q --quiet)*-v[use verbose output (-vv for very verbose)]' \ +'(-q --quiet)*--verbose[use verbose output (-vv for very verbose)]' \ +'(-v --verbose)-q[use quiet output]' \ +'(-v --verbose)--quiet[use quiet output]' \ '-i[use incremental compilation]' \ '--incremental[use incremental compilation]' \ '--include-default-paths[include default paths in addition to the provided ones]' \ @@ -1190,8 +1238,10 @@ _arguments "${_arguments_options[@]}" : \ '*--reproducible-artifact=[Additional reproducible artifacts that should be added to the reproducible artifacts archive]:REPRODUCIBLE_ARTIFACT:_default' \ '*--set=[override options in bootstrap.toml]:section.option=value:' \ '--ci=[Make bootstrap to behave as it'\''s running on the CI environment or not]:bool:(true false)' \ -'*-v[use verbose output (-vv for very verbose)]' \ -'*--verbose[use verbose output (-vv for very verbose)]' \ +'(-q --quiet)*-v[use verbose output (-vv for very verbose)]' \ +'(-q --quiet)*--verbose[use verbose output (-vv for very verbose)]' \ +'(-v --verbose)-q[use quiet output]' \ +'(-v --verbose)--quiet[use quiet output]' \ '-i[use incremental compilation]' \ '--incremental[use incremental compilation]' \ '--include-default-paths[include default paths in addition to the provided ones]' \ @@ -1237,8 +1287,10 @@ _arguments "${_arguments_options[@]}" : \ '*--reproducible-artifact=[Additional reproducible artifacts that should be added to the reproducible artifacts archive]:REPRODUCIBLE_ARTIFACT:_default' \ '*--set=[override options in bootstrap.toml]:section.option=value:' \ '--ci=[Make bootstrap to behave as it'\''s running on the CI environment or not]:bool:(true false)' \ -'*-v[use verbose output (-vv for very verbose)]' \ -'*--verbose[use verbose output (-vv for very verbose)]' \ +'(-q --quiet)*-v[use verbose output (-vv for very verbose)]' \ +'(-q --quiet)*--verbose[use verbose output (-vv for very verbose)]' \ +'(-v --verbose)-q[use quiet output]' \ +'(-v --verbose)--quiet[use quiet output]' \ '-i[use incremental compilation]' \ '--incremental[use incremental compilation]' \ '--include-default-paths[include default paths in addition to the provided ones]' \ @@ -1282,8 +1334,10 @@ _arguments "${_arguments_options[@]}" : \ '*--reproducible-artifact=[Additional reproducible artifacts that should be added to the reproducible artifacts archive]:REPRODUCIBLE_ARTIFACT:_default' \ '*--set=[override options in bootstrap.toml]:section.option=value:' \ '--ci=[Make bootstrap to behave as it'\''s running on the CI environment or not]:bool:(true false)' \ -'*-v[use verbose output (-vv for very verbose)]' \ -'*--verbose[use verbose output (-vv for very verbose)]' \ +'(-q --quiet)*-v[use verbose output (-vv for very verbose)]' \ +'(-q --quiet)*--verbose[use verbose output (-vv for very verbose)]' \ +'(-v --verbose)-q[use quiet output]' \ +'(-v --verbose)--quiet[use quiet output]' \ '-i[use incremental compilation]' \ '--incremental[use incremental compilation]' \ '--include-default-paths[include default paths in addition to the provided ones]' \ diff --git a/src/etc/completions/x.sh b/src/etc/completions/x.sh index 6314fe1307dcb..27b2a45efd53f 100644 --- a/src/etc/completions/x.sh +++ b/src/etc/completions/x.sh @@ -97,7 +97,7 @@ _x() { case "${cmd}" in x) - opts="-v -i -j -h --verbose --incremental --config --build-dir --build --host --target --exclude --skip --include-default-paths --rustc-error-format --on-fail --dry-run --dump-bootstrap-shims --stage --keep-stage --keep-stage-std --src --jobs --warnings --json-output --compile-time-deps --color --bypass-bootstrap-lock --rust-profile-generate --rust-profile-use --llvm-profile-use --llvm-profile-generate --enable-bolt-settings --skip-stage0-validation --reproducible-artifact --set --ci --skip-std-check-if-no-download-rustc --help [PATHS]... [ARGS]... build b check c clippy fix fmt doc d test t miri bench clean dist install run r setup vendor perf" + opts="-v -q -i -j -h --verbose --quiet --incremental --config --build-dir --build --host --target --exclude --skip --include-default-paths --rustc-error-format --on-fail --dry-run --dump-bootstrap-shims --stage --keep-stage --keep-stage-std --src --jobs --warnings --json-output --compile-time-deps --color --bypass-bootstrap-lock --rust-profile-generate --rust-profile-use --llvm-profile-use --llvm-profile-generate --enable-bolt-settings --skip-stage0-validation --reproducible-artifact --set --ci --skip-std-check-if-no-download-rustc --help [PATHS]... [ARGS]... build b check c clippy fix fmt doc d test t miri bench clean dist install run r setup vendor perf" if [[ ${cur} == -* || ${COMP_CWORD} -eq 1 ]] ; then COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) return 0 @@ -283,7 +283,7 @@ _x() { return 0 ;; x__bench) - opts="-v -i -j -h --test-args --verbose --incremental --config --build-dir --build --host --target --exclude --skip --include-default-paths --rustc-error-format --on-fail --dry-run --dump-bootstrap-shims --stage --keep-stage --keep-stage-std --src --jobs --warnings --json-output --compile-time-deps --color --bypass-bootstrap-lock --rust-profile-generate --rust-profile-use --llvm-profile-use --llvm-profile-generate --enable-bolt-settings --skip-stage0-validation --reproducible-artifact --set --ci --skip-std-check-if-no-download-rustc --help [PATHS]... [ARGS]..." + opts="-v -q -i -j -h --test-args --verbose --quiet --incremental --config --build-dir --build --host --target --exclude --skip --include-default-paths --rustc-error-format --on-fail --dry-run --dump-bootstrap-shims --stage --keep-stage --keep-stage-std --src --jobs --warnings --json-output --compile-time-deps --color --bypass-bootstrap-lock --rust-profile-generate --rust-profile-use --llvm-profile-use --llvm-profile-generate --enable-bolt-settings --skip-stage0-validation --reproducible-artifact --set --ci --skip-std-check-if-no-download-rustc --help [PATHS]... [ARGS]..." if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) return 0 @@ -473,7 +473,7 @@ _x() { return 0 ;; x__build) - opts="-v -i -j -h --timings --verbose --incremental --config --build-dir --build --host --target --exclude --skip --include-default-paths --rustc-error-format --on-fail --dry-run --dump-bootstrap-shims --stage --keep-stage --keep-stage-std --src --jobs --warnings --json-output --compile-time-deps --color --bypass-bootstrap-lock --rust-profile-generate --rust-profile-use --llvm-profile-use --llvm-profile-generate --enable-bolt-settings --skip-stage0-validation --reproducible-artifact --set --ci --skip-std-check-if-no-download-rustc --help [PATHS]... [ARGS]..." + opts="-v -q -i -j -h --timings --verbose --quiet --incremental --config --build-dir --build --host --target --exclude --skip --include-default-paths --rustc-error-format --on-fail --dry-run --dump-bootstrap-shims --stage --keep-stage --keep-stage-std --src --jobs --warnings --json-output --compile-time-deps --color --bypass-bootstrap-lock --rust-profile-generate --rust-profile-use --llvm-profile-use --llvm-profile-generate --enable-bolt-settings --skip-stage0-validation --reproducible-artifact --set --ci --skip-std-check-if-no-download-rustc --help [PATHS]... [ARGS]..." if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) return 0 @@ -659,7 +659,7 @@ _x() { return 0 ;; x__build) - opts="-v -i -j -h --timings --verbose --incremental --config --build-dir --build --host --target --exclude --skip --include-default-paths --rustc-error-format --on-fail --dry-run --dump-bootstrap-shims --stage --keep-stage --keep-stage-std --src --jobs --warnings --json-output --compile-time-deps --color --bypass-bootstrap-lock --rust-profile-generate --rust-profile-use --llvm-profile-use --llvm-profile-generate --enable-bolt-settings --skip-stage0-validation --reproducible-artifact --set --ci --skip-std-check-if-no-download-rustc --help [PATHS]... [ARGS]..." + opts="-v -q -i -j -h --timings --verbose --quiet --incremental --config --build-dir --build --host --target --exclude --skip --include-default-paths --rustc-error-format --on-fail --dry-run --dump-bootstrap-shims --stage --keep-stage --keep-stage-std --src --jobs --warnings --json-output --compile-time-deps --color --bypass-bootstrap-lock --rust-profile-generate --rust-profile-use --llvm-profile-use --llvm-profile-generate --enable-bolt-settings --skip-stage0-validation --reproducible-artifact --set --ci --skip-std-check-if-no-download-rustc --help [PATHS]... [ARGS]..." if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) return 0 @@ -845,7 +845,7 @@ _x() { return 0 ;; x__check) - opts="-v -i -j -h --all-targets --timings --verbose --incremental --config --build-dir --build --host --target --exclude --skip --include-default-paths --rustc-error-format --on-fail --dry-run --dump-bootstrap-shims --stage --keep-stage --keep-stage-std --src --jobs --warnings --json-output --compile-time-deps --color --bypass-bootstrap-lock --rust-profile-generate --rust-profile-use --llvm-profile-use --llvm-profile-generate --enable-bolt-settings --skip-stage0-validation --reproducible-artifact --set --ci --skip-std-check-if-no-download-rustc --help [PATHS]... [ARGS]..." + opts="-v -q -i -j -h --all-targets --timings --verbose --quiet --incremental --config --build-dir --build --host --target --exclude --skip --include-default-paths --rustc-error-format --on-fail --dry-run --dump-bootstrap-shims --stage --keep-stage --keep-stage-std --src --jobs --warnings --json-output --compile-time-deps --color --bypass-bootstrap-lock --rust-profile-generate --rust-profile-use --llvm-profile-use --llvm-profile-generate --enable-bolt-settings --skip-stage0-validation --reproducible-artifact --set --ci --skip-std-check-if-no-download-rustc --help [PATHS]... [ARGS]..." if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) return 0 @@ -1031,7 +1031,7 @@ _x() { return 0 ;; x__check) - opts="-v -i -j -h --all-targets --timings --verbose --incremental --config --build-dir --build --host --target --exclude --skip --include-default-paths --rustc-error-format --on-fail --dry-run --dump-bootstrap-shims --stage --keep-stage --keep-stage-std --src --jobs --warnings --json-output --compile-time-deps --color --bypass-bootstrap-lock --rust-profile-generate --rust-profile-use --llvm-profile-use --llvm-profile-generate --enable-bolt-settings --skip-stage0-validation --reproducible-artifact --set --ci --skip-std-check-if-no-download-rustc --help [PATHS]... [ARGS]..." + opts="-v -q -i -j -h --all-targets --timings --verbose --quiet --incremental --config --build-dir --build --host --target --exclude --skip --include-default-paths --rustc-error-format --on-fail --dry-run --dump-bootstrap-shims --stage --keep-stage --keep-stage-std --src --jobs --warnings --json-output --compile-time-deps --color --bypass-bootstrap-lock --rust-profile-generate --rust-profile-use --llvm-profile-use --llvm-profile-generate --enable-bolt-settings --skip-stage0-validation --reproducible-artifact --set --ci --skip-std-check-if-no-download-rustc --help [PATHS]... [ARGS]..." if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) return 0 @@ -1217,7 +1217,7 @@ _x() { return 0 ;; x__clean) - opts="-v -i -j -h --all --stage --verbose --incremental --config --build-dir --build --host --target --exclude --skip --include-default-paths --rustc-error-format --on-fail --dry-run --dump-bootstrap-shims --keep-stage --keep-stage-std --src --jobs --warnings --json-output --compile-time-deps --color --bypass-bootstrap-lock --rust-profile-generate --rust-profile-use --llvm-profile-use --llvm-profile-generate --enable-bolt-settings --skip-stage0-validation --reproducible-artifact --set --ci --skip-std-check-if-no-download-rustc --help [PATHS]... [ARGS]..." + opts="-v -q -i -j -h --all --stage --verbose --quiet --incremental --config --build-dir --build --host --target --exclude --skip --include-default-paths --rustc-error-format --on-fail --dry-run --dump-bootstrap-shims --keep-stage --keep-stage-std --src --jobs --warnings --json-output --compile-time-deps --color --bypass-bootstrap-lock --rust-profile-generate --rust-profile-use --llvm-profile-use --llvm-profile-generate --enable-bolt-settings --skip-stage0-validation --reproducible-artifact --set --ci --skip-std-check-if-no-download-rustc --help [PATHS]... [ARGS]..." if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) return 0 @@ -1400,7 +1400,7 @@ _x() { return 0 ;; x__clippy) - opts="-A -D -W -F -v -i -j -h --fix --allow-dirty --allow-staged --verbose --incremental --config --build-dir --build --host --target --exclude --skip --include-default-paths --rustc-error-format --on-fail --dry-run --dump-bootstrap-shims --stage --keep-stage --keep-stage-std --src --jobs --warnings --json-output --compile-time-deps --color --bypass-bootstrap-lock --rust-profile-generate --rust-profile-use --llvm-profile-use --llvm-profile-generate --enable-bolt-settings --skip-stage0-validation --reproducible-artifact --set --ci --skip-std-check-if-no-download-rustc --help [PATHS]... [ARGS]..." + opts="-A -D -W -F -v -q -i -j -h --fix --allow-dirty --allow-staged --verbose --quiet --incremental --config --build-dir --build --host --target --exclude --skip --include-default-paths --rustc-error-format --on-fail --dry-run --dump-bootstrap-shims --stage --keep-stage --keep-stage-std --src --jobs --warnings --json-output --compile-time-deps --color --bypass-bootstrap-lock --rust-profile-generate --rust-profile-use --llvm-profile-use --llvm-profile-generate --enable-bolt-settings --skip-stage0-validation --reproducible-artifact --set --ci --skip-std-check-if-no-download-rustc --help [PATHS]... [ARGS]..." if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) return 0 @@ -1602,7 +1602,7 @@ _x() { return 0 ;; x__dist) - opts="-v -i -j -h --verbose --incremental --config --build-dir --build --host --target --exclude --skip --include-default-paths --rustc-error-format --on-fail --dry-run --dump-bootstrap-shims --stage --keep-stage --keep-stage-std --src --jobs --warnings --json-output --compile-time-deps --color --bypass-bootstrap-lock --rust-profile-generate --rust-profile-use --llvm-profile-use --llvm-profile-generate --enable-bolt-settings --skip-stage0-validation --reproducible-artifact --set --ci --skip-std-check-if-no-download-rustc --help [PATHS]... [ARGS]..." + opts="-v -q -i -j -h --verbose --quiet --incremental --config --build-dir --build --host --target --exclude --skip --include-default-paths --rustc-error-format --on-fail --dry-run --dump-bootstrap-shims --stage --keep-stage --keep-stage-std --src --jobs --warnings --json-output --compile-time-deps --color --bypass-bootstrap-lock --rust-profile-generate --rust-profile-use --llvm-profile-use --llvm-profile-generate --enable-bolt-settings --skip-stage0-validation --reproducible-artifact --set --ci --skip-std-check-if-no-download-rustc --help [PATHS]... [ARGS]..." if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) return 0 @@ -1788,7 +1788,7 @@ _x() { return 0 ;; x__doc) - opts="-v -i -j -h --open --json --verbose --incremental --config --build-dir --build --host --target --exclude --skip --include-default-paths --rustc-error-format --on-fail --dry-run --dump-bootstrap-shims --stage --keep-stage --keep-stage-std --src --jobs --warnings --json-output --compile-time-deps --color --bypass-bootstrap-lock --rust-profile-generate --rust-profile-use --llvm-profile-use --llvm-profile-generate --enable-bolt-settings --skip-stage0-validation --reproducible-artifact --set --ci --skip-std-check-if-no-download-rustc --help [PATHS]... [ARGS]..." + opts="-v -q -i -j -h --open --json --verbose --quiet --incremental --config --build-dir --build --host --target --exclude --skip --include-default-paths --rustc-error-format --on-fail --dry-run --dump-bootstrap-shims --stage --keep-stage --keep-stage-std --src --jobs --warnings --json-output --compile-time-deps --color --bypass-bootstrap-lock --rust-profile-generate --rust-profile-use --llvm-profile-use --llvm-profile-generate --enable-bolt-settings --skip-stage0-validation --reproducible-artifact --set --ci --skip-std-check-if-no-download-rustc --help [PATHS]... [ARGS]..." if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) return 0 @@ -1974,7 +1974,7 @@ _x() { return 0 ;; x__doc) - opts="-v -i -j -h --open --json --verbose --incremental --config --build-dir --build --host --target --exclude --skip --include-default-paths --rustc-error-format --on-fail --dry-run --dump-bootstrap-shims --stage --keep-stage --keep-stage-std --src --jobs --warnings --json-output --compile-time-deps --color --bypass-bootstrap-lock --rust-profile-generate --rust-profile-use --llvm-profile-use --llvm-profile-generate --enable-bolt-settings --skip-stage0-validation --reproducible-artifact --set --ci --skip-std-check-if-no-download-rustc --help [PATHS]... [ARGS]..." + opts="-v -q -i -j -h --open --json --verbose --quiet --incremental --config --build-dir --build --host --target --exclude --skip --include-default-paths --rustc-error-format --on-fail --dry-run --dump-bootstrap-shims --stage --keep-stage --keep-stage-std --src --jobs --warnings --json-output --compile-time-deps --color --bypass-bootstrap-lock --rust-profile-generate --rust-profile-use --llvm-profile-use --llvm-profile-generate --enable-bolt-settings --skip-stage0-validation --reproducible-artifact --set --ci --skip-std-check-if-no-download-rustc --help [PATHS]... [ARGS]..." if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) return 0 @@ -2160,7 +2160,7 @@ _x() { return 0 ;; x__fix) - opts="-v -i -j -h --verbose --incremental --config --build-dir --build --host --target --exclude --skip --include-default-paths --rustc-error-format --on-fail --dry-run --dump-bootstrap-shims --stage --keep-stage --keep-stage-std --src --jobs --warnings --json-output --compile-time-deps --color --bypass-bootstrap-lock --rust-profile-generate --rust-profile-use --llvm-profile-use --llvm-profile-generate --enable-bolt-settings --skip-stage0-validation --reproducible-artifact --set --ci --skip-std-check-if-no-download-rustc --help [PATHS]... [ARGS]..." + opts="-v -q -i -j -h --verbose --quiet --incremental --config --build-dir --build --host --target --exclude --skip --include-default-paths --rustc-error-format --on-fail --dry-run --dump-bootstrap-shims --stage --keep-stage --keep-stage-std --src --jobs --warnings --json-output --compile-time-deps --color --bypass-bootstrap-lock --rust-profile-generate --rust-profile-use --llvm-profile-use --llvm-profile-generate --enable-bolt-settings --skip-stage0-validation --reproducible-artifact --set --ci --skip-std-check-if-no-download-rustc --help [PATHS]... [ARGS]..." if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) return 0 @@ -2346,7 +2346,7 @@ _x() { return 0 ;; x__fmt) - opts="-v -i -j -h --check --all --verbose --incremental --config --build-dir --build --host --target --exclude --skip --include-default-paths --rustc-error-format --on-fail --dry-run --dump-bootstrap-shims --stage --keep-stage --keep-stage-std --src --jobs --warnings --json-output --compile-time-deps --color --bypass-bootstrap-lock --rust-profile-generate --rust-profile-use --llvm-profile-use --llvm-profile-generate --enable-bolt-settings --skip-stage0-validation --reproducible-artifact --set --ci --skip-std-check-if-no-download-rustc --help [PATHS]... [ARGS]..." + opts="-v -q -i -j -h --check --all --verbose --quiet --incremental --config --build-dir --build --host --target --exclude --skip --include-default-paths --rustc-error-format --on-fail --dry-run --dump-bootstrap-shims --stage --keep-stage --keep-stage-std --src --jobs --warnings --json-output --compile-time-deps --color --bypass-bootstrap-lock --rust-profile-generate --rust-profile-use --llvm-profile-use --llvm-profile-generate --enable-bolt-settings --skip-stage0-validation --reproducible-artifact --set --ci --skip-std-check-if-no-download-rustc --help [PATHS]... [ARGS]..." if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) return 0 @@ -2532,7 +2532,7 @@ _x() { return 0 ;; x__install) - opts="-v -i -j -h --verbose --incremental --config --build-dir --build --host --target --exclude --skip --include-default-paths --rustc-error-format --on-fail --dry-run --dump-bootstrap-shims --stage --keep-stage --keep-stage-std --src --jobs --warnings --json-output --compile-time-deps --color --bypass-bootstrap-lock --rust-profile-generate --rust-profile-use --llvm-profile-use --llvm-profile-generate --enable-bolt-settings --skip-stage0-validation --reproducible-artifact --set --ci --skip-std-check-if-no-download-rustc --help [PATHS]... [ARGS]..." + opts="-v -q -i -j -h --verbose --quiet --incremental --config --build-dir --build --host --target --exclude --skip --include-default-paths --rustc-error-format --on-fail --dry-run --dump-bootstrap-shims --stage --keep-stage --keep-stage-std --src --jobs --warnings --json-output --compile-time-deps --color --bypass-bootstrap-lock --rust-profile-generate --rust-profile-use --llvm-profile-use --llvm-profile-generate --enable-bolt-settings --skip-stage0-validation --reproducible-artifact --set --ci --skip-std-check-if-no-download-rustc --help [PATHS]... [ARGS]..." if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) return 0 @@ -2718,7 +2718,7 @@ _x() { return 0 ;; x__miri) - opts="-v -i -j -h --no-fail-fast --test-args --all-targets --doc --tests --no-doc --verbose --incremental --config --build-dir --build --host --target --exclude --skip --include-default-paths --rustc-error-format --on-fail --dry-run --dump-bootstrap-shims --stage --keep-stage --keep-stage-std --src --jobs --warnings --json-output --compile-time-deps --color --bypass-bootstrap-lock --rust-profile-generate --rust-profile-use --llvm-profile-use --llvm-profile-generate --enable-bolt-settings --skip-stage0-validation --reproducible-artifact --set --ci --skip-std-check-if-no-download-rustc --help [PATHS]... [ARGS]..." + opts="-v -q -i -j -h --no-fail-fast --test-args --all-targets --doc --tests --no-doc --verbose --quiet --incremental --config --build-dir --build --host --target --exclude --skip --include-default-paths --rustc-error-format --on-fail --dry-run --dump-bootstrap-shims --stage --keep-stage --keep-stage-std --src --jobs --warnings --json-output --compile-time-deps --color --bypass-bootstrap-lock --rust-profile-generate --rust-profile-use --llvm-profile-use --llvm-profile-generate --enable-bolt-settings --skip-stage0-validation --reproducible-artifact --set --ci --skip-std-check-if-no-download-rustc --help [PATHS]... [ARGS]..." if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) return 0 @@ -2908,7 +2908,7 @@ _x() { return 0 ;; x__perf) - opts="-v -i -j -h --verbose --incremental --config --build-dir --build --host --target --exclude --skip --include-default-paths --rustc-error-format --on-fail --dry-run --dump-bootstrap-shims --stage --keep-stage --keep-stage-std --src --jobs --warnings --json-output --compile-time-deps --color --bypass-bootstrap-lock --rust-profile-generate --rust-profile-use --llvm-profile-use --llvm-profile-generate --enable-bolt-settings --skip-stage0-validation --reproducible-artifact --set --ci --skip-std-check-if-no-download-rustc --help [PATHS]... [ARGS]... eprintln samply cachegrind benchmark compare" + opts="-v -q -i -j -h --verbose --quiet --incremental --config --build-dir --build --host --target --exclude --skip --include-default-paths --rustc-error-format --on-fail --dry-run --dump-bootstrap-shims --stage --keep-stage --keep-stage-std --src --jobs --warnings --json-output --compile-time-deps --color --bypass-bootstrap-lock --rust-profile-generate --rust-profile-use --llvm-profile-use --llvm-profile-generate --enable-bolt-settings --skip-stage0-validation --reproducible-artifact --set --ci --skip-std-check-if-no-download-rustc --help [PATHS]... [ARGS]... eprintln samply cachegrind benchmark compare" if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) return 0 @@ -3094,7 +3094,7 @@ _x() { return 0 ;; x__perf__benchmark) - opts="-v -i -j -h --include --exclude --scenarios --profiles --verbose --incremental --config --build-dir --build --host --target --skip --include-default-paths --rustc-error-format --on-fail --dry-run --dump-bootstrap-shims --stage --keep-stage --keep-stage-std --src --jobs --warnings --json-output --compile-time-deps --color --bypass-bootstrap-lock --rust-profile-generate --rust-profile-use --llvm-profile-use --llvm-profile-generate --enable-bolt-settings --skip-stage0-validation --reproducible-artifact --set --ci --skip-std-check-if-no-download-rustc --help [PATHS]... [ARGS]..." + opts="-v -q -i -j -h --include --exclude --scenarios --profiles --verbose --quiet --incremental --config --build-dir --build --host --target --skip --include-default-paths --rustc-error-format --on-fail --dry-run --dump-bootstrap-shims --stage --keep-stage --keep-stage-std --src --jobs --warnings --json-output --compile-time-deps --color --bypass-bootstrap-lock --rust-profile-generate --rust-profile-use --llvm-profile-use --llvm-profile-generate --enable-bolt-settings --skip-stage0-validation --reproducible-artifact --set --ci --skip-std-check-if-no-download-rustc --help [PATHS]... [ARGS]..." if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) return 0 @@ -3292,7 +3292,7 @@ _x() { return 0 ;; x__perf__cachegrind) - opts="-v -i -j -h --include --exclude --scenarios --profiles --verbose --incremental --config --build-dir --build --host --target --skip --include-default-paths --rustc-error-format --on-fail --dry-run --dump-bootstrap-shims --stage --keep-stage --keep-stage-std --src --jobs --warnings --json-output --compile-time-deps --color --bypass-bootstrap-lock --rust-profile-generate --rust-profile-use --llvm-profile-use --llvm-profile-generate --enable-bolt-settings --skip-stage0-validation --reproducible-artifact --set --ci --skip-std-check-if-no-download-rustc --help [PATHS]... [ARGS]..." + opts="-v -q -i -j -h --include --exclude --scenarios --profiles --verbose --quiet --incremental --config --build-dir --build --host --target --skip --include-default-paths --rustc-error-format --on-fail --dry-run --dump-bootstrap-shims --stage --keep-stage --keep-stage-std --src --jobs --warnings --json-output --compile-time-deps --color --bypass-bootstrap-lock --rust-profile-generate --rust-profile-use --llvm-profile-use --llvm-profile-generate --enable-bolt-settings --skip-stage0-validation --reproducible-artifact --set --ci --skip-std-check-if-no-download-rustc --help [PATHS]... [ARGS]..." if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) return 0 @@ -3490,7 +3490,7 @@ _x() { return 0 ;; x__perf__compare) - opts="-v -i -j -h --verbose --incremental --config --build-dir --build --host --target --exclude --skip --include-default-paths --rustc-error-format --on-fail --dry-run --dump-bootstrap-shims --stage --keep-stage --keep-stage-std --src --jobs --warnings --json-output --compile-time-deps --color --bypass-bootstrap-lock --rust-profile-generate --rust-profile-use --llvm-profile-use --llvm-profile-generate --enable-bolt-settings --skip-stage0-validation --reproducible-artifact --set --ci --skip-std-check-if-no-download-rustc --help [PATHS]... [ARGS]..." + opts="-v -q -i -j -h --verbose --quiet --incremental --config --build-dir --build --host --target --exclude --skip --include-default-paths --rustc-error-format --on-fail --dry-run --dump-bootstrap-shims --stage --keep-stage --keep-stage-std --src --jobs --warnings --json-output --compile-time-deps --color --bypass-bootstrap-lock --rust-profile-generate --rust-profile-use --llvm-profile-use --llvm-profile-generate --enable-bolt-settings --skip-stage0-validation --reproducible-artifact --set --ci --skip-std-check-if-no-download-rustc --help [PATHS]... [ARGS]..." if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) return 0 @@ -3676,7 +3676,7 @@ _x() { return 0 ;; x__perf__eprintln) - opts="-v -i -j -h --include --exclude --scenarios --profiles --verbose --incremental --config --build-dir --build --host --target --skip --include-default-paths --rustc-error-format --on-fail --dry-run --dump-bootstrap-shims --stage --keep-stage --keep-stage-std --src --jobs --warnings --json-output --compile-time-deps --color --bypass-bootstrap-lock --rust-profile-generate --rust-profile-use --llvm-profile-use --llvm-profile-generate --enable-bolt-settings --skip-stage0-validation --reproducible-artifact --set --ci --skip-std-check-if-no-download-rustc --help [PATHS]... [ARGS]..." + opts="-v -q -i -j -h --include --exclude --scenarios --profiles --verbose --quiet --incremental --config --build-dir --build --host --target --skip --include-default-paths --rustc-error-format --on-fail --dry-run --dump-bootstrap-shims --stage --keep-stage --keep-stage-std --src --jobs --warnings --json-output --compile-time-deps --color --bypass-bootstrap-lock --rust-profile-generate --rust-profile-use --llvm-profile-use --llvm-profile-generate --enable-bolt-settings --skip-stage0-validation --reproducible-artifact --set --ci --skip-std-check-if-no-download-rustc --help [PATHS]... [ARGS]..." if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) return 0 @@ -3874,7 +3874,7 @@ _x() { return 0 ;; x__perf__samply) - opts="-v -i -j -h --include --exclude --scenarios --profiles --verbose --incremental --config --build-dir --build --host --target --skip --include-default-paths --rustc-error-format --on-fail --dry-run --dump-bootstrap-shims --stage --keep-stage --keep-stage-std --src --jobs --warnings --json-output --compile-time-deps --color --bypass-bootstrap-lock --rust-profile-generate --rust-profile-use --llvm-profile-use --llvm-profile-generate --enable-bolt-settings --skip-stage0-validation --reproducible-artifact --set --ci --skip-std-check-if-no-download-rustc --help [PATHS]... [ARGS]..." + opts="-v -q -i -j -h --include --exclude --scenarios --profiles --verbose --quiet --incremental --config --build-dir --build --host --target --skip --include-default-paths --rustc-error-format --on-fail --dry-run --dump-bootstrap-shims --stage --keep-stage --keep-stage-std --src --jobs --warnings --json-output --compile-time-deps --color --bypass-bootstrap-lock --rust-profile-generate --rust-profile-use --llvm-profile-use --llvm-profile-generate --enable-bolt-settings --skip-stage0-validation --reproducible-artifact --set --ci --skip-std-check-if-no-download-rustc --help [PATHS]... [ARGS]..." if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) return 0 @@ -4072,7 +4072,7 @@ _x() { return 0 ;; x__run) - opts="-v -i -j -h --args --verbose --incremental --config --build-dir --build --host --target --exclude --skip --include-default-paths --rustc-error-format --on-fail --dry-run --dump-bootstrap-shims --stage --keep-stage --keep-stage-std --src --jobs --warnings --json-output --compile-time-deps --color --bypass-bootstrap-lock --rust-profile-generate --rust-profile-use --llvm-profile-use --llvm-profile-generate --enable-bolt-settings --skip-stage0-validation --reproducible-artifact --set --ci --skip-std-check-if-no-download-rustc --help [PATHS]... [ARGS]..." + opts="-v -q -i -j -h --args --verbose --quiet --incremental --config --build-dir --build --host --target --exclude --skip --include-default-paths --rustc-error-format --on-fail --dry-run --dump-bootstrap-shims --stage --keep-stage --keep-stage-std --src --jobs --warnings --json-output --compile-time-deps --color --bypass-bootstrap-lock --rust-profile-generate --rust-profile-use --llvm-profile-use --llvm-profile-generate --enable-bolt-settings --skip-stage0-validation --reproducible-artifact --set --ci --skip-std-check-if-no-download-rustc --help [PATHS]... [ARGS]..." if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) return 0 @@ -4262,7 +4262,7 @@ _x() { return 0 ;; x__run) - opts="-v -i -j -h --args --verbose --incremental --config --build-dir --build --host --target --exclude --skip --include-default-paths --rustc-error-format --on-fail --dry-run --dump-bootstrap-shims --stage --keep-stage --keep-stage-std --src --jobs --warnings --json-output --compile-time-deps --color --bypass-bootstrap-lock --rust-profile-generate --rust-profile-use --llvm-profile-use --llvm-profile-generate --enable-bolt-settings --skip-stage0-validation --reproducible-artifact --set --ci --skip-std-check-if-no-download-rustc --help [PATHS]... [ARGS]..." + opts="-v -q -i -j -h --args --verbose --quiet --incremental --config --build-dir --build --host --target --exclude --skip --include-default-paths --rustc-error-format --on-fail --dry-run --dump-bootstrap-shims --stage --keep-stage --keep-stage-std --src --jobs --warnings --json-output --compile-time-deps --color --bypass-bootstrap-lock --rust-profile-generate --rust-profile-use --llvm-profile-use --llvm-profile-generate --enable-bolt-settings --skip-stage0-validation --reproducible-artifact --set --ci --skip-std-check-if-no-download-rustc --help [PATHS]... [ARGS]..." if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) return 0 @@ -4452,7 +4452,7 @@ _x() { return 0 ;; x__setup) - opts="-v -i -j -h --verbose --incremental --config --build-dir --build --host --target --exclude --skip --include-default-paths --rustc-error-format --on-fail --dry-run --dump-bootstrap-shims --stage --keep-stage --keep-stage-std --src --jobs --warnings --json-output --compile-time-deps --color --bypass-bootstrap-lock --rust-profile-generate --rust-profile-use --llvm-profile-use --llvm-profile-generate --enable-bolt-settings --skip-stage0-validation --reproducible-artifact --set --ci --skip-std-check-if-no-download-rustc --help [|hook|editor|link] [PATHS]... [ARGS]..." + opts="-v -q -i -j -h --verbose --quiet --incremental --config --build-dir --build --host --target --exclude --skip --include-default-paths --rustc-error-format --on-fail --dry-run --dump-bootstrap-shims --stage --keep-stage --keep-stage-std --src --jobs --warnings --json-output --compile-time-deps --color --bypass-bootstrap-lock --rust-profile-generate --rust-profile-use --llvm-profile-use --llvm-profile-generate --enable-bolt-settings --skip-stage0-validation --reproducible-artifact --set --ci --skip-std-check-if-no-download-rustc --help [|hook|editor|link] [PATHS]... [ARGS]..." if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) return 0 @@ -4638,7 +4638,7 @@ _x() { return 0 ;; x__test) - opts="-v -i -j -h --no-fail-fast --test-args --compiletest-rustc-args --all-targets --doc --tests --bless --extra-checks --force-rerun --only-modified --compare-mode --pass --run --rustfix-coverage --no-capture --verbose-run-make-subprocess-output --test-codegen-backend --bypass-ignore-backends --no-doc --verbose --incremental --config --build-dir --build --host --target --exclude --skip --include-default-paths --rustc-error-format --on-fail --dry-run --dump-bootstrap-shims --stage --keep-stage --keep-stage-std --src --jobs --warnings --json-output --compile-time-deps --color --bypass-bootstrap-lock --rust-profile-generate --rust-profile-use --llvm-profile-use --llvm-profile-generate --enable-bolt-settings --skip-stage0-validation --reproducible-artifact --set --ci --skip-std-check-if-no-download-rustc --help [PATHS]... [ARGS]..." + opts="-v -q -i -j -h --no-fail-fast --test-args --compiletest-rustc-args --all-targets --doc --tests --bless --extra-checks --force-rerun --only-modified --compare-mode --pass --run --rustfix-coverage --no-capture --verbose-run-make-subprocess-output --test-codegen-backend --bypass-ignore-backends --no-doc --verbose --quiet --incremental --config --build-dir --build --host --target --exclude --skip --include-default-paths --rustc-error-format --on-fail --dry-run --dump-bootstrap-shims --stage --keep-stage --keep-stage-std --src --jobs --warnings --json-output --compile-time-deps --color --bypass-bootstrap-lock --rust-profile-generate --rust-profile-use --llvm-profile-use --llvm-profile-generate --enable-bolt-settings --skip-stage0-validation --reproducible-artifact --set --ci --skip-std-check-if-no-download-rustc --help [PATHS]... [ARGS]..." if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) return 0 @@ -4856,7 +4856,7 @@ _x() { return 0 ;; x__test) - opts="-v -i -j -h --no-fail-fast --test-args --compiletest-rustc-args --all-targets --doc --tests --bless --extra-checks --force-rerun --only-modified --compare-mode --pass --run --rustfix-coverage --no-capture --verbose-run-make-subprocess-output --test-codegen-backend --bypass-ignore-backends --no-doc --verbose --incremental --config --build-dir --build --host --target --exclude --skip --include-default-paths --rustc-error-format --on-fail --dry-run --dump-bootstrap-shims --stage --keep-stage --keep-stage-std --src --jobs --warnings --json-output --compile-time-deps --color --bypass-bootstrap-lock --rust-profile-generate --rust-profile-use --llvm-profile-use --llvm-profile-generate --enable-bolt-settings --skip-stage0-validation --reproducible-artifact --set --ci --skip-std-check-if-no-download-rustc --help [PATHS]... [ARGS]..." + opts="-v -q -i -j -h --no-fail-fast --test-args --compiletest-rustc-args --all-targets --doc --tests --bless --extra-checks --force-rerun --only-modified --compare-mode --pass --run --rustfix-coverage --no-capture --verbose-run-make-subprocess-output --test-codegen-backend --bypass-ignore-backends --no-doc --verbose --quiet --incremental --config --build-dir --build --host --target --exclude --skip --include-default-paths --rustc-error-format --on-fail --dry-run --dump-bootstrap-shims --stage --keep-stage --keep-stage-std --src --jobs --warnings --json-output --compile-time-deps --color --bypass-bootstrap-lock --rust-profile-generate --rust-profile-use --llvm-profile-use --llvm-profile-generate --enable-bolt-settings --skip-stage0-validation --reproducible-artifact --set --ci --skip-std-check-if-no-download-rustc --help [PATHS]... [ARGS]..." if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) return 0 @@ -5074,7 +5074,7 @@ _x() { return 0 ;; x__vendor) - opts="-v -i -j -h --sync --versioned-dirs --verbose --incremental --config --build-dir --build --host --target --exclude --skip --include-default-paths --rustc-error-format --on-fail --dry-run --dump-bootstrap-shims --stage --keep-stage --keep-stage-std --src --jobs --warnings --json-output --compile-time-deps --color --bypass-bootstrap-lock --rust-profile-generate --rust-profile-use --llvm-profile-use --llvm-profile-generate --enable-bolt-settings --skip-stage0-validation --reproducible-artifact --set --ci --skip-std-check-if-no-download-rustc --help [PATHS]... [ARGS]..." + opts="-v -q -i -j -h --sync --versioned-dirs --verbose --quiet --incremental --config --build-dir --build --host --target --exclude --skip --include-default-paths --rustc-error-format --on-fail --dry-run --dump-bootstrap-shims --stage --keep-stage --keep-stage-std --src --jobs --warnings --json-output --compile-time-deps --color --bypass-bootstrap-lock --rust-profile-generate --rust-profile-use --llvm-profile-use --llvm-profile-generate --enable-bolt-settings --skip-stage0-validation --reproducible-artifact --set --ci --skip-std-check-if-no-download-rustc --help [PATHS]... [ARGS]..." if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) return 0 diff --git a/src/etc/completions/x.zsh b/src/etc/completions/x.zsh index 12f441012e60f..8382f900d021e 100644 --- a/src/etc/completions/x.zsh +++ b/src/etc/completions/x.zsh @@ -38,8 +38,10 @@ _x() { '*--reproducible-artifact=[Additional reproducible artifacts that should be added to the reproducible artifacts archive]:REPRODUCIBLE_ARTIFACT:_default' \ '*--set=[override options in bootstrap.toml]:section.option=value:' \ '--ci=[Make bootstrap to behave as it'\''s running on the CI environment or not]:bool:(true false)' \ -'*-v[use verbose output (-vv for very verbose)]' \ -'*--verbose[use verbose output (-vv for very verbose)]' \ +'(-q --quiet)*-v[use verbose output (-vv for very verbose)]' \ +'(-q --quiet)*--verbose[use verbose output (-vv for very verbose)]' \ +'(-v --verbose)-q[use quiet output]' \ +'(-v --verbose)--quiet[use quiet output]' \ '-i[use incremental compilation]' \ '--incremental[use incremental compilation]' \ '--include-default-paths[include default paths in addition to the provided ones]' \ @@ -91,8 +93,10 @@ _arguments "${_arguments_options[@]}" : \ '*--set=[override options in bootstrap.toml]:section.option=value:' \ '--ci=[Make bootstrap to behave as it'\''s running on the CI environment or not]:bool:(true false)' \ '--timings[Pass \`--timings\` to Cargo to get crate build timings]' \ -'*-v[use verbose output (-vv for very verbose)]' \ -'*--verbose[use verbose output (-vv for very verbose)]' \ +'(-q --quiet)*-v[use verbose output (-vv for very verbose)]' \ +'(-q --quiet)*--verbose[use verbose output (-vv for very verbose)]' \ +'(-v --verbose)-q[use quiet output]' \ +'(-v --verbose)--quiet[use quiet output]' \ '-i[use incremental compilation]' \ '--incremental[use incremental compilation]' \ '--include-default-paths[include default paths in addition to the provided ones]' \ @@ -136,8 +140,10 @@ _arguments "${_arguments_options[@]}" : \ '*--set=[override options in bootstrap.toml]:section.option=value:' \ '--ci=[Make bootstrap to behave as it'\''s running on the CI environment or not]:bool:(true false)' \ '--timings[Pass \`--timings\` to Cargo to get crate build timings]' \ -'*-v[use verbose output (-vv for very verbose)]' \ -'*--verbose[use verbose output (-vv for very verbose)]' \ +'(-q --quiet)*-v[use verbose output (-vv for very verbose)]' \ +'(-q --quiet)*--verbose[use verbose output (-vv for very verbose)]' \ +'(-v --verbose)-q[use quiet output]' \ +'(-v --verbose)--quiet[use quiet output]' \ '-i[use incremental compilation]' \ '--incremental[use incremental compilation]' \ '--include-default-paths[include default paths in addition to the provided ones]' \ @@ -182,8 +188,10 @@ _arguments "${_arguments_options[@]}" : \ '--ci=[Make bootstrap to behave as it'\''s running on the CI environment or not]:bool:(true false)' \ '--all-targets[Check all targets]' \ '--timings[Pass \`--timings\` to Cargo to get crate build timings]' \ -'*-v[use verbose output (-vv for very verbose)]' \ -'*--verbose[use verbose output (-vv for very verbose)]' \ +'(-q --quiet)*-v[use verbose output (-vv for very verbose)]' \ +'(-q --quiet)*--verbose[use verbose output (-vv for very verbose)]' \ +'(-v --verbose)-q[use quiet output]' \ +'(-v --verbose)--quiet[use quiet output]' \ '-i[use incremental compilation]' \ '--incremental[use incremental compilation]' \ '--include-default-paths[include default paths in addition to the provided ones]' \ @@ -228,8 +236,10 @@ _arguments "${_arguments_options[@]}" : \ '--ci=[Make bootstrap to behave as it'\''s running on the CI environment or not]:bool:(true false)' \ '--all-targets[Check all targets]' \ '--timings[Pass \`--timings\` to Cargo to get crate build timings]' \ -'*-v[use verbose output (-vv for very verbose)]' \ -'*--verbose[use verbose output (-vv for very verbose)]' \ +'(-q --quiet)*-v[use verbose output (-vv for very verbose)]' \ +'(-q --quiet)*--verbose[use verbose output (-vv for very verbose)]' \ +'(-v --verbose)-q[use quiet output]' \ +'(-v --verbose)--quiet[use quiet output]' \ '-i[use incremental compilation]' \ '--incremental[use incremental compilation]' \ '--include-default-paths[include default paths in addition to the provided ones]' \ @@ -279,8 +289,10 @@ _arguments "${_arguments_options[@]}" : \ '--fix[]' \ '--allow-dirty[]' \ '--allow-staged[]' \ -'*-v[use verbose output (-vv for very verbose)]' \ -'*--verbose[use verbose output (-vv for very verbose)]' \ +'(-q --quiet)*-v[use verbose output (-vv for very verbose)]' \ +'(-q --quiet)*--verbose[use verbose output (-vv for very verbose)]' \ +'(-v --verbose)-q[use quiet output]' \ +'(-v --verbose)--quiet[use quiet output]' \ '-i[use incremental compilation]' \ '--incremental[use incremental compilation]' \ '--include-default-paths[include default paths in addition to the provided ones]' \ @@ -323,8 +335,10 @@ _arguments "${_arguments_options[@]}" : \ '*--reproducible-artifact=[Additional reproducible artifacts that should be added to the reproducible artifacts archive]:REPRODUCIBLE_ARTIFACT:_default' \ '*--set=[override options in bootstrap.toml]:section.option=value:' \ '--ci=[Make bootstrap to behave as it'\''s running on the CI environment or not]:bool:(true false)' \ -'*-v[use verbose output (-vv for very verbose)]' \ -'*--verbose[use verbose output (-vv for very verbose)]' \ +'(-q --quiet)*-v[use verbose output (-vv for very verbose)]' \ +'(-q --quiet)*--verbose[use verbose output (-vv for very verbose)]' \ +'(-v --verbose)-q[use quiet output]' \ +'(-v --verbose)--quiet[use quiet output]' \ '-i[use incremental compilation]' \ '--incremental[use incremental compilation]' \ '--include-default-paths[include default paths in addition to the provided ones]' \ @@ -369,8 +383,10 @@ _arguments "${_arguments_options[@]}" : \ '--ci=[Make bootstrap to behave as it'\''s running on the CI environment or not]:bool:(true false)' \ '--check[check formatting instead of applying]' \ '--all[apply to all appropriate files, not just those that have been modified]' \ -'*-v[use verbose output (-vv for very verbose)]' \ -'*--verbose[use verbose output (-vv for very verbose)]' \ +'(-q --quiet)*-v[use verbose output (-vv for very verbose)]' \ +'(-q --quiet)*--verbose[use verbose output (-vv for very verbose)]' \ +'(-v --verbose)-q[use quiet output]' \ +'(-v --verbose)--quiet[use quiet output]' \ '-i[use incremental compilation]' \ '--incremental[use incremental compilation]' \ '--include-default-paths[include default paths in addition to the provided ones]' \ @@ -415,8 +431,10 @@ _arguments "${_arguments_options[@]}" : \ '--ci=[Make bootstrap to behave as it'\''s running on the CI environment or not]:bool:(true false)' \ '--open[open the docs in a browser]' \ '--json[render the documentation in JSON format in addition to the usual HTML format]' \ -'*-v[use verbose output (-vv for very verbose)]' \ -'*--verbose[use verbose output (-vv for very verbose)]' \ +'(-q --quiet)*-v[use verbose output (-vv for very verbose)]' \ +'(-q --quiet)*--verbose[use verbose output (-vv for very verbose)]' \ +'(-v --verbose)-q[use quiet output]' \ +'(-v --verbose)--quiet[use quiet output]' \ '-i[use incremental compilation]' \ '--incremental[use incremental compilation]' \ '--include-default-paths[include default paths in addition to the provided ones]' \ @@ -461,8 +479,10 @@ _arguments "${_arguments_options[@]}" : \ '--ci=[Make bootstrap to behave as it'\''s running on the CI environment or not]:bool:(true false)' \ '--open[open the docs in a browser]' \ '--json[render the documentation in JSON format in addition to the usual HTML format]' \ -'*-v[use verbose output (-vv for very verbose)]' \ -'*--verbose[use verbose output (-vv for very verbose)]' \ +'(-q --quiet)*-v[use verbose output (-vv for very verbose)]' \ +'(-q --quiet)*--verbose[use verbose output (-vv for very verbose)]' \ +'(-v --verbose)-q[use quiet output]' \ +'(-v --verbose)--quiet[use quiet output]' \ '-i[use incremental compilation]' \ '--incremental[use incremental compilation]' \ '--include-default-paths[include default paths in addition to the provided ones]' \ @@ -524,8 +544,10 @@ _arguments "${_arguments_options[@]}" : \ '--no-capture[don'\''t capture stdout/stderr of tests]' \ '--bypass-ignore-backends[Ignore \`//@ ignore-backends\` directives]' \ '--no-doc[Deprecated. Use \`--all-targets\` or \`--tests\` instead]' \ -'*-v[use verbose output (-vv for very verbose)]' \ -'*--verbose[use verbose output (-vv for very verbose)]' \ +'(-q --quiet)*-v[use verbose output (-vv for very verbose)]' \ +'(-q --quiet)*--verbose[use verbose output (-vv for very verbose)]' \ +'(-v --verbose)-q[use quiet output]' \ +'(-v --verbose)--quiet[use quiet output]' \ '-i[use incremental compilation]' \ '--incremental[use incremental compilation]' \ '--include-default-paths[include default paths in addition to the provided ones]' \ @@ -587,8 +609,10 @@ _arguments "${_arguments_options[@]}" : \ '--no-capture[don'\''t capture stdout/stderr of tests]' \ '--bypass-ignore-backends[Ignore \`//@ ignore-backends\` directives]' \ '--no-doc[Deprecated. Use \`--all-targets\` or \`--tests\` instead]' \ -'*-v[use verbose output (-vv for very verbose)]' \ -'*--verbose[use verbose output (-vv for very verbose)]' \ +'(-q --quiet)*-v[use verbose output (-vv for very verbose)]' \ +'(-q --quiet)*--verbose[use verbose output (-vv for very verbose)]' \ +'(-v --verbose)-q[use quiet output]' \ +'(-v --verbose)--quiet[use quiet output]' \ '-i[use incremental compilation]' \ '--incremental[use incremental compilation]' \ '--include-default-paths[include default paths in addition to the provided ones]' \ @@ -637,8 +661,10 @@ _arguments "${_arguments_options[@]}" : \ '--doc[Only run doc tests]' \ '--tests[Only run unit and integration tests]' \ '--no-doc[Deprecated. Use \`--all-targets\` or \`--tests\` instead]' \ -'*-v[use verbose output (-vv for very verbose)]' \ -'*--verbose[use verbose output (-vv for very verbose)]' \ +'(-q --quiet)*-v[use verbose output (-vv for very verbose)]' \ +'(-q --quiet)*--verbose[use verbose output (-vv for very verbose)]' \ +'(-v --verbose)-q[use quiet output]' \ +'(-v --verbose)--quiet[use quiet output]' \ '-i[use incremental compilation]' \ '--incremental[use incremental compilation]' \ '--include-default-paths[include default paths in addition to the provided ones]' \ @@ -682,8 +708,10 @@ _arguments "${_arguments_options[@]}" : \ '*--reproducible-artifact=[Additional reproducible artifacts that should be added to the reproducible artifacts archive]:REPRODUCIBLE_ARTIFACT:_default' \ '*--set=[override options in bootstrap.toml]:section.option=value:' \ '--ci=[Make bootstrap to behave as it'\''s running on the CI environment or not]:bool:(true false)' \ -'*-v[use verbose output (-vv for very verbose)]' \ -'*--verbose[use verbose output (-vv for very verbose)]' \ +'(-q --quiet)*-v[use verbose output (-vv for very verbose)]' \ +'(-q --quiet)*--verbose[use verbose output (-vv for very verbose)]' \ +'(-v --verbose)-q[use quiet output]' \ +'(-v --verbose)--quiet[use quiet output]' \ '-i[use incremental compilation]' \ '--incremental[use incremental compilation]' \ '--include-default-paths[include default paths in addition to the provided ones]' \ @@ -727,8 +755,10 @@ _arguments "${_arguments_options[@]}" : \ '*--set=[override options in bootstrap.toml]:section.option=value:' \ '--ci=[Make bootstrap to behave as it'\''s running on the CI environment or not]:bool:(true false)' \ '--all[Clean the entire build directory (not used by default)]' \ -'*-v[use verbose output (-vv for very verbose)]' \ -'*--verbose[use verbose output (-vv for very verbose)]' \ +'(-q --quiet)*-v[use verbose output (-vv for very verbose)]' \ +'(-q --quiet)*--verbose[use verbose output (-vv for very verbose)]' \ +'(-v --verbose)-q[use quiet output]' \ +'(-v --verbose)--quiet[use quiet output]' \ '-i[use incremental compilation]' \ '--incremental[use incremental compilation]' \ '--include-default-paths[include default paths in addition to the provided ones]' \ @@ -771,8 +801,10 @@ _arguments "${_arguments_options[@]}" : \ '*--reproducible-artifact=[Additional reproducible artifacts that should be added to the reproducible artifacts archive]:REPRODUCIBLE_ARTIFACT:_default' \ '*--set=[override options in bootstrap.toml]:section.option=value:' \ '--ci=[Make bootstrap to behave as it'\''s running on the CI environment or not]:bool:(true false)' \ -'*-v[use verbose output (-vv for very verbose)]' \ -'*--verbose[use verbose output (-vv for very verbose)]' \ +'(-q --quiet)*-v[use verbose output (-vv for very verbose)]' \ +'(-q --quiet)*--verbose[use verbose output (-vv for very verbose)]' \ +'(-v --verbose)-q[use quiet output]' \ +'(-v --verbose)--quiet[use quiet output]' \ '-i[use incremental compilation]' \ '--incremental[use incremental compilation]' \ '--include-default-paths[include default paths in addition to the provided ones]' \ @@ -815,8 +847,10 @@ _arguments "${_arguments_options[@]}" : \ '*--reproducible-artifact=[Additional reproducible artifacts that should be added to the reproducible artifacts archive]:REPRODUCIBLE_ARTIFACT:_default' \ '*--set=[override options in bootstrap.toml]:section.option=value:' \ '--ci=[Make bootstrap to behave as it'\''s running on the CI environment or not]:bool:(true false)' \ -'*-v[use verbose output (-vv for very verbose)]' \ -'*--verbose[use verbose output (-vv for very verbose)]' \ +'(-q --quiet)*-v[use verbose output (-vv for very verbose)]' \ +'(-q --quiet)*--verbose[use verbose output (-vv for very verbose)]' \ +'(-v --verbose)-q[use quiet output]' \ +'(-v --verbose)--quiet[use quiet output]' \ '-i[use incremental compilation]' \ '--incremental[use incremental compilation]' \ '--include-default-paths[include default paths in addition to the provided ones]' \ @@ -860,8 +894,10 @@ _arguments "${_arguments_options[@]}" : \ '*--reproducible-artifact=[Additional reproducible artifacts that should be added to the reproducible artifacts archive]:REPRODUCIBLE_ARTIFACT:_default' \ '*--set=[override options in bootstrap.toml]:section.option=value:' \ '--ci=[Make bootstrap to behave as it'\''s running on the CI environment or not]:bool:(true false)' \ -'*-v[use verbose output (-vv for very verbose)]' \ -'*--verbose[use verbose output (-vv for very verbose)]' \ +'(-q --quiet)*-v[use verbose output (-vv for very verbose)]' \ +'(-q --quiet)*--verbose[use verbose output (-vv for very verbose)]' \ +'(-v --verbose)-q[use quiet output]' \ +'(-v --verbose)--quiet[use quiet output]' \ '-i[use incremental compilation]' \ '--incremental[use incremental compilation]' \ '--include-default-paths[include default paths in addition to the provided ones]' \ @@ -905,8 +941,10 @@ _arguments "${_arguments_options[@]}" : \ '*--reproducible-artifact=[Additional reproducible artifacts that should be added to the reproducible artifacts archive]:REPRODUCIBLE_ARTIFACT:_default' \ '*--set=[override options in bootstrap.toml]:section.option=value:' \ '--ci=[Make bootstrap to behave as it'\''s running on the CI environment or not]:bool:(true false)' \ -'*-v[use verbose output (-vv for very verbose)]' \ -'*--verbose[use verbose output (-vv for very verbose)]' \ +'(-q --quiet)*-v[use verbose output (-vv for very verbose)]' \ +'(-q --quiet)*--verbose[use verbose output (-vv for very verbose)]' \ +'(-v --verbose)-q[use quiet output]' \ +'(-v --verbose)--quiet[use quiet output]' \ '-i[use incremental compilation]' \ '--incremental[use incremental compilation]' \ '--include-default-paths[include default paths in addition to the provided ones]' \ @@ -949,8 +987,10 @@ _arguments "${_arguments_options[@]}" : \ '*--reproducible-artifact=[Additional reproducible artifacts that should be added to the reproducible artifacts archive]:REPRODUCIBLE_ARTIFACT:_default' \ '*--set=[override options in bootstrap.toml]:section.option=value:' \ '--ci=[Make bootstrap to behave as it'\''s running on the CI environment or not]:bool:(true false)' \ -'*-v[use verbose output (-vv for very verbose)]' \ -'*--verbose[use verbose output (-vv for very verbose)]' \ +'(-q --quiet)*-v[use verbose output (-vv for very verbose)]' \ +'(-q --quiet)*--verbose[use verbose output (-vv for very verbose)]' \ +'(-v --verbose)-q[use quiet output]' \ +'(-v --verbose)--quiet[use quiet output]' \ '-i[use incremental compilation]' \ '--incremental[use incremental compilation]' \ '--include-default-paths[include default paths in addition to the provided ones]' \ @@ -996,8 +1036,10 @@ _arguments "${_arguments_options[@]}" : \ '*--set=[override options in bootstrap.toml]:section.option=value:' \ '--ci=[Make bootstrap to behave as it'\''s running on the CI environment or not]:bool:(true false)' \ '--versioned-dirs[Always include version in subdir name]' \ -'*-v[use verbose output (-vv for very verbose)]' \ -'*--verbose[use verbose output (-vv for very verbose)]' \ +'(-q --quiet)*-v[use verbose output (-vv for very verbose)]' \ +'(-q --quiet)*--verbose[use verbose output (-vv for very verbose)]' \ +'(-v --verbose)-q[use quiet output]' \ +'(-v --verbose)--quiet[use quiet output]' \ '-i[use incremental compilation]' \ '--incremental[use incremental compilation]' \ '--include-default-paths[include default paths in addition to the provided ones]' \ @@ -1040,8 +1082,10 @@ _arguments "${_arguments_options[@]}" : \ '*--reproducible-artifact=[Additional reproducible artifacts that should be added to the reproducible artifacts archive]:REPRODUCIBLE_ARTIFACT:_default' \ '*--set=[override options in bootstrap.toml]:section.option=value:' \ '--ci=[Make bootstrap to behave as it'\''s running on the CI environment or not]:bool:(true false)' \ -'*-v[use verbose output (-vv for very verbose)]' \ -'*--verbose[use verbose output (-vv for very verbose)]' \ +'(-q --quiet)*-v[use verbose output (-vv for very verbose)]' \ +'(-q --quiet)*--verbose[use verbose output (-vv for very verbose)]' \ +'(-v --verbose)-q[use quiet output]' \ +'(-v --verbose)--quiet[use quiet output]' \ '-i[use incremental compilation]' \ '--incremental[use incremental compilation]' \ '--include-default-paths[include default paths in addition to the provided ones]' \ @@ -1096,8 +1140,10 @@ _arguments "${_arguments_options[@]}" : \ '*--reproducible-artifact=[Additional reproducible artifacts that should be added to the reproducible artifacts archive]:REPRODUCIBLE_ARTIFACT:_default' \ '*--set=[override options in bootstrap.toml]:section.option=value:' \ '--ci=[Make bootstrap to behave as it'\''s running on the CI environment or not]:bool:(true false)' \ -'*-v[use verbose output (-vv for very verbose)]' \ -'*--verbose[use verbose output (-vv for very verbose)]' \ +'(-q --quiet)*-v[use verbose output (-vv for very verbose)]' \ +'(-q --quiet)*--verbose[use verbose output (-vv for very verbose)]' \ +'(-v --verbose)-q[use quiet output]' \ +'(-v --verbose)--quiet[use quiet output]' \ '-i[use incremental compilation]' \ '--incremental[use incremental compilation]' \ '--include-default-paths[include default paths in addition to the provided ones]' \ @@ -1143,8 +1189,10 @@ _arguments "${_arguments_options[@]}" : \ '*--reproducible-artifact=[Additional reproducible artifacts that should be added to the reproducible artifacts archive]:REPRODUCIBLE_ARTIFACT:_default' \ '*--set=[override options in bootstrap.toml]:section.option=value:' \ '--ci=[Make bootstrap to behave as it'\''s running on the CI environment or not]:bool:(true false)' \ -'*-v[use verbose output (-vv for very verbose)]' \ -'*--verbose[use verbose output (-vv for very verbose)]' \ +'(-q --quiet)*-v[use verbose output (-vv for very verbose)]' \ +'(-q --quiet)*--verbose[use verbose output (-vv for very verbose)]' \ +'(-v --verbose)-q[use quiet output]' \ +'(-v --verbose)--quiet[use quiet output]' \ '-i[use incremental compilation]' \ '--incremental[use incremental compilation]' \ '--include-default-paths[include default paths in addition to the provided ones]' \ @@ -1190,8 +1238,10 @@ _arguments "${_arguments_options[@]}" : \ '*--reproducible-artifact=[Additional reproducible artifacts that should be added to the reproducible artifacts archive]:REPRODUCIBLE_ARTIFACT:_default' \ '*--set=[override options in bootstrap.toml]:section.option=value:' \ '--ci=[Make bootstrap to behave as it'\''s running on the CI environment or not]:bool:(true false)' \ -'*-v[use verbose output (-vv for very verbose)]' \ -'*--verbose[use verbose output (-vv for very verbose)]' \ +'(-q --quiet)*-v[use verbose output (-vv for very verbose)]' \ +'(-q --quiet)*--verbose[use verbose output (-vv for very verbose)]' \ +'(-v --verbose)-q[use quiet output]' \ +'(-v --verbose)--quiet[use quiet output]' \ '-i[use incremental compilation]' \ '--incremental[use incremental compilation]' \ '--include-default-paths[include default paths in addition to the provided ones]' \ @@ -1237,8 +1287,10 @@ _arguments "${_arguments_options[@]}" : \ '*--reproducible-artifact=[Additional reproducible artifacts that should be added to the reproducible artifacts archive]:REPRODUCIBLE_ARTIFACT:_default' \ '*--set=[override options in bootstrap.toml]:section.option=value:' \ '--ci=[Make bootstrap to behave as it'\''s running on the CI environment or not]:bool:(true false)' \ -'*-v[use verbose output (-vv for very verbose)]' \ -'*--verbose[use verbose output (-vv for very verbose)]' \ +'(-q --quiet)*-v[use verbose output (-vv for very verbose)]' \ +'(-q --quiet)*--verbose[use verbose output (-vv for very verbose)]' \ +'(-v --verbose)-q[use quiet output]' \ +'(-v --verbose)--quiet[use quiet output]' \ '-i[use incremental compilation]' \ '--incremental[use incremental compilation]' \ '--include-default-paths[include default paths in addition to the provided ones]' \ @@ -1282,8 +1334,10 @@ _arguments "${_arguments_options[@]}" : \ '*--reproducible-artifact=[Additional reproducible artifacts that should be added to the reproducible artifacts archive]:REPRODUCIBLE_ARTIFACT:_default' \ '*--set=[override options in bootstrap.toml]:section.option=value:' \ '--ci=[Make bootstrap to behave as it'\''s running on the CI environment or not]:bool:(true false)' \ -'*-v[use verbose output (-vv for very verbose)]' \ -'*--verbose[use verbose output (-vv for very verbose)]' \ +'(-q --quiet)*-v[use verbose output (-vv for very verbose)]' \ +'(-q --quiet)*--verbose[use verbose output (-vv for very verbose)]' \ +'(-v --verbose)-q[use quiet output]' \ +'(-v --verbose)--quiet[use quiet output]' \ '-i[use incremental compilation]' \ '--incremental[use incremental compilation]' \ '--include-default-paths[include default paths in addition to the provided ones]' \ diff --git a/src/etc/xhelp b/src/etc/xhelp index 3061110efb231..4bd6575fc6974 100644 --- a/src/etc/xhelp +++ b/src/etc/xhelp @@ -26,6 +26,8 @@ Arguments: Options: -v, --verbose... use verbose output (-vv for very verbose) + -q, --quiet + use quiet output -i, --incremental use incremental compilation --config From 4095bbdd2d99a217f6b60ffbece3d72ba6204d4f Mon Sep 17 00:00:00 2001 From: Balt <59123926+balt-dev@users.noreply.github.com> Date: Wed, 15 Apr 2026 11:48:40 -0500 Subject: [PATCH 30/38] Add new Layout methods to release notes --- RELEASES.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/RELEASES.md b/RELEASES.md index d69fea0f0bf64..27b4fe36136c1 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -85,6 +85,10 @@ Stabilized APIs - [`VecDeque::insert_mut`](https://doc.rust-lang.org/stable/std/collections/struct.VecDeque.html#method.insert_mut) - [`LinkedList::push_front_mut`](https://doc.rust-lang.org/stable/std/collections/struct.LinkedList.html#method.push_front_mut) - [`LinkedList::push_back_mut`](https://doc.rust-lang.org/stable/std/collections/struct.LinkedList.html#method.push_back_mut) +- [`Layout::danging_ptr`](https://doc.rust-lang.org/stable/std/alloc/struct.Layout.html#method.danging_ptr) +- [`Layout::repeat`](https://doc.rust-lang.org/stable/std/alloc/struct.Layout.html#method.repeat) +- [`Layout::repeat_packed`](https://doc.rust-lang.org/stable/std/alloc/struct.Layout.html#method.repeat_packed) +- [`Layout::extend_packed`](https://doc.rust-lang.org/stable/std/alloc/struct.Layout.html#method.extend_packed) These previously stable APIs are now stable in const contexts: From d87a2e7ddd74e80a7d1358fa7dc70553eb4e58c6 Mon Sep 17 00:00:00 2001 From: Balt <59123926+balt-dev@users.noreply.github.com> Date: Wed, 15 Apr 2026 11:56:45 -0500 Subject: [PATCH 31/38] Fix typo for danging_ptr Co-authored-by: Josh Stone --- RELEASES.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/RELEASES.md b/RELEASES.md index 27b4fe36136c1..32d7b4add8c0a 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -85,7 +85,7 @@ Stabilized APIs - [`VecDeque::insert_mut`](https://doc.rust-lang.org/stable/std/collections/struct.VecDeque.html#method.insert_mut) - [`LinkedList::push_front_mut`](https://doc.rust-lang.org/stable/std/collections/struct.LinkedList.html#method.push_front_mut) - [`LinkedList::push_back_mut`](https://doc.rust-lang.org/stable/std/collections/struct.LinkedList.html#method.push_back_mut) -- [`Layout::danging_ptr`](https://doc.rust-lang.org/stable/std/alloc/struct.Layout.html#method.danging_ptr) +- [`Layout::dangling_ptr`](https://doc.rust-lang.org/stable/std/alloc/struct.Layout.html#method.dangling_ptr) - [`Layout::repeat`](https://doc.rust-lang.org/stable/std/alloc/struct.Layout.html#method.repeat) - [`Layout::repeat_packed`](https://doc.rust-lang.org/stable/std/alloc/struct.Layout.html#method.repeat_packed) - [`Layout::extend_packed`](https://doc.rust-lang.org/stable/std/alloc/struct.Layout.html#method.extend_packed) From 32381125bb8bfe89aea7f0a3333763d110648827 Mon Sep 17 00:00:00 2001 From: Vadim Petrochenkov Date: Wed, 15 Apr 2026 16:03:18 +0300 Subject: [PATCH 32/38] resolve: Cleanup diagnostic code for struct constructors --- .../rustc_resolve/src/build_reduced_graph.rs | 11 +- compiler/rustc_resolve/src/diagnostics.rs | 34 +++++- compiler/rustc_resolve/src/ident.rs | 24 +--- .../rustc_resolve/src/late/diagnostics.rs | 112 ++++++------------ compiler/rustc_resolve/src/lib.rs | 4 +- 5 files changed, 76 insertions(+), 109 deletions(-) diff --git a/compiler/rustc_resolve/src/build_reduced_graph.rs b/compiler/rustc_resolve/src/build_reduced_graph.rs index 50977ba6cff5f..772846fd7cf5b 100644 --- a/compiler/rustc_resolve/src/build_reduced_graph.rs +++ b/compiler/rustc_resolve/src/build_reduced_graph.rs @@ -32,6 +32,7 @@ use tracing::debug; use crate::Namespace::{MacroNS, TypeNS, ValueNS}; use crate::def_collector::collect_definitions; +use crate::diagnostics::StructCtor; use crate::imports::{ImportData, ImportKind, OnUnknownData}; use crate::macros::{MacroRulesDecl, MacroRulesScope, MacroRulesScopeRef}; use crate::ref_mut::CmCell; @@ -929,7 +930,7 @@ impl<'a, 'ra, 'tcx> BuildReducedGraphVisitor<'a, 'ra, 'tcx> { vis }; - let mut ret_fields = Vec::with_capacity(vdata.fields().len()); + let mut field_visibilities = Vec::with_capacity(vdata.fields().len()); for field in vdata.fields() { // NOTE: The field may be an expansion placeholder, but expansion sets @@ -941,7 +942,7 @@ impl<'a, 'ra, 'tcx> BuildReducedGraphVisitor<'a, 'ra, 'tcx> { if ctor_vis.is_at_least(field_vis, self.r.tcx) { ctor_vis = field_vis; } - ret_fields.push(field_vis.to_def_id()); + field_visibilities.push(field_vis.to_def_id()); } let feed = self.r.feed(ctor_node_id); let ctor_def_id = feed.key(); @@ -951,9 +952,9 @@ impl<'a, 'ra, 'tcx> BuildReducedGraphVisitor<'a, 'ra, 'tcx> { // We need the field visibility spans also for the constructor for E0603. self.insert_field_visibilities_local(ctor_def_id.to_def_id(), vdata.fields()); - self.r - .struct_constructors - .insert(local_def_id, (ctor_res, ctor_vis.to_def_id(), ret_fields)); + let ctor = + StructCtor { res: ctor_res, vis: ctor_vis.to_def_id(), field_visibilities }; + self.r.struct_ctors.insert(local_def_id, ctor); } self.r.struct_generics.insert(local_def_id, generics.clone()); } diff --git a/compiler/rustc_resolve/src/diagnostics.rs b/compiler/rustc_resolve/src/diagnostics.rs index 4d855037ca170..f2dfa0a281a2f 100644 --- a/compiler/rustc_resolve/src/diagnostics.rs +++ b/compiler/rustc_resolve/src/diagnostics.rs @@ -21,7 +21,7 @@ use rustc_hir::def::{self, CtorKind, CtorOf, DefKind, MacroKinds, NonMacroAttrKi use rustc_hir::def_id::{CRATE_DEF_ID, DefId}; use rustc_hir::{PrimTy, Stability, StabilityLevel, find_attr}; use rustc_middle::bug; -use rustc_middle::ty::TyCtxt; +use rustc_middle::ty::{TyCtxt, Visibility}; use rustc_session::Session; use rustc_session::lint::builtin::{ ABSOLUTE_PATHS_NOT_STARTING_WITH_CRATE, AMBIGUOUS_GLOB_IMPORTS, AMBIGUOUS_IMPORT_VISIBILITIES, @@ -63,6 +63,19 @@ pub(crate) type Suggestion = (Vec<(Span, String)>, String, Applicability); /// similarly named label and whether or not it is reachable. pub(crate) type LabelSuggestion = (Ident, bool); +#[derive(Clone)] +pub(crate) struct StructCtor { + pub res: Res, + pub vis: Visibility, + pub field_visibilities: Vec>, +} + +impl StructCtor { + pub(crate) fn has_private_fields<'ra>(&self, m: Module<'ra>, r: &Resolver<'ra, '_>) -> bool { + self.field_visibilities.iter().any(|&vis| !r.is_accessible_from(vis, m)) + } +} + #[derive(Debug)] pub(crate) enum SuggestionTarget { /// The target has a similar name as the name used by the programmer (probably a typo) @@ -3176,6 +3189,25 @@ impl<'ra, 'tcx> Resolver<'ra, 'tcx> { err.subdiagnostic(note); } } + + pub(crate) fn struct_ctor(&self, def_id: DefId) -> Option { + match def_id.as_local() { + Some(def_id) => self.struct_ctors.get(&def_id).cloned(), + None => { + self.cstore().ctor_untracked(self.tcx, def_id).map(|(ctor_kind, ctor_def_id)| { + let res = Res::Def(DefKind::Ctor(CtorOf::Struct, ctor_kind), ctor_def_id); + let vis = self.tcx.visibility(ctor_def_id); + let field_visibilities = self + .tcx + .associated_item_def_ids(def_id) + .iter() + .map(|&field_id| self.tcx.visibility(field_id)) + .collect(); + StructCtor { res, vis, field_visibilities } + }) + } + } + } } /// Given a `binding_span` of a binding within a use statement: diff --git a/compiler/rustc_resolve/src/ident.rs b/compiler/rustc_resolve/src/ident.rs index 46b4a3aa25864..f38ce51d709c1 100644 --- a/compiler/rustc_resolve/src/ident.rs +++ b/compiler/rustc_resolve/src/ident.rs @@ -1299,28 +1299,8 @@ impl<'ra, 'tcx> Resolver<'ra, 'tcx> { // be constructed through this re-export. We track that case here to expand later // privacy errors with appropriate information. if let Res::Def(_, def_id) = binding.res() { - let struct_ctor = match def_id.as_local() { - Some(def_id) => self.struct_constructors.get(&def_id).cloned(), - None => { - let ctor = self.cstore().ctor_untracked(self.tcx(), def_id); - ctor.map(|(ctor_kind, ctor_def_id)| { - let ctor_res = Res::Def( - DefKind::Ctor(rustc_hir::def::CtorOf::Struct, ctor_kind), - ctor_def_id, - ); - let ctor_vis = self.tcx.visibility(ctor_def_id); - let field_visibilities = self - .tcx - .associated_item_def_ids(def_id) - .iter() - .map(|&field_id| self.tcx.visibility(field_id)) - .collect(); - (ctor_res, ctor_vis, field_visibilities) - }) - } - }; - if let Some((_, _, fields)) = struct_ctor - && fields.iter().any(|vis| !self.is_accessible_from(*vis, module)) + if let Some(ctor) = self.struct_ctor(def_id) + && ctor.has_private_fields(module, self) { self.inaccessible_ctor_reexport.insert(path_span, binding.span); } diff --git a/compiler/rustc_resolve/src/late/diagnostics.rs b/compiler/rustc_resolve/src/late/diagnostics.rs index 467f03fa46fdd..05bcd67f76da9 100644 --- a/compiler/rustc_resolve/src/late/diagnostics.rs +++ b/compiler/rustc_resolve/src/late/diagnostics.rs @@ -1040,14 +1040,15 @@ impl<'ast, 'ra, 'tcx> LateResolutionVisitor<'_, 'ast, 'ra, 'tcx> { } if let Some(Res::Def(DefKind::Struct, def_id)) = res { - let private_fields = self.has_private_fields(def_id); - let adjust_error_message = - private_fields && self.is_struct_with_fn_ctor(def_id); - if adjust_error_message { - self.update_err_for_private_tuple_struct_fields(err, &source, def_id); - } - - if private_fields { + if let Some(ctor) = self.r.struct_ctor(def_id) + && ctor.has_private_fields(self.parent_scope.module, self.r) + { + if matches!( + ctor.res, + Res::Def(DefKind::Ctor(CtorOf::Struct, CtorKind::Fn), _) + ) { + self.update_err_for_private_tuple_struct_fields(err, &source, def_id); + } err.note("constructor is not visible here due to private fields"); } } else { @@ -2015,19 +2016,6 @@ impl<'ast, 'ra, 'tcx> LateResolutionVisitor<'_, 'ast, 'ra, 'tcx> { } } - fn is_struct_with_fn_ctor(&mut self, def_id: DefId) -> bool { - def_id - .as_local() - .and_then(|local_id| self.r.struct_constructors.get(&local_id)) - .map(|struct_ctor| { - matches!( - struct_ctor.0, - def::Res::Def(DefKind::Ctor(CtorOf::Struct, CtorKind::Fn), _) - ) - }) - .unwrap_or(false) - } - fn update_err_for_private_tuple_struct_fields( &mut self, err: &mut Diag<'_>, @@ -2201,7 +2189,17 @@ impl<'ast, 'ra, 'tcx> LateResolutionVisitor<'_, 'ast, 'ra, 'tcx> { _ => (": val", "literal", Applicability::HasPlaceholders, None), }; - if !this.has_private_fields(def_id) { + // Imprecise for local structs without ctors, we don't keep fields for them. + let has_private_fields = match def_id.as_local() { + Some(def_id) => this.r.struct_ctors.get(&def_id).is_some_and(|ctor| { + ctor.has_private_fields(this.parent_scope.module, this.r) + }), + None => this.r.tcx.associated_item_def_ids(def_id).iter().any(|field_id| { + let vis = this.r.tcx.visibility(*field_id); + !this.r.is_accessible_from(vis, this.parent_scope.module) + }), + }; + if !has_private_fields { // If the fields of the type are private, we shouldn't be suggesting using // the struct literal syntax at all, as that will cause a subsequent error. let fields = this.r.field_idents(def_id); @@ -2367,40 +2365,18 @@ impl<'ast, 'ra, 'tcx> LateResolutionVisitor<'_, 'ast, 'ra, 'tcx> { self.suggest_using_enum_variant(err, source, def_id, span); } (Res::Def(DefKind::Struct, def_id), source) if ns == ValueNS => { - let struct_ctor = match def_id.as_local() { - Some(def_id) => self.r.struct_constructors.get(&def_id).cloned(), - None => { - let ctor = self.r.cstore().ctor_untracked(self.r.tcx(), def_id); - ctor.map(|(ctor_kind, ctor_def_id)| { - let ctor_res = - Res::Def(DefKind::Ctor(CtorOf::Struct, ctor_kind), ctor_def_id); - let ctor_vis = self.r.tcx.visibility(ctor_def_id); - let field_visibilities = self - .r - .tcx - .associated_item_def_ids(def_id) - .iter() - .map(|&field_id| self.r.tcx.visibility(field_id)) - .collect(); - (ctor_res, ctor_vis, field_visibilities) - }) - } - }; - - let (ctor_def, ctor_vis, fields) = if let Some(struct_ctor) = struct_ctor { - if let PathSource::Expr(Some(parent)) = source - && let ExprKind::Field(..) | ExprKind::MethodCall(..) = parent.kind - { - bad_struct_syntax_suggestion(self, err, def_id); - return true; - } - struct_ctor - } else { + if let PathSource::Expr(Some(parent)) = source + && let ExprKind::Field(..) | ExprKind::MethodCall(..) = parent.kind + { + bad_struct_syntax_suggestion(self, err, def_id); + return true; + } + let Some(ctor) = self.r.struct_ctor(def_id) else { bad_struct_syntax_suggestion(self, err, def_id); return true; }; - let is_accessible = self.r.is_accessible_from(ctor_vis, self.parent_scope.module); + let is_accessible = self.r.is_accessible_from(ctor.vis, self.parent_scope.module); if let Some(use_span) = self.r.inaccessible_ctor_reexport.get(&span) && is_accessible { @@ -2409,11 +2385,7 @@ impl<'ast, 'ra, 'tcx> LateResolutionVisitor<'_, 'ast, 'ra, 'tcx> { "the type is accessed through this re-export, but the type's constructor \ is not visible in this import's scope due to private fields", ); - if is_accessible - && fields - .iter() - .all(|vis| self.r.is_accessible_from(*vis, self.parent_scope.module)) - { + if is_accessible && !ctor.has_private_fields(self.parent_scope.module, self.r) { err.span_suggestion_verbose( span, "the type can be constructed directly, because its fields are \ @@ -2430,17 +2402,17 @@ impl<'ast, 'ra, 'tcx> LateResolutionVisitor<'_, 'ast, 'ra, 'tcx> { } self.update_err_for_private_tuple_struct_fields(err, &source, def_id); } - if !is_expected(ctor_def) || is_accessible { + if !is_expected(ctor.res) || is_accessible { return true; } let field_spans = self.update_err_for_private_tuple_struct_fields(err, &source, def_id); - if let Some(spans) = - field_spans.filter(|spans| spans.len() > 0 && fields.len() == spans.len()) + if let Some(spans) = field_spans + .filter(|spans| spans.len() > 0 && ctor.field_visibilities.len() == spans.len()) { - let non_visible_spans: Vec = iter::zip(&fields, &spans) + let non_visible_spans: Vec = iter::zip(&ctor.field_visibilities, &spans) .filter(|(vis, _)| { !self.r.is_accessible_from(**vis, self.parent_scope.module) }) @@ -2715,24 +2687,6 @@ impl<'ast, 'ra, 'tcx> LateResolutionVisitor<'_, 'ast, 'ra, 'tcx> { } } - fn has_private_fields(&self, def_id: DefId) -> bool { - let fields = match def_id.as_local() { - Some(def_id) => self.r.struct_constructors.get(&def_id).cloned().map(|(_, _, f)| f), - None => Some( - self.r - .tcx - .associated_item_def_ids(def_id) - .iter() - .map(|&field_id| self.r.tcx.visibility(field_id)) - .collect(), - ), - }; - - fields.is_some_and(|fields| { - fields.iter().any(|vis| !self.r.is_accessible_from(*vis, self.parent_scope.module)) - }) - } - /// Given the target `ident` and `kind`, search for the similarly named associated item /// in `self.current_trait_ref`. pub(crate) fn find_similarly_named_assoc_item( diff --git a/compiler/rustc_resolve/src/lib.rs b/compiler/rustc_resolve/src/lib.rs index 7334131a1c01d..5247777e2287e 100644 --- a/compiler/rustc_resolve/src/lib.rs +++ b/compiler/rustc_resolve/src/lib.rs @@ -26,7 +26,7 @@ use std::fmt; use std::ops::ControlFlow; use std::sync::Arc; -use diagnostics::{ImportSuggestion, LabelSuggestion, Suggestion}; +use diagnostics::{ImportSuggestion, LabelSuggestion, StructCtor, Suggestion}; use effective_visibilities::EffectiveVisibilitiesVisitor; use errors::{ParamKindInEnumDiscriminant, ParamKindInNonTrivialAnonConst}; use hygiene::Macros20NormalizedSyntaxContext; @@ -1346,7 +1346,7 @@ pub struct Resolver<'ra, 'tcx> { /// Table for mapping struct IDs into struct constructor IDs, /// it's not used during normal resolution, only for better error reporting. /// Also includes of list of each fields visibility - struct_constructors: LocalDefIdMap<(Res, Visibility, Vec>)> = Default::default(), + struct_ctors: LocalDefIdMap = Default::default(), /// for all the struct /// it's not used during normal resolution, only for better error reporting. From 9c2e42418cf92f34e091754359adb633b8713a3e Mon Sep 17 00:00:00 2001 From: Vadim Petrochenkov Date: Wed, 15 Apr 2026 19:24:58 +0300 Subject: [PATCH 33/38] resolve: Remove `type Res` aliases except the one in the crate root Use imports instead --- .../rustc_resolve/src/build_reduced_graph.rs | 6 ++---- compiler/rustc_resolve/src/diagnostics.rs | 6 ++---- compiler/rustc_resolve/src/imports.rs | 4 +--- compiler/rustc_resolve/src/late.rs | 6 ++---- compiler/rustc_resolve/src/late/diagnostics.rs | 18 +++++------------- compiler/rustc_resolve/src/macros.rs | 8 +++----- 6 files changed, 15 insertions(+), 33 deletions(-) diff --git a/compiler/rustc_resolve/src/build_reduced_graph.rs b/compiler/rustc_resolve/src/build_reduced_graph.rs index 772846fd7cf5b..1c6889efe7501 100644 --- a/compiler/rustc_resolve/src/build_reduced_graph.rs +++ b/compiler/rustc_resolve/src/build_reduced_graph.rs @@ -38,12 +38,10 @@ use crate::macros::{MacroRulesDecl, MacroRulesScope, MacroRulesScopeRef}; use crate::ref_mut::CmCell; use crate::{ BindingKey, Decl, DeclData, DeclKind, ExternPreludeEntry, Finalize, IdentKey, MacroData, - Module, ModuleKind, ModuleOrUniformRoot, ParentScope, PathResult, ResolutionError, Resolver, - Segment, Used, VisResolutionError, errors, + Module, ModuleKind, ModuleOrUniformRoot, ParentScope, PathResult, Res, ResolutionError, + Resolver, Segment, Used, VisResolutionError, errors, }; -type Res = def::Res; - impl<'ra, 'tcx> Resolver<'ra, 'tcx> { /// Attempt to put the declaration with the given name and namespace into the module, /// and report an error in case of a collision. diff --git a/compiler/rustc_resolve/src/diagnostics.rs b/compiler/rustc_resolve/src/diagnostics.rs index f2dfa0a281a2f..08ee2db1f5b17 100644 --- a/compiler/rustc_resolve/src/diagnostics.rs +++ b/compiler/rustc_resolve/src/diagnostics.rs @@ -17,7 +17,7 @@ use rustc_errors::{ use rustc_feature::BUILTIN_ATTRIBUTES; use rustc_hir::attrs::{CfgEntry, StrippedCfgItem}; use rustc_hir::def::Namespace::{self, *}; -use rustc_hir::def::{self, CtorKind, CtorOf, DefKind, MacroKinds, NonMacroAttrKind, PerNS}; +use rustc_hir::def::{CtorKind, CtorOf, DefKind, MacroKinds, NonMacroAttrKind, PerNS}; use rustc_hir::def_id::{CRATE_DEF_ID, DefId}; use rustc_hir::{PrimTy, Stability, StabilityLevel, find_attr}; use rustc_middle::bug; @@ -49,13 +49,11 @@ use crate::late::{DiagMetadata, PatternSource, Rib}; use crate::{ AmbiguityError, AmbiguityKind, AmbiguityWarning, BindingError, BindingKey, Decl, DeclKind, Finalize, ForwardGenericParamBanReason, HasGenericParams, IdentKey, LateDecl, MacroRulesScope, - Module, ModuleKind, ModuleOrUniformRoot, ParentScope, PathResult, PrivacyError, + Module, ModuleKind, ModuleOrUniformRoot, ParentScope, PathResult, PrivacyError, Res, ResolutionError, Resolver, Scope, ScopeSet, Segment, UseError, Used, VisResolutionError, errors as errs, path_names_to_string, }; -type Res = def::Res; - /// A vector of spans and replacements, a message and applicability. pub(crate) type Suggestion = (Vec<(Span, String)>, String, Applicability); diff --git a/compiler/rustc_resolve/src/imports.rs b/compiler/rustc_resolve/src/imports.rs index a94f3ea435e2c..d1a3960afd039 100644 --- a/compiler/rustc_resolve/src/imports.rs +++ b/compiler/rustc_resolve/src/imports.rs @@ -37,12 +37,10 @@ use crate::errors::{ use crate::ref_mut::CmCell; use crate::{ AmbiguityError, BindingKey, CmResolver, Decl, DeclData, DeclKind, Determinacy, Finalize, - IdentKey, ImportSuggestion, Module, ModuleOrUniformRoot, ParentScope, PathResult, PerNS, + IdentKey, ImportSuggestion, Module, ModuleOrUniformRoot, ParentScope, PathResult, PerNS, Res, ResolutionError, Resolver, ScopeSet, Segment, Used, module_to_string, names_to_string, }; -type Res = def::Res; - /// A potential import declaration in the process of being planted into a module. /// Also used for lazily planting names from `--extern` flags to extern prelude. #[derive(Clone, Copy, Default, PartialEq, Debug)] diff --git a/compiler/rustc_resolve/src/late.rs b/compiler/rustc_resolve/src/late.rs index 25ef573447c12..a88f06f931389 100644 --- a/compiler/rustc_resolve/src/late.rs +++ b/compiler/rustc_resolve/src/late.rs @@ -25,7 +25,7 @@ use rustc_errors::{ StashKey, Suggestions, elided_lifetime_in_path_suggestion, pluralize, }; use rustc_hir::def::Namespace::{self, *}; -use rustc_hir::def::{self, CtorKind, DefKind, LifetimeRes, NonMacroAttrKind, PartialRes, PerNS}; +use rustc_hir::def::{CtorKind, DefKind, LifetimeRes, NonMacroAttrKind, PartialRes, PerNS}; use rustc_hir::def_id::{CRATE_DEF_ID, DefId, LOCAL_CRATE, LocalDefId}; use rustc_hir::{MissingLifetimeKind, PrimTy, TraitCandidate}; use rustc_middle::middle::resolve_bound_vars::Set1; @@ -41,14 +41,12 @@ use tracing::{debug, instrument, trace}; use crate::{ BindingError, BindingKey, Decl, DelegationFnSig, Finalize, IdentKey, LateDecl, Module, - ModuleOrUniformRoot, ParentScope, PathResult, ResolutionError, Resolver, Segment, Stage, + ModuleOrUniformRoot, ParentScope, PathResult, Res, ResolutionError, Resolver, Segment, Stage, TyCtxt, UseError, Used, errors, path_names_to_string, rustdoc, }; mod diagnostics; -type Res = def::Res; - use diagnostics::{ElisionFnParameter, LifetimeElisionCandidate, MissingLifetime}; #[derive(Copy, Clone, Debug)] diff --git a/compiler/rustc_resolve/src/late/diagnostics.rs b/compiler/rustc_resolve/src/late/diagnostics.rs index 05bcd67f76da9..634893354c9e2 100644 --- a/compiler/rustc_resolve/src/late/diagnostics.rs +++ b/compiler/rustc_resolve/src/late/diagnostics.rs @@ -19,7 +19,7 @@ use rustc_errors::{ }; use rustc_hir as hir; use rustc_hir::def::Namespace::{self, *}; -use rustc_hir::def::{self, CtorKind, CtorOf, DefKind, MacroKinds}; +use rustc_hir::def::{CtorKind, CtorOf, DefKind, MacroKinds}; use rustc_hir::def_id::{CRATE_DEF_ID, DefId}; use rustc_hir::{MissingLifetimeKind, PrimTy, find_attr}; use rustc_middle::ty; @@ -38,12 +38,10 @@ use crate::late::{ }; use crate::ty::fast_reject::SimplifiedType; use crate::{ - Finalize, Module, ModuleKind, ModuleOrUniformRoot, ParentScope, PathResult, PathSource, + Finalize, Module, ModuleKind, ModuleOrUniformRoot, ParentScope, PathResult, PathSource, Res, Resolver, ScopeSet, Segment, errors, path_names_to_string, }; -type Res = def::Res; - /// A field or associated item from self type suggested in case of resolution failure. enum AssocSuggestion { Field(Span), @@ -1893,10 +1891,7 @@ impl<'ast, 'ra, 'tcx> LateResolutionVisitor<'_, 'ast, 'ra, 'tcx> { let ast::TyKind::Path(Some(qself), path) = &bounded_ty.kind else { return false }; // use this to verify that ident is a type param. let Some(partial_res) = self.r.partial_res_map.get(&bounded_ty.id) else { return false }; - if !matches!( - partial_res.full_res(), - Some(hir::def::Res::Def(hir::def::DefKind::AssocTy, _)) - ) { + if !matches!(partial_res.full_res(), Some(Res::Def(DefKind::AssocTy, _))) { return false; } @@ -1906,10 +1901,7 @@ impl<'ast, 'ra, 'tcx> LateResolutionVisitor<'_, 'ast, 'ra, 'tcx> { let Some(partial_res) = self.r.partial_res_map.get(&peeled_ty.id) else { return false; }; - if !matches!( - partial_res.full_res(), - Some(hir::def::Res::Def(hir::def::DefKind::TyParam, _)) - ) { + if !matches!(partial_res.full_res(), Some(Res::Def(DefKind::TyParam, _))) { return false; } let ([ast::PathSegment { args: None, .. }], [ast::GenericBound::Trait(poly_trait_ref)]) = @@ -1929,7 +1921,7 @@ impl<'ast, 'ra, 'tcx> LateResolutionVisitor<'_, 'ast, 'ra, 'tcx> { let Some(partial_res) = self.r.partial_res_map.get(&id) else { return false; }; - if !matches!(partial_res.full_res(), Some(hir::def::Res::Def(..))) { + if !matches!(partial_res.full_res(), Some(Res::Def(..))) { return false; } diff --git a/compiler/rustc_resolve/src/macros.rs b/compiler/rustc_resolve/src/macros.rs index f0e757b2d673d..68242fba473d6 100644 --- a/compiler/rustc_resolve/src/macros.rs +++ b/compiler/rustc_resolve/src/macros.rs @@ -18,7 +18,7 @@ use rustc_expand::expand::{ }; use rustc_feature::Features; use rustc_hir::attrs::{AttributeKind, CfgEntry, StrippedCfgItem}; -use rustc_hir::def::{self, DefKind, MacroKinds, Namespace, NonMacroAttrKind}; +use rustc_hir::def::{DefKind, MacroKinds, Namespace, NonMacroAttrKind}; use rustc_hir::def_id::{CrateNum, DefId, LocalDefId}; use rustc_hir::{Attribute, StabilityLevel}; use rustc_middle::middle::stability; @@ -43,12 +43,10 @@ use crate::hygiene::Macros20NormalizedSyntaxContext; use crate::imports::Import; use crate::{ BindingKey, CacheCell, CmResolver, Decl, DeclKind, DeriveData, Determinacy, Finalize, IdentKey, - InvocationParent, MacroData, ModuleKind, ModuleOrUniformRoot, ParentScope, PathResult, + InvocationParent, MacroData, ModuleKind, ModuleOrUniformRoot, ParentScope, PathResult, Res, ResolutionError, Resolver, ScopeSet, Segment, Used, }; -type Res = def::Res; - /// Name declaration produced by a `macro_rules` item definition. /// Not modularized, can shadow previous `macro_rules` definitions, etc. #[derive(Debug)] @@ -880,7 +878,7 @@ impl<'ra, 'tcx> Resolver<'ra, 'tcx> { let res = res?; let ext = match deleg_impl { Some((impl_def_id, star_span)) => match res { - def::Res::Def(DefKind::Trait, def_id) => { + Res::Def(DefKind::Trait, def_id) => { let edition = self.tcx.sess.edition(); Some(Arc::new(SyntaxExtension::glob_delegation( def_id, From 19c7df6f3f57bf930562a4875f4b59fbac004a81 Mon Sep 17 00:00:00 2001 From: Vadim Petrochenkov Date: Wed, 15 Apr 2026 19:45:53 +0300 Subject: [PATCH 34/38] resolve: Remove `inaccessible_ctor_reexport` resolver field Collect the necessary information during error reporting instead of doing it on a good path from the core name resolution infra --- compiler/rustc_resolve/src/ident.rs | 14 ------------- .../rustc_resolve/src/late/diagnostics.rs | 20 +++++++++++++++---- compiler/rustc_resolve/src/lib.rs | 5 ----- 3 files changed, 16 insertions(+), 23 deletions(-) diff --git a/compiler/rustc_resolve/src/ident.rs b/compiler/rustc_resolve/src/ident.rs index f38ce51d709c1..7ff3f09668928 100644 --- a/compiler/rustc_resolve/src/ident.rs +++ b/compiler/rustc_resolve/src/ident.rs @@ -1087,7 +1087,6 @@ impl<'ra, 'tcx> Resolver<'ra, 'tcx> { orig_ident_span, binding, parent_scope, - module, finalize, shadowing, ); @@ -1150,7 +1149,6 @@ impl<'ra, 'tcx> Resolver<'ra, 'tcx> { orig_ident_span, binding, parent_scope, - module, finalize, shadowing, ); @@ -1260,7 +1258,6 @@ impl<'ra, 'tcx> Resolver<'ra, 'tcx> { orig_ident_span: Span, binding: Option>, parent_scope: &ParentScope<'ra>, - module: Module<'ra>, finalize: Finalize, shadowing: Shadowing, ) -> Result, ControlFlow> { @@ -1295,17 +1292,6 @@ impl<'ra, 'tcx> Resolver<'ra, 'tcx> { self.macro_expanded_macro_export_errors.insert((path_span, binding.span)); } - // If we encounter a re-export for a type with private fields, it will not be able to - // be constructed through this re-export. We track that case here to expand later - // privacy errors with appropriate information. - if let Res::Def(_, def_id) = binding.res() { - if let Some(ctor) = self.struct_ctor(def_id) - && ctor.has_private_fields(module, self) - { - self.inaccessible_ctor_reexport.insert(path_span, binding.span); - } - } - self.record_use(ident, binding, used); return Ok(binding); } diff --git a/compiler/rustc_resolve/src/late/diagnostics.rs b/compiler/rustc_resolve/src/late/diagnostics.rs index 634893354c9e2..cbcf1a182c7e1 100644 --- a/compiler/rustc_resolve/src/late/diagnostics.rs +++ b/compiler/rustc_resolve/src/late/diagnostics.rs @@ -2368,16 +2368,28 @@ impl<'ast, 'ra, 'tcx> LateResolutionVisitor<'_, 'ast, 'ra, 'tcx> { return true; }; + // A type is re-exported and has an inaccessible constructor because it has fields + // that are inaccessible from the reexport's scope, extend the diagnostic. let is_accessible = self.r.is_accessible_from(ctor.vis, self.parent_scope.module); - if let Some(use_span) = self.r.inaccessible_ctor_reexport.get(&span) - && is_accessible + if is_accessible + && let mod_path = &path[..path.len() - 1] + && let PathResult::Module(ModuleOrUniformRoot::Module(import_mod)) = + self.resolve_path(mod_path, Some(TypeNS), None, PathSource::Module) + && ctor.has_private_fields(import_mod, self.r) + && let Ok(import_decl) = self.r.cm().maybe_resolve_ident_in_module( + ModuleOrUniformRoot::Module(import_mod), + path.last().unwrap().ident, + TypeNS, + &self.parent_scope, + None, + ) { err.span_note( - *use_span, + import_decl.span, "the type is accessed through this re-export, but the type's constructor \ is not visible in this import's scope due to private fields", ); - if is_accessible && !ctor.has_private_fields(self.parent_scope.module, self.r) { + if !ctor.has_private_fields(self.parent_scope.module, self.r) { err.span_suggestion_verbose( span, "the type can be constructed directly, because its fields are \ diff --git a/compiler/rustc_resolve/src/lib.rs b/compiler/rustc_resolve/src/lib.rs index 5247777e2287e..35ef00f945035 100644 --- a/compiler/rustc_resolve/src/lib.rs +++ b/compiler/rustc_resolve/src/lib.rs @@ -1285,11 +1285,6 @@ pub struct Resolver<'ra, 'tcx> { /// Crate-local macro expanded `macro_export` referred to by a module-relative path. macro_expanded_macro_export_errors: BTreeSet<(Span, Span)> = BTreeSet::new(), - /// When a type is re-exported that has an inaccessible constructor because it has fields that - /// are inaccessible from the import's scope, we mark that as the type won't be able to be built - /// through the re-export. We use this information to extend the existing diagnostic. - inaccessible_ctor_reexport: FxHashMap = default::fx_hash_map(), - arenas: &'ra ResolverArenas<'ra>, dummy_decl: Decl<'ra>, builtin_type_decls: FxHashMap>, From dbb83b65b042224d3f40db5a0e60f9bc1dc93ef3 Mon Sep 17 00:00:00 2001 From: WilliamTakeshi Date: Wed, 15 Apr 2026 21:23:02 +0200 Subject: [PATCH 35/38] remove calls to AliasTyKind::def_id --- .../src/traits/query/normalize.rs | 4 ++-- compiler/rustc_ty_utils/src/opaque_types.rs | 18 +++++++++--------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/compiler/rustc_trait_selection/src/traits/query/normalize.rs b/compiler/rustc_trait_selection/src/traits/query/normalize.rs index a088384146293..216df6ba82cf5 100644 --- a/compiler/rustc_trait_selection/src/traits/query/normalize.rs +++ b/compiler/rustc_trait_selection/src/traits/query/normalize.rs @@ -211,7 +211,7 @@ impl<'a, 'tcx> FallibleTypeFolder> for QueryNormalizer<'a, 'tcx> { // See note in `rustc_trait_selection::traits::project` about why we // wait to fold the args. let res = match data.kind { - ty::Opaque { .. } => { + ty::Opaque { def_id } => { // Only normalize `impl Trait` outside of type inference, usually in codegen. match self.infcx.typing_mode() { TypingMode::Coherence @@ -236,7 +236,7 @@ impl<'a, 'tcx> FallibleTypeFolder> for QueryNormalizer<'a, 'tcx> { return Ok(Ty::new_error(self.cx(), guar)); } - let generic_ty = self.cx().type_of(data.kind.def_id()); + let generic_ty = self.cx().type_of(def_id); let mut concrete_ty = generic_ty.instantiate(self.cx(), args); self.anon_depth += 1; if concrete_ty == ty { diff --git a/compiler/rustc_ty_utils/src/opaque_types.rs b/compiler/rustc_ty_utils/src/opaque_types.rs index f27ab51278d3e..37db892ce2e95 100644 --- a/compiler/rustc_ty_utils/src/opaque_types.rs +++ b/compiler/rustc_ty_utils/src/opaque_types.rs @@ -92,12 +92,14 @@ impl<'tcx> OpaqueTypeCollector<'tcx> { #[instrument(level = "debug", skip(self))] fn visit_opaque_ty(&mut self, alias_ty: ty::AliasTy<'tcx>) { - if !self.seen.insert(alias_ty.kind.def_id().expect_local()) { + let ty::Opaque { def_id } = alias_ty.kind else { bug!("{alias_ty:?}") }; + + if !self.seen.insert(def_id.expect_local()) { return; } // TAITs outside their defining scopes are ignored. - match self.tcx.local_opaque_ty_origin(alias_ty.kind.def_id().expect_local()) { + match self.tcx.local_opaque_ty_origin(def_id.expect_local()) { rustc_hir::OpaqueTyOrigin::FnReturn { .. } | rustc_hir::OpaqueTyOrigin::AsyncFn { .. } => {} rustc_hir::OpaqueTyOrigin::TyAlias { in_assoc_ty, .. } => match self.mode { @@ -122,9 +124,9 @@ impl<'tcx> OpaqueTypeCollector<'tcx> { } trace!(?alias_ty, "adding"); - self.opaques.push(alias_ty.kind.def_id().expect_local()); + self.opaques.push(def_id.expect_local()); - let parent_count = self.tcx.generics_of(alias_ty.kind.def_id()).parent_count; + let parent_count = self.tcx.generics_of(def_id).parent_count; // Only check that the parent generics of the TAIT/RPIT are unique. // the args owned by the opaque are going to always be duplicate // lifetime params for RPITs, and empty for TAITs. @@ -140,9 +142,7 @@ impl<'tcx> OpaqueTypeCollector<'tcx> { // Collect opaque types nested within the associated type bounds of this opaque type. // We use identity args here, because we already know that the opaque type uses // only generic parameters, and thus instantiating would not give us more information. - for (pred, span) in - self.tcx.explicit_item_bounds(alias_ty.kind.def_id()).iter_identity_copied() - { + for (pred, span) in self.tcx.explicit_item_bounds(def_id).iter_identity_copied() { trace!(?pred); self.visit_spanned(span, pred); } @@ -151,14 +151,14 @@ impl<'tcx> OpaqueTypeCollector<'tcx> { self.tcx.dcx().emit_err(NotParam { arg, span: self.span(), - opaque_span: self.tcx.def_span(alias_ty.kind.def_id()), + opaque_span: self.tcx.def_span(def_id), }); } Err(NotUniqueParam::DuplicateParam(arg)) => { self.tcx.dcx().emit_err(DuplicateArg { arg, span: self.span(), - opaque_span: self.tcx.def_span(alias_ty.kind.def_id()), + opaque_span: self.tcx.def_span(def_id), }); } } From ae6dbdd9f012a33ffa1c66c35a56032b0fdafe85 Mon Sep 17 00:00:00 2001 From: Urgau Date: Wed, 15 Apr 2026 20:30:59 +0200 Subject: [PATCH 36/38] Add `--remap-path-scope` as unstable in rustdoc --- compiler/rustc_session/src/config.rs | 3 +- src/doc/rustdoc/src/unstable-features.md | 6 ++++ src/librustdoc/config.rs | 8 +++++- src/librustdoc/core.rs | 2 ++ src/librustdoc/doctest.rs | 1 + src/librustdoc/lib.rs | 8 ++++++ .../output-default.stdout | 3 ++ tests/rustdoc-ui/remap-path-prefix-doctest.rs | 22 +++++++++++++++ ...path-prefix-doctest.with-diag-scope.stdout | 24 ++++++++++++++++ ...-path-prefix-doctest.with-doc-scope.stdout | 24 ++++++++++++++++ ...ath-prefix-doctest.with-macro-scope.stdout | 24 ++++++++++++++++ ...th-prefix-doctest.with-object-scope.stdout | 24 ++++++++++++++++ ...p-path-prefix-doctest.without-scope.stdout | 24 ++++++++++++++++ ...o.rs => remap-path-prefix-macro-138520.rs} | 0 tests/rustdoc-ui/remap-path-prefix.rs | 28 +++++++++++++++++++ ...ap-path-prefix.with-debuginfo-scope.stderr | 8 ++++++ .../remap-path-prefix.with-diag-scope.stderr | 8 ++++++ .../remap-path-prefix.with-doc-scope.stderr | 8 ++++++ .../remap-path-prefix.with-macro-scope.stderr | 8 ++++++ .../remap-path-prefix.without-remap.stderr | 8 ++++++ .../remap-path-prefix.without-scopes.stderr | 8 ++++++ .../remap-path-scope-invalid.foo.stderr | 2 ++ tests/rustdoc-ui/remap-path-scope-invalid.rs | 10 +++++++ ...remap-path-scope-invalid.underscore.stderr | 2 ++ tests/rustdoc-ui/remap-path-scope-unstable.rs | 7 +++++ .../remap-path-scope-unstable.stderr | 2 ++ 26 files changed, 270 insertions(+), 2 deletions(-) create mode 100644 tests/rustdoc-ui/remap-path-prefix-doctest.rs create mode 100644 tests/rustdoc-ui/remap-path-prefix-doctest.with-diag-scope.stdout create mode 100644 tests/rustdoc-ui/remap-path-prefix-doctest.with-doc-scope.stdout create mode 100644 tests/rustdoc-ui/remap-path-prefix-doctest.with-macro-scope.stdout create mode 100644 tests/rustdoc-ui/remap-path-prefix-doctest.with-object-scope.stdout create mode 100644 tests/rustdoc-ui/remap-path-prefix-doctest.without-scope.stdout rename tests/rustdoc-ui/{remap-path-prefix-macro.rs => remap-path-prefix-macro-138520.rs} (100%) create mode 100644 tests/rustdoc-ui/remap-path-prefix.rs create mode 100644 tests/rustdoc-ui/remap-path-prefix.with-debuginfo-scope.stderr create mode 100644 tests/rustdoc-ui/remap-path-prefix.with-diag-scope.stderr create mode 100644 tests/rustdoc-ui/remap-path-prefix.with-doc-scope.stderr create mode 100644 tests/rustdoc-ui/remap-path-prefix.with-macro-scope.stderr create mode 100644 tests/rustdoc-ui/remap-path-prefix.without-remap.stderr create mode 100644 tests/rustdoc-ui/remap-path-prefix.without-scopes.stderr create mode 100644 tests/rustdoc-ui/remap-path-scope-invalid.foo.stderr create mode 100644 tests/rustdoc-ui/remap-path-scope-invalid.rs create mode 100644 tests/rustdoc-ui/remap-path-scope-invalid.underscore.stderr create mode 100644 tests/rustdoc-ui/remap-path-scope-unstable.rs create mode 100644 tests/rustdoc-ui/remap-path-scope-unstable.stderr diff --git a/compiler/rustc_session/src/config.rs b/compiler/rustc_session/src/config.rs index 3c0b3b4876659..c255d546e3933 100644 --- a/compiler/rustc_session/src/config.rs +++ b/compiler/rustc_session/src/config.rs @@ -1320,7 +1320,8 @@ impl OutputFilenames { } } -pub(crate) fn parse_remap_path_scope( +// pub for rustdoc +pub fn parse_remap_path_scope( early_dcx: &EarlyDiagCtxt, matches: &getopts::Matches, unstable_opts: &UnstableOptions, diff --git a/src/doc/rustdoc/src/unstable-features.md b/src/doc/rustdoc/src/unstable-features.md index ae007c4c13bb5..1c91ad343b8c0 100644 --- a/src/doc/rustdoc/src/unstable-features.md +++ b/src/doc/rustdoc/src/unstable-features.md @@ -759,6 +759,12 @@ it permits remapping source path prefixes in all output, including compiler diag debug information, macro expansions, etc. It takes a value of the form `FROM=TO` where a path prefix equal to `FROM` is rewritten to the value `TO`. +## `--remap-path-scope`: Scopes to which the source remapping should be done + +This flag is the equivalent flag from `rustc` `--remap-path-scope`. + +Defines which scopes of paths should be remapped by --remap-path-prefix. + ### `documentation` scope `rustdoc` (and by extension `rustc`) have a special `documentation` remapping scope, it diff --git a/src/librustdoc/config.rs b/src/librustdoc/config.rs index 15c86b552bba2..d726c612acf68 100644 --- a/src/librustdoc/config.rs +++ b/src/librustdoc/config.rs @@ -15,8 +15,8 @@ use rustc_session::config::{ use rustc_session::lint::Level; use rustc_session::search_paths::SearchPath; use rustc_session::{EarlyDiagCtxt, getopts}; -use rustc_span::FileName; use rustc_span::edition::Edition; +use rustc_span::{FileName, RemapPathScopeComponents}; use rustc_target::spec::TargetTuple; use crate::core::new_dcx; @@ -140,6 +140,8 @@ pub(crate) struct Options { pub(crate) no_run: bool, /// What sources are being mapped. pub(crate) remap_path_prefix: Vec<(PathBuf, PathBuf)>, + /// Which scope(s) to use with `--remap-path-prefix` + pub(crate) remap_path_scope: RemapPathScopeComponents, /// The path to a rustc-like binary to build tests with. If not set, we /// default to loading from `$sysroot/bin/rustc`. @@ -222,6 +224,7 @@ impl fmt::Debug for Options { .field("no_run", &self.no_run) .field("test_builder_wrappers", &self.test_builder_wrappers) .field("remap-file-prefix", &self.remap_path_prefix) + .field("remap-file-scope", &self.remap_path_scope) .field("no_capture", &self.no_capture) .field("scrape_examples_options", &self.scrape_examples_options) .field("unstable_features", &self.unstable_features) @@ -423,6 +426,8 @@ impl Options { early_dcx.early_fatal(err); } }; + let remap_path_scope = + rustc_session::config::parse_remap_path_scope(early_dcx, matches, &unstable_opts); let dcx = new_dcx(error_format, None, diagnostic_width, &unstable_opts); let dcx = dcx.handle(); @@ -889,6 +894,7 @@ impl Options { no_run, test_builder_wrappers, remap_path_prefix, + remap_path_scope, no_capture, crate_name, output_format, diff --git a/src/librustdoc/core.rs b/src/librustdoc/core.rs index 3c5b1e55de644..21ce508d8560c 100644 --- a/src/librustdoc/core.rs +++ b/src/librustdoc/core.rs @@ -211,6 +211,7 @@ pub(crate) fn create_config( lint_cap, scrape_examples_options, remap_path_prefix, + remap_path_scope, target_modifiers, .. }: RustdocOptions, @@ -270,6 +271,7 @@ pub(crate) fn create_config( crate_name, test, remap_path_prefix, + remap_path_scope, output_types: if let Some(file) = render_options.dep_info() { OutputTypes::new(&[(OutputType::DepInfo, file.cloned())]) } else { diff --git a/src/librustdoc/doctest.rs b/src/librustdoc/doctest.rs index bfcdc3a505585..6ec4aaf282238 100644 --- a/src/librustdoc/doctest.rs +++ b/src/librustdoc/doctest.rs @@ -171,6 +171,7 @@ pub(crate) fn run(dcx: DiagCtxtHandle<'_>, input: Input, options: RustdocOptions target_triple: options.target.clone(), crate_name: options.crate_name.clone(), remap_path_prefix: options.remap_path_prefix.clone(), + remap_path_scope: options.remap_path_scope.clone(), unstable_opts: options.unstable_opts.clone(), error_format: options.error_format.clone(), target_modifiers: options.target_modifiers.clone(), diff --git a/src/librustdoc/lib.rs b/src/librustdoc/lib.rs index 7fa716a9eb3f6..750ce27ea7962 100644 --- a/src/librustdoc/lib.rs +++ b/src/librustdoc/lib.rs @@ -556,6 +556,14 @@ fn opts() -> Vec { "Remap source names in compiler messages", "FROM=TO", ), + opt( + Unstable, + Opt, + "", + "remap-path-scope", + "Defines which scopes of paths should be remapped by `--remap-path-prefix`", + "[macro,diagnostics,debuginfo,coverage,object,all]", + ), opt( Unstable, FlagMulti, diff --git a/tests/run-make/rustdoc-default-output/output-default.stdout b/tests/run-make/rustdoc-default-output/output-default.stdout index bc3a67a1ebcdc..7202ed71a2a82 100644 --- a/tests/run-make/rustdoc-default-output/output-default.stdout +++ b/tests/run-make/rustdoc-default-output/output-default.stdout @@ -160,6 +160,9 @@ Options: rustdoc will emit a hard error. --remap-path-prefix FROM=TO Remap source names in compiler messages + --remap-path-scope [macro,diagnostics,debuginfo,coverage,object,all] + Defines which scopes of paths should be remapped by + `--remap-path-prefix` --show-type-layout Include the memory layout of types in the docs --no-capture Don't capture stdout and stderr of tests diff --git a/tests/rustdoc-ui/remap-path-prefix-doctest.rs b/tests/rustdoc-ui/remap-path-prefix-doctest.rs new file mode 100644 index 0000000000000..34fff98d5caa2 --- /dev/null +++ b/tests/rustdoc-ui/remap-path-prefix-doctest.rs @@ -0,0 +1,22 @@ +// This test checks the output of remapping with `--remap-path-prefix` and +// `--remap-path-scope` with a doctest. + +//@ failure-status: 101 +//@ rustc-env:RUST_BACKTRACE=0 +//@ normalize-stdout: "finished in \d+\.\d+s" -> "finished in $$TIME" + +//@ revisions: with-diag-scope with-macro-scope with-object-scope with-doc-scope +//@ revisions: without-scope + +//@ compile-flags:--test --test-args --test-threads=1 +//@ compile-flags:-Z unstable-options --remap-path-prefix={{src-base}}=remapped_path + +//@[with-diag-scope] compile-flags: -Zunstable-options --remap-path-scope=diagnostics +//@[with-macro-scope] compile-flags: -Zunstable-options --remap-path-scope=macro +//@[with-object-scope] compile-flags: -Zunstable-options --remap-path-scope=debuginfo +//@[with-doc-scope] compile-flags: -Zunstable-options --remap-path-scope=documentation + +/// ``` +/// fn invalid( +/// ``` +pub struct SomeStruct; diff --git a/tests/rustdoc-ui/remap-path-prefix-doctest.with-diag-scope.stdout b/tests/rustdoc-ui/remap-path-prefix-doctest.with-diag-scope.stdout new file mode 100644 index 0000000000000..22f4fe70c6175 --- /dev/null +++ b/tests/rustdoc-ui/remap-path-prefix-doctest.with-diag-scope.stdout @@ -0,0 +1,24 @@ + +running 1 test +test $DIR/remap-path-prefix-doctest.rs - SomeStruct (line 19) ... FAILED + +failures: + +---- $DIR/remap-path-prefix-doctest.rs - SomeStruct (line 19) stdout ---- +error: this file contains an unclosed delimiter + --> $DIR/remap-path-prefix-doctest.rs:20:12 + | +LL | fn invalid( + | -^ + | | + | unclosed delimiter + +error: aborting due to 1 previous error + +Couldn't compile the test. + +failures: + $DIR/remap-path-prefix-doctest.rs - SomeStruct (line 19) + +test result: FAILED. 0 passed; 1 failed; 0 ignored; 0 measured; 0 filtered out; finished in $TIME + diff --git a/tests/rustdoc-ui/remap-path-prefix-doctest.with-doc-scope.stdout b/tests/rustdoc-ui/remap-path-prefix-doctest.with-doc-scope.stdout new file mode 100644 index 0000000000000..248f7734652fa --- /dev/null +++ b/tests/rustdoc-ui/remap-path-prefix-doctest.with-doc-scope.stdout @@ -0,0 +1,24 @@ + +running 1 test +test remapped_path/remap-path-prefix-doctest.rs - SomeStruct (line 19) ... FAILED + +failures: + +---- remapped_path/remap-path-prefix-doctest.rs - SomeStruct (line 19) stdout ---- +error: this file contains an unclosed delimiter + --> remapped_path/remap-path-prefix-doctest.rs:20:12 + | +LL | fn invalid( + | -^ + | | + | unclosed delimiter + +error: aborting due to 1 previous error + +Couldn't compile the test. + +failures: + remapped_path/remap-path-prefix-doctest.rs - SomeStruct (line 19) + +test result: FAILED. 0 passed; 1 failed; 0 ignored; 0 measured; 0 filtered out; finished in $TIME + diff --git a/tests/rustdoc-ui/remap-path-prefix-doctest.with-macro-scope.stdout b/tests/rustdoc-ui/remap-path-prefix-doctest.with-macro-scope.stdout new file mode 100644 index 0000000000000..22f4fe70c6175 --- /dev/null +++ b/tests/rustdoc-ui/remap-path-prefix-doctest.with-macro-scope.stdout @@ -0,0 +1,24 @@ + +running 1 test +test $DIR/remap-path-prefix-doctest.rs - SomeStruct (line 19) ... FAILED + +failures: + +---- $DIR/remap-path-prefix-doctest.rs - SomeStruct (line 19) stdout ---- +error: this file contains an unclosed delimiter + --> $DIR/remap-path-prefix-doctest.rs:20:12 + | +LL | fn invalid( + | -^ + | | + | unclosed delimiter + +error: aborting due to 1 previous error + +Couldn't compile the test. + +failures: + $DIR/remap-path-prefix-doctest.rs - SomeStruct (line 19) + +test result: FAILED. 0 passed; 1 failed; 0 ignored; 0 measured; 0 filtered out; finished in $TIME + diff --git a/tests/rustdoc-ui/remap-path-prefix-doctest.with-object-scope.stdout b/tests/rustdoc-ui/remap-path-prefix-doctest.with-object-scope.stdout new file mode 100644 index 0000000000000..22f4fe70c6175 --- /dev/null +++ b/tests/rustdoc-ui/remap-path-prefix-doctest.with-object-scope.stdout @@ -0,0 +1,24 @@ + +running 1 test +test $DIR/remap-path-prefix-doctest.rs - SomeStruct (line 19) ... FAILED + +failures: + +---- $DIR/remap-path-prefix-doctest.rs - SomeStruct (line 19) stdout ---- +error: this file contains an unclosed delimiter + --> $DIR/remap-path-prefix-doctest.rs:20:12 + | +LL | fn invalid( + | -^ + | | + | unclosed delimiter + +error: aborting due to 1 previous error + +Couldn't compile the test. + +failures: + $DIR/remap-path-prefix-doctest.rs - SomeStruct (line 19) + +test result: FAILED. 0 passed; 1 failed; 0 ignored; 0 measured; 0 filtered out; finished in $TIME + diff --git a/tests/rustdoc-ui/remap-path-prefix-doctest.without-scope.stdout b/tests/rustdoc-ui/remap-path-prefix-doctest.without-scope.stdout new file mode 100644 index 0000000000000..248f7734652fa --- /dev/null +++ b/tests/rustdoc-ui/remap-path-prefix-doctest.without-scope.stdout @@ -0,0 +1,24 @@ + +running 1 test +test remapped_path/remap-path-prefix-doctest.rs - SomeStruct (line 19) ... FAILED + +failures: + +---- remapped_path/remap-path-prefix-doctest.rs - SomeStruct (line 19) stdout ---- +error: this file contains an unclosed delimiter + --> remapped_path/remap-path-prefix-doctest.rs:20:12 + | +LL | fn invalid( + | -^ + | | + | unclosed delimiter + +error: aborting due to 1 previous error + +Couldn't compile the test. + +failures: + remapped_path/remap-path-prefix-doctest.rs - SomeStruct (line 19) + +test result: FAILED. 0 passed; 1 failed; 0 ignored; 0 measured; 0 filtered out; finished in $TIME + diff --git a/tests/rustdoc-ui/remap-path-prefix-macro.rs b/tests/rustdoc-ui/remap-path-prefix-macro-138520.rs similarity index 100% rename from tests/rustdoc-ui/remap-path-prefix-macro.rs rename to tests/rustdoc-ui/remap-path-prefix-macro-138520.rs diff --git a/tests/rustdoc-ui/remap-path-prefix.rs b/tests/rustdoc-ui/remap-path-prefix.rs new file mode 100644 index 0000000000000..e3efa9a693490 --- /dev/null +++ b/tests/rustdoc-ui/remap-path-prefix.rs @@ -0,0 +1,28 @@ +// This test exercises `--remap-path-prefix` and `--remap-path-scope` with macros, +// like file!() and a diagnostic with compile_error!(). +// +// See the compiler test suite for a more advanced tests, we just want to +// make sure here that rustdoc passes the right scopes to the underline rustc APIs. + +//@ revisions: with-diag-scope with-macro-scope with-debuginfo-scope with-doc-scope +//@ revisions: without-scopes without-remap + +//@[with-diag-scope] compile-flags: -Zunstable-options --remap-path-prefix={{src-base}}=remapped +//@[with-macro-scope] compile-flags: -Zunstable-options --remap-path-prefix={{src-base}}=remapped +//@[with-debuginfo-scope] compile-flags: -Zunstable-options --remap-path-prefix={{src-base}}=remapped +//@[with-doc-scope] compile-flags: -Zunstable-options --remap-path-prefix={{src-base}}=remapped +//@[without-scopes] compile-flags: -Zunstable-options --remap-path-prefix={{src-base}}=remapped + +//@[with-diag-scope] compile-flags: -Zunstable-options --remap-path-scope=diagnostics +//@[with-macro-scope] compile-flags: -Zunstable-options --remap-path-scope=macro +//@[with-debuginfo-scope] compile-flags: -Zunstable-options --remap-path-scope=debuginfo +//@[with-doc-scope] compile-flags: -Zunstable-options --remap-path-scope=documentation + +compile_error!(concat!("file!() = ", file!())); +//[with-macro-scope]~^ ERROR file!() +//[with-debuginfo-scope]~^^ ERROR file!() +//[with-doc-scope]~^^^ ERROR file!() +//[without-remap]~^^^^ ERROR file!() + +//[with-diag-scope]~? ERROR file!() +//[without-scopes]~? ERROR file!() diff --git a/tests/rustdoc-ui/remap-path-prefix.with-debuginfo-scope.stderr b/tests/rustdoc-ui/remap-path-prefix.with-debuginfo-scope.stderr new file mode 100644 index 0000000000000..ce506a9529c6c --- /dev/null +++ b/tests/rustdoc-ui/remap-path-prefix.with-debuginfo-scope.stderr @@ -0,0 +1,8 @@ +error: file!() = $DIR/remap-path-prefix.rs + --> $DIR/remap-path-prefix.rs:21:1 + | +LL | compile_error!(concat!("file!() = ", file!())); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: aborting due to 1 previous error + diff --git a/tests/rustdoc-ui/remap-path-prefix.with-diag-scope.stderr b/tests/rustdoc-ui/remap-path-prefix.with-diag-scope.stderr new file mode 100644 index 0000000000000..a51ff5dce4a38 --- /dev/null +++ b/tests/rustdoc-ui/remap-path-prefix.with-diag-scope.stderr @@ -0,0 +1,8 @@ +error: file!() = $DIR/remap-path-prefix.rs + --> remapped/remap-path-prefix.rs:21:1 + | +LL | compile_error!(concat!("file!() = ", file!())); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: aborting due to 1 previous error + diff --git a/tests/rustdoc-ui/remap-path-prefix.with-doc-scope.stderr b/tests/rustdoc-ui/remap-path-prefix.with-doc-scope.stderr new file mode 100644 index 0000000000000..ce506a9529c6c --- /dev/null +++ b/tests/rustdoc-ui/remap-path-prefix.with-doc-scope.stderr @@ -0,0 +1,8 @@ +error: file!() = $DIR/remap-path-prefix.rs + --> $DIR/remap-path-prefix.rs:21:1 + | +LL | compile_error!(concat!("file!() = ", file!())); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: aborting due to 1 previous error + diff --git a/tests/rustdoc-ui/remap-path-prefix.with-macro-scope.stderr b/tests/rustdoc-ui/remap-path-prefix.with-macro-scope.stderr new file mode 100644 index 0000000000000..2ac0fb513a9cd --- /dev/null +++ b/tests/rustdoc-ui/remap-path-prefix.with-macro-scope.stderr @@ -0,0 +1,8 @@ +error: file!() = remapped/remap-path-prefix.rs + --> $DIR/remap-path-prefix.rs:21:1 + | +LL | compile_error!(concat!("file!() = ", file!())); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: aborting due to 1 previous error + diff --git a/tests/rustdoc-ui/remap-path-prefix.without-remap.stderr b/tests/rustdoc-ui/remap-path-prefix.without-remap.stderr new file mode 100644 index 0000000000000..ce506a9529c6c --- /dev/null +++ b/tests/rustdoc-ui/remap-path-prefix.without-remap.stderr @@ -0,0 +1,8 @@ +error: file!() = $DIR/remap-path-prefix.rs + --> $DIR/remap-path-prefix.rs:21:1 + | +LL | compile_error!(concat!("file!() = ", file!())); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: aborting due to 1 previous error + diff --git a/tests/rustdoc-ui/remap-path-prefix.without-scopes.stderr b/tests/rustdoc-ui/remap-path-prefix.without-scopes.stderr new file mode 100644 index 0000000000000..8564703e74dcc --- /dev/null +++ b/tests/rustdoc-ui/remap-path-prefix.without-scopes.stderr @@ -0,0 +1,8 @@ +error: file!() = remapped/remap-path-prefix.rs + --> remapped/remap-path-prefix.rs:21:1 + | +LL | compile_error!(concat!("file!() = ", file!())); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: aborting due to 1 previous error + diff --git a/tests/rustdoc-ui/remap-path-scope-invalid.foo.stderr b/tests/rustdoc-ui/remap-path-scope-invalid.foo.stderr new file mode 100644 index 0000000000000..dc72089e0d57b --- /dev/null +++ b/tests/rustdoc-ui/remap-path-scope-invalid.foo.stderr @@ -0,0 +1,2 @@ +error: argument for `--remap-path-scope` must be a comma separated list of scopes: `macro`, `diagnostics`, `documentation`, `debuginfo`, `coverage`, `object`, `all` + diff --git a/tests/rustdoc-ui/remap-path-scope-invalid.rs b/tests/rustdoc-ui/remap-path-scope-invalid.rs new file mode 100644 index 0000000000000..7dde2739d409a --- /dev/null +++ b/tests/rustdoc-ui/remap-path-scope-invalid.rs @@ -0,0 +1,10 @@ +// Error on invalid --remap-path-scope arguments + +//@ revisions: foo underscore +//@ compile-flags: -Zunstable-options +//@ [foo]compile-flags: --remap-path-scope=foo +//@ [underscore]compile-flags: --remap-path-scope=macro_object + +//~? RAW argument for `--remap-path-scope + +fn main() {} diff --git a/tests/rustdoc-ui/remap-path-scope-invalid.underscore.stderr b/tests/rustdoc-ui/remap-path-scope-invalid.underscore.stderr new file mode 100644 index 0000000000000..dc72089e0d57b --- /dev/null +++ b/tests/rustdoc-ui/remap-path-scope-invalid.underscore.stderr @@ -0,0 +1,2 @@ +error: argument for `--remap-path-scope` must be a comma separated list of scopes: `macro`, `diagnostics`, `documentation`, `debuginfo`, `coverage`, `object`, `all` + diff --git a/tests/rustdoc-ui/remap-path-scope-unstable.rs b/tests/rustdoc-ui/remap-path-scope-unstable.rs new file mode 100644 index 0000000000000..34b8040c87c1b --- /dev/null +++ b/tests/rustdoc-ui/remap-path-scope-unstable.rs @@ -0,0 +1,7 @@ +// Regression test to make sure `--remap-path-scope` is unstable in rustdoc + +//@ compile-flags:--remap-path-scope macro + +//~? RAW the `-Z unstable-options` flag must also be passed to enable the flag `remap-path-scope` + +fn main() {} diff --git a/tests/rustdoc-ui/remap-path-scope-unstable.stderr b/tests/rustdoc-ui/remap-path-scope-unstable.stderr new file mode 100644 index 0000000000000..04c51836206aa --- /dev/null +++ b/tests/rustdoc-ui/remap-path-scope-unstable.stderr @@ -0,0 +1,2 @@ +error: the `-Z unstable-options` flag must also be passed to enable the flag `remap-path-scope` + From 9b64d52d7856bc9ceb2dab1a8fd2e2bbb7ef0fb4 Mon Sep 17 00:00:00 2001 From: Nicholas Nethercote Date: Thu, 16 Apr 2026 07:42:17 +1000 Subject: [PATCH 37/38] Reduce diagnostic type visibilities. Most diagnostic types are only used within their own crate, and so have a `pub(crate)` visibility. We have some diagnostic types that are unnecessarily `pub`. This is bad because (a) information hiding, and (b) if a `pub(crate)` type becomes unused the compiler will warn but it won't warn for a `pub` type. This commit eliminates unnecessary `pub` visibilities for some diagnostic types, and also some related things due to knock-on effects. (I found these types with some ad hoc use of `grep`.) --- compiler/rustc_codegen_ssa/src/errors.rs | 6 +- .../rustc_const_eval/src/const_eval/error.rs | 2 +- compiler/rustc_const_eval/src/errors.rs | 34 ++--- .../rustc_const_eval/src/interpret/stack.rs | 2 +- .../src/session_diagnostics.rs | 2 +- compiler/rustc_interface/src/errors.rs | 30 ++--- compiler/rustc_metadata/src/errors.rs | 118 +++++++++--------- compiler/rustc_middle/src/error.rs | 2 +- compiler/rustc_pattern_analysis/src/errors.rs | 10 +- compiler/rustc_session/src/errors.rs | 2 +- .../src/error_reporting/infer/mod.rs | 3 +- .../nice_region_error/placeholder_error.rs | 3 +- compiler/rustc_trait_selection/src/errors.rs | 108 ++++++++-------- .../src/errors/note_and_explain.rs | 8 +- 14 files changed, 165 insertions(+), 165 deletions(-) diff --git a/compiler/rustc_codegen_ssa/src/errors.rs b/compiler/rustc_codegen_ssa/src/errors.rs index 8a97521feb436..f1112510af0f0 100644 --- a/compiler/rustc_codegen_ssa/src/errors.rs +++ b/compiler/rustc_codegen_ssa/src/errors.rs @@ -1069,7 +1069,7 @@ pub(crate) struct TargetFeatureSafeTrait { #[derive(Diagnostic)] #[diag("target feature `{$feature}` cannot be enabled with `#[target_feature]`: {$reason}")] -pub struct ForbiddenTargetFeatureAttr<'a> { +pub(crate) struct ForbiddenTargetFeatureAttr<'a> { #[primary_span] pub span: Span, pub feature: &'a str, @@ -1211,7 +1211,7 @@ pub(crate) struct ForbiddenCTargetFeature<'a> { pub reason: &'a str, } -pub struct TargetFeatureDisableOrEnable<'a> { +pub(crate) struct TargetFeatureDisableOrEnable<'a> { pub features: &'a [&'a str], pub span: Option, pub missing_features: Option, @@ -1219,7 +1219,7 @@ pub struct TargetFeatureDisableOrEnable<'a> { #[derive(Subdiagnostic)] #[help("add the missing features in a `target_feature` attribute")] -pub struct MissingFeatures; +pub(crate) struct MissingFeatures; impl Diagnostic<'_, G> for TargetFeatureDisableOrEnable<'_> { fn into_diag(self, dcx: DiagCtxtHandle<'_>, level: Level) -> Diag<'_, G> { diff --git a/compiler/rustc_const_eval/src/const_eval/error.rs b/compiler/rustc_const_eval/src/const_eval/error.rs index c48b33e29eb6d..2c299df7b777d 100644 --- a/compiler/rustc_const_eval/src/const_eval/error.rs +++ b/compiler/rustc_const_eval/src/const_eval/error.rs @@ -92,7 +92,7 @@ impl<'tcx> Into> for ConstEvalErrKind { } } -pub fn get_span_and_frames<'tcx>( +pub(crate) fn get_span_and_frames<'tcx>( tcx: TyCtxtAt<'tcx>, stack: &[Frame<'tcx, impl Provenance, impl Sized>], ) -> (Span, Vec) { diff --git a/compiler/rustc_const_eval/src/errors.rs b/compiler/rustc_const_eval/src/errors.rs index 3943be0cf15ef..a61601a7b3c86 100644 --- a/compiler/rustc_const_eval/src/errors.rs +++ b/compiler/rustc_const_eval/src/errors.rs @@ -314,14 +314,14 @@ pub(crate) struct InteriorMutableBorrowEscaping { "this lint makes sure the compiler doesn't get stuck due to infinite loops in const eval. If your compilation actually takes a long time, you can safely allow the lint" )] -pub struct LongRunning { +pub(crate) struct LongRunning { #[help("the constant being evaluated")] pub item_span: Span, } #[derive(Diagnostic)] #[diag("constant evaluation is taking a long time")] -pub struct LongRunningWarn { +pub(crate) struct LongRunningWarn { #[primary_span] #[label("the const evaluator is currently interpreting this expression")] pub span: Span, @@ -339,7 +339,7 @@ pub(crate) struct NonConstImplNote { } #[derive(Clone)] -pub struct FrameNote { +pub(crate) struct FrameNote { pub span: Span, pub times: i32, pub where_: &'static str, @@ -377,7 +377,7 @@ impl Subdiagnostic for FrameNote { #[derive(Subdiagnostic)] #[note(r#"the raw bytes of the constant (size: {$size}, align: {$align}) {"{"}{$bytes}{"}"}"#)] -pub struct RawBytesNote { +pub(crate) struct RawBytesNote { pub size: u64, pub align: u64, pub bytes: String, @@ -393,7 +393,7 @@ pub struct RawBytesNote { }s"# )] #[note("`{$ty}` cannot be compared in compile-time, and therefore cannot be used in `match`es")] -pub struct NonConstMatchEq<'tcx> { +pub(crate) struct NonConstMatchEq<'tcx> { #[primary_span] pub span: Span, pub ty: Ty<'tcx>, @@ -408,7 +408,7 @@ pub struct NonConstMatchEq<'tcx> { [const_fn] constant function *[other] {""} }s"#, code = E0015)] -pub struct NonConstForLoopIntoIter<'tcx> { +pub(crate) struct NonConstForLoopIntoIter<'tcx> { #[primary_span] pub span: Span, pub ty: Ty<'tcx>, @@ -423,7 +423,7 @@ pub struct NonConstForLoopIntoIter<'tcx> { [const_fn] constant function *[other] {""} }s"#, code = E0015)] -pub struct NonConstQuestionBranch<'tcx> { +pub(crate) struct NonConstQuestionBranch<'tcx> { #[primary_span] pub span: Span, pub ty: Ty<'tcx>, @@ -438,7 +438,7 @@ pub struct NonConstQuestionBranch<'tcx> { [const_fn] constant function *[other] {""} }s"#, code = E0015)] -pub struct NonConstQuestionFromResidual<'tcx> { +pub(crate) struct NonConstQuestionFromResidual<'tcx> { #[primary_span] pub span: Span, pub ty: Ty<'tcx>, @@ -453,7 +453,7 @@ pub struct NonConstQuestionFromResidual<'tcx> { [const_fn] constant function *[other] {""} }s"#, code = E0015)] -pub struct NonConstTryBlockFromOutput<'tcx> { +pub(crate) struct NonConstTryBlockFromOutput<'tcx> { #[primary_span] pub span: Span, pub ty: Ty<'tcx>, @@ -468,7 +468,7 @@ pub struct NonConstTryBlockFromOutput<'tcx> { [const_fn] constant function *[other] {""} }s"#, code = E0015)] -pub struct NonConstAwait<'tcx> { +pub(crate) struct NonConstAwait<'tcx> { #[primary_span] pub span: Span, pub ty: Ty<'tcx>, @@ -483,7 +483,7 @@ pub struct NonConstAwait<'tcx> { [const_fn] constant function *[other] {""} }s"#, code = E0015)] -pub struct NonConstClosure { +pub(crate) struct NonConstClosure { #[primary_span] pub span: Span, pub kind: ConstContext, @@ -499,14 +499,14 @@ pub struct NonConstClosure { [const_fn] constant function *[other] {""} }s"#, code = E0015)] -pub struct NonConstCVariadicCall { +pub(crate) struct NonConstCVariadicCall { #[primary_span] pub span: Span, pub kind: ConstContext, } #[derive(Subdiagnostic)] -pub enum NonConstClosureNote { +pub(crate) enum NonConstClosureNote { #[note("function defined here, but it is not `const`")] FnDef { #[primary_span] @@ -534,7 +534,7 @@ pub enum NonConstClosureNote { #[derive(Subdiagnostic)] #[multipart_suggestion("consider dereferencing here", applicability = "machine-applicable")] -pub struct ConsiderDereferencing { +pub(crate) struct ConsiderDereferencing { pub deref: String, #[suggestion_part(code = "{deref}")] pub span: Span, @@ -549,7 +549,7 @@ pub struct ConsiderDereferencing { [const_fn] constant function *[other] {""} }s"#, code = E0015)] -pub struct NonConstOperator { +pub(crate) struct NonConstOperator { #[primary_span] pub span: Span, pub kind: ConstContext, @@ -566,7 +566,7 @@ pub struct NonConstOperator { *[other] {""} }s"#, code = E0015)] #[note("attempting to deref into `{$target_ty}`")] -pub struct NonConstDerefCoercion<'tcx> { +pub(crate) struct NonConstDerefCoercion<'tcx> { #[primary_span] pub span: Span, pub ty: Ty<'tcx>, @@ -579,7 +579,7 @@ pub struct NonConstDerefCoercion<'tcx> { #[derive(Diagnostic)] #[diag("destructor of `{$dropped_ty}` cannot be evaluated at compile-time", code = E0493)] -pub struct LiveDrop<'tcx> { +pub(crate) struct LiveDrop<'tcx> { #[primary_span] #[label( r#"the destructor for this type cannot be evaluated in {$kind -> diff --git a/compiler/rustc_const_eval/src/interpret/stack.rs b/compiler/rustc_const_eval/src/interpret/stack.rs index a73767264daba..3e7c57a439c67 100644 --- a/compiler/rustc_const_eval/src/interpret/stack.rs +++ b/compiler/rustc_const_eval/src/interpret/stack.rs @@ -223,7 +223,7 @@ impl<'tcx> fmt::Display for FrameInfo<'tcx> { } impl<'tcx> FrameInfo<'tcx> { - pub fn as_note(&self, tcx: TyCtxt<'tcx>) -> errors::FrameNote { + pub(crate) fn as_note(&self, tcx: TyCtxt<'tcx>) -> errors::FrameNote { let span = self.span; if tcx.def_key(self.instance.def_id()).disambiguated_data.data == DefPathData::Closure { errors::FrameNote { diff --git a/compiler/rustc_driver_impl/src/session_diagnostics.rs b/compiler/rustc_driver_impl/src/session_diagnostics.rs index 97972185ebc4c..f800c3f6b9d0d 100644 --- a/compiler/rustc_driver_impl/src/session_diagnostics.rs +++ b/compiler/rustc_driver_impl/src/session_diagnostics.rs @@ -4,7 +4,7 @@ use rustc_macros::{Diagnostic, Subdiagnostic}; #[derive(Diagnostic)] #[diag("could not emit MIR: {$error}")] -pub struct CantEmitMIR { +pub(crate) struct CantEmitMIR { pub error: std::io::Error, } diff --git a/compiler/rustc_interface/src/errors.rs b/compiler/rustc_interface/src/errors.rs index 7e4671889f57f..7cae1aa54d2e7 100644 --- a/compiler/rustc_interface/src/errors.rs +++ b/compiler/rustc_interface/src/errors.rs @@ -25,7 +25,7 @@ pub(crate) struct CrateNameInvalid<'a> { #[derive(Diagnostic)] #[diag("Ferris cannot be used as an identifier")] -pub struct FerrisIdentifier { +pub(crate) struct FerrisIdentifier { #[primary_span] pub spans: Vec, #[suggestion( @@ -39,7 +39,7 @@ pub struct FerrisIdentifier { #[derive(Diagnostic)] #[diag("identifiers cannot contain emoji: `{$ident}`")] -pub struct EmojiIdentifier { +pub(crate) struct EmojiIdentifier { #[primary_span] pub spans: Vec, pub ident: Symbol, @@ -47,22 +47,22 @@ pub struct EmojiIdentifier { #[derive(Diagnostic)] #[diag("cannot mix `bin` crate type with others")] -pub struct MixedBinCrate; +pub(crate) struct MixedBinCrate; #[derive(Diagnostic)] #[diag("cannot mix `proc-macro` crate type with others")] -pub struct MixedProcMacroCrate; +pub(crate) struct MixedProcMacroCrate; #[derive(Diagnostic)] #[diag("error writing dependencies to `{$path}`: {$error}")] -pub struct ErrorWritingDependencies<'a> { +pub(crate) struct ErrorWritingDependencies<'a> { pub path: &'a Path, pub error: io::Error, } #[derive(Diagnostic)] #[diag("the input file \"{$path}\" would be overwritten by the generated executable")] -pub struct InputFileWouldBeOverWritten<'a> { +pub(crate) struct InputFileWouldBeOverWritten<'a> { pub path: &'a Path, } @@ -70,22 +70,22 @@ pub struct InputFileWouldBeOverWritten<'a> { #[diag( "the generated executable for the input file \"{$input_path}\" conflicts with the existing directory \"{$dir_path}\"" )] -pub struct GeneratedFileConflictsWithDirectory<'a> { +pub(crate) struct GeneratedFileConflictsWithDirectory<'a> { pub input_path: &'a Path, pub dir_path: &'a Path, } #[derive(Diagnostic)] #[diag("failed to find or create the directory specified by `--temps-dir`")] -pub struct TempsDirError; +pub(crate) struct TempsDirError; #[derive(Diagnostic)] #[diag("failed to find or create the directory specified by `--out-dir`")] -pub struct OutDirError; +pub(crate) struct OutDirError; #[derive(Diagnostic)] #[diag("failed to write file {$path}: {$error}\"")] -pub struct FailedWritingFile<'a> { +pub(crate) struct FailedWritingFile<'a> { pub path: &'a Path, pub error: io::Error, } @@ -94,25 +94,25 @@ pub struct FailedWritingFile<'a> { #[diag( "building proc macro crate with `panic=abort` or `panic=immediate-abort` may crash the compiler should the proc-macro panic" )] -pub struct ProcMacroCratePanicAbort; +pub(crate) struct ProcMacroCratePanicAbort; #[derive(Diagnostic)] #[diag( "due to multiple output types requested, the explicitly specified output file name will be adapted for each output type" )] -pub struct MultipleOutputTypesAdaption; +pub(crate) struct MultipleOutputTypesAdaption; #[derive(Diagnostic)] #[diag("ignoring -C extra-filename flag due to -o flag")] -pub struct IgnoringExtraFilename; +pub(crate) struct IgnoringExtraFilename; #[derive(Diagnostic)] #[diag("ignoring --out-dir flag due to -o flag")] -pub struct IgnoringOutDir; +pub(crate) struct IgnoringOutDir; #[derive(Diagnostic)] #[diag("can't use option `-o` or `--emit` to write multiple output types to stdout")] -pub struct MultipleOutputTypesToStdout; +pub(crate) struct MultipleOutputTypesToStdout; #[derive(Diagnostic)] #[diag( diff --git a/compiler/rustc_metadata/src/errors.rs b/compiler/rustc_metadata/src/errors.rs index 259b4f82593e5..5c33fab5011d1 100644 --- a/compiler/rustc_metadata/src/errors.rs +++ b/compiler/rustc_metadata/src/errors.rs @@ -13,7 +13,7 @@ use crate::locator::CrateFlavor; #[diag( "crate `{$crate_name}` required to be available in rlib format, but was not found in this form" )] -pub struct RlibRequired { +pub(crate) struct RlibRequired { pub crate_name: Symbol, } @@ -21,7 +21,7 @@ pub struct RlibRequired { #[diag( "crate `{$crate_name}` required to be available in {$kind} format, but was not found in this form" )] -pub struct LibRequired<'a> { +pub(crate) struct LibRequired<'a> { pub crate_name: Symbol, pub kind: &'a str, } @@ -31,7 +31,7 @@ pub struct LibRequired<'a> { "crate `{$crate_name}` required to be available in {$kind} format, but was not found in this form" )] #[help("try adding `extern crate rustc_driver;` at the top level of this crate")] -pub struct RustcLibRequired<'a> { +pub(crate) struct RustcLibRequired<'a> { pub crate_name: Symbol, pub kind: &'a str, } @@ -39,7 +39,7 @@ pub struct RustcLibRequired<'a> { #[derive(Diagnostic)] #[diag("cannot satisfy dependencies so `{$crate_name}` only shows up once")] #[help("having upstream crates all available in one format will likely make this go away")] -pub struct CrateDepMultiple { +pub(crate) struct CrateDepMultiple { pub crate_name: Symbol, #[subdiagnostic] pub non_static_deps: Vec, @@ -49,14 +49,14 @@ pub struct CrateDepMultiple { #[derive(Subdiagnostic)] #[note("`{$sub_crate_name}` was unavailable as a static crate, preventing fully static linking")] -pub struct NonStaticCrateDep { +pub(crate) struct NonStaticCrateDep { /// It's different from `crate_name` in main Diagnostic. pub sub_crate_name: Symbol, } #[derive(Diagnostic)] #[diag("cannot link together two panic runtimes: {$prev_name} and {$cur_name}")] -pub struct TwoPanicRuntimes { +pub(crate) struct TwoPanicRuntimes { pub prev_name: Symbol, pub cur_name: Symbol, } @@ -65,7 +65,7 @@ pub struct TwoPanicRuntimes { #[diag( "the linked panic runtime `{$runtime}` is not compiled with this crate's panic strategy `{$strategy}`" )] -pub struct BadPanicStrategy { +pub(crate) struct BadPanicStrategy { pub runtime: Symbol, pub strategy: PanicStrategy, } @@ -74,7 +74,7 @@ pub struct BadPanicStrategy { #[diag( "the crate `{$crate_name}` requires panic strategy `{$found_strategy}` which is incompatible with this crate's strategy of `{$desired_strategy}`" )] -pub struct RequiredPanicStrategy { +pub(crate) struct RequiredPanicStrategy { pub crate_name: Symbol, pub found_strategy: PanicStrategy, pub desired_strategy: PanicStrategy, @@ -84,7 +84,7 @@ pub struct RequiredPanicStrategy { #[diag( "the crate `{$crate_name}` was compiled with a panic strategy which is incompatible with `immediate-abort`" )] -pub struct IncompatibleWithImmediateAbort { +pub(crate) struct IncompatibleWithImmediateAbort { pub crate_name: Symbol, } @@ -92,13 +92,13 @@ pub struct IncompatibleWithImmediateAbort { #[diag( "the crate `core` was compiled with a panic strategy which is incompatible with `immediate-abort`" )] -pub struct IncompatibleWithImmediateAbortCore; +pub(crate) struct IncompatibleWithImmediateAbortCore; #[derive(Diagnostic)] #[diag( "the crate `{$crate_name}` is compiled with the panic-in-drop strategy `{$found_strategy}` which is incompatible with this crate's strategy of `{$desired_strategy}`" )] -pub struct IncompatiblePanicInDropStrategy { +pub(crate) struct IncompatiblePanicInDropStrategy { pub crate_name: Symbol, pub found_strategy: PanicStrategy, pub desired_strategy: PanicStrategy, @@ -106,18 +106,18 @@ pub struct IncompatiblePanicInDropStrategy { #[derive(Diagnostic)] #[diag("`#[link_ordinal]` is only supported if link kind is `raw-dylib`")] -pub struct LinkOrdinalRawDylib { +pub(crate) struct LinkOrdinalRawDylib { #[primary_span] pub span: Span, } #[derive(Diagnostic)] #[diag("library kind `framework` is only supported on Apple targets")] -pub struct LibFrameworkApple; +pub(crate) struct LibFrameworkApple; #[derive(Diagnostic)] #[diag("an empty renaming target was specified for library `{$lib_name}`")] -pub struct EmptyRenamingTarget<'a> { +pub(crate) struct EmptyRenamingTarget<'a> { pub lib_name: &'a str, } @@ -125,46 +125,46 @@ pub struct EmptyRenamingTarget<'a> { #[diag( "renaming of the library `{$lib_name}` was specified, however this crate contains no `#[link(...)]` attributes referencing this library" )] -pub struct RenamingNoLink<'a> { +pub(crate) struct RenamingNoLink<'a> { pub lib_name: &'a str, } #[derive(Diagnostic)] #[diag("multiple renamings were specified for library `{$lib_name}`")] -pub struct MultipleRenamings<'a> { +pub(crate) struct MultipleRenamings<'a> { pub lib_name: &'a str, } #[derive(Diagnostic)] #[diag("overriding linking modifiers from command line is not supported")] -pub struct NoLinkModOverride { +pub(crate) struct NoLinkModOverride { #[primary_span] pub span: Option, } #[derive(Diagnostic)] #[diag("ABI not supported by `#[link(kind = \"raw-dylib\")]` on this architecture")] -pub struct RawDylibUnsupportedAbi { +pub(crate) struct RawDylibUnsupportedAbi { #[primary_span] pub span: Span, } #[derive(Diagnostic)] #[diag("failed to create file encoder: {$err}")] -pub struct FailCreateFileEncoder { +pub(crate) struct FailCreateFileEncoder { pub err: Error, } #[derive(Diagnostic)] #[diag("failed to write to `{$path}`: {$err}")] -pub struct FailWriteFile<'a> { +pub(crate) struct FailWriteFile<'a> { pub path: &'a Path, pub err: Error, } #[derive(Diagnostic)] #[diag("the crate `{$crate_name}` is not a panic runtime")] -pub struct CrateNotPanicRuntime { +pub(crate) struct CrateNotPanicRuntime { pub crate_name: Symbol, } @@ -172,26 +172,26 @@ pub struct CrateNotPanicRuntime { #[diag( "the crate `{$crate_name}` resolved as `compiler_builtins` but is not `#![compiler_builtins]`" )] -pub struct CrateNotCompilerBuiltins { +pub(crate) struct CrateNotCompilerBuiltins { pub crate_name: Symbol, } #[derive(Diagnostic)] #[diag("the crate `{$crate_name}` does not have the panic strategy `{$strategy}`")] -pub struct NoPanicStrategy { +pub(crate) struct NoPanicStrategy { pub crate_name: Symbol, pub strategy: PanicStrategy, } #[derive(Diagnostic)] #[diag("the crate `{$crate_name}` is not a profiler runtime")] -pub struct NotProfilerRuntime { +pub(crate) struct NotProfilerRuntime { pub crate_name: Symbol, } #[derive(Diagnostic)] #[diag("cannot define multiple global allocators")] -pub struct NoMultipleGlobalAlloc { +pub(crate) struct NoMultipleGlobalAlloc { #[primary_span] #[label("cannot define a new global allocator")] pub span2: Span, @@ -201,7 +201,7 @@ pub struct NoMultipleGlobalAlloc { #[derive(Diagnostic)] #[diag("cannot define multiple allocation error handlers")] -pub struct NoMultipleAllocErrorHandler { +pub(crate) struct NoMultipleAllocErrorHandler { #[primary_span] #[label("cannot define a new allocation error handler")] pub span2: Span, @@ -213,7 +213,7 @@ pub struct NoMultipleAllocErrorHandler { #[diag( "the `#[global_allocator]` in {$other_crate_name} conflicts with global allocator in: {$crate_name}" )] -pub struct ConflictingGlobalAlloc { +pub(crate) struct ConflictingGlobalAlloc { pub crate_name: Symbol, pub other_crate_name: Symbol, } @@ -222,7 +222,7 @@ pub struct ConflictingGlobalAlloc { #[diag( "the `#[alloc_error_handler]` in {$other_crate_name} conflicts with allocation error handler in: {$crate_name}" )] -pub struct ConflictingAllocErrorHandler { +pub(crate) struct ConflictingAllocErrorHandler { pub crate_name: Symbol, pub other_crate_name: Symbol, } @@ -231,18 +231,18 @@ pub struct ConflictingAllocErrorHandler { #[diag( "no global memory allocator found but one is required; link to std or add `#[global_allocator]` to a static item that implements the GlobalAlloc trait" )] -pub struct GlobalAllocRequired; +pub(crate) struct GlobalAllocRequired; #[derive(Diagnostic)] #[diag("failed to write {$filename}: {$err}")] -pub struct FailedWriteError { +pub(crate) struct FailedWriteError { pub filename: PathBuf, pub err: Error, } #[derive(Diagnostic)] #[diag("failed to copy {$filename} to stdout: {$err}")] -pub struct FailedCopyToStdout { +pub(crate) struct FailedCopyToStdout { pub filename: PathBuf, pub err: Error, } @@ -251,18 +251,18 @@ pub struct FailedCopyToStdout { #[diag( "option `-o` or `--emit` is used to write binary output type `metadata` to stdout, but stdout is a tty" )] -pub struct BinaryOutputToTty; +pub(crate) struct BinaryOutputToTty; #[derive(Diagnostic)] #[diag("could not find native static library `{$libname}`, perhaps an -L flag is missing?")] -pub struct MissingNativeLibrary<'a> { +pub(crate) struct MissingNativeLibrary<'a> { libname: &'a str, #[subdiagnostic] suggest_name: Option>, } impl<'a> MissingNativeLibrary<'a> { - pub fn new(libname: &'a str, verbatim: bool) -> Self { + pub(crate) fn new(libname: &'a str, verbatim: bool) -> Self { // if it looks like the user has provided a complete filename rather just the bare lib name, // then provide a note that they might want to try trimming the name let suggested_name = if !verbatim { @@ -289,32 +289,32 @@ impl<'a> MissingNativeLibrary<'a> { #[derive(Subdiagnostic)] #[help("only provide the library name `{$suggested_name}`, not the full filename")] -pub struct SuggestLibraryName<'a> { +pub(crate) struct SuggestLibraryName<'a> { suggested_name: &'a str, } #[derive(Diagnostic)] #[diag("couldn't create a temp dir: {$err}")] -pub struct FailedCreateTempdir { +pub(crate) struct FailedCreateTempdir { pub err: Error, } #[derive(Diagnostic)] #[diag("failed to create the file {$filename}: {$err}")] -pub struct FailedCreateFile<'a> { +pub(crate) struct FailedCreateFile<'a> { pub filename: &'a Path, pub err: Error, } #[derive(Diagnostic)] #[diag("failed to create encoded metadata from file: {$err}")] -pub struct FailedCreateEncodedMetadata { +pub(crate) struct FailedCreateEncodedMetadata { pub err: Error, } #[derive(Diagnostic)] #[diag("cannot load a crate with a non-ascii name `{$crate_name}`")] -pub struct NonAsciiName { +pub(crate) struct NonAsciiName { #[primary_span] pub span: Span, pub crate_name: Symbol, @@ -322,7 +322,7 @@ pub struct NonAsciiName { #[derive(Diagnostic)] #[diag("extern location for {$crate_name} does not exist: {$location}")] -pub struct ExternLocationNotExist<'a> { +pub(crate) struct ExternLocationNotExist<'a> { #[primary_span] pub span: Span, pub crate_name: Symbol, @@ -331,7 +331,7 @@ pub struct ExternLocationNotExist<'a> { #[derive(Diagnostic)] #[diag("extern location for {$crate_name} is not a file: {$location}")] -pub struct ExternLocationNotFile<'a> { +pub(crate) struct ExternLocationNotFile<'a> { #[primary_span] pub span: Span, pub crate_name: Symbol, @@ -376,7 +376,7 @@ pub(crate) struct FullMetadataNotFound { #[derive(Diagnostic)] #[diag("the current crate is indistinguishable from one of its dependencies: it has the same crate-name `{$crate_name}` and was compiled with the same `-C metadata` arguments, so this will result in symbol conflicts between the two", code = E0519)] -pub struct SymbolConflictsCurrent { +pub(crate) struct SymbolConflictsCurrent { #[primary_span] pub span: Span, pub crate_name: Symbol, @@ -384,7 +384,7 @@ pub struct SymbolConflictsCurrent { #[derive(Diagnostic)] #[diag("found crates (`{$crate_name0}` and `{$crate_name1}`) with colliding StableCrateId values")] -pub struct StableCrateIdCollision { +pub(crate) struct StableCrateIdCollision { #[primary_span] pub span: Span, pub crate_name0: Symbol, @@ -393,7 +393,7 @@ pub struct StableCrateIdCollision { #[derive(Diagnostic)] #[diag("{$path}{$err}")] -pub struct DlError { +pub(crate) struct DlError { #[primary_span] pub span: Span, pub path: String, @@ -404,7 +404,7 @@ pub struct DlError { #[diag("found possibly newer version of crate `{$crate_name}`{$add_info}", code = E0460)] #[note("perhaps that crate needs to be recompiled?")] #[note("the following crate versions were found:{$found_crates}")] -pub struct NewerCrateVersion { +pub(crate) struct NewerCrateVersion { #[primary_span] pub span: Span, pub crate_name: Symbol, @@ -415,7 +415,7 @@ pub struct NewerCrateVersion { #[derive(Diagnostic)] #[diag("couldn't find crate `{$crate_name}` with expected target triple {$locator_triple}{$add_info}", code = E0461)] #[note("the following crate versions were found:{$found_crates}")] -pub struct NoCrateWithTriple<'a> { +pub(crate) struct NoCrateWithTriple<'a> { #[primary_span] pub span: Span, pub crate_name: Symbol, @@ -428,7 +428,7 @@ pub struct NoCrateWithTriple<'a> { #[diag("found staticlib `{$crate_name}` instead of rlib or dylib{$add_info}", code = E0462)] #[note("the following crate versions were found:{$found_crates}")] #[help("please recompile that crate using --crate-type lib")] -pub struct FoundStaticlib { +pub(crate) struct FoundStaticlib { #[primary_span] pub span: Span, pub crate_name: Symbol, @@ -442,7 +442,7 @@ pub struct FoundStaticlib { #[help( "please recompile that crate using this compiler ({$rustc_version}) (consider running `cargo clean` first)" )] -pub struct IncompatibleRustc { +pub(crate) struct IncompatibleRustc { #[primary_span] pub span: Span, pub crate_name: Symbol, @@ -451,7 +451,7 @@ pub struct IncompatibleRustc { pub rustc_version: String, } -pub struct InvalidMetadataFiles { +pub(crate) struct InvalidMetadataFiles { pub span: Span, pub crate_name: Symbol, pub add_info: String, @@ -477,7 +477,7 @@ impl Diagnostic<'_, G> for InvalidMetadataFiles { } } -pub struct CannotFindCrate { +pub(crate) struct CannotFindCrate { pub span: Span, pub crate_name: Symbol, pub add_info: String, @@ -550,7 +550,7 @@ impl Diagnostic<'_, G> for CannotFindCrate { #[derive(Diagnostic)] #[diag("extern location for {$crate_name} is of an unknown type: {$path}")] -pub struct CrateLocationUnknownType<'a> { +pub(crate) struct CrateLocationUnknownType<'a> { #[primary_span] pub span: Span, pub path: &'a Path, @@ -559,7 +559,7 @@ pub struct CrateLocationUnknownType<'a> { #[derive(Diagnostic)] #[diag("file name should be lib*.rlib or {$dll_prefix}*{$dll_suffix}")] -pub struct LibFilenameForm<'a> { +pub(crate) struct LibFilenameForm<'a> { #[primary_span] pub span: Span, pub dll_prefix: &'a str, @@ -589,7 +589,7 @@ pub(crate) struct WasmCAbi { #[help( "if you are sure this will not cause problems, you may use `-Cunsafe-allow-abi-mismatch={$flag_name}` to silence this error" )] -pub struct IncompatibleTargetModifiers { +pub(crate) struct IncompatibleTargetModifiers { #[primary_span] pub span: Span, pub extern_crate: Symbol, @@ -614,7 +614,7 @@ pub struct IncompatibleTargetModifiers { #[help( "if you are sure this will not cause problems, you may use `-Cunsafe-allow-abi-mismatch={$flag_name}` to silence this error" )] -pub struct IncompatibleTargetModifiersLMissed { +pub(crate) struct IncompatibleTargetModifiersLMissed { #[primary_span] pub span: Span, pub extern_crate: Symbol, @@ -638,7 +638,7 @@ pub struct IncompatibleTargetModifiersLMissed { #[help( "if you are sure this will not cause problems, you may use `-Cunsafe-allow-abi-mismatch={$flag_name}` to silence this error" )] -pub struct IncompatibleTargetModifiersRMissed { +pub(crate) struct IncompatibleTargetModifiersRMissed { #[primary_span] pub span: Span, pub extern_crate: Symbol, @@ -652,7 +652,7 @@ pub struct IncompatibleTargetModifiersRMissed { #[diag( "unknown target modifier `{$flag_name}`, requested by `-Cunsafe-allow-abi-mismatch={$flag_name}`" )] -pub struct UnknownTargetModifierUnsafeAllowed { +pub(crate) struct UnknownTargetModifierUnsafeAllowed { #[primary_span] pub span: Span, pub flag_name: String, @@ -665,7 +665,7 @@ pub struct UnknownTargetModifierUnsafeAllowed { #[help( "if async drop type will be dropped in a crate without `feature(async_drop)`, sync Drop will be used" )] -pub struct AsyncDropTypesInDependency { +pub(crate) struct AsyncDropTypesInDependency { #[primary_span] pub span: Span, pub extern_crate: Symbol, @@ -674,7 +674,7 @@ pub struct AsyncDropTypesInDependency { #[derive(Diagnostic)] #[diag("link name must be well-formed if link kind is `raw-dylib`")] -pub struct RawDylibMalformed { +pub(crate) struct RawDylibMalformed { #[primary_span] pub span: Span, } @@ -697,7 +697,7 @@ pub(crate) struct UnusedCrateDependency { #[help( "it is possible to disable `-Z allow-partial-mitigations={$mitigation_name}` via `-Z deny-partial-mitigations={$mitigation_name}`" )] -pub struct MitigationLessStrictInDependency { +pub(crate) struct MitigationLessStrictInDependency { #[primary_span] pub span: Span, pub mitigation_name: String, diff --git a/compiler/rustc_middle/src/error.rs b/compiler/rustc_middle/src/error.rs index 0f66faa83d0b3..90af4d785945b 100644 --- a/compiler/rustc_middle/src/error.rs +++ b/compiler/rustc_middle/src/error.rs @@ -37,7 +37,7 @@ pub(crate) struct OpaqueHiddenTypeMismatch<'tcx> { } #[derive(Subdiagnostic)] -pub enum TypeMismatchReason { +pub(crate) enum TypeMismatchReason { #[label("this expression supplies two conflicting concrete types for the same opaque type")] ConflictType { #[primary_span] diff --git a/compiler/rustc_pattern_analysis/src/errors.rs b/compiler/rustc_pattern_analysis/src/errors.rs index 109acf0ec4107..bf9bcbb7f71aa 100644 --- a/compiler/rustc_pattern_analysis/src/errors.rs +++ b/compiler/rustc_pattern_analysis/src/errors.rs @@ -48,7 +48,7 @@ impl Uncovered { #[derive(Diagnostic)] #[diag("multiple patterns overlap on their endpoints")] #[note("you likely meant to write mutually exclusive ranges")] -pub struct OverlappingRangeEndpoints { +pub(crate) struct OverlappingRangeEndpoints { #[label("... with this range")] pub range: Span, #[subdiagnostic] @@ -57,7 +57,7 @@ pub struct OverlappingRangeEndpoints { #[derive(Subdiagnostic)] #[label("this range overlaps on `{$range}`...")] -pub struct Overlap { +pub(crate) struct Overlap { #[primary_span] pub span: Span, pub range: String, // a printed pattern @@ -65,7 +65,7 @@ pub struct Overlap { #[derive(Diagnostic)] #[diag("exclusive range missing `{$max}`")] -pub struct ExclusiveRangeMissingMax { +pub(crate) struct ExclusiveRangeMissingMax { #[label("this range doesn't match `{$max}` because `..` is an exclusive range")] #[suggestion( "use an inclusive range instead", @@ -81,7 +81,7 @@ pub struct ExclusiveRangeMissingMax { #[derive(Diagnostic)] #[diag("multiple ranges are one apart")] -pub struct ExclusiveRangeMissingGap { +pub(crate) struct ExclusiveRangeMissingGap { #[label("this range doesn't match `{$gap}` because `..` is an exclusive range")] #[suggestion( "use an inclusive range instead", @@ -102,7 +102,7 @@ pub struct ExclusiveRangeMissingGap { #[label( "this could appear to continue range `{$first_range}`, but `{$gap}` isn't matched by either of them" )] -pub struct GappedRange { +pub(crate) struct GappedRange { #[primary_span] pub span: Span, pub gap: String, // a printed pattern diff --git a/compiler/rustc_session/src/errors.rs b/compiler/rustc_session/src/errors.rs index 295d9c3617778..101cb1837759e 100644 --- a/compiler/rustc_session/src/errors.rs +++ b/compiler/rustc_session/src/errors.rs @@ -71,7 +71,7 @@ pub(crate) struct FeatureDiagnosticHelp { applicability = "maybe-incorrect", code = "#![feature({feature})]\n" )] -pub struct FeatureDiagnosticSuggestion { +pub(crate) struct FeatureDiagnosticSuggestion { pub feature: Symbol, #[primary_span] pub span: Span, diff --git a/compiler/rustc_trait_selection/src/error_reporting/infer/mod.rs b/compiler/rustc_trait_selection/src/error_reporting/infer/mod.rs index 19a6c5dfe5ee6..4ac00cef6b9ce 100644 --- a/compiler/rustc_trait_selection/src/error_reporting/infer/mod.rs +++ b/compiler/rustc_trait_selection/src/error_reporting/infer/mod.rs @@ -1826,7 +1826,7 @@ impl<'a, 'tcx> TypeErrCtxt<'a, 'tcx> { debug!(?diag); } - pub fn type_error_additional_suggestions( + pub(crate) fn type_error_additional_suggestions( &self, trace: &TypeTrace<'tcx>, terr: TypeError<'tcx>, @@ -2274,6 +2274,7 @@ impl<'tcx> ObligationCause<'tcx> { }, } } + fn as_failure_code_diag( &self, terr: TypeError<'tcx>, diff --git a/compiler/rustc_trait_selection/src/error_reporting/infer/nice_region_error/placeholder_error.rs b/compiler/rustc_trait_selection/src/error_reporting/infer/nice_region_error/placeholder_error.rs index 373b756dcdb71..50dbae0a05d6f 100644 --- a/compiler/rustc_trait_selection/src/error_reporting/infer/nice_region_error/placeholder_error.rs +++ b/compiler/rustc_trait_selection/src/error_reporting/infer/nice_region_error/placeholder_error.rs @@ -18,9 +18,8 @@ use crate::errors::{ use crate::infer::{RegionResolutionError, SubregionOrigin, TypeTrace, ValuePairs}; use crate::traits::{ObligationCause, ObligationCauseCode}; -// HACK(eddyb) maybe move this in a more central location. #[derive(Copy, Clone)] -pub struct Highlighted<'tcx, T> { +pub(crate) struct Highlighted<'tcx, T> { pub tcx: TyCtxt<'tcx>, pub highlight: RegionHighlightMode<'tcx>, pub value: T, diff --git a/compiler/rustc_trait_selection/src/errors.rs b/compiler/rustc_trait_selection/src/errors.rs index 1edb3f172149f..1656493fc3093 100644 --- a/compiler/rustc_trait_selection/src/errors.rs +++ b/compiler/rustc_trait_selection/src/errors.rs @@ -18,17 +18,17 @@ use crate::error_reporting::infer::ObligationCauseAsDiagArg; use crate::error_reporting::infer::need_type_info::UnderspecifiedArgKind; use crate::error_reporting::infer::nice_region_error::placeholder_error::Highlighted; -pub mod note_and_explain; +pub(crate) mod note_and_explain; #[derive(Diagnostic)] #[diag("unable to construct a constant value for the unevaluated constant {$unevaluated}")] -pub struct UnableToConstructConstantValue<'a> { +pub(crate) struct UnableToConstructConstantValue<'a> { #[primary_span] pub span: Span, pub unevaluated: ty::UnevaluatedConst<'a>, } -pub struct NegativePositiveConflict<'tcx> { +pub(crate) struct NegativePositiveConflict<'tcx> { pub impl_span: Span, pub trait_desc: ty::TraitRef<'tcx>, pub self_ty: Option>, @@ -77,13 +77,13 @@ impl Diagnostic<'_, G> for NegativePositiveConflict<'_> { #[derive(Diagnostic)] #[diag("overflow evaluating associated type `{$ty}`")] -pub struct InherentProjectionNormalizationOverflow { +pub(crate) struct InherentProjectionNormalizationOverflow { #[primary_span] pub span: Span, pub ty: String, } -pub enum AdjustSignatureBorrow { +pub(crate) enum AdjustSignatureBorrow { Borrow { to_borrow: Vec<(Span, String)> }, RemoveBorrow { remove_borrow: Vec<(Span, String)> }, } @@ -123,7 +123,7 @@ impl Subdiagnostic for AdjustSignatureBorrow { #[derive(Diagnostic)] #[diag("expected a closure that implements the `{$trait_prefix}{$expected}` trait, but this closure only implements `{$trait_prefix}{$found}`", code = E0525)] -pub struct ClosureKindMismatch { +pub(crate) struct ClosureKindMismatch { #[primary_span] #[label("this closure implements `{$trait_prefix}{$found}`, not `{$trait_prefix}{$expected}`")] pub closure_span: Span, @@ -145,7 +145,7 @@ pub struct ClosureKindMismatch { #[label( "closure is `{$trait_prefix}FnOnce` because it moves the variable `{$place}` out of its environment" )] -pub struct ClosureFnOnceLabel { +pub(crate) struct ClosureFnOnceLabel { #[primary_span] pub span: Span, pub place: String, @@ -154,7 +154,7 @@ pub struct ClosureFnOnceLabel { #[derive(Subdiagnostic)] #[label("closure is `{$trait_prefix}FnMut` because it mutates the variable `{$place}` here")] -pub struct ClosureFnMutLabel { +pub(crate) struct ClosureFnMutLabel { #[primary_span] pub span: Span, pub place: String, @@ -178,7 +178,7 @@ pub(crate) struct CoroClosureNotFn { [normal] type annotations needed for `{$source_name}` *[other] type annotations needed }", code = E0282)] -pub struct AnnotationRequired<'a> { +pub(crate) struct AnnotationRequired<'a> { #[primary_span] pub span: Span, pub source_kind: &'static str, @@ -200,7 +200,7 @@ pub struct AnnotationRequired<'a> { [normal] type annotations needed for `{$source_name}` *[other] type annotations needed }", code = E0283)] -pub struct AmbiguousImpl<'a> { +pub(crate) struct AmbiguousImpl<'a> { #[primary_span] pub span: Span, pub source_kind: &'static str, @@ -222,7 +222,7 @@ pub struct AmbiguousImpl<'a> { [normal] type annotations needed for `{$source_name}` *[other] type annotations needed }", code = E0284)] -pub struct AmbiguousReturn<'a> { +pub(crate) struct AmbiguousReturn<'a> { #[primary_span] pub span: Span, pub source_kind: &'static str, @@ -252,7 +252,7 @@ pub struct AmbiguousReturn<'a> { } }" )] -pub struct InferenceBadError<'a> { +pub(crate) struct InferenceBadError<'a> { #[primary_span] pub span: Span, pub bad_kind: &'static str, @@ -265,7 +265,7 @@ pub struct InferenceBadError<'a> { } #[derive(Subdiagnostic)] -pub enum SourceKindSubdiag<'a> { +pub(crate) enum SourceKindSubdiag<'a> { #[suggestion( "{$kind -> [with_pattern] consider giving `{$name}` an explicit type @@ -334,7 +334,7 @@ pub enum SourceKindSubdiag<'a> { } #[derive(Subdiagnostic)] -pub enum SourceKindMultiSuggestion<'a> { +pub(crate) enum SourceKindMultiSuggestion<'a> { #[multipart_suggestion( "try using a fully qualified path to specify the expected types", style = "verbose", @@ -364,7 +364,7 @@ pub enum SourceKindMultiSuggestion<'a> { } impl<'a> SourceKindMultiSuggestion<'a> { - pub fn new_fully_qualified( + pub(crate) fn new_fully_qualified( span: Span, def_path: String, adjustment: &'a str, @@ -379,7 +379,7 @@ impl<'a> SourceKindMultiSuggestion<'a> { } } - pub fn new_closure_return( + pub(crate) fn new_closure_return( ty_info: String, data: &'a FnRetTy<'a>, should_wrap_expr: Option, @@ -396,7 +396,7 @@ impl<'a> SourceKindMultiSuggestion<'a> { } } -pub enum RegionOriginNote<'a> { +pub(crate) enum RegionOriginNote<'a> { Plain { span: Span, msg: DiagMessage, @@ -492,7 +492,7 @@ impl Subdiagnostic for RegionOriginNote<'_> { } } -pub enum LifetimeMismatchLabels { +pub(crate) enum LifetimeMismatchLabels { InRet { param_span: Span, ret_span: Span, @@ -573,7 +573,7 @@ impl Subdiagnostic for LifetimeMismatchLabels { } } -pub struct AddLifetimeParamsSuggestion<'a> { +pub(crate) struct AddLifetimeParamsSuggestion<'a> { pub tcx: TyCtxt<'a>, pub generic_param_scope: LocalDefId, pub sub: Region<'a>, @@ -753,7 +753,7 @@ impl Subdiagnostic for AddLifetimeParamsSuggestion<'_> { #[derive(Diagnostic)] #[diag("lifetime mismatch", code = E0623)] -pub struct LifetimeMismatch<'a> { +pub(crate) struct LifetimeMismatch<'a> { #[primary_span] pub span: Span, #[subdiagnostic] @@ -762,7 +762,7 @@ pub struct LifetimeMismatch<'a> { pub suggestion: AddLifetimeParamsSuggestion<'a>, } -pub struct IntroducesStaticBecauseUnmetLifetimeReq { +pub(crate) struct IntroducesStaticBecauseUnmetLifetimeReq { pub unmet_requirements: MultiSpan, pub binding_span: Span, } @@ -782,7 +782,7 @@ impl Subdiagnostic for IntroducesStaticBecauseUnmetLifetimeReq { // FIXME(#100717): replace with a `Option` when subdiagnostic supports that #[derive(Subdiagnostic)] -pub enum DoesNotOutliveStaticFromImpl { +pub(crate) enum DoesNotOutliveStaticFromImpl { #[note( "...does not necessarily outlive the static lifetime introduced by the compatible `impl`" )] @@ -797,7 +797,7 @@ pub enum DoesNotOutliveStaticFromImpl { } #[derive(Subdiagnostic)] -pub enum ImplicitStaticLifetimeSubdiag { +pub(crate) enum ImplicitStaticLifetimeSubdiag { #[note("this has an implicit `'static` lifetime requirement")] Note { #[primary_span] @@ -817,7 +817,7 @@ pub enum ImplicitStaticLifetimeSubdiag { #[derive(Diagnostic)] #[diag("incompatible lifetime on type")] -pub struct MismatchedStaticLifetime<'a> { +pub(crate) struct MismatchedStaticLifetime<'a> { #[primary_span] pub cause_span: Span, #[subdiagnostic] @@ -831,7 +831,7 @@ pub struct MismatchedStaticLifetime<'a> { } #[derive(Diagnostic)] -pub enum ExplicitLifetimeRequired<'a> { +pub(crate) enum ExplicitLifetimeRequired<'a> { #[diag("explicit lifetime required in the type of `{$simple_ident}`", code = E0621)] WithIdent { #[primary_span] @@ -867,7 +867,7 @@ pub enum ExplicitLifetimeRequired<'a> { }, } -pub enum TyOrSig<'tcx> { +pub(crate) enum TyOrSig<'tcx> { Ty(Highlighted<'tcx, Ty<'tcx>>), ClosureSig(Highlighted<'tcx, Binder<'tcx, FnSig<'tcx>>>), } @@ -882,7 +882,7 @@ impl IntoDiagArg for TyOrSig<'_> { } #[derive(Subdiagnostic)] -pub enum ActualImplExplNotes<'tcx> { +pub(crate) enum ActualImplExplNotes<'tcx> { #[note("{$leading_ellipsis -> [true] ... *[false] {\"\"} @@ -1050,13 +1050,13 @@ pub enum ActualImplExplNotes<'tcx> { }, } -pub enum ActualImplExpectedKind { +pub(crate) enum ActualImplExpectedKind { Signature, Passive, Other, } -pub enum ActualImplExpectedLifetimeKind { +pub(crate) enum ActualImplExpectedLifetimeKind { Two, Any, Some, @@ -1064,7 +1064,7 @@ pub enum ActualImplExpectedLifetimeKind { } impl<'tcx> ActualImplExplNotes<'tcx> { - pub fn new_expected( + pub(crate) fn new_expected( kind: ActualImplExpectedKind, lt_kind: ActualImplExpectedLifetimeKind, leading_ellipsis: bool, @@ -1134,7 +1134,7 @@ impl<'tcx> ActualImplExplNotes<'tcx> { #[derive(Diagnostic)] #[diag("implementation of `{$trait_def_id}` is not general enough")] -pub struct TraitPlaceholderMismatch<'tcx> { +pub(crate) struct TraitPlaceholderMismatch<'tcx> { #[primary_span] pub span: Span, #[label("doesn't satisfy where-clause")] @@ -1150,7 +1150,7 @@ pub struct TraitPlaceholderMismatch<'tcx> { pub actual_impl_expl_notes: Vec>, } -pub struct ConsiderBorrowingParamHelp { +pub(crate) struct ConsiderBorrowingParamHelp { pub spans: Vec, } @@ -1171,7 +1171,7 @@ impl Subdiagnostic for ConsiderBorrowingParamHelp { #[derive(Diagnostic)] #[diag("`impl` item signature doesn't match `trait` item signature")] -pub struct TraitImplDiff { +pub(crate) struct TraitImplDiff { #[primary_span] #[label("found `{$found}`")] pub sp: Span, @@ -1200,7 +1200,7 @@ pub struct TraitImplDiff { [true] lifetime `{$lifetime}` *[false] an anonymous lifetime `'_` } but it needs to satisfy a `'static` lifetime requirement", code = E0759)] -pub struct ButNeedsToSatisfy { +pub(crate) struct ButNeedsToSatisfy { #[primary_span] pub sp: Span, #[label( @@ -1238,7 +1238,7 @@ pub struct ButNeedsToSatisfy { #[derive(Diagnostic)] #[diag("lifetime of reference outlives lifetime of borrowed content...", code = E0312)] -pub struct OutlivesContent<'a> { +pub(crate) struct OutlivesContent<'a> { #[primary_span] pub span: Span, #[subdiagnostic] @@ -1247,7 +1247,7 @@ pub struct OutlivesContent<'a> { #[derive(Diagnostic)] #[diag("lifetime of the source pointer does not outlive lifetime bound of the object type", code = E0476)] -pub struct OutlivesBound<'a> { +pub(crate) struct OutlivesBound<'a> { #[primary_span] pub span: Span, #[subdiagnostic] @@ -1256,7 +1256,7 @@ pub struct OutlivesBound<'a> { #[derive(Diagnostic)] #[diag("the type `{$ty}` does not fulfill the required lifetime", code = E0477)] -pub struct FulfillReqLifetime<'a> { +pub(crate) struct FulfillReqLifetime<'a> { #[primary_span] pub span: Span, pub ty: Ty<'a>, @@ -1266,7 +1266,7 @@ pub struct FulfillReqLifetime<'a> { #[derive(Diagnostic)] #[diag("lifetime bound not satisfied", code = E0478)] -pub struct LfBoundNotSatisfied<'a> { +pub(crate) struct LfBoundNotSatisfied<'a> { #[primary_span] pub span: Span, #[subdiagnostic] @@ -1275,7 +1275,7 @@ pub struct LfBoundNotSatisfied<'a> { #[derive(Diagnostic)] #[diag("in type `{$ty}`, reference has a longer lifetime than the data it references", code = E0491)] -pub struct RefLongerThanData<'a> { +pub(crate) struct RefLongerThanData<'a> { #[primary_span] pub span: Span, pub ty: Ty<'a>, @@ -1284,7 +1284,7 @@ pub struct RefLongerThanData<'a> { } #[derive(Subdiagnostic)] -pub enum WhereClauseSuggestions { +pub(crate) enum WhereClauseSuggestions { #[suggestion( "remove the `where` clause", code = "", @@ -1310,7 +1310,7 @@ pub enum WhereClauseSuggestions { } #[derive(Subdiagnostic)] -pub enum SuggestRemoveSemiOrReturnBinding { +pub(crate) enum SuggestRemoveSemiOrReturnBinding { #[multipart_suggestion( "consider removing this semicolon and boxing the expressions", applicability = "machine-applicable" @@ -1357,7 +1357,7 @@ pub enum SuggestRemoveSemiOrReturnBinding { } #[derive(Subdiagnostic)] -pub enum ConsiderAddingAwait { +pub(crate) enum ConsiderAddingAwait { #[help("consider `await`ing on both `Future`s")] BothFuturesHelp, #[multipart_suggestion( @@ -1397,7 +1397,7 @@ pub enum ConsiderAddingAwait { } #[derive(Diagnostic)] -pub enum PlaceholderRelationLfNotSatisfied { +pub(crate) enum PlaceholderRelationLfNotSatisfied { #[diag("lifetime bound not satisfied")] HasBoth { #[primary_span] @@ -1467,7 +1467,7 @@ pub enum PlaceholderRelationLfNotSatisfied { #[derive(Diagnostic)] #[diag("hidden type for `{$opaque_ty}` captures lifetime that does not appear in bounds", code = E0700)] -pub struct OpaqueCapturesLifetime<'tcx> { +pub(crate) struct OpaqueCapturesLifetime<'tcx> { #[primary_span] pub span: Span, #[label("opaque type defined here")] @@ -1476,7 +1476,7 @@ pub struct OpaqueCapturesLifetime<'tcx> { } #[derive(Subdiagnostic)] -pub enum FunctionPointerSuggestion<'a> { +pub(crate) enum FunctionPointerSuggestion<'a> { #[suggestion( "consider using a reference", code = "&", @@ -1557,26 +1557,26 @@ pub enum FunctionPointerSuggestion<'a> { #[derive(Subdiagnostic)] #[note("fn items are distinct from fn pointers")] -pub struct FnItemsAreDistinct; +pub(crate) struct FnItemsAreDistinct; #[derive(Subdiagnostic)] #[note("different fn items have unique types, even if their signatures are the same")] -pub struct FnUniqTypes; +pub(crate) struct FnUniqTypes; #[derive(Subdiagnostic)] #[help("consider casting the fn item to a fn pointer: `{$casting}`")] -pub struct FnConsiderCasting { +pub(crate) struct FnConsiderCasting { pub casting: String, } #[derive(Subdiagnostic)] #[help("consider casting both fn items to fn pointers using `as {$sig}`")] -pub struct FnConsiderCastingBoth<'a> { +pub(crate) struct FnConsiderCastingBoth<'a> { pub sig: Binder<'a, FnSig<'a>>, } #[derive(Subdiagnostic)] -pub enum SuggestAccessingField<'a> { +pub(crate) enum SuggestAccessingField<'a> { #[suggestion( "you might have meant to use field `{$name}` whose type is `{$ty}`", code = "{snippet}.{name}", @@ -1610,7 +1610,7 @@ pub enum SuggestAccessingField<'a> { "try wrapping the pattern in `{$variant}`", applicability = "maybe-incorrect" )] -pub struct SuggestTuplePatternOne { +pub(crate) struct SuggestTuplePatternOne { pub variant: String, #[suggestion_part(code = "{variant}(")] pub span_low: Span, @@ -1618,7 +1618,7 @@ pub struct SuggestTuplePatternOne { pub span_high: Span, } -pub struct SuggestTuplePatternMany { +pub(crate) struct SuggestTuplePatternMany { pub path: String, pub cause_span: Span, pub compatible_variants: Vec, @@ -1836,7 +1836,7 @@ pub enum ObligationCauseFailureCode { } #[derive(Subdiagnostic)] -pub enum AddPreciseCapturing { +pub(crate) enum AddPreciseCapturing { #[suggestion( "add a `use<...>` bound to explicitly capture `{$new_lifetime}`", style = "verbose", @@ -1864,7 +1864,7 @@ pub enum AddPreciseCapturing { }, } -pub struct AddPreciseCapturingAndParams { +pub(crate) struct AddPreciseCapturingAndParams { pub suggs: Vec<(Span, String)>, pub new_lifetime: Symbol, pub apit_spans: Vec, diff --git a/compiler/rustc_trait_selection/src/errors/note_and_explain.rs b/compiler/rustc_trait_selection/src/errors/note_and_explain.rs index fd943bff3700b..07b8adb898aa6 100644 --- a/compiler/rustc_trait_selection/src/errors/note_and_explain.rs +++ b/compiler/rustc_trait_selection/src/errors/note_and_explain.rs @@ -83,7 +83,7 @@ impl<'a> DescriptionCtx<'a> { } } -pub enum PrefixKind { +pub(crate) enum PrefixKind { Empty, RefValidFor, ContentValidFor, @@ -99,7 +99,7 @@ pub enum PrefixKind { DataValidFor, } -pub enum SuffixKind { +pub(crate) enum SuffixKind { Empty, Continues, ReqByBinding, @@ -139,14 +139,14 @@ impl IntoDiagArg for SuffixKind { } } -pub struct RegionExplanation<'a> { +pub(crate) struct RegionExplanation<'a> { desc: DescriptionCtx<'a>, prefix: PrefixKind, suffix: SuffixKind, } impl RegionExplanation<'_> { - pub fn new<'tcx>( + pub(crate) fn new<'tcx>( tcx: TyCtxt<'tcx>, generic_param_scope: LocalDefId, region: ty::Region<'tcx>, From f3fc5376e835fc99d81cd8420b170fac62bb755f Mon Sep 17 00:00:00 2001 From: Nicholas Nethercote Date: Thu, 16 Apr 2026 08:56:50 +1000 Subject: [PATCH 38/38] Move `MustBeNameOfAssociatedFunction` to the crate that uses it. --- .../rustc_attr_parsing/src/attributes/rustc_internal.rs | 2 +- compiler/rustc_attr_parsing/src/errors.rs | 7 +++++++ compiler/rustc_session/src/errors.rs | 7 ------- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/compiler/rustc_attr_parsing/src/attributes/rustc_internal.rs b/compiler/rustc_attr_parsing/src/attributes/rustc_internal.rs index 15bcffe529a0c..9dc7cadeaa7f2 100644 --- a/compiler/rustc_attr_parsing/src/attributes/rustc_internal.rs +++ b/compiler/rustc_attr_parsing/src/attributes/rustc_internal.rs @@ -6,11 +6,11 @@ use rustc_hir::attrs::{ BorrowckGraphvizFormatKind, CguFields, CguKind, DivergingBlockBehavior, DivergingFallbackBehavior, RustcCleanAttribute, RustcCleanQueries, RustcMirKind, }; -use rustc_session::errors; use rustc_span::Symbol; use super::prelude::*; use super::util::parse_single_integer; +use crate::errors; use crate::session_diagnostics::{ AttributeRequiresOpt, CguFieldsMissing, RustcScalableVectorCountOutOfRange, UnknownLangItem, }; diff --git a/compiler/rustc_attr_parsing/src/errors.rs b/compiler/rustc_attr_parsing/src/errors.rs index d4236416dd6aa..4613325a245b7 100644 --- a/compiler/rustc_attr_parsing/src/errors.rs +++ b/compiler/rustc_attr_parsing/src/errors.rs @@ -50,3 +50,10 @@ pub(crate) struct UnreachableCfgSelectPredicateWildcard { #[label("always matches")] pub wildcard_span: Span, } + +#[derive(Diagnostic)] +#[diag("must be a name of an associated function")] +pub(crate) struct MustBeNameOfAssociatedFunction { + #[primary_span] + pub span: Span, +} diff --git a/compiler/rustc_session/src/errors.rs b/compiler/rustc_session/src/errors.rs index 101cb1837759e..54f88aa22bdc4 100644 --- a/compiler/rustc_session/src/errors.rs +++ b/compiler/rustc_session/src/errors.rs @@ -83,13 +83,6 @@ pub(crate) struct CliFeatureDiagnosticHelp { pub(crate) feature: Symbol, } -#[derive(Diagnostic)] -#[diag("must be a name of an associated function")] -pub struct MustBeNameOfAssociatedFunction { - #[primary_span] - pub span: Span, -} - #[derive(Diagnostic)] #[diag( "`-Zunleash-the-miri-inside-of-you` may not be used to circumvent feature gates, except when testing error paths in the CTFE engine"