summaryrefslogtreecommitdiffstats
path: root/tests/rustdoc-ui
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:19:41 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:19:41 +0000
commit4f9fe856a25ab29345b90e7725509e9ee38a37be (patch)
treee4ffd8a9374cae7b21f7cbfb352927e0e074aff6 /tests/rustdoc-ui
parentAdding upstream version 1.68.2+dfsg1. (diff)
downloadrustc-5cd5bd4daf55da04d2c8e7c06c3067a027cfbfc2.tar.xz
rustc-5cd5bd4daf55da04d2c8e7c06c3067a027cfbfc2.zip
Adding upstream version 1.69.0+dfsg1.upstream/1.69.0+dfsg1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tests/rustdoc-ui')
-rw-r--r--tests/rustdoc-ui/auxiliary/panic-handler.rs9
-rw-r--r--tests/rustdoc-ui/bounded-hr-lifetime.stderr4
-rw-r--r--tests/rustdoc-ui/check-fail.rs1
-rw-r--r--tests/rustdoc-ui/check-fail.stderr18
-rw-r--r--tests/rustdoc-ui/check.rs1
-rw-r--r--tests/rustdoc-ui/check.stderr12
-rw-r--r--tests/rustdoc-ui/feature-gate-doc_cfg_hide.stderr4
-rw-r--r--tests/rustdoc-ui/feature-gate-rustdoc_missing_doc_code_examples.rs4
-rw-r--r--tests/rustdoc-ui/feature-gate-rustdoc_missing_doc_code_examples.stderr14
-rw-r--r--tests/rustdoc-ui/impl-fn-nesting.stderr4
-rw-r--r--tests/rustdoc-ui/infinite-recursive-type-impl-trait-return.rs4
-rw-r--r--tests/rustdoc-ui/infinite-recursive-type-impl-trait-return.stderr16
-rw-r--r--tests/rustdoc-ui/infinite-recursive-type-impl-trait.rs5
-rw-r--r--tests/rustdoc-ui/infinite-recursive-type-impl-trait.stderr16
-rw-r--r--tests/rustdoc-ui/intra-doc/errors.rs16
-rw-r--r--tests/rustdoc-ui/intra-doc/errors.stderr14
-rw-r--r--tests/rustdoc-ui/intra-doc/import-inline-merge.rs16
-rw-r--r--tests/rustdoc-ui/intra-doc/proc-macro-doc.rs27
-rw-r--r--tests/rustdoc-ui/intra-doc/unknown-disambiguator.stderr32
-rw-r--r--tests/rustdoc-ui/intra-doc/unresolved-import-recovery.stderr4
-rw-r--r--tests/rustdoc-ui/issue-105742.rs21
-rw-r--r--tests/rustdoc-ui/issue-105742.stderr362
-rw-r--r--tests/rustdoc-ui/issue-107918.rs12
-rw-r--r--tests/rustdoc-ui/issue-61732.stderr4
-rw-r--r--tests/rustdoc-ui/lint-group.rs1
-rw-r--r--tests/rustdoc-ui/lint-group.stderr20
-rw-r--r--tests/rustdoc-ui/proc_macro_bug.rs12
-rw-r--r--tests/rustdoc-ui/proc_macro_bug.stderr8
-rw-r--r--tests/rustdoc-ui/rustdoc-all-only-stable-lints.rs6
-rw-r--r--tests/rustdoc-ui/track-diagnostics.stderr2
-rw-r--r--tests/rustdoc-ui/unable-fulfill-trait.stderr2
-rw-r--r--tests/rustdoc-ui/unknown-renamed-lints.stderr4
-rw-r--r--tests/rustdoc-ui/z-help.stdout361
33 files changed, 417 insertions, 619 deletions
diff --git a/tests/rustdoc-ui/auxiliary/panic-handler.rs b/tests/rustdoc-ui/auxiliary/panic-handler.rs
new file mode 100644
index 000000000..0aaaeee10
--- /dev/null
+++ b/tests/rustdoc-ui/auxiliary/panic-handler.rs
@@ -0,0 +1,9 @@
+// compile-flags: -C panic=abort
+
+#![no_std]
+#![no_main]
+
+#[panic_handler]
+fn panic(_: &core::panic::PanicInfo) -> ! {
+ loop {}
+}
diff --git a/tests/rustdoc-ui/bounded-hr-lifetime.stderr b/tests/rustdoc-ui/bounded-hr-lifetime.stderr
index d8fcd6cb4..580f70c97 100644
--- a/tests/rustdoc-ui/bounded-hr-lifetime.stderr
+++ b/tests/rustdoc-ui/bounded-hr-lifetime.stderr
@@ -4,7 +4,5 @@ error: lifetime bounds cannot be used in this context
LL | for<'a: 'b + 'c> &'a (): std::fmt::Debug,
| ^^ ^^
-error: Compilation failed, aborting rustdoc
-
-error: aborting due to 2 previous errors
+error: aborting due to previous error
diff --git a/tests/rustdoc-ui/check-fail.rs b/tests/rustdoc-ui/check-fail.rs
index c5e1759ee..02632b4ce 100644
--- a/tests/rustdoc-ui/check-fail.rs
+++ b/tests/rustdoc-ui/check-fail.rs
@@ -2,6 +2,7 @@
#![feature(rustdoc_missing_doc_code_examples)]
#![deny(missing_docs)]
+#![deny(rustdoc::missing_doc_code_examples)]
#![deny(rustdoc::all)]
//! ```rust,testharness
diff --git a/tests/rustdoc-ui/check-fail.stderr b/tests/rustdoc-ui/check-fail.stderr
index d8aeccbfc..f05e457af 100644
--- a/tests/rustdoc-ui/check-fail.stderr
+++ b/tests/rustdoc-ui/check-fail.stderr
@@ -1,5 +1,5 @@
error: missing documentation for a function
- --> $DIR/check-fail.rs:12:1
+ --> $DIR/check-fail.rs:13:1
|
LL | pub fn foo() {}
| ^^^^^^^^^^^^
@@ -11,7 +11,7 @@ LL | #![deny(missing_docs)]
| ^^^^^^^^^^^^
error: missing code example in this documentation
- --> $DIR/check-fail.rs:12:1
+ --> $DIR/check-fail.rs:13:1
|
LL | pub fn foo() {}
| ^^^^^^^^^^^^^^^
@@ -19,12 +19,11 @@ LL | pub fn foo() {}
note: the lint level is defined here
--> $DIR/check-fail.rs:5:9
|
-LL | #![deny(rustdoc::all)]
- | ^^^^^^^^^^^^
- = note: `#[deny(rustdoc::missing_doc_code_examples)]` implied by `#[deny(rustdoc::all)]`
+LL | #![deny(rustdoc::missing_doc_code_examples)]
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: unknown attribute `testharness`. Did you mean `test_harness`?
- --> $DIR/check-fail.rs:7:1
+ --> $DIR/check-fail.rs:8:1
|
LL | / //! ```rust,testharness
LL | |
@@ -33,10 +32,15 @@ LL | | //! ```
| |_______^
|
= help: the code block will either not be tested if not marked as a rust one or the code will be wrapped inside a main function
+note: the lint level is defined here
+ --> $DIR/check-fail.rs:6:9
+ |
+LL | #![deny(rustdoc::all)]
+ | ^^^^^^^^^^^^
= note: `#[deny(rustdoc::invalid_codeblock_attributes)]` implied by `#[deny(rustdoc::all)]`
error: unknown attribute `testharness`. Did you mean `test_harness`?
- --> $DIR/check-fail.rs:16:1
+ --> $DIR/check-fail.rs:17:1
|
LL | / /// hello
LL | |
diff --git a/tests/rustdoc-ui/check.rs b/tests/rustdoc-ui/check.rs
index f70b03361..e389a81bb 100644
--- a/tests/rustdoc-ui/check.rs
+++ b/tests/rustdoc-ui/check.rs
@@ -7,6 +7,7 @@
//~^^ WARN
#![warn(missing_docs)]
+#![warn(rustdoc::missing_doc_code_examples)]
#![warn(rustdoc::all)]
pub fn foo() {}
diff --git a/tests/rustdoc-ui/check.stderr b/tests/rustdoc-ui/check.stderr
index d379f33f2..c5ed5d0c3 100644
--- a/tests/rustdoc-ui/check.stderr
+++ b/tests/rustdoc-ui/check.stderr
@@ -17,7 +17,7 @@ LL | #![warn(missing_docs)]
| ^^^^^^^^^^^^
warning: missing documentation for a function
- --> $DIR/check.rs:12:1
+ --> $DIR/check.rs:13:1
|
LL | pub fn foo() {}
| ^^^^^^^^^^^^
@@ -27,7 +27,7 @@ warning: no documentation found for this crate's top-level module
= help: The following guide may be of use:
https://doc.rust-lang.org/$CHANNEL/rustdoc/how-to-write-documentation.html
note: the lint level is defined here
- --> $DIR/check.rs:10:9
+ --> $DIR/check.rs:11:9
|
LL | #![warn(rustdoc::all)]
| ^^^^^^^^^^^^
@@ -45,10 +45,14 @@ LL | |
LL | | pub fn foo() {}
| |_______________^
|
- = note: `#[warn(rustdoc::missing_doc_code_examples)]` implied by `#[warn(rustdoc::all)]`
+note: the lint level is defined here
+ --> $DIR/check.rs:10:9
+ |
+LL | #![warn(rustdoc::missing_doc_code_examples)]
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
warning: missing code example in this documentation
- --> $DIR/check.rs:12:1
+ --> $DIR/check.rs:13:1
|
LL | pub fn foo() {}
| ^^^^^^^^^^^^^^^
diff --git a/tests/rustdoc-ui/feature-gate-doc_cfg_hide.stderr b/tests/rustdoc-ui/feature-gate-doc_cfg_hide.stderr
index ba42c7bbb..0864159c8 100644
--- a/tests/rustdoc-ui/feature-gate-doc_cfg_hide.stderr
+++ b/tests/rustdoc-ui/feature-gate-doc_cfg_hide.stderr
@@ -7,8 +7,6 @@ LL | #![doc(cfg_hide(test))]
= note: see issue #43781 <https://github.com/rust-lang/rust/issues/43781> for more information
= help: add `#![feature(doc_cfg_hide)]` to the crate attributes to enable
-error: Compilation failed, aborting rustdoc
-
-error: aborting due to 2 previous errors
+error: aborting due to previous error
For more information about this error, try `rustc --explain E0658`.
diff --git a/tests/rustdoc-ui/feature-gate-rustdoc_missing_doc_code_examples.rs b/tests/rustdoc-ui/feature-gate-rustdoc_missing_doc_code_examples.rs
index daba69868..c34ea0567 100644
--- a/tests/rustdoc-ui/feature-gate-rustdoc_missing_doc_code_examples.rs
+++ b/tests/rustdoc-ui/feature-gate-rustdoc_missing_doc_code_examples.rs
@@ -1,10 +1,12 @@
#![deny(unknown_lints)]
//~^ NOTE defined here
-
#![allow(rustdoc::missing_doc_code_examples)]
//~^ ERROR unknown lint
//~| ERROR unknown lint
+//~| ERROR unknown lint
+//~| NOTE lint is unstable
//~| NOTE lint is unstable
//~| NOTE lint is unstable
//~| NOTE see issue
//~| NOTE see issue
+//~| NOTE see issue
diff --git a/tests/rustdoc-ui/feature-gate-rustdoc_missing_doc_code_examples.stderr b/tests/rustdoc-ui/feature-gate-rustdoc_missing_doc_code_examples.stderr
index cbe9a3d14..326dcfe3b 100644
--- a/tests/rustdoc-ui/feature-gate-rustdoc_missing_doc_code_examples.stderr
+++ b/tests/rustdoc-ui/feature-gate-rustdoc_missing_doc_code_examples.stderr
@@ -1,5 +1,5 @@
error: unknown lint: `rustdoc::missing_doc_code_examples`
- --> $DIR/feature-gate-rustdoc_missing_doc_code_examples.rs:4:1
+ --> $DIR/feature-gate-rustdoc_missing_doc_code_examples.rs:3:1
|
LL | #![allow(rustdoc::missing_doc_code_examples)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -14,7 +14,7 @@ LL | #![deny(unknown_lints)]
| ^^^^^^^^^^^^^
error: unknown lint: `rustdoc::missing_doc_code_examples`
- --> $DIR/feature-gate-rustdoc_missing_doc_code_examples.rs:4:1
+ --> $DIR/feature-gate-rustdoc_missing_doc_code_examples.rs:3:1
|
LL | #![allow(rustdoc::missing_doc_code_examples)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -23,7 +23,15 @@ LL | #![allow(rustdoc::missing_doc_code_examples)]
= note: see issue #101730 <https://github.com/rust-lang/rust/issues/101730> for more information
= help: add `#![feature(rustdoc_missing_doc_code_examples)]` to the crate attributes to enable
-error: Compilation failed, aborting rustdoc
+error: unknown lint: `rustdoc::missing_doc_code_examples`
+ --> $DIR/feature-gate-rustdoc_missing_doc_code_examples.rs:3:1
+ |
+LL | #![allow(rustdoc::missing_doc_code_examples)]
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ |
+ = note: the `rustdoc::missing_doc_code_examples` lint is unstable
+ = note: see issue #101730 <https://github.com/rust-lang/rust/issues/101730> for more information
+ = help: add `#![feature(rustdoc_missing_doc_code_examples)]` to the crate attributes to enable
error: aborting due to 3 previous errors
diff --git a/tests/rustdoc-ui/impl-fn-nesting.stderr b/tests/rustdoc-ui/impl-fn-nesting.stderr
index 608749af8..75e6b4ed2 100644
--- a/tests/rustdoc-ui/impl-fn-nesting.stderr
+++ b/tests/rustdoc-ui/impl-fn-nesting.stderr
@@ -58,9 +58,7 @@ error[E0412]: cannot find type `UnknownType` in this scope
LL | pub fn doubly_nested(c: UnknownType) {
| ^^^^^^^^^^^ not found in this scope
-error: Compilation failed, aborting rustdoc
-
-error: aborting due to 11 previous errors
+error: aborting due to 10 previous errors
Some errors have detailed explanations: E0405, E0412.
For more information about an error, try `rustc --explain E0405`.
diff --git a/tests/rustdoc-ui/infinite-recursive-type-impl-trait-return.rs b/tests/rustdoc-ui/infinite-recursive-type-impl-trait-return.rs
index 4b1e04234..939da186f 100644
--- a/tests/rustdoc-ui/infinite-recursive-type-impl-trait-return.rs
+++ b/tests/rustdoc-ui/infinite-recursive-type-impl-trait-return.rs
@@ -1,12 +1,10 @@
-// check-pass
// normalize-stderr-test: "`.*`" -> "`DEF_ID`"
// normalize-stdout-test: "`.*`" -> "`DEF_ID`"
// edition:2018
pub async fn f() -> impl std::fmt::Debug {
- // rustdoc doesn't care that this is infinitely sized
#[derive(Debug)]
- enum E {
+ enum E { //~ ERROR
This(E),
Unit,
}
diff --git a/tests/rustdoc-ui/infinite-recursive-type-impl-trait-return.stderr b/tests/rustdoc-ui/infinite-recursive-type-impl-trait-return.stderr
new file mode 100644
index 000000000..aff7402bc
--- /dev/null
+++ b/tests/rustdoc-ui/infinite-recursive-type-impl-trait-return.stderr
@@ -0,0 +1,16 @@
+error[E0072]: recursive type `DEF_ID` has infinite size
+ --> $DIR/infinite-recursive-type-impl-trait-return.rs:7:5
+ |
+LL | enum E {
+ | ^^^^^^
+LL | This(E),
+ | - recursive without indirection
+ |
+help: insert some indirection (e.g., a `DEF_ID`) to break the cycle
+ |
+LL | This(Box<E>),
+ | ++++ +
+
+error: aborting due to previous error
+
+For more information about this error, try `DEF_ID`.
diff --git a/tests/rustdoc-ui/infinite-recursive-type-impl-trait.rs b/tests/rustdoc-ui/infinite-recursive-type-impl-trait.rs
index ac79582fb..ac5172574 100644
--- a/tests/rustdoc-ui/infinite-recursive-type-impl-trait.rs
+++ b/tests/rustdoc-ui/infinite-recursive-type-impl-trait.rs
@@ -1,8 +1,5 @@
-// check-pass
-
fn f() -> impl Sized {
- // rustdoc doesn't care that this is infinitely sized
- enum E {
+ enum E { //~ ERROR
V(E),
}
unimplemented!()
diff --git a/tests/rustdoc-ui/infinite-recursive-type-impl-trait.stderr b/tests/rustdoc-ui/infinite-recursive-type-impl-trait.stderr
new file mode 100644
index 000000000..a61577bd1
--- /dev/null
+++ b/tests/rustdoc-ui/infinite-recursive-type-impl-trait.stderr
@@ -0,0 +1,16 @@
+error[E0072]: recursive type `f::E` has infinite size
+ --> $DIR/infinite-recursive-type-impl-trait.rs:2:5
+ |
+LL | enum E {
+ | ^^^^^^
+LL | V(E),
+ | - recursive without indirection
+ |
+help: insert some indirection (e.g., a `Box`, `Rc`, or `&`) to break the cycle
+ |
+LL | V(Box<E>),
+ | ++++ +
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0072`.
diff --git a/tests/rustdoc-ui/intra-doc/errors.rs b/tests/rustdoc-ui/intra-doc/errors.rs
index b29f7c29b..95dd2b98e 100644
--- a/tests/rustdoc-ui/intra-doc/errors.rs
+++ b/tests/rustdoc-ui/intra-doc/errors.rs
@@ -103,3 +103,19 @@ pub trait T {
macro_rules! m {
() => {};
}
+
+///[`TestEnum::Variant1::field_name`]
+//~^ ERROR unresolved link
+//~| NOTE variant `Variant1` has no such field
+pub enum TestEnum {
+ Variant1 {},
+ Variant2 { field_name: u64 },
+}
+
+///[`TestEnumNoFields::Variant1::field_name`]
+//~^ ERROR unresolved link
+//~| NOTE `Variant1` is a variant, not a module or type, and cannot have associated items
+pub enum TestEnumNoFields {
+ Variant1 (),
+ Variant2 {},
+}
diff --git a/tests/rustdoc-ui/intra-doc/errors.stderr b/tests/rustdoc-ui/intra-doc/errors.stderr
index 9a1896fb0..1b2416d7d 100644
--- a/tests/rustdoc-ui/intra-doc/errors.stderr
+++ b/tests/rustdoc-ui/intra-doc/errors.stderr
@@ -142,6 +142,18 @@ error: unresolved link to `T::h`
LL | /// [T::h!]
| ^^^^^ the trait `T` has no macro named `h`
+error: unresolved link to `TestEnum::Variant1::field_name`
+ --> $DIR/errors.rs:107:6
+ |
+LL | ///[`TestEnum::Variant1::field_name`]
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ variant `Variant1` has no such field
+
+error: unresolved link to `TestEnumNoFields::Variant1::field_name`
+ --> $DIR/errors.rs:115:6
+ |
+LL | ///[`TestEnumNoFields::Variant1::field_name`]
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `Variant1` is a variant, not a module or type, and cannot have associated items
+
error: unresolved link to `m`
--> $DIR/errors.rs:98:6
|
@@ -153,5 +165,5 @@ help: to link to the macro, add an exclamation mark
LL | /// [m!()]
| +
-error: aborting due to 20 previous errors
+error: aborting due to 22 previous errors
diff --git a/tests/rustdoc-ui/intra-doc/import-inline-merge.rs b/tests/rustdoc-ui/intra-doc/import-inline-merge.rs
new file mode 100644
index 000000000..31fef032b
--- /dev/null
+++ b/tests/rustdoc-ui/intra-doc/import-inline-merge.rs
@@ -0,0 +1,16 @@
+// Import for `A` is inlined and doc comments on the import and `A` itself are merged.
+// After the merge they still have correct parent scopes to resolve both `[A]` and `[B]`.
+
+// check-pass
+
+#![allow(rustdoc::private_intra_doc_links)]
+
+mod m {
+ /// [B]
+ pub struct A {}
+
+ pub struct B {}
+}
+
+/// [A]
+pub use m::A;
diff --git a/tests/rustdoc-ui/intra-doc/proc-macro-doc.rs b/tests/rustdoc-ui/intra-doc/proc-macro-doc.rs
new file mode 100644
index 000000000..8335fc902
--- /dev/null
+++ b/tests/rustdoc-ui/intra-doc/proc-macro-doc.rs
@@ -0,0 +1,27 @@
+// check-pass
+// force-host
+// no-prefer-dynamic
+// compile-flags: --crate-type proc-macro
+
+#![deny(rustdoc::broken_intra_doc_links)]
+
+extern crate proc_macro;
+use proc_macro::*;
+
+/// [`Unpin`]
+#[proc_macro_derive(F)]
+pub fn derive_(t: proc_macro::TokenStream) -> proc_macro::TokenStream {
+ t
+}
+
+/// [`Vec`]
+#[proc_macro_attribute]
+pub fn attr(t: proc_macro::TokenStream, _: proc_macro::TokenStream) -> proc_macro::TokenStream {
+ t
+}
+
+/// [`std::fs::File`]
+#[proc_macro]
+pub fn func(t: proc_macro::TokenStream) -> proc_macro::TokenStream {
+ t
+}
diff --git a/tests/rustdoc-ui/intra-doc/unknown-disambiguator.stderr b/tests/rustdoc-ui/intra-doc/unknown-disambiguator.stderr
index 19e541736..741a7f51a 100644
--- a/tests/rustdoc-ui/intra-doc/unknown-disambiguator.stderr
+++ b/tests/rustdoc-ui/intra-doc/unknown-disambiguator.stderr
@@ -20,22 +20,6 @@ LL | //! Linking to [foo@banana] and [`bar@banana!()`].
|
= note: see https://doc.rust-lang.org/$CHANNEL/rustdoc/write-documentation/linking-to-items-by-name.html#namespaces-and-disambiguators for more info about disambiguators
-error: unknown disambiguator `foo`
- --> $DIR/unknown-disambiguator.rs:10:34
- |
-LL | //! And with weird backticks: [``foo@hello``] [foo`@`hello].
- | ^^^
- |
- = note: see https://doc.rust-lang.org/$CHANNEL/rustdoc/write-documentation/linking-to-items-by-name.html#namespaces-and-disambiguators for more info about disambiguators
-
-error: unknown disambiguator `foo`
- --> $DIR/unknown-disambiguator.rs:10:48
- |
-LL | //! And with weird backticks: [``foo@hello``] [foo`@`hello].
- | ^^^
- |
- = note: see https://doc.rust-lang.org/$CHANNEL/rustdoc/write-documentation/linking-to-items-by-name.html#namespaces-and-disambiguators for more info about disambiguators
-
error: unknown disambiguator ``
--> $DIR/unknown-disambiguator.rs:7:31
|
@@ -52,5 +36,21 @@ LL | //! And to [no disambiguator](@nectarine) and [another](@apricot!()).
|
= note: see https://doc.rust-lang.org/$CHANNEL/rustdoc/write-documentation/linking-to-items-by-name.html#namespaces-and-disambiguators for more info about disambiguators
+error: unknown disambiguator `foo`
+ --> $DIR/unknown-disambiguator.rs:10:34
+ |
+LL | //! And with weird backticks: [``foo@hello``] [foo`@`hello].
+ | ^^^
+ |
+ = note: see https://doc.rust-lang.org/$CHANNEL/rustdoc/write-documentation/linking-to-items-by-name.html#namespaces-and-disambiguators for more info about disambiguators
+
+error: unknown disambiguator `foo`
+ --> $DIR/unknown-disambiguator.rs:10:48
+ |
+LL | //! And with weird backticks: [``foo@hello``] [foo`@`hello].
+ | ^^^
+ |
+ = note: see https://doc.rust-lang.org/$CHANNEL/rustdoc/write-documentation/linking-to-items-by-name.html#namespaces-and-disambiguators for more info about disambiguators
+
error: aborting due to 6 previous errors
diff --git a/tests/rustdoc-ui/intra-doc/unresolved-import-recovery.stderr b/tests/rustdoc-ui/intra-doc/unresolved-import-recovery.stderr
index b54f82006..14f560618 100644
--- a/tests/rustdoc-ui/intra-doc/unresolved-import-recovery.stderr
+++ b/tests/rustdoc-ui/intra-doc/unresolved-import-recovery.stderr
@@ -6,8 +6,6 @@ LL | use unresolved_crate::module::Name;
|
= help: consider adding `extern crate unresolved_crate` to use the `unresolved_crate` crate
-error: Compilation failed, aborting rustdoc
-
-error: aborting due to 2 previous errors
+error: aborting due to previous error
For more information about this error, try `rustc --explain E0433`.
diff --git a/tests/rustdoc-ui/issue-105742.rs b/tests/rustdoc-ui/issue-105742.rs
index cb1de7433..9f36e5315 100644
--- a/tests/rustdoc-ui/issue-105742.rs
+++ b/tests/rustdoc-ui/issue-105742.rs
@@ -3,38 +3,17 @@
use std::ops::Index;
pub fn next<'a, T>(s: &'a mut dyn SVec<Item = T, Output = T>) {
-//~^ ERROR
-//~^^ ERROR
-//~^^^ ERROR
let _ = s;
}
pub trait SVec: Index<
<Self as SVec>::Item,
-//~^ ERROR
-//~^^ ERROR
-//~^^^ ERROR
-//~^^^^ ERROR
Output = <Index<<Self as SVec>::Item,
-//~^ ERROR
-//~^^ ERROR
-//~^^^ ERROR
-//~^^^^ ERROR
Output = <Self as SVec>::Item> as SVec>::Item,
-//~^ ERROR
-//~^^ ERROR
-//~^^^ ERROR
-//~^^^^ ERROR
-//~^^^^^ ERROR
-//~^^^^^^ ERROR
-//~^^^^^^^ ERROR
-//~^^^^^^^^ ERROR
> {
type Item<'a, T>;
fn len(&self) -> <Self as SVec>::Item;
//~^ ERROR
//~^^ ERROR
- //~^^^ ERROR
- //~^^^^ ERROR
}
diff --git a/tests/rustdoc-ui/issue-105742.stderr b/tests/rustdoc-ui/issue-105742.stderr
index ffb602cf8..4d2ee9726 100644
--- a/tests/rustdoc-ui/issue-105742.stderr
+++ b/tests/rustdoc-ui/issue-105742.stderr
@@ -1,360 +1,11 @@
error[E0107]: missing generics for associated type `SVec::Item`
- --> $DIR/issue-105742.rs:13:21
- |
-LL | <Self as SVec>::Item,
- | ^^^^ expected 1 lifetime argument
- |
-note: associated type defined here, with 1 lifetime parameter: `'a`
- --> $DIR/issue-105742.rs:33:10
- |
-LL | type Item<'a, T>;
- | ^^^^ --
-help: add missing lifetime argument
- |
-LL | <Self as SVec>::Item<'a>,
- | ++++
-
-error[E0107]: missing generics for associated type `SVec::Item`
- --> $DIR/issue-105742.rs:13:21
- |
-LL | <Self as SVec>::Item,
- | ^^^^ expected 1 generic argument
- |
-note: associated type defined here, with 1 generic parameter: `T`
- --> $DIR/issue-105742.rs:33:10
- |
-LL | type Item<'a, T>;
- | ^^^^ -
-help: add missing generic argument
- |
-LL | <Self as SVec>::Item<T>,
- | +++
-
-error[E0107]: missing generics for associated type `SVec::Item`
- --> $DIR/issue-105742.rs:18:37
- |
-LL | Output = <Index<<Self as SVec>::Item,
- | ^^^^ expected 1 lifetime argument
- |
-note: associated type defined here, with 1 lifetime parameter: `'a`
- --> $DIR/issue-105742.rs:33:10
- |
-LL | type Item<'a, T>;
- | ^^^^ --
-help: add missing lifetime argument
- |
-LL | Output = <Index<<Self as SVec>::Item<'a>,
- | ++++
-
-error[E0107]: missing generics for associated type `SVec::Item`
- --> $DIR/issue-105742.rs:18:37
- |
-LL | Output = <Index<<Self as SVec>::Item,
- | ^^^^ expected 1 generic argument
- |
-note: associated type defined here, with 1 generic parameter: `T`
- --> $DIR/issue-105742.rs:33:10
- |
-LL | type Item<'a, T>;
- | ^^^^ -
-help: add missing generic argument
- |
-LL | Output = <Index<<Self as SVec>::Item<T>,
- | +++
-
-error[E0107]: missing generics for associated type `SVec::Item`
- --> $DIR/issue-105742.rs:23:30
- |
-LL | Output = <Self as SVec>::Item> as SVec>::Item,
- | ^^^^ expected 1 lifetime argument
- |
-note: associated type defined here, with 1 lifetime parameter: `'a`
- --> $DIR/issue-105742.rs:33:10
- |
-LL | type Item<'a, T>;
- | ^^^^ --
-help: add missing lifetime argument
- |
-LL | Output = <Self as SVec>::Item<'a>> as SVec>::Item,
- | ++++
-
-error[E0107]: missing generics for associated type `SVec::Item`
- --> $DIR/issue-105742.rs:23:30
- |
-LL | Output = <Self as SVec>::Item> as SVec>::Item,
- | ^^^^ expected 1 generic argument
- |
-note: associated type defined here, with 1 generic parameter: `T`
- --> $DIR/issue-105742.rs:33:10
- |
-LL | type Item<'a, T>;
- | ^^^^ -
-help: add missing generic argument
- |
-LL | Output = <Self as SVec>::Item<T>> as SVec>::Item,
- | +++
-
-error[E0107]: missing generics for associated type `SVec::Item`
- --> $DIR/issue-105742.rs:23:46
- |
-LL | Output = <Self as SVec>::Item> as SVec>::Item,
- | ^^^^ expected 1 lifetime argument
- |
-note: associated type defined here, with 1 lifetime parameter: `'a`
- --> $DIR/issue-105742.rs:33:10
- |
-LL | type Item<'a, T>;
- | ^^^^ --
-help: add missing lifetime argument
- |
-LL | Output = <Self as SVec>::Item> as SVec>::Item<'a>,
- | ++++
-
-error[E0107]: missing generics for associated type `SVec::Item`
- --> $DIR/issue-105742.rs:23:46
- |
-LL | Output = <Self as SVec>::Item> as SVec>::Item,
- | ^^^^ expected 1 generic argument
- |
-note: associated type defined here, with 1 generic parameter: `T`
- --> $DIR/issue-105742.rs:33:10
- |
-LL | type Item<'a, T>;
- | ^^^^ -
-help: add missing generic argument
- |
-LL | Output = <Self as SVec>::Item> as SVec>::Item<T>,
- | +++
-
-error[E0107]: missing generics for associated type `SVec::Item`
- --> $DIR/issue-105742.rs:5:40
- |
-LL | pub fn next<'a, T>(s: &'a mut dyn SVec<Item = T, Output = T>) {
- | ^^^^ expected 1 lifetime argument
- |
-note: associated type defined here, with 1 lifetime parameter: `'a`
- --> $DIR/issue-105742.rs:33:10
- |
-LL | type Item<'a, T>;
- | ^^^^ --
-help: add missing lifetime argument
- |
-LL | pub fn next<'a, T>(s: &'a mut dyn SVec<Item<'_> = T, Output = T>) {
- | ++++
-
-error[E0107]: missing generics for associated type `SVec::Item`
- --> $DIR/issue-105742.rs:5:40
- |
-LL | pub fn next<'a, T>(s: &'a mut dyn SVec<Item = T, Output = T>) {
- | ^^^^ expected 1 generic argument
- |
-note: associated type defined here, with 1 generic parameter: `T`
- --> $DIR/issue-105742.rs:33:10
- |
-LL | type Item<'a, T>;
- | ^^^^ -
-help: add missing generic argument
- |
-LL | pub fn next<'a, T>(s: &'a mut dyn SVec<Item<T> = T, Output = T>) {
- | +++
-
-error[E0107]: missing generics for associated type `SVec::Item`
- --> $DIR/issue-105742.rs:13:21
- |
-LL | <Self as SVec>::Item,
- | ^^^^ expected 1 lifetime argument
- |
-note: associated type defined here, with 1 lifetime parameter: `'a`
- --> $DIR/issue-105742.rs:33:10
- |
-LL | type Item<'a, T>;
- | ^^^^ --
-help: add missing lifetime argument
- |
-LL | <Self as SVec>::Item<'a>,
- | ++++
-
-error[E0107]: missing generics for associated type `SVec::Item`
- --> $DIR/issue-105742.rs:13:21
- |
-LL | <Self as SVec>::Item,
- | ^^^^ expected 1 generic argument
- |
-note: associated type defined here, with 1 generic parameter: `T`
- --> $DIR/issue-105742.rs:33:10
- |
-LL | type Item<'a, T>;
- | ^^^^ -
-help: add missing generic argument
- |
-LL | <Self as SVec>::Item<T>,
- | +++
-
-error[E0107]: missing generics for associated type `SVec::Item`
- --> $DIR/issue-105742.rs:18:37
- |
-LL | Output = <Index<<Self as SVec>::Item,
- | ^^^^ expected 1 lifetime argument
- |
-note: associated type defined here, with 1 lifetime parameter: `'a`
- --> $DIR/issue-105742.rs:33:10
- |
-LL | type Item<'a, T>;
- | ^^^^ --
-help: add missing lifetime argument
- |
-LL | Output = <Index<<Self as SVec>::Item<'a>,
- | ++++
-
-error[E0107]: missing generics for associated type `SVec::Item`
- --> $DIR/issue-105742.rs:18:37
- |
-LL | Output = <Index<<Self as SVec>::Item,
- | ^^^^ expected 1 generic argument
- |
-note: associated type defined here, with 1 generic parameter: `T`
- --> $DIR/issue-105742.rs:33:10
- |
-LL | type Item<'a, T>;
- | ^^^^ -
-help: add missing generic argument
- |
-LL | Output = <Index<<Self as SVec>::Item<T>,
- | +++
-
-error[E0107]: missing generics for associated type `SVec::Item`
- --> $DIR/issue-105742.rs:23:30
- |
-LL | Output = <Self as SVec>::Item> as SVec>::Item,
- | ^^^^ expected 1 lifetime argument
- |
-note: associated type defined here, with 1 lifetime parameter: `'a`
- --> $DIR/issue-105742.rs:33:10
- |
-LL | type Item<'a, T>;
- | ^^^^ --
-help: add missing lifetime argument
- |
-LL | Output = <Self as SVec>::Item<'a>> as SVec>::Item,
- | ++++
-
-error[E0107]: missing generics for associated type `SVec::Item`
- --> $DIR/issue-105742.rs:23:30
- |
-LL | Output = <Self as SVec>::Item> as SVec>::Item,
- | ^^^^ expected 1 generic argument
- |
-note: associated type defined here, with 1 generic parameter: `T`
- --> $DIR/issue-105742.rs:33:10
- |
-LL | type Item<'a, T>;
- | ^^^^ -
-help: add missing generic argument
- |
-LL | Output = <Self as SVec>::Item<T>> as SVec>::Item,
- | +++
-
-error[E0107]: missing generics for associated type `SVec::Item`
- --> $DIR/issue-105742.rs:23:46
- |
-LL | Output = <Self as SVec>::Item> as SVec>::Item,
- | ^^^^ expected 1 lifetime argument
- |
-note: associated type defined here, with 1 lifetime parameter: `'a`
- --> $DIR/issue-105742.rs:33:10
- |
-LL | type Item<'a, T>;
- | ^^^^ --
-help: add missing lifetime argument
- |
-LL | Output = <Self as SVec>::Item> as SVec>::Item<'a>,
- | ++++
-
-error[E0107]: missing generics for associated type `SVec::Item`
- --> $DIR/issue-105742.rs:23:46
- |
-LL | Output = <Self as SVec>::Item> as SVec>::Item,
- | ^^^^ expected 1 generic argument
- |
-note: associated type defined here, with 1 generic parameter: `T`
- --> $DIR/issue-105742.rs:33:10
- |
-LL | type Item<'a, T>;
- | ^^^^ -
-help: add missing generic argument
- |
-LL | Output = <Self as SVec>::Item> as SVec>::Item<T>,
- | +++
-
-error[E0038]: the trait `SVec` cannot be made into an object
- --> $DIR/issue-105742.rs:5:31
- |
-LL | pub fn next<'a, T>(s: &'a mut dyn SVec<Item = T, Output = T>) {
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `SVec` cannot be made into an object
- |
-note: for a trait to be "object safe" it needs to allow building a vtable to allow the call to be resolvable dynamically; for more information visit <https://doc.rust-lang.org/reference/items/traits.html#object-safety>
- --> $DIR/issue-105742.rs:12:17
- |
-LL | pub trait SVec: Index<
- | ____________----__^
- | | |
- | | this trait cannot be made into an object...
-LL | | <Self as SVec>::Item,
-LL | |
-LL | |
-... |
-LL | |/ Output = <Index<<Self as SVec>::Item,
-LL | ||
-LL | ||
-LL | ||
-LL | ||
-LL | || Output = <Self as SVec>::Item> as SVec>::Item,
- | ||_________________________________________________^ ...because it uses `Self` as a type parameter
-... |
-LL | |
-LL | | > {
- | |__^ ...because it uses `Self` as a type parameter
-
-error[E0107]: missing generics for associated type `SVec::Item`
- --> $DIR/issue-105742.rs:35:38
- |
-LL | fn len(&self) -> <Self as SVec>::Item;
- | ^^^^ expected 1 lifetime argument
- |
-note: associated type defined here, with 1 lifetime parameter: `'a`
- --> $DIR/issue-105742.rs:33:10
- |
-LL | type Item<'a, T>;
- | ^^^^ --
-help: add missing lifetime argument
- |
-LL | fn len(&self) -> <Self as SVec>::Item<'_>;
- | ++++
-
-error[E0107]: missing generics for associated type `SVec::Item`
- --> $DIR/issue-105742.rs:35:38
- |
-LL | fn len(&self) -> <Self as SVec>::Item;
- | ^^^^ expected 1 generic argument
- |
-note: associated type defined here, with 1 generic parameter: `T`
- --> $DIR/issue-105742.rs:33:10
- |
-LL | type Item<'a, T>;
- | ^^^^ -
-help: add missing generic argument
- |
-LL | fn len(&self) -> <Self as SVec>::Item<T>;
- | +++
-
-error[E0107]: missing generics for associated type `SVec::Item`
- --> $DIR/issue-105742.rs:35:38
+ --> $DIR/issue-105742.rs:16:38
|
LL | fn len(&self) -> <Self as SVec>::Item;
| ^^^^ expected 1 lifetime argument
|
note: associated type defined here, with 1 lifetime parameter: `'a`
- --> $DIR/issue-105742.rs:33:10
+ --> $DIR/issue-105742.rs:14:10
|
LL | type Item<'a, T>;
| ^^^^ --
@@ -364,13 +15,13 @@ LL | fn len(&self) -> <Self as SVec>::Item<'_>;
| ++++
error[E0107]: missing generics for associated type `SVec::Item`
- --> $DIR/issue-105742.rs:35:38
+ --> $DIR/issue-105742.rs:16:38
|
LL | fn len(&self) -> <Self as SVec>::Item;
| ^^^^ expected 1 generic argument
|
note: associated type defined here, with 1 generic parameter: `T`
- --> $DIR/issue-105742.rs:33:10
+ --> $DIR/issue-105742.rs:14:10
|
LL | type Item<'a, T>;
| ^^^^ -
@@ -379,7 +30,6 @@ help: add missing generic argument
LL | fn len(&self) -> <Self as SVec>::Item<T>;
| +++
-error: aborting due to 23 previous errors
+error: aborting due to 2 previous errors
-Some errors have detailed explanations: E0038, E0107.
-For more information about an error, try `rustc --explain E0038`.
+For more information about this error, try `rustc --explain E0107`.
diff --git a/tests/rustdoc-ui/issue-107918.rs b/tests/rustdoc-ui/issue-107918.rs
new file mode 100644
index 000000000..13788df0f
--- /dev/null
+++ b/tests/rustdoc-ui/issue-107918.rs
@@ -0,0 +1,12 @@
+// aux-build:panic-handler.rs
+// compile-flags: --document-private-items
+// build-pass
+// ignore-windows
+
+#![no_std]
+#![no_main]
+
+#[panic_handler]
+fn panic(_: &core::panic::PanicInfo) -> ! {
+ loop {}
+}
diff --git a/tests/rustdoc-ui/issue-61732.stderr b/tests/rustdoc-ui/issue-61732.stderr
index 38fadaa44..d16ec6a85 100644
--- a/tests/rustdoc-ui/issue-61732.stderr
+++ b/tests/rustdoc-ui/issue-61732.stderr
@@ -6,8 +6,6 @@ LL | pub(in crate::r#mod) fn main() {}
|
= help: consider adding `extern crate r#mod` to use the `r#mod` crate
-error: Compilation failed, aborting rustdoc
-
-error: aborting due to 2 previous errors
+error: aborting due to previous error
For more information about this error, try `rustc --explain E0433`.
diff --git a/tests/rustdoc-ui/lint-group.rs b/tests/rustdoc-ui/lint-group.rs
index 09aca6d2b..ad88157f6 100644
--- a/tests/rustdoc-ui/lint-group.rs
+++ b/tests/rustdoc-ui/lint-group.rs
@@ -6,6 +6,7 @@
//! println!("sup");
//! ```
+#![deny(rustdoc::missing_doc_code_examples)]
#![deny(rustdoc::all)]
/// what up, let's make an [error]
diff --git a/tests/rustdoc-ui/lint-group.stderr b/tests/rustdoc-ui/lint-group.stderr
index 4f2c96588..7ff09fcc4 100644
--- a/tests/rustdoc-ui/lint-group.stderr
+++ b/tests/rustdoc-ui/lint-group.stderr
@@ -1,5 +1,5 @@
error: missing code example in this documentation
- --> $DIR/lint-group.rs:18:1
+ --> $DIR/lint-group.rs:19:1
|
LL | /// wait, this doesn't have a doctest?
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -7,12 +7,11 @@ LL | /// wait, this doesn't have a doctest?
note: the lint level is defined here
--> $DIR/lint-group.rs:9:9
|
-LL | #![deny(rustdoc::all)]
- | ^^^^^^^^^^^^
- = note: `#[deny(rustdoc::missing_doc_code_examples)]` implied by `#[deny(rustdoc::all)]`
+LL | #![deny(rustdoc::missing_doc_code_examples)]
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: documentation test in private item
- --> $DIR/lint-group.rs:21:1
+ --> $DIR/lint-group.rs:22:1
|
LL | / /// wait, this *does* have a doctest?
LL | | ///
@@ -21,16 +20,21 @@ LL | | /// println!("sup");
LL | | /// ```
| |_______^
|
+note: the lint level is defined here
+ --> $DIR/lint-group.rs:10:9
+ |
+LL | #![deny(rustdoc::all)]
+ | ^^^^^^^^^^^^
= note: `#[deny(rustdoc::private_doc_tests)]` implied by `#[deny(rustdoc::all)]`
error: missing code example in this documentation
- --> $DIR/lint-group.rs:28:1
+ --> $DIR/lint-group.rs:29:1
|
LL | /// <unknown>
| ^^^^^^^^^^^^^
error: unresolved link to `error`
- --> $DIR/lint-group.rs:11:29
+ --> $DIR/lint-group.rs:12:29
|
LL | /// what up, let's make an [error]
| ^^^^^ no item named `error` in scope
@@ -39,7 +43,7 @@ LL | /// what up, let's make an [error]
= note: `#[deny(rustdoc::broken_intra_doc_links)]` implied by `#[deny(rustdoc::all)]`
error: unclosed HTML tag `unknown`
- --> $DIR/lint-group.rs:28:5
+ --> $DIR/lint-group.rs:29:5
|
LL | /// <unknown>
| ^^^^^^^^^
diff --git a/tests/rustdoc-ui/proc_macro_bug.rs b/tests/rustdoc-ui/proc_macro_bug.rs
new file mode 100644
index 000000000..e384e4863
--- /dev/null
+++ b/tests/rustdoc-ui/proc_macro_bug.rs
@@ -0,0 +1,12 @@
+// regression test for failing to pass `--crate-type proc-macro` to rustdoc
+// when documenting a proc macro crate https://github.com/rust-lang/rust/pull/107291
+
+extern crate proc_macro;
+
+use proc_macro::TokenStream;
+
+#[proc_macro_derive(DeriveA)]
+//~^ ERROR the `#[proc_macro_derive]` attribute is only usable with crates of the `proc-macro` crate type
+pub fn a_derive(input: TokenStream) -> TokenStream {
+ input
+}
diff --git a/tests/rustdoc-ui/proc_macro_bug.stderr b/tests/rustdoc-ui/proc_macro_bug.stderr
new file mode 100644
index 000000000..5b048097c
--- /dev/null
+++ b/tests/rustdoc-ui/proc_macro_bug.stderr
@@ -0,0 +1,8 @@
+error: the `#[proc_macro_derive]` attribute is only usable with crates of the `proc-macro` crate type
+ --> $DIR/proc_macro_bug.rs:8:1
+ |
+LL | #[proc_macro_derive(DeriveA)]
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+error: aborting due to previous error
+
diff --git a/tests/rustdoc-ui/rustdoc-all-only-stable-lints.rs b/tests/rustdoc-ui/rustdoc-all-only-stable-lints.rs
new file mode 100644
index 000000000..e106d06af
--- /dev/null
+++ b/tests/rustdoc-ui/rustdoc-all-only-stable-lints.rs
@@ -0,0 +1,6 @@
+// check-pass
+
+// Ensure `rustdoc::all` only affects stable lints. See #106289.
+
+#![deny(unknown_lints)]
+#![allow(rustdoc::all)]
diff --git a/tests/rustdoc-ui/track-diagnostics.stderr b/tests/rustdoc-ui/track-diagnostics.stderr
index ec3031862..39418d359 100644
--- a/tests/rustdoc-ui/track-diagnostics.stderr
+++ b/tests/rustdoc-ui/track-diagnostics.stderr
@@ -2,7 +2,7 @@ error[E0308]: mismatched types
--> $DIR/track-diagnostics.rs:LL:CC
|
LL | const S: A = B;
- | ^ expected struct `A`, found struct `B`
+ | ^ expected `A`, found `B`
-Ztrack-diagnostics: created at compiler/rustc_infer/src/infer/error_reporting/mod.rs:LL:CC
error: aborting due to previous error
diff --git a/tests/rustdoc-ui/unable-fulfill-trait.stderr b/tests/rustdoc-ui/unable-fulfill-trait.stderr
index a16b5b6eb..72f35cb92 100644
--- a/tests/rustdoc-ui/unable-fulfill-trait.stderr
+++ b/tests/rustdoc-ui/unable-fulfill-trait.stderr
@@ -1,4 +1,4 @@
-error[E0107]: this trait takes 1 generic argument but 0 generic arguments were supplied
+error[E0107]: trait takes 1 generic argument but 0 generic arguments were supplied
--> $DIR/unable-fulfill-trait.rs:4:17
|
LL | field1: dyn Bar<'a, 'b,>,
diff --git a/tests/rustdoc-ui/unknown-renamed-lints.stderr b/tests/rustdoc-ui/unknown-renamed-lints.stderr
index b105f47d7..bf529b9f8 100644
--- a/tests/rustdoc-ui/unknown-renamed-lints.stderr
+++ b/tests/rustdoc-ui/unknown-renamed-lints.stderr
@@ -58,7 +58,5 @@ error: unknown lint: `rustdoc::intra_doc_link_resolution_failure`
LL | #![deny(rustdoc::intra_doc_link_resolution_failure)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-error: Compilation failed, aborting rustdoc
-
-error: aborting due to 9 previous errors
+error: aborting due to 8 previous errors
diff --git a/tests/rustdoc-ui/z-help.stdout b/tests/rustdoc-ui/z-help.stdout
index 4bdecdc1b..79e6b94f1 100644
--- a/tests/rustdoc-ui/z-help.stdout
+++ b/tests/rustdoc-ui/z-help.stdout
@@ -1,193 +1,204 @@
- -Z allow-features=val -- only allow the listed language features to be enabled in code (comma separated)
- -Z always-encode-mir=val -- encode MIR of all functions into the crate metadata (default: no)
- -Z asm-comments=val -- generate comments into the assembly (may change behavior) (default: no)
- -Z assert-incr-state=val -- assert that the incremental cache is in given state: either `loaded` or `not-loaded`.
- -Z assume-incomplete-release=val -- make cfg(version) treat the current version as incomplete (default: no)
- -Z binary-dep-depinfo=val -- include artifacts (sysroot, crate dependencies) used during compilation in dep-info (default: no)
- -Z box-noalias=val -- emit noalias metadata for box (default: yes)
- -Z branch-protection=val -- set options for branch target identification and pointer authentication on AArch64
- -Z cf-protection=val -- instrument control-flow architecture protection
- -Z cgu-partitioning-strategy=val -- the codegen unit partitioning strategy to use
- -Z codegen-backend=val -- the backend to use
- -Z combine-cgu=val -- combine CGUs into a single one
- -Z crate-attr=val -- inject the given attribute in the crate
- -Z debug-info-for-profiling=val -- emit discriminators and other data necessary for AutoFDO
- -Z debug-macros=val -- emit line numbers debug info inside macros (default: no)
- -Z deduplicate-diagnostics=val -- deduplicate identical diagnostics (default: yes)
- -Z dep-info-omit-d-target=val -- in dep-info output, omit targets for tracking dependencies of the dep-info files themselves (default: no)
- -Z dep-tasks=val -- print tasks that execute and the color their dep node gets (requires debug build) (default: no)
- -Z diagnostic-width=val -- set the current output width for diagnostic truncation
- -Z dlltool=val -- import library generation tool (windows-gnu only)
- -Z dont-buffer-diagnostics=val -- emit diagnostics rather than buffering (breaks NLL error downgrading, sorting) (default: no)
- -Z drop-tracking=val -- enables drop tracking in generators (default: no)
- -Z dual-proc-macros=val -- load proc macros for both target and host, but only link to the target (default: no)
- -Z dump-dep-graph=val -- dump the dependency graph to $RUST_DEP_GRAPH (default: /tmp/dep_graph.gv) (default: no)
- -Z dump-drop-tracking-cfg=val -- dump drop-tracking control-flow graph as a `.dot` file (default: no)
- -Z dump-mir=val -- dump MIR state to file.
+ -Z allow-features=val -- only allow the listed language features to be enabled in code (comma separated)
+ -Z always-encode-mir=val -- encode MIR of all functions into the crate metadata (default: no)
+ -Z asm-comments=val -- generate comments into the assembly (may change behavior) (default: no)
+ -Z assert-incr-state=val -- assert that the incremental cache is in given state: either `loaded` or `not-loaded`.
+ -Z assume-incomplete-release=val -- make cfg(version) treat the current version as incomplete (default: no)
+ -Z binary-dep-depinfo=val -- include artifacts (sysroot, crate dependencies) used during compilation in dep-info (default: no)
+ -Z box-noalias=val -- emit noalias metadata for box (default: yes)
+ -Z branch-protection=val -- set options for branch target identification and pointer authentication on AArch64
+ -Z cf-protection=val -- instrument control-flow architecture protection
+ -Z cgu-partitioning-strategy=val -- the codegen unit partitioning strategy to use
+ -Z codegen-backend=val -- the backend to use
+ -Z combine-cgu=val -- combine CGUs into a single one
+ -Z crate-attr=val -- inject the given attribute in the crate
+ -Z debug-info-for-profiling=val -- emit discriminators and other data necessary for AutoFDO
+ -Z debug-macros=val -- emit line numbers debug info inside macros (default: no)
+ -Z deduplicate-diagnostics=val -- deduplicate identical diagnostics (default: yes)
+ -Z dep-info-omit-d-target=val -- in dep-info output, omit targets for tracking dependencies of the dep-info files themselves (default: no)
+ -Z dep-tasks=val -- print tasks that execute and the color their dep node gets (requires debug build) (default: no)
+ -Z diagnostic-width=val -- set the current output width for diagnostic truncation
+ -Z dlltool=val -- import library generation tool (windows-gnu only)
+ -Z dont-buffer-diagnostics=val -- emit diagnostics rather than buffering (breaks NLL error downgrading, sorting) (default: no)
+ -Z drop-tracking=val -- enables drop tracking in generators (default: no)
+ -Z drop-tracking-mir=val -- enables drop tracking on MIR in generators (default: no)
+ -Z dual-proc-macros=val -- load proc macros for both target and host, but only link to the target (default: no)
+ -Z dump-dep-graph=val -- dump the dependency graph to $RUST_DEP_GRAPH (default: /tmp/dep_graph.gv) (default: no)
+ -Z dump-drop-tracking-cfg=val -- dump drop-tracking control-flow graph as a `.dot` file (default: no)
+ -Z dump-mir=val -- dump MIR state to file.
`val` is used to select which passes and functions to dump. For example:
`all` matches all passes and functions,
`foo` matches all passes for functions whose name contains 'foo',
`foo & ConstProp` only the 'ConstProp' pass for function names containing 'foo',
`foo | bar` all passes for function names containing 'foo' or 'bar'.
- -Z dump-mir-dataflow=val -- in addition to `.mir` files, create graphviz `.dot` files with dataflow results (default: no)
- -Z dump-mir-dir=val -- the directory the MIR is dumped into (default: `mir_dump`)
- -Z dump-mir-exclude-pass-number=val -- exclude the pass number when dumping MIR (used in tests) (default: no)
- -Z dump-mir-graphviz=val -- in addition to `.mir` files, create graphviz `.dot` files (and with `-Z instrument-coverage`, also create a `.dot` file for the MIR-derived coverage graph) (default: no)
- -Z dump-mir-spanview=val -- in addition to `.mir` files, create `.html` files to view spans for all `statement`s (including terminators), only `terminator` spans, or computed `block` spans (one span encompassing a block's terminator and all statements). If `-Z instrument-coverage` is also enabled, create an additional `.html` file showing the computed coverage spans.
- -Z dump-mono-stats=val -- output statistics about monomorphization collection
- -Z dump-mono-stats-format=val -- the format to use for -Z dump-mono-stats (`markdown` (default) or `json`)
- -Z dwarf-version=val -- version of DWARF debug information to emit (default: 2 or 4, depending on platform)
- -Z dylib-lto=val -- enables LTO for dylib crate type
- -Z emit-stack-sizes=val -- emit a section containing stack size metadata (default: no)
- -Z emit-thin-lto=val -- emit the bc module with thin LTO info (default: yes)
- -Z export-executable-symbols=val -- export symbols from executables, as if they were dynamic libraries
- -Z extra-const-ub-checks=val -- turns on more checks to detect const UB, which can be slow (default: no)
- -Z fewer-names=val -- reduce memory use by retaining fewer names within compilation artifacts (LLVM-IR) (default: no)
- -Z force-unstable-if-unmarked=val -- force all crates to be `rustc_private` unstable (default: no)
- -Z fuel=val -- set the optimization fuel quota for a crate
- -Z function-sections=val -- whether each function should go in its own section
- -Z future-incompat-test=val -- forces all lints to be future incompatible, used for internal testing (default: no)
- -Z gcc-ld=val -- implementation of ld used by cc
- -Z graphviz-dark-mode=val -- use dark-themed colors in graphviz output (default: no)
- -Z graphviz-font=val -- use the given `fontname` in graphviz output; can be overridden by setting environment variable `RUSTC_GRAPHVIZ_FONT` (default: `Courier, monospace`)
- -Z hir-stats=val -- print some statistics about AST and HIR (default: no)
- -Z human-readable-cgu-names=val -- generate human-readable, predictable names for codegen units (default: no)
- -Z identify-regions=val -- display unnamed regions as `'<id>`, using a non-ident unique id (default: no)
- -Z incremental-ignore-spans=val -- ignore spans during ICH computation -- used for testing (default: no)
- -Z incremental-info=val -- print high-level information about incremental reuse (or the lack thereof) (default: no)
- -Z incremental-relative-spans=val -- hash spans relative to their parent item for incr. comp. (default: no)
- -Z incremental-verify-ich=val -- verify incr. comp. hashes of green query instances (default: no)
- -Z inline-in-all-cgus=val -- control whether `#[inline]` functions are in all CGUs
- -Z inline-llvm=val -- enable LLVM inlining (default: yes)
- -Z inline-mir=val -- enable MIR inlining (default: no)
- -Z inline-mir-hint-threshold=val -- inlining threshold for functions with inline hint (default: 100)
- -Z inline-mir-threshold=val -- a default MIR inlining threshold (default: 50)
- -Z input-stats=val -- gather statistics about the input (default: no)
- -Z instrument-coverage=val -- instrument the generated code to support LLVM source-based code coverage reports (note, the compiler build config must include `profiler = true`); implies `-C symbol-mangling-version=v0`. Optional values are:
+ -Z dump-mir-dataflow=val -- in addition to `.mir` files, create graphviz `.dot` files with dataflow results (default: no)
+ -Z dump-mir-dir=val -- the directory the MIR is dumped into (default: `mir_dump`)
+ -Z dump-mir-exclude-pass-number=val -- exclude the pass number when dumping MIR (used in tests) (default: no)
+ -Z dump-mir-graphviz=val -- in addition to `.mir` files, create graphviz `.dot` files (and with `-Z instrument-coverage`, also create a `.dot` file for the MIR-derived coverage graph) (default: no)
+ -Z dump-mir-spanview=val -- in addition to `.mir` files, create `.html` files to view spans for all `statement`s (including terminators), only `terminator` spans, or computed `block` spans (one span encompassing a block's terminator and all statements). If `-Z instrument-coverage` is also enabled, create an additional `.html` file showing the computed coverage spans.
+ -Z dump-mono-stats=val -- output statistics about monomorphization collection
+ -Z dump-mono-stats-format=val -- the format to use for -Z dump-mono-stats (`markdown` (default) or `json`)
+ -Z dwarf-version=val -- version of DWARF debug information to emit (default: 2 or 4, depending on platform)
+ -Z dylib-lto=val -- enables LTO for dylib crate type
+ -Z emit-stack-sizes=val -- emit a section containing stack size metadata (default: no)
+ -Z emit-thin-lto=val -- emit the bc module with thin LTO info (default: yes)
+ -Z export-executable-symbols=val -- export symbols from executables, as if they were dynamic libraries
+ -Z extra-const-ub-checks=val -- turns on more checks to detect const UB, which can be slow (default: no)
+ -Z fewer-names=val -- reduce memory use by retaining fewer names within compilation artifacts (LLVM-IR) (default: no)
+ -Z force-unstable-if-unmarked=val -- force all crates to be `rustc_private` unstable (default: no)
+ -Z fuel=val -- set the optimization fuel quota for a crate
+ -Z function-sections=val -- whether each function should go in its own section
+ -Z future-incompat-test=val -- forces all lints to be future incompatible, used for internal testing (default: no)
+ -Z gcc-ld=val -- implementation of ld used by cc
+ -Z graphviz-dark-mode=val -- use dark-themed colors in graphviz output (default: no)
+ -Z graphviz-font=val -- use the given `fontname` in graphviz output; can be overridden by setting environment variable `RUSTC_GRAPHVIZ_FONT` (default: `Courier, monospace`)
+ -Z hir-stats=val -- print some statistics about AST and HIR (default: no)
+ -Z human-readable-cgu-names=val -- generate human-readable, predictable names for codegen units (default: no)
+ -Z identify-regions=val -- display unnamed regions as `'<id>`, using a non-ident unique id (default: no)
+ -Z incremental-ignore-spans=val -- ignore spans during ICH computation -- used for testing (default: no)
+ -Z incremental-info=val -- print high-level information about incremental reuse (or the lack thereof) (default: no)
+ -Z incremental-relative-spans=val -- hash spans relative to their parent item for incr. comp. (default: no)
+ -Z incremental-verify-ich=val -- verify incr. comp. hashes of green query instances (default: no)
+ -Z inline-in-all-cgus=val -- control whether `#[inline]` functions are in all CGUs
+ -Z inline-llvm=val -- enable LLVM inlining (default: yes)
+ -Z inline-mir=val -- enable MIR inlining (default: no)
+ -Z inline-mir-hint-threshold=val -- inlining threshold for functions with inline hint (default: 100)
+ -Z inline-mir-threshold=val -- a default MIR inlining threshold (default: 50)
+ -Z input-stats=val -- gather statistics about the input (default: no)
+ -Z instrument-coverage=val -- instrument the generated code to support LLVM source-based code coverage reports (note, the compiler build config must include `profiler = true`); implies `-C symbol-mangling-version=v0`. Optional values are:
`=all` (implicit value)
`=except-unused-generics`
`=except-unused-functions`
`=off` (default)
- -Z instrument-mcount=val -- insert function instrument code for mcount-based tracing (default: no)
- -Z keep-hygiene-data=val -- keep hygiene data after analysis (default: no)
- -Z layout-seed=val -- seed layout randomization
- -Z link-native-libraries=val -- link native libraries in the linker invocation (default: yes)
- -Z link-only=val -- link the `.rlink` file generated by `-Z no-link` (default: no)
- -Z llvm-plugins=val -- a list LLVM plugins to enable (space separated)
- -Z llvm-time-trace=val -- generate JSON tracing data file from LLVM data (default: no)
- -Z location-detail=val -- what location details should be tracked when using caller_location, either `none`, or a comma separated list of location details, for which valid options are `file`, `line`, and `column` (default: `file,line,column`)
- -Z log-backtrace=val -- add a backtrace along with logging
- -Z ls=val -- list the symbols defined by a library crate (default: no)
- -Z macro-backtrace=val -- show macro backtraces (default: no)
- -Z maximal-hir-to-mir-coverage=val -- save as much information as possible about the correspondence between MIR and HIR as source scopes (default: no)
- -Z merge-functions=val -- control the operation of the MergeFunctions LLVM pass, taking the same values as the target option of the same name
- -Z meta-stats=val -- gather metadata statistics (default: no)
- -Z mir-emit-retag=val -- emit Retagging MIR statements, interpreted e.g., by miri; implies -Zmir-opt-level=0 (default: no)
- -Z mir-enable-passes=val -- use like `-Zmir-enable-passes=+DestProp,-InstCombine`. Forces the specified passes to be enabled, overriding all other checks. Passes that are not specified are enabled or disabled by other flags as usual.
- -Z mir-opt-level=val -- MIR optimization level (0-4; default: 1 in non optimized builds and 2 in optimized builds)
- -Z mir-pretty-relative-line-numbers=val -- use line numbers relative to the function in mir pretty printing
- -Z move-size-limit=val -- the size at which the `large_assignments` lint starts to be emitted
- -Z mutable-noalias=val -- emit noalias metadata for mutable references (default: yes)
- -Z nll-facts=val -- dump facts from NLL analysis into side files (default: no)
- -Z nll-facts-dir=val -- the directory the NLL facts are dumped into (default: `nll-facts`)
- -Z no-analysis=val -- parse and expand the source, but run no analysis
- -Z no-codegen=val -- run all passes except codegen; no output
- -Z no-generate-arange-section=val -- omit DWARF address ranges that give faster lookups
- -Z no-jump-tables=val -- disable the jump tables and lookup tables that can be generated from a switch case lowering
- -Z no-leak-check=val -- disable the 'leak check' for subtyping; unsound, but useful for tests
- -Z no-link=val -- compile without linking
- -Z no-parallel-llvm=val -- run LLVM in non-parallel mode (while keeping codegen-units and ThinLTO)
- -Z no-profiler-runtime=val -- prevent automatic injection of the profiler_builtins crate
- -Z no-unique-section-names=val -- do not use unique names for text and data sections when -Z function-sections is used
- -Z normalize-docs=val -- normalize associated items in rustdoc when generating documentation
- -Z oom=val -- panic strategy for out-of-memory handling
- -Z osx-rpath-install-name=val -- pass `-install_name @rpath/...` to the macOS linker (default: no)
- -Z packed-bundled-libs=val -- change rlib format to store native libraries as archives
- -Z panic-abort-tests=val -- support compiling tests with panic=abort (default: no)
- -Z panic-in-drop=val -- panic strategy for panics in drops
- -Z parse-only=val -- parse only; do not compile, assemble, or link (default: no)
- -Z perf-stats=val -- print some performance-related statistics (default: no)
- -Z pick-stable-methods-before-any-unstable=val -- try to pick stable methods first before picking any unstable methods (default: yes)
- -Z plt=val -- whether to use the PLT when calling into shared libraries;
+ -Z instrument-mcount=val -- insert function instrument code for mcount-based tracing (default: no)
+ -Z instrument-xray=val -- insert function instrument code for XRay-based tracing (default: no)
+ Optional extra settings:
+ `=always`
+ `=never`
+ `=ignore-loops`
+ `=instruction-threshold=N`
+ `=skip-entry`
+ `=skip-exit`
+ Multiple options can be combined with commas.
+ -Z keep-hygiene-data=val -- keep hygiene data after analysis (default: no)
+ -Z layout-seed=val -- seed layout randomization
+ -Z link-directives=val -- honor #[link] directives in the compiled crate (default: yes)
+ -Z link-native-libraries=val -- link native libraries in the linker invocation (default: yes)
+ -Z link-only=val -- link the `.rlink` file generated by `-Z no-link` (default: no)
+ -Z llvm-plugins=val -- a list LLVM plugins to enable (space separated)
+ -Z llvm-time-trace=val -- generate JSON tracing data file from LLVM data (default: no)
+ -Z location-detail=val -- what location details should be tracked when using caller_location, either `none`, or a comma separated list of location details, for which valid options are `file`, `line`, and `column` (default: `file,line,column`)
+ -Z lower-impl-trait-in-trait-to-assoc-ty=val -- modify the lowering strategy for `impl Trait` in traits so that they are lowered to generic associated types
+ -Z ls=val -- list the symbols defined by a library crate (default: no)
+ -Z macro-backtrace=val -- show macro backtraces (default: no)
+ -Z maximal-hir-to-mir-coverage=val -- save as much information as possible about the correspondence between MIR and HIR as source scopes (default: no)
+ -Z merge-functions=val -- control the operation of the MergeFunctions LLVM pass, taking the same values as the target option of the same name
+ -Z meta-stats=val -- gather metadata statistics (default: no)
+ -Z mir-emit-retag=val -- emit Retagging MIR statements, interpreted e.g., by miri; implies -Zmir-opt-level=0 (default: no)
+ -Z mir-enable-passes=val -- use like `-Zmir-enable-passes=+DestProp,-InstCombine`. Forces the specified passes to be enabled, overriding all other checks. Passes that are not specified are enabled or disabled by other flags as usual.
+ -Z mir-opt-level=val -- MIR optimization level (0-4; default: 1 in non optimized builds and 2 in optimized builds)
+ -Z mir-pretty-relative-line-numbers=val -- use line numbers relative to the function in mir pretty printing
+ -Z move-size-limit=val -- the size at which the `large_assignments` lint starts to be emitted
+ -Z mutable-noalias=val -- emit noalias metadata for mutable references (default: yes)
+ -Z nll-facts=val -- dump facts from NLL analysis into side files (default: no)
+ -Z nll-facts-dir=val -- the directory the NLL facts are dumped into (default: `nll-facts`)
+ -Z no-analysis=val -- parse and expand the source, but run no analysis
+ -Z no-codegen=val -- run all passes except codegen; no output
+ -Z no-generate-arange-section=val -- omit DWARF address ranges that give faster lookups
+ -Z no-jump-tables=val -- disable the jump tables and lookup tables that can be generated from a switch case lowering
+ -Z no-leak-check=val -- disable the 'leak check' for subtyping; unsound, but useful for tests
+ -Z no-link=val -- compile without linking
+ -Z no-parallel-llvm=val -- run LLVM in non-parallel mode (while keeping codegen-units and ThinLTO)
+ -Z no-profiler-runtime=val -- prevent automatic injection of the profiler_builtins crate
+ -Z no-unique-section-names=val -- do not use unique names for text and data sections when -Z function-sections is used
+ -Z normalize-docs=val -- normalize associated items in rustdoc when generating documentation
+ -Z oom=val -- panic strategy for out-of-memory handling
+ -Z osx-rpath-install-name=val -- pass `-install_name @rpath/...` to the macOS linker (default: no)
+ -Z packed-bundled-libs=val -- change rlib format to store native libraries as archives
+ -Z panic-abort-tests=val -- support compiling tests with panic=abort (default: no)
+ -Z panic-in-drop=val -- panic strategy for panics in drops
+ -Z parse-only=val -- parse only; do not compile, assemble, or link (default: no)
+ -Z perf-stats=val -- print some performance-related statistics (default: no)
+ -Z plt=val -- whether to use the PLT when calling into shared libraries;
only has effect for PIC code on systems with ELF binaries
(default: PLT is disabled if full relro is enabled)
- -Z polonius=val -- enable polonius-based borrow-checker (default: no)
- -Z polymorphize=val -- perform polymorphization analysis
- -Z pre-link-arg=val -- a single extra argument to prepend the linker invocation (can be used several times)
- -Z pre-link-args=val -- extra arguments to prepend to the linker invocation (space separated)
- -Z precise-enum-drop-elaboration=val -- use a more precise version of drop elaboration for matches on enums (default: yes). This results in better codegen, but has caused miscompilations on some tier 2 platforms. See #77382 and #74551.
- -Z print-fuel=val -- make rustc print the total optimization fuel used by a crate
- -Z print-llvm-passes=val -- print the LLVM optimization passes being run (default: no)
- -Z print-mono-items=val -- print the result of the monomorphization collection pass
- -Z print-type-sizes=val -- print layout information for each type encountered (default: no)
- -Z proc-macro-backtrace=val -- show backtraces for panics during proc-macro execution (default: no)
- -Z proc-macro-execution-strategy=val -- how to run proc-macro code (default: same-thread)
- -Z profile=val -- insert profiling code (default: no)
- -Z profile-closures=val -- profile size of closures
- -Z profile-emit=val -- file path to emit profiling data at runtime when using 'profile' (default based on relative source path)
- -Z profile-sample-use=val -- use the given `.prof` file for sampled profile-guided optimization (also known as AutoFDO)
- -Z profiler-runtime=val -- name of the profiler runtime crate to automatically inject (default: `profiler_builtins`)
- -Z query-dep-graph=val -- enable queries of the dependency graph for regression testing (default: no)
- -Z randomize-layout=val -- randomize the layout of types (default: no)
- -Z relax-elf-relocations=val -- whether ELF relocations can be relaxed
- -Z relro-level=val -- choose which RELRO level to use
- -Z remap-cwd-prefix=val -- remap paths under the current working directory to this path prefix
- -Z report-delayed-bugs=val -- immediately print bugs registered with `delay_span_bug` (default: no)
- -Z sanitizer=val -- use a sanitizer
- -Z sanitizer-memory-track-origins=val -- enable origins tracking in MemorySanitizer
- -Z sanitizer-recover=val -- enable recovery for selected sanitizers
- -Z saturating-float-casts=val -- make float->int casts UB-free: numbers outside the integer type's range are clipped to the max/min integer respectively, and NaN is mapped to 0 (default: yes)
- -Z save-analysis=val -- write syntax and type analysis (in JSON format) information, in addition to normal output (default: no)
- -Z self-profile=val -- run the self profiler and output the raw event data
- -Z self-profile-counter=val -- counter used by the self profiler (default: `wall-time`), one of:
+ -Z polonius=val -- enable polonius-based borrow-checker (default: no)
+ -Z polymorphize=val -- perform polymorphization analysis
+ -Z pre-link-arg=val -- a single extra argument to prepend the linker invocation (can be used several times)
+ -Z pre-link-args=val -- extra arguments to prepend to the linker invocation (space separated)
+ -Z precise-enum-drop-elaboration=val -- use a more precise version of drop elaboration for matches on enums (default: yes). This results in better codegen, but has caused miscompilations on some tier 2 platforms. See #77382 and #74551.
+ -Z print-fuel=val -- make rustc print the total optimization fuel used by a crate
+ -Z print-llvm-passes=val -- print the LLVM optimization passes being run (default: no)
+ -Z print-mono-items=val -- print the result of the monomorphization collection pass
+ -Z print-type-sizes=val -- print layout information for each type encountered (default: no)
+ -Z proc-macro-backtrace=val -- show backtraces for panics during proc-macro execution (default: no)
+ -Z proc-macro-execution-strategy=val -- how to run proc-macro code (default: same-thread)
+ -Z profile=val -- insert profiling code (default: no)
+ -Z profile-closures=val -- profile size of closures
+ -Z profile-emit=val -- file path to emit profiling data at runtime when using 'profile' (default based on relative source path)
+ -Z profile-sample-use=val -- use the given `.prof` file for sampled profile-guided optimization (also known as AutoFDO)
+ -Z profiler-runtime=val -- name of the profiler runtime crate to automatically inject (default: `profiler_builtins`)
+ -Z query-dep-graph=val -- enable queries of the dependency graph for regression testing (default: no)
+ -Z randomize-layout=val -- randomize the layout of types (default: no)
+ -Z relax-elf-relocations=val -- whether ELF relocations can be relaxed
+ -Z relro-level=val -- choose which RELRO level to use
+ -Z remap-cwd-prefix=val -- remap paths under the current working directory to this path prefix
+ -Z report-delayed-bugs=val -- immediately print bugs registered with `delay_span_bug` (default: no)
+ -Z sanitizer=val -- use a sanitizer
+ -Z sanitizer-memory-track-origins=val -- enable origins tracking in MemorySanitizer
+ -Z sanitizer-recover=val -- enable recovery for selected sanitizers
+ -Z saturating-float-casts=val -- make float->int casts UB-free: numbers outside the integer type's range are clipped to the max/min integer respectively, and NaN is mapped to 0 (default: yes)
+ -Z self-profile=val -- run the self profiler and output the raw event data
+ -Z self-profile-counter=val -- counter used by the self profiler (default: `wall-time`), one of:
`wall-time` (monotonic clock, i.e. `std::time::Instant`)
`instructions:u` (retired instructions, userspace-only)
`instructions-minus-irqs:u` (subtracting hardware interrupt counts for extra accuracy)
- -Z self-profile-events=val -- specify the events recorded by the self profiler;
+ -Z self-profile-events=val -- specify the events recorded by the self profiler;
for example: `-Z self-profile-events=default,query-keys`
all options: none, all, default, generic-activity, query-provider, query-cache-hit
query-blocked, incr-cache-load, incr-result-hashing, query-keys, function-args, args, llvm, artifact-sizes
- -Z share-generics=val -- make the current crate share its generic instantiations
- -Z show-span=val -- show spans for compiler debugging (expr|pat|ty)
- -Z simulate-remapped-rust-src-base=val -- simulate the effect of remap-debuginfo = true at bootstrapping by remapping path to rust's source base directory. only meant for testing purposes
- -Z span-debug=val -- forward proc_macro::Span's `Debug` impl to `Span`
- -Z span-free-formats=val -- exclude spans when debug-printing compiler state (default: no)
- -Z split-dwarf-inlining=val -- provide minimal debug info in the object/executable to facilitate online symbolication/stack traces in the absence of .dwo/.dwp files when using Split DWARF
- -Z split-dwarf-kind=val -- split dwarf variant (only if -Csplit-debuginfo is enabled and on relevant platform)
+ -Z share-generics=val -- make the current crate share its generic instantiations
+ -Z show-span=val -- show spans for compiler debugging (expr|pat|ty)
+ -Z simulate-remapped-rust-src-base=val -- simulate the effect of remap-debuginfo = true at bootstrapping by remapping path to rust's source base directory. only meant for testing purposes
+ -Z span-debug=val -- forward proc_macro::Span's `Debug` impl to `Span`
+ -Z span-free-formats=val -- exclude spans when debug-printing compiler state (default: no)
+ -Z split-dwarf-inlining=val -- provide minimal debug info in the object/executable to facilitate online symbolication/stack traces in the absence of .dwo/.dwp files when using Split DWARF
+ -Z split-dwarf-kind=val -- split dwarf variant (only if -Csplit-debuginfo is enabled and on relevant platform)
(default: `split`)
`split`: sections which do not require relocation are written into a DWARF object (`.dwo`)
file which is ignored by the linker
`single`: sections which do not require relocation are written into object file but ignored
by the linker
- -Z src-hash-algorithm=val -- hash algorithm of source files in debug info (`md5`, `sha1`, or `sha256`)
- -Z stack-protector=val -- control stack smash protection strategy (`rustc --print stack-protector-strategies` for details)
- -Z strict-init-checks=val -- control if mem::uninitialized and mem::zeroed panic on more UB
- -Z strip=val -- tell the linker which information to strip (`none` (default), `debuginfo` or `symbols`)
- -Z symbol-mangling-version=val -- which mangling version to use for symbol names ('legacy' (default) or 'v0')
- -Z teach=val -- show extended diagnostic help (default: no)
- -Z temps-dir=val -- the directory the intermediate files are written to
- -Z thinlto=val -- enable ThinLTO when possible
- -Z thir-unsafeck=val -- use the THIR unsafety checker (default: no)
- -Z threads=val -- use a thread pool with N threads
- -Z time-llvm-passes=val -- measure time of each LLVM pass (default: no)
- -Z time-passes=val -- measure time of each rustc pass (default: no)
- -Z tls-model=val -- choose the TLS model to use (`rustc --print tls-models` for details)
- -Z trace-macros=val -- for every macro invocation, print its name and arguments (default: no)
- -Z track-diagnostics=val -- tracks where in rustc a diagnostic was emitted
- -Z trait-solver=val -- specify the trait solver mode used by rustc (default: classic)
- -Z translate-additional-ftl=val -- additional fluent translation to preferentially use (for testing translation)
- -Z translate-directionality-markers=val -- emit directionality isolation markers in translated diagnostics
- -Z translate-lang=val -- language identifier for diagnostic output
- -Z translate-remapped-path-to-local-path=val -- translate remapped paths into local paths when possible (default: yes)
- -Z trap-unreachable=val -- generate trap instructions for unreachable intrinsics (default: use target setting, usually yes)
- -Z treat-err-as-bug=val -- treat error number `val` that occurs as bug
- -Z trim-diagnostic-paths=val -- in diagnostics, use heuristics to shorten paths referring to items
- -Z tune-cpu=val -- select processor to schedule for (`rustc --print target-cpus` for details)
- -Z ui-testing=val -- emit compiler diagnostics in a form suitable for UI testing (default: no)
- -Z uninit-const-chunk-threshold=val -- allow generating const initializers with mixed init/uninit chunks, and set the maximum number of chunks for which this is allowed (default: 16)
- -Z unleash-the-miri-inside-of-you=val -- take the brakes off const evaluation. NOTE: this is unsound (default: no)
- -Z unpretty=val -- present the input source, unstable (and less-pretty) variants;
+ -Z src-hash-algorithm=val -- hash algorithm of source files in debug info (`md5`, `sha1`, or `sha256`)
+ -Z stack-protector=val -- control stack smash protection strategy (`rustc --print stack-protector-strategies` for details)
+ -Z strict-init-checks=val -- control if mem::uninitialized and mem::zeroed panic on more UB
+ -Z strip=val -- tell the linker which information to strip (`none` (default), `debuginfo` or `symbols`)
+ -Z symbol-mangling-version=val -- which mangling version to use for symbol names ('legacy' (default) or 'v0')
+ -Z teach=val -- show extended diagnostic help (default: no)
+ -Z temps-dir=val -- the directory the intermediate files are written to
+ -Z terminal-urls=val -- use the OSC 8 hyperlink terminal specification to print hyperlinks in the compiler output
+ -Z thinlto=val -- enable ThinLTO when possible
+ -Z thir-unsafeck=val -- use the THIR unsafety checker (default: no)
+ -Z threads=val -- use a thread pool with N threads
+ -Z time-llvm-passes=val -- measure time of each LLVM pass (default: no)
+ -Z time-passes=val -- measure time of each rustc pass (default: no)
+ -Z tiny-const-eval-limit=val -- sets a tiny, non-configurable limit for const eval; useful for compiler tests
+ -Z tls-model=val -- choose the TLS model to use (`rustc --print tls-models` for details)
+ -Z trace-macros=val -- for every macro invocation, print its name and arguments (default: no)
+ -Z track-diagnostics=val -- tracks where in rustc a diagnostic was emitted
+ -Z trait-solver=val -- specify the trait solver mode used by rustc (default: classic)
+ -Z translate-additional-ftl=val -- additional fluent translation to preferentially use (for testing translation)
+ -Z translate-directionality-markers=val -- emit directionality isolation markers in translated diagnostics
+ -Z translate-lang=val -- language identifier for diagnostic output
+ -Z translate-remapped-path-to-local-path=val -- translate remapped paths into local paths when possible (default: yes)
+ -Z trap-unreachable=val -- generate trap instructions for unreachable intrinsics (default: use target setting, usually yes)
+ -Z treat-err-as-bug=val -- treat error number `val` that occurs as bug
+ -Z trim-diagnostic-paths=val -- in diagnostics, use heuristics to shorten paths referring to items
+ -Z tune-cpu=val -- select processor to schedule for (`rustc --print target-cpus` for details)
+ -Z ui-testing=val -- emit compiler diagnostics in a form suitable for UI testing (default: no)
+ -Z uninit-const-chunk-threshold=val -- allow generating const initializers with mixed init/uninit chunks, and set the maximum number of chunks for which this is allowed (default: 16)
+ -Z unleash-the-miri-inside-of-you=val -- take the brakes off const evaluation. NOTE: this is unsound (default: no)
+ -Z unpretty=val -- present the input source, unstable (and less-pretty) variants;
`normal`, `identified`,
`expanded`, `expanded,identified`,
`expanded,hygiene` (with internal representations),
@@ -197,11 +208,11 @@
`hir,typed` (HIR with types for each node),
`hir-tree` (dump the raw HIR),
`mir` (the MIR), or `mir-cfg` (graphviz formatted MIR)
- -Z unsound-mir-opts=val -- enable unsound and buggy MIR optimizations (default: no)
- -Z unstable-options=val -- adds unstable command line options to rustc interface (default: no)
- -Z use-ctors-section=val -- use legacy .ctors section for initializers rather than .init_array
- -Z validate-mir=val -- validate MIR after each transformation
- -Z verbose=val -- in general, enable more debug printouts (default: no)
- -Z verify-llvm-ir=val -- verify LLVM IR (default: no)
- -Z virtual-function-elimination=val -- enables dead virtual function elimination optimization. Requires `-Clto[=[fat,yes]]`
- -Z wasi-exec-model=val -- whether to build a wasi command or reactor
+ -Z unsound-mir-opts=val -- enable unsound and buggy MIR optimizations (default: no)
+ -Z unstable-options=val -- adds unstable command line options to rustc interface (default: no)
+ -Z use-ctors-section=val -- use legacy .ctors section for initializers rather than .init_array
+ -Z validate-mir=val -- validate MIR after each transformation
+ -Z verbose=val -- in general, enable more debug printouts (default: no)
+ -Z verify-llvm-ir=val -- verify LLVM IR (default: no)
+ -Z virtual-function-elimination=val -- enables dead virtual function elimination optimization. Requires `-Clto[=[fat,yes]]`
+ -Z wasi-exec-model=val -- whether to build a wasi command or reactor