diff options
| author | mejrs <> | 2022-10-19 00:08:20 +0200 |
|---|---|---|
| committer | mejrs <> | 2022-10-19 00:08:20 +0200 |
| commit | 406e1dc8ebdeb509515c0c8be7cfe015c5eced30 (patch) | |
| tree | 89007e9a41db189b3228175001218ee04363b205 /src | |
| parent | a24a020e6d926dffe6b472fc647978f92269504e (diff) | |
| download | rust-406e1dc8ebdeb509515c0c8be7cfe015c5eced30.tar.gz rust-406e1dc8ebdeb509515c0c8be7cfe015c5eced30.zip | |
Implement -Ztrack-diagnostics
Diffstat (limited to 'src')
| -rw-r--r-- | src/librustdoc/core.rs | 2 | ||||
| -rw-r--r-- | src/librustdoc/doctest.rs | 3 | ||||
| -rw-r--r-- | src/test/ui/track-diagnostics/track.rs | 6 | ||||
| -rw-r--r-- | src/test/ui/track-diagnostics/track.stderr | 26 | ||||
| -rw-r--r-- | src/tools/clippy/clippy_lints/src/doc.rs | 1 | ||||
| -rw-r--r-- | src/tools/clippy/src/driver.rs | 1 | ||||
| -rw-r--r-- | src/tools/rustfmt/src/parse/session.rs | 1 |
7 files changed, 40 insertions, 0 deletions
diff --git a/src/librustdoc/core.rs b/src/librustdoc/core.rs index 858e939bd96..2a61c2451b6 100644 --- a/src/librustdoc/core.rs +++ b/src/librustdoc/core.rs @@ -172,6 +172,7 @@ pub(crate) fn new_handler( unstable_opts.teach, diagnostic_width, false, + false, ) .ui_testing(unstable_opts.ui_testing), ) @@ -190,6 +191,7 @@ pub(crate) fn new_handler( json_rendered, diagnostic_width, false, + false, ) .ui_testing(unstable_opts.ui_testing), ) diff --git a/src/librustdoc/doctest.rs b/src/librustdoc/doctest.rs index ac8b5211878..7bd7fc5ea75 100644 --- a/src/librustdoc/doctest.rs +++ b/src/librustdoc/doctest.rs @@ -551,6 +551,7 @@ pub(crate) fn make_test( false, Some(80), false, + false, ) .supports_color(); @@ -564,6 +565,7 @@ pub(crate) fn make_test( false, None, false, + false, ); // FIXME(misdreavus): pass `-Z treat-err-as-bug` to the doctest parser @@ -748,6 +750,7 @@ fn check_if_attr_is_complete(source: &str, edition: Edition) -> bool { false, None, false, + false, ); let handler = Handler::with_emitter(false, None, Box::new(emitter)); diff --git a/src/test/ui/track-diagnostics/track.rs b/src/test/ui/track-diagnostics/track.rs new file mode 100644 index 00000000000..3427c593e85 --- /dev/null +++ b/src/test/ui/track-diagnostics/track.rs @@ -0,0 +1,6 @@ +// compile-flags: -Z track-diagnostics +// error-pattern: created at + +fn main() { + break rust +} diff --git a/src/test/ui/track-diagnostics/track.stderr b/src/test/ui/track-diagnostics/track.stderr new file mode 100644 index 00000000000..83ff935dbab --- /dev/null +++ b/src/test/ui/track-diagnostics/track.stderr @@ -0,0 +1,26 @@ +error[E0425]: cannot find value `rust` in this scope + --> $DIR/track.rs:5:11 + | +LL | break rust + | ^^^^ not found in this scope +-Ztrack-diagnostics: created at compiler/rustc_resolve/src/late/diagnostics.rs:289:28 + +error[E0268]: `break` outside of a loop + --> $DIR/track.rs:5:5 + | +LL | break rust + | ^^^^^^^^^^ cannot `break` outside of a loop +-Ztrack-diagnostics: created at compiler/rustc_passes/src/errors.rs:957:10 + +error: internal compiler error: It looks like you're trying to break rust; would you like some ICE? + +note: the compiler expectedly panicked. this is a feature. + +note: we would appreciate a joke overview: https://github.com/rust-lang/rust/issues/43162#issuecomment-320764675 + +note: rustc 1.66.0-dev running on x86_64-pc-windows-msvc + +error: aborting due to 3 previous errors + +Some errors have detailed explanations: E0268, E0425. +For more information about an error, try `rustc --explain E0268`. diff --git a/src/tools/clippy/clippy_lints/src/doc.rs b/src/tools/clippy/clippy_lints/src/doc.rs index 36dc7e3396b..9e2facf0f63 100644 --- a/src/tools/clippy/clippy_lints/src/doc.rs +++ b/src/tools/clippy/clippy_lints/src/doc.rs @@ -691,6 +691,7 @@ fn check_code(cx: &LateContext<'_>, text: &str, edition: Edition, span: Span) { false, None, false, + false, ); let handler = Handler::with_emitter(false, None, Box::new(emitter)); let sess = ParseSess::with_span_handler(handler, sm); diff --git a/src/tools/clippy/src/driver.rs b/src/tools/clippy/src/driver.rs index b12208ac62a..ae54b2078a6 100644 --- a/src/tools/clippy/src/driver.rs +++ b/src/tools/clippy/src/driver.rs @@ -179,6 +179,7 @@ fn report_clippy_ice(info: &panic::PanicInfo<'_>, bug_report_url: &str) { false, None, false, + false, )); let handler = rustc_errors::Handler::with_emitter(true, None, emitter); diff --git a/src/tools/rustfmt/src/parse/session.rs b/src/tools/rustfmt/src/parse/session.rs index 6efeee98fea..6bfec79cd70 100644 --- a/src/tools/rustfmt/src/parse/session.rs +++ b/src/tools/rustfmt/src/parse/session.rs @@ -134,6 +134,7 @@ fn default_handler( false, None, false, + false, )) }; Handler::with_emitter( |
