diff options
Diffstat (limited to 'src/test')
21 files changed, 391 insertions, 56 deletions
diff --git a/src/test/compile-fail/empty-extern-arg.rs b/src/test/compile-fail/empty-extern-arg.rs index ae28fcad903..d3cb5aaaeba 100644 --- a/src/test/compile-fail/empty-extern-arg.rs +++ b/src/test/compile-fail/empty-extern-arg.rs @@ -1,4 +1,4 @@ // compile-flags: --extern std= -// error-pattern: can't find crate for `std` +// error-pattern: extern location for std does not exist fn main() {} diff --git a/src/test/mir-opt/instrument_coverage/rustc.bar.InstrumentCoverage.diff b/src/test/mir-opt/instrument_coverage/rustc.bar.InstrumentCoverage.diff index af2899c887a..e7fef4622b1 100644 --- a/src/test/mir-opt/instrument_coverage/rustc.bar.InstrumentCoverage.diff +++ b/src/test/mir-opt/instrument_coverage/rustc.bar.InstrumentCoverage.diff @@ -3,34 +3,40 @@ fn bar() -> bool { let mut _0: bool; // return place in scope 0 at $DIR/instrument_coverage.rs:18:13: 18:17 -+ let mut _1: (); // in scope 0 at $DIR/instrument_coverage.rs:18:1: 20:2 ++ let mut _1: (); // in scope 0 at $DIR/instrument_coverage.rs:18:18: 18:18 bb0: { -+ StorageLive(_1); // scope 0 at $DIR/instrument_coverage.rs:18:1: 20:2 -+ _1 = const std::intrinsics::count_code_region(const 0_u32, const 484_u32, const 513_u32) -> bb2; // scope 0 at $DIR/instrument_coverage.rs:18:1: 20:2 ++ StorageLive(_1); // scope 0 at $DIR/instrument_coverage.rs:18:18: 18:18 ++ _1 = const std::intrinsics::count_code_region(const 10208505205182607101_u64, const 0_u32, const 501_u32, const 513_u32) -> bb2; // scope 0 at $DIR/instrument_coverage.rs:18:18: 18:18 + // ty::Const -+ // + ty: unsafe extern "rust-intrinsic" fn(u32, u32, u32) {std::intrinsics::count_code_region} ++ // + ty: unsafe extern "rust-intrinsic" fn(u64, u32, u32, u32) {std::intrinsics::count_code_region} + // + val: Value(Scalar(<ZST>)) + // mir::Constant -+ // + span: $DIR/instrument_coverage.rs:18:1: 18:1 -+ // + literal: Const { ty: unsafe extern "rust-intrinsic" fn(u32, u32, u32) {std::intrinsics::count_code_region}, val: Value(Scalar(<ZST>)) } ++ // + span: $DIR/instrument_coverage.rs:18:18: 18:18 ++ // + literal: Const { ty: unsafe extern "rust-intrinsic" fn(u64, u32, u32, u32) {std::intrinsics::count_code_region}, val: Value(Scalar(<ZST>)) } ++ // ty::Const ++ // + ty: u64 ++ // + val: Value(Scalar(0x8dabe565aaa2aefd)) ++ // mir::Constant ++ // + span: $DIR/instrument_coverage.rs:18:18: 18:18 ++ // + literal: Const { ty: u64, val: Value(Scalar(0x8dabe565aaa2aefd)) } + // ty::Const + // + ty: u32 + // + val: Value(Scalar(0x00000000)) + // mir::Constant -+ // + span: $DIR/instrument_coverage.rs:18:1: 18:1 ++ // + span: $DIR/instrument_coverage.rs:18:18: 18:18 + // + literal: Const { ty: u32, val: Value(Scalar(0x00000000)) } + // ty::Const + // + ty: u32 -+ // + val: Value(Scalar(0x000001e4)) ++ // + val: Value(Scalar(0x000001f5)) + // mir::Constant -+ // + span: $DIR/instrument_coverage.rs:18:1: 18:1 -+ // + literal: Const { ty: u32, val: Value(Scalar(0x000001e4)) } ++ // + span: $DIR/instrument_coverage.rs:18:18: 18:18 ++ // + literal: Const { ty: u32, val: Value(Scalar(0x000001f5)) } + // ty::Const + // + ty: u32 + // + val: Value(Scalar(0x00000201)) + // mir::Constant -+ // + span: $DIR/instrument_coverage.rs:18:1: 18:1 ++ // + span: $DIR/instrument_coverage.rs:18:18: 18:18 + // + literal: Const { ty: u32, val: Value(Scalar(0x00000201)) } + } + diff --git a/src/test/mir-opt/instrument_coverage/rustc.main.InstrumentCoverage.diff b/src/test/mir-opt/instrument_coverage/rustc.main.InstrumentCoverage.diff index 4a300230f8a..51378c216da 100644 --- a/src/test/mir-opt/instrument_coverage/rustc.main.InstrumentCoverage.diff +++ b/src/test/mir-opt/instrument_coverage/rustc.main.InstrumentCoverage.diff @@ -6,35 +6,41 @@ let mut _1: (); // in scope 0 at $DIR/instrument_coverage.rs:9:1: 15:2 let mut _2: bool; // in scope 0 at $DIR/instrument_coverage.rs:11:12: 11:17 let mut _3: !; // in scope 0 at $DIR/instrument_coverage.rs:11:18: 13:10 -+ let mut _4: (); // in scope 0 at $DIR/instrument_coverage.rs:9:1: 15:2 ++ let mut _4: (); // in scope 0 at $DIR/instrument_coverage.rs:9:11: 9:11 bb0: { - falseUnwind -> [real: bb1, cleanup: bb2]; // scope 0 at $DIR/instrument_coverage.rs:10:5: 14:6 -+ StorageLive(_4); // scope 0 at $DIR/instrument_coverage.rs:9:1: 15:2 -+ _4 = const std::intrinsics::count_code_region(const 0_u32, const 387_u32, const 465_u32) -> bb7; // scope 0 at $DIR/instrument_coverage.rs:9:1: 15:2 ++ StorageLive(_4); // scope 0 at $DIR/instrument_coverage.rs:9:11: 9:11 ++ _4 = const std::intrinsics::count_code_region(const 16004455475339839479_u64, const 0_u32, const 397_u32, const 465_u32) -> bb7; // scope 0 at $DIR/instrument_coverage.rs:9:11: 9:11 + // ty::Const -+ // + ty: unsafe extern "rust-intrinsic" fn(u32, u32, u32) {std::intrinsics::count_code_region} ++ // + ty: unsafe extern "rust-intrinsic" fn(u64, u32, u32, u32) {std::intrinsics::count_code_region} + // + val: Value(Scalar(<ZST>)) + // mir::Constant -+ // + span: $DIR/instrument_coverage.rs:9:1: 9:1 -+ // + literal: Const { ty: unsafe extern "rust-intrinsic" fn(u32, u32, u32) {std::intrinsics::count_code_region}, val: Value(Scalar(<ZST>)) } ++ // + span: $DIR/instrument_coverage.rs:9:11: 9:11 ++ // + literal: Const { ty: unsafe extern "rust-intrinsic" fn(u64, u32, u32, u32) {std::intrinsics::count_code_region}, val: Value(Scalar(<ZST>)) } ++ // ty::Const ++ // + ty: u64 ++ // + val: Value(Scalar(0xde1b3f75a72fc7f7)) ++ // mir::Constant ++ // + span: $DIR/instrument_coverage.rs:9:11: 9:11 ++ // + literal: Const { ty: u64, val: Value(Scalar(0xde1b3f75a72fc7f7)) } + // ty::Const + // + ty: u32 + // + val: Value(Scalar(0x00000000)) + // mir::Constant -+ // + span: $DIR/instrument_coverage.rs:9:1: 9:1 ++ // + span: $DIR/instrument_coverage.rs:9:11: 9:11 + // + literal: Const { ty: u32, val: Value(Scalar(0x00000000)) } + // ty::Const + // + ty: u32 -+ // + val: Value(Scalar(0x00000183)) ++ // + val: Value(Scalar(0x0000018d)) + // mir::Constant -+ // + span: $DIR/instrument_coverage.rs:9:1: 9:1 -+ // + literal: Const { ty: u32, val: Value(Scalar(0x00000183)) } ++ // + span: $DIR/instrument_coverage.rs:9:11: 9:11 ++ // + literal: Const { ty: u32, val: Value(Scalar(0x0000018d)) } + // ty::Const + // + ty: u32 + // + val: Value(Scalar(0x000001d1)) + // mir::Constant -+ // + span: $DIR/instrument_coverage.rs:9:1: 9:1 ++ // + span: $DIR/instrument_coverage.rs:9:11: 9:11 + // + literal: Const { ty: u32, val: Value(Scalar(0x000001d1)) } } diff --git a/src/test/run-make-fulldeps/instrument-coverage/Makefile b/src/test/run-make-fulldeps/instrument-coverage/Makefile new file mode 100644 index 00000000000..df47305b547 --- /dev/null +++ b/src/test/run-make-fulldeps/instrument-coverage/Makefile @@ -0,0 +1,57 @@ +# needs-profiler-support +# ignore-msvc + +# FIXME(richkadel): Debug the following problem, and reenable on Windows (by +# removing the `# ignore-msvc` directive above). The current implementation +# generates a segfault when running the instrumented `main` executable, +# after the `main` program code executes, but before the process terminates. +# This most likely points to a problem generating the LLVM "main.profraw" +# file. + +-include ../tools.mk + +# This test makes sure that LLVM coverage maps are genereated in LLVM IR. + +COMMON_FLAGS=-Zinstrument-coverage + +all: + # Compile the test program with instrumentation, and also generate LLVM IR + $(RUSTC) $(COMMON_FLAGS) main.rs + + # Run it in order to generate some profiling data, + # with `LLVM_PROFILE_FILE=<profdata_file>` environment variable set to + # output the coverage stats for this run. + LLVM_PROFILE_FILE="$(TMPDIR)"/main.profraw \ + $(call RUN,main) + + # Postprocess the profiling data so it can be used by the llvm-cov tool + "$(LLVM_BIN_DIR)"/llvm-profdata merge --sparse \ + "$(TMPDIR)"/main.profraw \ + -o "$(TMPDIR)"/main.profdata + + # Generate a coverage report using `llvm-cov show`. The output ordering + # can be non-deterministic, so ignore the return status. If the test fails + # when comparing the JSON `export`, the `show` output may be useful when + # debugging. + "$(LLVM_BIN_DIR)"/llvm-cov show \ + --Xdemangler="$(RUST_DEMANGLER)" \ + --show-line-counts-or-regions \ + --instr-profile="$(TMPDIR)"/main.profdata \ + $(call BIN,"$(TMPDIR)"/main) \ + > "$(TMPDIR)"/actual_show_coverage.txt + + # Compare the show coverage output + $(DIFF) typical_show_coverage.txt "$(TMPDIR)"/actual_show_coverage.txt || \ + >&2 echo 'diff failed for `llvm-cov show` (might not be an error)' + + # Generate a coverage report in JSON, using `llvm-cov export`, and fail if + # there are differences from the expected output. + "$(LLVM_BIN_DIR)"/llvm-cov export \ + --summary-only \ + --instr-profile="$(TMPDIR)"/main.profdata \ + $(call BIN,"$(TMPDIR)"/main) \ + | "$(PYTHON)" prettify_json.py \ + > "$(TMPDIR)"/actual_export_coverage.json + + # Check that the exported JSON coverage data matches what we expect + $(DIFF) expected_export_coverage.json "$(TMPDIR)"/actual_export_coverage.json diff --git a/src/test/run-make-fulldeps/instrument-coverage/expected_export_coverage.json b/src/test/run-make-fulldeps/instrument-coverage/expected_export_coverage.json new file mode 100644 index 00000000000..9d739a89114 --- /dev/null +++ b/src/test/run-make-fulldeps/instrument-coverage/expected_export_coverage.json @@ -0,0 +1,59 @@ +{ + "data": [ + { + "files": [ + { + "filename": "main.rs", + "summary": { + "functions": { + "count": 7, + "covered": 5, + "percent": 71.42857142857143 + }, + "instantiations": { + "count": 8, + "covered": 6, + "percent": 75 + }, + "lines": { + "count": 30, + "covered": 25, + "percent": 83.33333333333334 + }, + "regions": { + "count": 7, + "covered": 5, + "notcovered": 2, + "percent": 71.42857142857143 + } + } + } + ], + "totals": { + "functions": { + "count": 7, + "covered": 5, + "percent": 71.42857142857143 + }, + "instantiations": { + "count": 8, + "covered": 6, + "percent": 75 + }, + "lines": { + "count": 30, + "covered": 25, + "percent": 83.33333333333334 + }, + "regions": { + "count": 7, + "covered": 5, + "notcovered": 2, + "percent": 71.42857142857143 + } + } + } + ], + "type": "llvm.coverage.json.export", + "version": "2.0.0" +} diff --git a/src/test/run-make-fulldeps/instrument-coverage/main.rs b/src/test/run-make-fulldeps/instrument-coverage/main.rs new file mode 100644 index 00000000000..358c25677ae --- /dev/null +++ b/src/test/run-make-fulldeps/instrument-coverage/main.rs @@ -0,0 +1,38 @@ +pub fn will_be_called() -> &'static str { + let val = "called"; + println!("{}", val); + val +} + +pub fn will_not_be_called() -> bool { + println!("should not have been called"); + false +} + +pub fn print<T>(left: &str, value: T, right: &str) +where + T: std::fmt::Display, +{ + println!("{}{}{}", left, value, right); +} + +pub fn wrap_with<F, T>(inner: T, should_wrap: bool, wrapper: F) +where + F: FnOnce(&T) +{ + if should_wrap { + wrapper(&inner) + } +} + +fn main() { + let less = 1; + let more = 100; + + if less < more { + wrap_with(will_be_called(), less < more, |inner| print(" ***", inner, "*** ")); + wrap_with(will_be_called(), more < less, |inner| print(" ***", inner, "*** ")); + } else { + wrap_with(will_not_be_called(), true, |inner| print("wrapped result is: ", inner, "")); + } +} diff --git a/src/test/run-make-fulldeps/instrument-coverage/prettify_json.py b/src/test/run-make-fulldeps/instrument-coverage/prettify_json.py new file mode 100644 index 00000000000..ed9279841f7 --- /dev/null +++ b/src/test/run-make-fulldeps/instrument-coverage/prettify_json.py @@ -0,0 +1,9 @@ +#!/usr/bin/env python + +import sys +import json + +# Try to decode line in order to ensure it is a valid JSON document +for line in sys.stdin: + parsed = json.loads(line) + print (json.dumps(parsed, indent=2, separators=(',', ': '), sort_keys=True)) diff --git a/src/test/run-make-fulldeps/instrument-coverage/typical_show_coverage.txt b/src/test/run-make-fulldeps/instrument-coverage/typical_show_coverage.txt new file mode 100644 index 00000000000..9c593d0809d --- /dev/null +++ b/src/test/run-make-fulldeps/instrument-coverage/typical_show_coverage.txt @@ -0,0 +1,55 @@ + 1| 2|pub fn will_be_called() -> &'static str { + 2| 2| let val = "called"; + 3| 2| println!("{}", val); + 4| 2| val + 5| 2|} + 6| | + 7| 0|pub fn will_not_be_called() -> bool { + 8| 0| println!("should not have been called"); + 9| 0| false + 10| 0|} + 11| | + 12| |pub fn print<T>(left: &str, value: T, right: &str) + 13| |where + 14| | T: std::fmt::Display, + 15| 1|{ + 16| 1| println!("{}{}{}", left, value, right); + 17| 1|} + 18| | + 19| |pub fn wrap_with<F, T>(inner: T, should_wrap: bool, wrapper: F) + 20| |where + 21| | F: FnOnce(&T) + 22| 2|{ + 23| 2| if should_wrap { + 24| 2| wrapper(&inner) + 25| 2| } + 26| 2|} + ------------------ + | main[317d481089b8c8fe]::wrap_with::<main[317d481089b8c8fe]::main::{closure#0}, &str>: + | 22| 1|{ + | 23| 1| if should_wrap { + | 24| 1| wrapper(&inner) + | 25| 1| } + | 26| 1|} + ------------------ + | main[317d481089b8c8fe]::wrap_with::<main[317d481089b8c8fe]::main::{closure#1}, &str>: + | 22| 1|{ + | 23| 1| if should_wrap { + | 24| 1| wrapper(&inner) + | 25| 1| } + | 26| 1|} + ------------------ + 27| | + 28| 1|fn main() { + 29| 1| let less = 1; + 30| 1| let more = 100; + 31| 1| + 32| 1| if less < more { + 33| 1| wrap_with(will_be_called(), less < more, |inner| print(" ***", inner, "*** ")); + 34| 1| wrap_with(will_be_called(), more < less, |inner| print(" ***", inner, "*** ")); + ^0 + 35| 1| } else { + 36| 1| wrap_with(will_not_be_called(), true, |inner| print("wrapped result is: ", inner, "")); + 37| 1| } + 38| 1|} + diff --git a/src/test/run-make-fulldeps/tools.mk b/src/test/run-make-fulldeps/tools.mk index 1effa46e101..8b885f1dc6d 100644 --- a/src/test/run-make-fulldeps/tools.mk +++ b/src/test/run-make-fulldeps/tools.mk @@ -18,6 +18,9 @@ endif HTMLDOCCK := '$(PYTHON)' '$(S)/src/etc/htmldocck.py' CGREP := "$(S)/src/etc/cat-and-grep.sh" +# diff with common flags for multi-platform diffs against text output +DIFF := diff -u --strip-trailing-cr + # This is the name of the binary we will generate and run; use this # e.g. for `$(CC) -o $(RUN_BINFILE)`. RUN_BINFILE = $(TMPDIR)/$(1) diff --git a/src/test/ui-fulldeps/macro-crate-rlib.rs b/src/test/ui-fulldeps/macro-crate-rlib.rs index b5038a58249..1fd514c6173 100644 --- a/src/test/ui-fulldeps/macro-crate-rlib.rs +++ b/src/test/ui-fulldeps/macro-crate-rlib.rs @@ -1,10 +1,8 @@ // aux-build:rlib-crate-test.rs -// ignore-tidy-linelength // ignore-cross-compile gives a different error message #![feature(plugin)] #![plugin(rlib_crate_test)] -//~^ ERROR: plugin `rlib_crate_test` only found in rlib format, but must be available in dylib format -//~| WARN use of deprecated attribute `plugin`: compiler plugins are deprecated +//~^ ERROR: plugin `rlib_crate_test` only found in rlib format, but must be available in dylib fn main() {} diff --git a/src/test/ui-fulldeps/macro-crate-rlib.stderr b/src/test/ui-fulldeps/macro-crate-rlib.stderr index 342663312a8..7b31f28a26e 100644 --- a/src/test/ui-fulldeps/macro-crate-rlib.stderr +++ b/src/test/ui-fulldeps/macro-crate-rlib.stderr @@ -1,16 +1,8 @@ error[E0457]: plugin `rlib_crate_test` only found in rlib format, but must be available in dylib format - --> $DIR/macro-crate-rlib.rs:6:11 + --> $DIR/macro-crate-rlib.rs:5:11 | LL | #![plugin(rlib_crate_test)] | ^^^^^^^^^^^^^^^ -warning: use of deprecated attribute `plugin`: compiler plugins are deprecated. See https://github.com/rust-lang/rust/pull/64675 - --> $DIR/macro-crate-rlib.rs:6:1 - | -LL | #![plugin(rlib_crate_test)] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: may be removed in a future compiler version - | - = note: `#[warn(deprecated)]` on by default - -error: aborting due to previous error; 1 warning emitted +error: aborting due to previous error diff --git a/src/test/ui/const-generics/issues/issue-62878.rs b/src/test/ui/const-generics/issues/issue-62878.rs new file mode 100644 index 00000000000..ccc05fdf100 --- /dev/null +++ b/src/test/ui/const-generics/issues/issue-62878.rs @@ -0,0 +1,11 @@ +#![feature(const_generics)] //~ WARN the feature `const_generics` is incomplete + +fn foo<const N: usize, const A: [u8; N]>() {} +//~^ ERROR the type of const parameters must not + +fn main() { + foo::<_, {[1]}>(); + //~^ ERROR wrong number of const arguments + //~| ERROR wrong number of type arguments + //~| ERROR mismatched types +} diff --git a/src/test/ui/const-generics/issues/issue-62878.stderr b/src/test/ui/const-generics/issues/issue-62878.stderr new file mode 100644 index 00000000000..fe0990d8241 --- /dev/null +++ b/src/test/ui/const-generics/issues/issue-62878.stderr @@ -0,0 +1,37 @@ +error[E0770]: the type of const parameters must not depend on other generic parameters + --> $DIR/issue-62878.rs:3:38 + | +LL | fn foo<const N: usize, const A: [u8; N]>() {} + | ^ the type must not depend on the parameter `N` + +warning: the feature `const_generics` is incomplete and may not be safe to use and/or cause compiler crashes + --> $DIR/issue-62878.rs:1:12 + | +LL | #![feature(const_generics)] + | ^^^^^^^^^^^^^^ + | + = note: `#[warn(incomplete_features)]` on by default + = note: see issue #44580 <https://github.com/rust-lang/rust/issues/44580> for more information + +error[E0107]: wrong number of const arguments: expected 2, found 1 + --> $DIR/issue-62878.rs:7:5 + | +LL | foo::<_, {[1]}>(); + | ^^^^^^^^^^^^^^^ expected 2 const arguments + +error[E0107]: wrong number of type arguments: expected 0, found 1 + --> $DIR/issue-62878.rs:7:11 + | +LL | foo::<_, {[1]}>(); + | ^ unexpected type argument + +error[E0308]: mismatched types + --> $DIR/issue-62878.rs:7:15 + | +LL | foo::<_, {[1]}>(); + | ^^^ expected `usize`, found array `[{integer}; 1]` + +error: aborting due to 4 previous errors; 1 warning emitted + +Some errors have detailed explanations: E0107, E0308, E0770. +For more information about an error, try `rustc --explain E0107`. diff --git a/src/test/ui/consts/const_unsafe_unreachable.rs b/src/test/ui/consts/const_unsafe_unreachable.rs new file mode 100644 index 00000000000..cfed6e5deb9 --- /dev/null +++ b/src/test/ui/consts/const_unsafe_unreachable.rs @@ -0,0 +1,17 @@ +// run-pass + +#![feature(const_fn)] +#![feature(const_unreachable_unchecked)] + +const unsafe fn foo(x: bool) -> bool { + match x { + true => true, + false => std::hint::unreachable_unchecked(), + } +} + +const BAR: bool = unsafe { foo(true) }; + +fn main() { + assert_eq!(BAR, true); +} diff --git a/src/test/ui/consts/const_unsafe_unreachable_ub.rs b/src/test/ui/consts/const_unsafe_unreachable_ub.rs new file mode 100644 index 00000000000..11920d852e0 --- /dev/null +++ b/src/test/ui/consts/const_unsafe_unreachable_ub.rs @@ -0,0 +1,20 @@ +// build-fail + +#![feature(const_fn)] +#![feature(const_unreachable_unchecked)] + +const unsafe fn foo(x: bool) -> bool { + match x { + true => true, + false => std::hint::unreachable_unchecked(), + } +} + +#[warn(const_err)] +const BAR: bool = unsafe { foo(false) }; + +fn main() { + assert_eq!(BAR, true); + //~^ ERROR E0080 + //~| ERROR erroneous constant +} diff --git a/src/test/ui/consts/const_unsafe_unreachable_ub.stderr b/src/test/ui/consts/const_unsafe_unreachable_ub.stderr new file mode 100644 index 00000000000..3ef8043a54d --- /dev/null +++ b/src/test/ui/consts/const_unsafe_unreachable_ub.stderr @@ -0,0 +1,44 @@ +warning: any use of this value will cause an error + --> $SRC_DIR/libcore/hint.rs:LL:COL + | +LL | unsafe { intrinsics::unreachable() } + | ^^^^^^^^^^^^^^^^^^^^^^^^^ + | | + | entering unreachable code + | inside `std::hint::unreachable_unchecked` at $SRC_DIR/libcore/hint.rs:LL:COL + | inside `foo` at $DIR/const_unsafe_unreachable_ub.rs:9:18 + | inside `BAR` at $DIR/const_unsafe_unreachable_ub.rs:14:28 + | + ::: $DIR/const_unsafe_unreachable_ub.rs:14:1 + | +LL | const BAR: bool = unsafe { foo(false) }; + | ---------------------------------------- + | +note: the lint level is defined here + --> $DIR/const_unsafe_unreachable_ub.rs:13:8 + | +LL | #[warn(const_err)] + | ^^^^^^^^^ + +error[E0080]: evaluation of constant expression failed + --> $DIR/const_unsafe_unreachable_ub.rs:17:3 + | +LL | assert_eq!(BAR, true); + | ^^^^^^^^^^^---^^^^^^^^ + | | + | referenced constant has errors + | + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) + +error: erroneous constant used + --> $DIR/const_unsafe_unreachable_ub.rs:17:3 + | +LL | assert_eq!(BAR, true); + | ^^^^^^^^^^^^^^^^^^^^^^ referenced constant has errors + | + = note: `#[deny(const_err)]` on by default + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) + +error: aborting due to 2 previous errors; 1 warning emitted + +For more information about this error, try `rustc --explain E0080`. diff --git a/src/test/ui/extern/extern-prelude-no-speculative.rs b/src/test/ui/extern/extern-prelude-no-speculative.rs index cc00737ab59..3ba124159e0 100644 --- a/src/test/ui/extern/extern-prelude-no-speculative.rs +++ b/src/test/ui/extern/extern-prelude-no-speculative.rs @@ -1,6 +1,6 @@ // run-pass #![allow(unused_variables)] -// compile-flags: --extern LooksLikeExternCrate +// compile-flags: --extern LooksLikeExternCrate=/path/to/nowhere mod m { pub struct LooksLikeExternCrate; diff --git a/src/test/ui/rfc-2457/crate_name_nonascii_forbidden-1.rs b/src/test/ui/rfc-2457/crate_name_nonascii_forbidden-1.rs index 3fb1cf9f557..310545b92d5 100644 --- a/src/test/ui/rfc-2457/crate_name_nonascii_forbidden-1.rs +++ b/src/test/ui/rfc-2457/crate_name_nonascii_forbidden-1.rs @@ -1,6 +1,5 @@ #![feature(non_ascii_idents)] extern crate ьаг; //~ ERROR cannot load a crate with a non-ascii name `ьаг` -//~| ERROR can't find crate for `ьаг` fn main() {} diff --git a/src/test/ui/rfc-2457/crate_name_nonascii_forbidden-1.stderr b/src/test/ui/rfc-2457/crate_name_nonascii_forbidden-1.stderr index 1e424237fd2..11108f2fb86 100644 --- a/src/test/ui/rfc-2457/crate_name_nonascii_forbidden-1.stderr +++ b/src/test/ui/rfc-2457/crate_name_nonascii_forbidden-1.stderr @@ -4,12 +4,5 @@ error: cannot load a crate with a non-ascii name `ьаг` LL | extern crate ьаг; | ^^^^^^^^^^^^^^^^^ -error[E0463]: can't find crate for `ьаг` - --> $DIR/crate_name_nonascii_forbidden-1.rs:3:1 - | -LL | extern crate ьаг; - | ^^^^^^^^^^^^^^^^^ can't find crate - -error: aborting due to 2 previous errors +error: aborting due to previous error -For more information about this error, try `rustc --explain E0463`. diff --git a/src/test/ui/rfc-2457/crate_name_nonascii_forbidden-2.rs b/src/test/ui/rfc-2457/crate_name_nonascii_forbidden-2.rs index e1acdbff061..0249848b35a 100644 --- a/src/test/ui/rfc-2457/crate_name_nonascii_forbidden-2.rs +++ b/src/test/ui/rfc-2457/crate_name_nonascii_forbidden-2.rs @@ -3,7 +3,5 @@ #![feature(non_ascii_idents)] use му_сгате::baz; //~ ERROR cannot load a crate with a non-ascii name `му_сгате` - //~| can't find crate for `му_сгате` - fn main() {} diff --git a/src/test/ui/rfc-2457/crate_name_nonascii_forbidden-2.stderr b/src/test/ui/rfc-2457/crate_name_nonascii_forbidden-2.stderr index c06405ebb37..8d3548ed33d 100644 --- a/src/test/ui/rfc-2457/crate_name_nonascii_forbidden-2.stderr +++ b/src/test/ui/rfc-2457/crate_name_nonascii_forbidden-2.stderr @@ -4,12 +4,5 @@ error: cannot load a crate with a non-ascii name `му_сгате` LL | use му_сгате::baz; | ^^^^^^^^ -error[E0463]: can't find crate for `му_сгате` - --> $DIR/crate_name_nonascii_forbidden-2.rs:5:5 - | -LL | use му_сгате::baz; - | ^^^^^^^^ can't find crate - -error: aborting due to 2 previous errors +error: aborting due to previous error -For more information about this error, try `rustc --explain E0463`. |
