add tests for -Zlocation-detail
This commit is contained in:
parent
8090f67fb7
commit
b802629311
@ -5,7 +5,9 @@ use rustc_errors::{emitter::HumanReadableErrorType, registry, ColorConfig};
|
||||
use rustc_session::config::InstrumentCoverage;
|
||||
use rustc_session::config::Strip;
|
||||
use rustc_session::config::{build_configuration, build_session_options, to_crate_config};
|
||||
use rustc_session::config::{rustc_optgroups, ErrorOutputType, ExternLocation, Options, Passes};
|
||||
use rustc_session::config::{
|
||||
rustc_optgroups, ErrorOutputType, ExternLocation, LocationDetail, Options, Passes,
|
||||
};
|
||||
use rustc_session::config::{CFGuard, ExternEntry, LinkerPluginLto, LtoCli, SwitchWithOptPath};
|
||||
use rustc_session::config::{
|
||||
Externs, OutputType, OutputTypes, SymbolManglingVersion, WasiExecModel,
|
||||
@ -733,6 +735,7 @@ fn test_debugging_options_tracking_hash() {
|
||||
tracked!(instrument_mcount, true);
|
||||
tracked!(link_only, true);
|
||||
tracked!(llvm_plugins, vec![String::from("plugin_name")]);
|
||||
tracked!(location_detail, LocationDetail { file: true, line: false, column: false });
|
||||
tracked!(merge_functions, Some(MergeFunctions::Disabled));
|
||||
tracked!(mir_emit_retag, true);
|
||||
tracked!(mir_opt_level, Some(4));
|
||||
|
7
src/test/ui/panics/location-detail-panic-no-column.rs
Normal file
7
src/test/ui/panics/location-detail-panic-no-column.rs
Normal file
@ -0,0 +1,7 @@
|
||||
// run-fail
|
||||
// check-run-results
|
||||
// compile-flags: -Zlocation-detail=line,file
|
||||
|
||||
fn main() {
|
||||
panic!("column-redacted");
|
||||
}
|
@ -0,0 +1,2 @@
|
||||
thread 'main' panicked at 'column-redacted', $DIR/location-detail-panic-no-column.rs:6:0
|
||||
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
|
7
src/test/ui/panics/location-detail-panic-no-file.rs
Normal file
7
src/test/ui/panics/location-detail-panic-no-file.rs
Normal file
@ -0,0 +1,7 @@
|
||||
// run-fail
|
||||
// check-run-results
|
||||
// compile-flags: -Zlocation-detail=line,column
|
||||
|
||||
fn main() {
|
||||
panic!("file-redacted");
|
||||
}
|
@ -0,0 +1,2 @@
|
||||
thread 'main' panicked at 'file-redacted', <redacted>:6:5
|
||||
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
|
7
src/test/ui/panics/location-detail-panic-no-line.rs
Normal file
7
src/test/ui/panics/location-detail-panic-no-line.rs
Normal file
@ -0,0 +1,7 @@
|
||||
// run-fail
|
||||
// check-run-results
|
||||
// compile-flags: -Zlocation-detail=file,column
|
||||
|
||||
fn main() {
|
||||
panic!("line-redacted");
|
||||
}
|
@ -0,0 +1,2 @@
|
||||
thread 'main' panicked at 'line-redacted', $DIR/location-detail-panic-no-line.rs:0:5
|
||||
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
|
8
src/test/ui/panics/location-detail-unwrap-no-file.rs
Normal file
8
src/test/ui/panics/location-detail-unwrap-no-file.rs
Normal file
@ -0,0 +1,8 @@
|
||||
// run-fail
|
||||
// check-run-results
|
||||
// compile-flags: -Zlocation-detail=line,column
|
||||
|
||||
fn main() {
|
||||
let opt: Option<u32> = None;
|
||||
opt.unwrap();
|
||||
}
|
@ -0,0 +1,2 @@
|
||||
thread 'main' panicked at 'called `Option::unwrap()` on a `None` value', <redacted>:7:9
|
||||
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
|
Loading…
x
Reference in New Issue
Block a user