diff options
Diffstat (limited to 'tests')
96 files changed, 693 insertions, 161 deletions
diff --git a/tests/crashes/132766.rs b/tests/crashes/132766.rs deleted file mode 100644 index 5f5117d77a5..00000000000 --- a/tests/crashes/132766.rs +++ /dev/null @@ -1,9 +0,0 @@ -//@ known-bug: #132766 - -trait Trait {} -impl<'a> Trait for () { - fn pass2<'a>() -> impl Trait2 {} -} - -trait Trait2 {} -impl Trait2 for () {} diff --git a/tests/run-make/libtest-json/output-default.json b/tests/run-make/libtest-json/output-default.json index a2293a032d0..a6a8a9f3b47 100644 --- a/tests/run-make/libtest-json/output-default.json +++ b/tests/run-make/libtest-json/output-default.json @@ -2,7 +2,7 @@ { "type": "test", "event": "started", "name": "a" } { "type": "test", "name": "a", "event": "ok" } { "type": "test", "event": "started", "name": "b" } -{ "type": "test", "name": "b", "event": "failed", "stdout": "thread 'b' panicked at f.rs:9:5:\nassertion failed: false\nnote: run with `RUST_BACKTRACE=1` environment variable to display a backtrace\n" } +{ "type": "test", "name": "b", "event": "failed", "stdout": "\nthread 'b' panicked at f.rs:9:5:\nassertion failed: false\nnote: run with `RUST_BACKTRACE=1` environment variable to display a backtrace\n" } { "type": "test", "event": "started", "name": "c" } { "type": "test", "name": "c", "event": "ok" } { "type": "test", "event": "started", "name": "d" } diff --git a/tests/run-make/libtest-json/output-stdout-success.json b/tests/run-make/libtest-json/output-stdout-success.json index cf92f01f63a..a6c36e746b3 100644 --- a/tests/run-make/libtest-json/output-stdout-success.json +++ b/tests/run-make/libtest-json/output-stdout-success.json @@ -2,9 +2,9 @@ { "type": "test", "event": "started", "name": "a" } { "type": "test", "name": "a", "event": "ok", "stdout": "print from successful test\n" } { "type": "test", "event": "started", "name": "b" } -{ "type": "test", "name": "b", "event": "failed", "stdout": "thread 'b' panicked at f.rs:9:5:\nassertion failed: false\nnote: run with `RUST_BACKTRACE=1` environment variable to display a backtrace\n" } +{ "type": "test", "name": "b", "event": "failed", "stdout": "\nthread 'b' panicked at f.rs:9:5:\nassertion failed: false\nnote: run with `RUST_BACKTRACE=1` environment variable to display a backtrace\n" } { "type": "test", "event": "started", "name": "c" } -{ "type": "test", "name": "c", "event": "ok", "stdout": "thread 'c' panicked at f.rs:15:5:\nassertion failed: false\n" } +{ "type": "test", "name": "c", "event": "ok", "stdout": "\nthread 'c' panicked at f.rs:15:5:\nassertion failed: false\n" } { "type": "test", "event": "started", "name": "d" } { "type": "test", "name": "d", "event": "ignored", "message": "msg" } { "type": "suite", "event": "failed", "passed": 2, "failed": 1, "ignored": 1, "measured": 0, "filtered_out": 0, "exec_time": "$EXEC_TIME" } diff --git a/tests/run-make/libtest-junit/output-default.xml b/tests/run-make/libtest-junit/output-default.xml index 58a9a28744f..aa1b8c855aa 100644 --- a/tests/run-make/libtest-junit/output-default.xml +++ b/tests/run-make/libtest-junit/output-default.xml @@ -1 +1 @@ -<?xml version="1.0" encoding="UTF-8"?><testsuites><testsuite name="test" package="test" id="0" errors="0" failures="1" tests="4" skipped="1" ><testcase classname="unknown" name="a" time="$TIME"/><testcase classname="unknown" name="b" time="$TIME"><failure type="assert"/><system-out><![CDATA[print from failing test]]>
<![CDATA[thread 'b' panicked at f.rs:10:5:]]>
<![CDATA[assertion failed: false]]>
<![CDATA[note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace]]>
<![CDATA[]]></system-out></testcase><testcase classname="unknown" name="c" time="$TIME"/><system-out/><system-err/></testsuite></testsuites> +<?xml version="1.0" encoding="UTF-8"?><testsuites><testsuite name="test" package="test" id="0" errors="0" failures="1" tests="4" skipped="1" ><testcase classname="unknown" name="a" time="$TIME"/><testcase classname="unknown" name="b" time="$TIME"><failure type="assert"/><system-out><![CDATA[print from failing test]]>

<![CDATA[thread 'b' panicked at f.rs:10:5:]]>
<![CDATA[assertion failed: false]]>
<![CDATA[note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace]]>
<![CDATA[]]></system-out></testcase><testcase classname="unknown" name="c" time="$TIME"/><system-out/><system-err/></testsuite></testsuites> diff --git a/tests/run-make/libtest-junit/output-stdout-success.xml b/tests/run-make/libtest-junit/output-stdout-success.xml index 723816a4acd..2592ec7efb1 100644 --- a/tests/run-make/libtest-junit/output-stdout-success.xml +++ b/tests/run-make/libtest-junit/output-stdout-success.xml @@ -1 +1 @@ -<?xml version="1.0" encoding="UTF-8"?><testsuites><testsuite name="test" package="test" id="0" errors="0" failures="1" tests="4" skipped="1" ><testcase classname="unknown" name="a" time="$TIME"><system-out><![CDATA[print from successful test]]>
<![CDATA[]]></system-out></testcase><testcase classname="unknown" name="b" time="$TIME"><failure type="assert"/><system-out><![CDATA[print from failing test]]>
<![CDATA[thread 'b' panicked at f.rs:10:5:]]>
<![CDATA[assertion failed: false]]>
<![CDATA[note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace]]>
<![CDATA[]]></system-out></testcase><testcase classname="unknown" name="c" time="$TIME"><system-out><![CDATA[thread 'c' panicked at f.rs:16:5:]]>
<![CDATA[assertion failed: false]]>
<![CDATA[]]></system-out></testcase><system-out/><system-err/></testsuite></testsuites> +<?xml version="1.0" encoding="UTF-8"?><testsuites><testsuite name="test" package="test" id="0" errors="0" failures="1" tests="4" skipped="1" ><testcase classname="unknown" name="a" time="$TIME"><system-out><![CDATA[print from successful test]]>
<![CDATA[]]></system-out></testcase><testcase classname="unknown" name="b" time="$TIME"><failure type="assert"/><system-out><![CDATA[print from failing test]]>

<![CDATA[thread 'b' panicked at f.rs:10:5:]]>
<![CDATA[assertion failed: false]]>
<![CDATA[note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace]]>
<![CDATA[]]></system-out></testcase><testcase classname="unknown" name="c" time="$TIME"><system-out><![CDATA[]]>
<![CDATA[thread 'c' panicked at f.rs:16:5:]]>
<![CDATA[assertion failed: false]]>
<![CDATA[]]></system-out></testcase><system-out/><system-err/></testsuite></testsuites> diff --git a/tests/rustdoc-gui/item-info.goml b/tests/rustdoc-gui/item-info.goml index b5b0052fe61..647a2fd290d 100644 --- a/tests/rustdoc-gui/item-info.goml +++ b/tests/rustdoc-gui/item-info.goml @@ -45,3 +45,26 @@ compare-elements-css: ( "#main-content > .item-info .stab:nth-of-type(2)", ["height"], ) + +// Now checking the text color and the links color. +show-text: true +include: "utils.goml" +go-to: "file://" + |DOC_PATH| + "/lib2/trait.Trait.html" + +call-function: ("switch-theme", {"theme": "ayu"}) +assert-css: (".item-info .stab", {"color": "rgb(197, 197, 197)"}, ALL) +assert-css: (".item-info .stab strong", {"color": "rgb(197, 197, 197)"}, ALL) +assert-css: (".item-info .stab span", {"color": "rgb(197, 197, 197)"}, ALL) +assert-css: (".item-info .stab a", {"color": "rgb(57, 175, 215)"}, ALL) + +call-function: ("switch-theme", {"theme": "dark"}) +assert-css: (".item-info .stab", {"color": "rgb(221, 221, 221)"}, ALL) +assert-css: (".item-info .stab strong", {"color": "rgb(221, 221, 221)"}, ALL) +assert-css: (".item-info .stab span", {"color": "rgb(221, 221, 221)"}, ALL) +assert-css: (".item-info .stab a", {"color": "rgb(210, 153, 29)"}, ALL) + +call-function: ("switch-theme", {"theme": "light"}) +assert-css: (".item-info .stab", {"color": "rgb(0, 0, 0)"}, ALL) +assert-css: (".item-info .stab strong", {"color": "rgb(0, 0, 0)"}, ALL) +assert-css: (".item-info .stab span", {"color": "rgb(0, 0, 0)"}, ALL) +assert-css: (".item-info .stab a", {"color": "rgb(56, 115, 173)"}, ALL) diff --git a/tests/rustdoc-ui/doctest/failed-doctest-output-windows.stdout b/tests/rustdoc-ui/doctest/failed-doctest-output-windows.stdout index 1b37249dd60..7aa965d543b 100644 --- a/tests/rustdoc-ui/doctest/failed-doctest-output-windows.stdout +++ b/tests/rustdoc-ui/doctest/failed-doctest-output-windows.stdout @@ -26,6 +26,7 @@ stdout 2 stderr: stderr 1 stderr 2 + thread 'main' panicked at $DIR/failed-doctest-output-windows.rs:7:1: oh no note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace diff --git a/tests/rustdoc-ui/doctest/failed-doctest-output.stdout b/tests/rustdoc-ui/doctest/failed-doctest-output.stdout index 7b0cf9a432d..a333f341ce5 100644 --- a/tests/rustdoc-ui/doctest/failed-doctest-output.stdout +++ b/tests/rustdoc-ui/doctest/failed-doctest-output.stdout @@ -26,6 +26,7 @@ stdout 2 stderr: stderr 1 stderr 2 + thread 'main' panicked at $DIR/failed-doctest-output.rs:7:1: oh no note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace diff --git a/tests/rustdoc-ui/doctest/non-local-defs-impl.rs b/tests/rustdoc-ui/doctest/non-local-defs-impl.rs index 04fdd285506..f2540574f15 100644 --- a/tests/rustdoc-ui/doctest/non-local-defs-impl.rs +++ b/tests/rustdoc-ui/doctest/non-local-defs-impl.rs @@ -21,7 +21,7 @@ /// } /// ``` /// -/// But this shoudln't produce a warning: +/// But this shouldn't produce a warning: /// ```rust,no_run /// # extern crate pub_trait; /// # use pub_trait::Trait; diff --git a/tests/rustdoc-ui/ice-bug-report-url.stderr b/tests/rustdoc-ui/ice-bug-report-url.stderr index 66622a7654c..14a961c2ce0 100644 --- a/tests/rustdoc-ui/ice-bug-report-url.stderr +++ b/tests/rustdoc-ui/ice-bug-report-url.stderr @@ -5,6 +5,7 @@ LL | fn wrong() | ^ expected one of `->`, `where`, or `{` + aborting due to `-Z treat-err-as-bug=1` stack backtrace: diff --git a/tests/rustdoc-ui/remap-path-prefix-failed-doctest-output.stdout b/tests/rustdoc-ui/remap-path-prefix-failed-doctest-output.stdout index 2102e2c3891..87d1e772b80 100644 --- a/tests/rustdoc-ui/remap-path-prefix-failed-doctest-output.stdout +++ b/tests/rustdoc-ui/remap-path-prefix-failed-doctest-output.stdout @@ -8,6 +8,7 @@ failures: Test executable failed (exit status: 101). stderr: + thread 'main' panicked at remapped_path/remap-path-prefix-failed-doctest-output.rs:3:1: oh no note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace diff --git a/tests/rustdoc/auxiliary/unsafe-binder-dep.rs b/tests/rustdoc/auxiliary/unsafe-binder-dep.rs new file mode 100644 index 00000000000..65aa9032fed --- /dev/null +++ b/tests/rustdoc/auxiliary/unsafe-binder-dep.rs @@ -0,0 +1,4 @@ +#![feature(unsafe_binders)] +#![allow(incomplete_features)] + +pub fn woof() -> unsafe<'a> &'a str { todo!() } diff --git a/tests/rustdoc/type-alias/deeply-nested-112515.rs b/tests/rustdoc/type-alias/deeply-nested-112515.rs index 161188ee576..9530feb78de 100644 --- a/tests/rustdoc/type-alias/deeply-nested-112515.rs +++ b/tests/rustdoc/type-alias/deeply-nested-112515.rs @@ -1,6 +1,6 @@ // Regression test for <https://github.com/rust-lang/rust/issues/112515>. // It's to ensure that this code doesn't have infinite loop in rustdoc when -// trying to retrive type alias implementations. +// trying to retrieve type alias implementations. // ignore-tidy-linelength diff --git a/tests/rustdoc/unsafe-binder.rs b/tests/rustdoc/unsafe-binder.rs new file mode 100644 index 00000000000..621c3dadc72 --- /dev/null +++ b/tests/rustdoc/unsafe-binder.rs @@ -0,0 +1,15 @@ +//@ aux-build:unsafe-binder-dep.rs + +#![feature(unsafe_binders)] +#![allow(incomplete_features)] + +extern crate unsafe_binder_dep; + +//@ has 'unsafe_binder/fn.woof.html' //pre "fn woof() -> unsafe<'a> &'a str" +pub use unsafe_binder_dep::woof; + +//@ has 'unsafe_binder/fn.meow.html' //pre "fn meow() -> unsafe<'a> &'a str" +pub fn meow() -> unsafe<'a> &'a str { todo!() } + +//@ has 'unsafe_binder/fn.meow_squared.html' //pre "fn meow_squared() -> unsafe<'b, 'a> &'a &'b str" +pub fn meow_squared() -> unsafe<'b, 'a> &'a &'b str { todo!() } diff --git a/tests/ui/async-await/async-closures/async-future-out-must-be-sized.rs b/tests/ui/async-await/async-closures/async-future-out-must-be-sized.rs new file mode 100644 index 00000000000..e5d70e30eb5 --- /dev/null +++ b/tests/ui/async-await/async-closures/async-future-out-must-be-sized.rs @@ -0,0 +1,20 @@ +//@ edition: 2021 + +// Ensure that the output of a `fn` pointer that implements `AsyncFn*` is `Sized`, +// like other built-in impls of an fn pointer, like `Fn*`. + +use std::future::Future; + +fn foo() -> fn() -> dyn Future<Output = ()> { + todo!() +} + +async fn is_async_fn(f: impl AsyncFn()) { + f().await; +} + +fn main() { + is_async_fn(foo()); + //~^ ERROR the size for values of type `dyn Future<Output = ()>` cannot be known at compilation time + //~| ERROR the size for values of type `dyn Future<Output = ()>` cannot be known at compilation time +} diff --git a/tests/ui/async-await/async-closures/async-future-out-must-be-sized.stderr b/tests/ui/async-await/async-closures/async-future-out-must-be-sized.stderr new file mode 100644 index 00000000000..f993247d8b9 --- /dev/null +++ b/tests/ui/async-await/async-closures/async-future-out-must-be-sized.stderr @@ -0,0 +1,31 @@ +error[E0277]: the size for values of type `dyn Future<Output = ()>` cannot be known at compilation time + --> $DIR/async-future-out-must-be-sized.rs:17:17 + | +LL | is_async_fn(foo()); + | ----------- ^^^^^ doesn't have a size known at compile-time + | | + | required by a bound introduced by this call + | + = help: the trait `Sized` is not implemented for `dyn Future<Output = ()>` +note: required by a bound in `is_async_fn` + --> $DIR/async-future-out-must-be-sized.rs:12:30 + | +LL | async fn is_async_fn(f: impl AsyncFn()) { + | ^^^^^^^^^ required by this bound in `is_async_fn` + +error[E0277]: the size for values of type `dyn Future<Output = ()>` cannot be known at compilation time + --> $DIR/async-future-out-must-be-sized.rs:17:5 + | +LL | is_async_fn(foo()); + | ^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time + | + = help: the trait `Sized` is not implemented for `dyn Future<Output = ()>` +note: required by a bound in `is_async_fn` + --> $DIR/async-future-out-must-be-sized.rs:12:30 + | +LL | async fn is_async_fn(f: impl AsyncFn()) { + | ^^^^^^^^^ required by this bound in `is_async_fn` + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0277`. diff --git a/tests/ui/backtrace/synchronized-panic-handler.run.stderr b/tests/ui/backtrace/synchronized-panic-handler.run.stderr index 8a06d00ea59..7a60ef2da60 100644 --- a/tests/ui/backtrace/synchronized-panic-handler.run.stderr +++ b/tests/ui/backtrace/synchronized-panic-handler.run.stderr @@ -1,5 +1,7 @@ + thread '<unnamed>' panicked at $DIR/synchronized-panic-handler.rs:11:5: oops oh no woe is me note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace + thread '<unnamed>' panicked at $DIR/synchronized-panic-handler.rs:11:5: oops oh no woe is me diff --git a/tests/ui/borrowck/index-mut-help.stderr b/tests/ui/borrowck/index-mut-help.stderr index fde2b5dc076..c4c9c1c5313 100644 --- a/tests/ui/borrowck/index-mut-help.stderr +++ b/tests/ui/borrowck/index-mut-help.stderr @@ -5,7 +5,10 @@ LL | map["peter"].clear(); | ^^^^^^^^^^^^ cannot borrow as mutable | = help: trait `IndexMut` is required to modify indexed content, but it is not implemented for `HashMap<&str, String>` - = help: to modify a `HashMap<&str, String>`, use `.get_mut()`, `.insert()` or the entry API +help: to modify a `HashMap<&str, String>` use `.get_mut()` + | +LL | if let Some(val) = map.get_mut("peter") { val.clear(); }; + | ++++++++++++++++++ ~~~~~~~~~ ~~~~~~~ +++ error[E0594]: cannot assign to data in an index of `HashMap<&str, String>` --> $DIR/index-mut-help.rs:11:5 @@ -14,12 +17,12 @@ LL | map["peter"] = "0".to_string(); | ^^^^^^^^^^^^ cannot assign | = help: trait `IndexMut` is required to modify indexed content, but it is not implemented for `HashMap<&str, String>` -help: to modify a `HashMap<&str, String>`, use `.get_mut()`, `.insert()` or the entry API +help: use `.insert()` to insert a value into a `HashMap<&str, String>`, `.get_mut()` to modify it, or the entry API for more flexibility | LL | map.insert("peter", "0".to_string()); | ~~~~~~~~ ~ + -LL | map.get_mut("peter").map(|val| { *val = "0".to_string(); }); - | ~~~~~~~~~ ~~~~~~~~~~~~~~~~~~ ++++ +LL | if let Some(val) = map.get_mut("peter") { *val = "0".to_string(); }; + | ++++++++++++++++++ ~~~~~~~~~ ~~~~~~~~ +++ LL | let val = map.entry("peter").or_insert("0".to_string()); | +++++++++ ~~~~~~~ ~~~~~~~~~~~~ + diff --git a/tests/ui/btreemap/btreemap-index-mut-2.stderr b/tests/ui/btreemap/btreemap-index-mut-2.stderr index 0b8c77cb9e1..c42462ee1eb 100644 --- a/tests/ui/btreemap/btreemap-index-mut-2.stderr +++ b/tests/ui/btreemap/btreemap-index-mut-2.stderr @@ -5,12 +5,12 @@ LL | map[&0] = 1; | ^^^^^^^^^^^ cannot assign | = help: trait `IndexMut` is required to modify indexed content, but it is not implemented for `BTreeMap<u32, u32>` -help: to modify a `BTreeMap<u32, u32>`, use `.get_mut()`, `.insert()` or the entry API +help: use `.insert()` to insert a value into a `BTreeMap<u32, u32>`, `.get_mut()` to modify it, or the entry API for more flexibility | LL | map.insert(&0, 1); | ~~~~~~~~ ~ + -LL | map.get_mut(&0).map(|val| { *val = 1; }); - | ~~~~~~~~~ ~~~~~~~~~~~~~~~~~~ ++++ +LL | if let Some(val) = map.get_mut(&0) { *val = 1; }; + | ++++++++++++++++++ ~~~~~~~~~ ~~~~~~~~ +++ LL | let val = map.entry(&0).or_insert(1); | +++++++++ ~~~~~~~ ~~~~~~~~~~~~ + diff --git a/tests/ui/btreemap/btreemap-index-mut.stderr b/tests/ui/btreemap/btreemap-index-mut.stderr index cc465fbf3de..f402f503c15 100644 --- a/tests/ui/btreemap/btreemap-index-mut.stderr +++ b/tests/ui/btreemap/btreemap-index-mut.stderr @@ -5,12 +5,12 @@ LL | map[&0] = 1; | ^^^^^^^^^^^ cannot assign | = help: trait `IndexMut` is required to modify indexed content, but it is not implemented for `BTreeMap<u32, u32>` -help: to modify a `BTreeMap<u32, u32>`, use `.get_mut()`, `.insert()` or the entry API +help: use `.insert()` to insert a value into a `BTreeMap<u32, u32>`, `.get_mut()` to modify it, or the entry API for more flexibility | LL | map.insert(&0, 1); | ~~~~~~~~ ~ + -LL | map.get_mut(&0).map(|val| { *val = 1; }); - | ~~~~~~~~~ ~~~~~~~~~~~~~~~~~~ ++++ +LL | if let Some(val) = map.get_mut(&0) { *val = 1; }; + | ++++++++++++++++++ ~~~~~~~~~ ~~~~~~~~ +++ LL | let val = map.entry(&0).or_insert(1); | +++++++++ ~~~~~~~ ~~~~~~~~~~~~ + diff --git a/tests/ui/closures/2229_closure_analysis/issue-118144.rs b/tests/ui/closures/2229_closure_analysis/issue-118144.rs index 3e5d9f9739a..5747cc75e98 100644 --- a/tests/ui/closures/2229_closure_analysis/issue-118144.rs +++ b/tests/ui/closures/2229_closure_analysis/issue-118144.rs @@ -6,7 +6,7 @@ fn func(func_arg: &mut V) { || { // Declaring `x` separately instead of using // a destructuring binding like `let V(x) = ...` - // becaue only `V(x) = ...` triggers the ICE + // because only `V(x) = ...` triggers the ICE let x; V(x) = func_arg; //~ ERROR: mismatched types func_arg.0 = 0; diff --git a/tests/ui/const-generics/generic_const_exprs/issue-80742.stderr b/tests/ui/const-generics/generic_const_exprs/issue-80742.stderr index 01529599d37..c851a8380f2 100644 --- a/tests/ui/const-generics/generic_const_exprs/issue-80742.stderr +++ b/tests/ui/const-generics/generic_const_exprs/issue-80742.stderr @@ -1,6 +1,7 @@ error: internal compiler error: compiler/rustc_const_eval/src/interpret/operator.rs:LL:CC: unsized type for `NullaryOp::SizeOf` --> $SRC_DIR/core/src/mem/mod.rs:LL:COL + Box<dyn Any> query stack during panic: #0 [eval_to_allocation_raw] const-evaluating + checking `<impl at $DIR/issue-80742.rs:26:1: 28:32>::{constant#0}` diff --git a/tests/ui/consts/const-eval/const-eval-query-stack.stderr b/tests/ui/consts/const-eval/const-eval-query-stack.stderr index 0a28c5b80bf..5a71c770fdc 100644 --- a/tests/ui/consts/const-eval/const-eval-query-stack.stderr +++ b/tests/ui/consts/const-eval/const-eval-query-stack.stderr @@ -4,6 +4,7 @@ error: internal compiler error[E0080]: evaluation of constant value failed LL | const X: i32 = 1 / 0; | ^^^^^ attempt to divide `1_i32` by zero + note: please make sure that you have updated to the latest nightly query stack during panic: diff --git a/tests/ui/coroutine/issue-53548.rs b/tests/ui/coroutine/issue-53548.rs index 3b8dff2be28..c70f3e5a0d0 100644 --- a/tests/ui/coroutine/issue-53548.rs +++ b/tests/ui/coroutine/issue-53548.rs @@ -6,7 +6,7 @@ // to process this `'r` region bound. In particular, to be WF, the // region bound must meet the requirements of the trait, and hence we // got `for<'r> { 'r: 'static }`. This would ICE because the `Binder` -// constructor we were using was assering that no higher-ranked +// constructor we were using was asserting that no higher-ranked // regions were involved (because the WF code is supposed to skip // those). The error (if debug-asserions were disabled) came because // we obviously cannot prove that `'r: 'static` for any region `'r`. diff --git a/tests/ui/duplicate/multiple-types-with-same-name-and-derive.rs b/tests/ui/duplicate/multiple-types-with-same-name-and-derive.rs index 8d36981b41b..72375eb0b3e 100644 --- a/tests/ui/duplicate/multiple-types-with-same-name-and-derive.rs +++ b/tests/ui/duplicate/multiple-types-with-same-name-and-derive.rs @@ -1,6 +1,6 @@ // Here, there are two types with the same name. One of these has a `derive` annotation, but in the // expansion these `impl`s are associated to the the *other* type. There is a suggestion to remove -// unneded type parameters, but because we're now point at a type with no type parameters, the +// unneeded type parameters, but because we're now point at a type with no type parameters, the // suggestion would suggest removing code from an empty span, which would ICE in nightly. // // issue: rust-lang/rust#108748 diff --git a/tests/ui/extern/extern-types-field-offset.run.stderr b/tests/ui/extern/extern-types-field-offset.run.stderr index 1b04b860db5..07bd4fcb13f 100644 --- a/tests/ui/extern/extern-types-field-offset.run.stderr +++ b/tests/ui/extern/extern-types-field-offset.run.stderr @@ -1,3 +1,4 @@ + thread 'main' panicked at library/core/src/panicking.rs:$LINE:$COL: attempted to compute the size or alignment of extern type `Opaque` note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace diff --git a/tests/ui/extern/extern-types-size_of_val.align.run.stderr b/tests/ui/extern/extern-types-size_of_val.align.run.stderr index 20c4d8785e8..5ba372d60fa 100644 --- a/tests/ui/extern/extern-types-size_of_val.align.run.stderr +++ b/tests/ui/extern/extern-types-size_of_val.align.run.stderr @@ -1,3 +1,4 @@ + thread 'main' panicked at library/core/src/panicking.rs:$LINE:$COL: attempted to compute the size or alignment of extern type `A` note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace diff --git a/tests/ui/extern/extern-types-size_of_val.size.run.stderr b/tests/ui/extern/extern-types-size_of_val.size.run.stderr index 20c4d8785e8..5ba372d60fa 100644 --- a/tests/ui/extern/extern-types-size_of_val.size.run.stderr +++ b/tests/ui/extern/extern-types-size_of_val.size.run.stderr @@ -1,3 +1,4 @@ + thread 'main' panicked at library/core/src/panicking.rs:$LINE:$COL: attempted to compute the size or alignment of extern type `A` note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace diff --git a/tests/ui/fmt/suggest-wrongly-order-format-parameter.fixed b/tests/ui/fmt/suggest-wrongly-order-format-parameter.fixed new file mode 100644 index 00000000000..a080a65854a --- /dev/null +++ b/tests/ui/fmt/suggest-wrongly-order-format-parameter.fixed @@ -0,0 +1,25 @@ +//! Regression test for https://github.com/rust-lang/rust/issues/129966 +//! +//! Ensure we provide suggestion for wrongly ordered format parameters. + +//@ run-rustfix +#![allow(dead_code)] + +#[derive(Debug)] +struct Foo(u8, u8); + +fn main() { + let f = Foo(1, 2); + + println!("{f:#?}"); + //~^ ERROR invalid format string: expected `}`, found `#` + //~| HELP did you mean `#?`? + + println!("{f:x?}"); + //~^ ERROR invalid format string: expected `}`, found `x` + //~| HELP did you mean `x?`? + + println!("{f:X?}"); + //~^ ERROR invalid format string: expected `}`, found `X` + //~| HELP did you mean `X?`? +} diff --git a/tests/ui/fmt/suggest-wrongly-order-format-parameter.rs b/tests/ui/fmt/suggest-wrongly-order-format-parameter.rs new file mode 100644 index 00000000000..830dafd4479 --- /dev/null +++ b/tests/ui/fmt/suggest-wrongly-order-format-parameter.rs @@ -0,0 +1,25 @@ +//! Regression test for https://github.com/rust-lang/rust/issues/129966 +//! +//! Ensure we provide suggestion for wrongly ordered format parameters. + +//@ run-rustfix +#![allow(dead_code)] + +#[derive(Debug)] +struct Foo(u8, u8); + +fn main() { + let f = Foo(1, 2); + + println!("{f:?#}"); + //~^ ERROR invalid format string: expected `}`, found `#` + //~| HELP did you mean `#?`? + + println!("{f:?x}"); + //~^ ERROR invalid format string: expected `}`, found `x` + //~| HELP did you mean `x?`? + + println!("{f:?X}"); + //~^ ERROR invalid format string: expected `}`, found `X` + //~| HELP did you mean `X?`? +} diff --git a/tests/ui/fmt/suggest-wrongly-order-format-parameter.stderr b/tests/ui/fmt/suggest-wrongly-order-format-parameter.stderr new file mode 100644 index 00000000000..fe693d2e904 --- /dev/null +++ b/tests/ui/fmt/suggest-wrongly-order-format-parameter.stderr @@ -0,0 +1,35 @@ +error: invalid format string: expected `}`, found `#` + --> $DIR/suggest-wrongly-order-format-parameter.rs:14:19 + | +LL | println!("{f:?#}"); + | ^ expected `'}'` in format string + | +help: did you mean `#?`? + | +LL | println!("{f:#?}"); + | ~~ + +error: invalid format string: expected `}`, found `x` + --> $DIR/suggest-wrongly-order-format-parameter.rs:18:19 + | +LL | println!("{f:?x}"); + | ^ expected `'}'` in format string + | +help: did you mean `x?`? + | +LL | println!("{f:x?}"); + | ~~ + +error: invalid format string: expected `}`, found `X` + --> $DIR/suggest-wrongly-order-format-parameter.rs:22:19 + | +LL | println!("{f:?X}"); + | ^ expected `'}'` in format string + | +help: did you mean `X?`? + | +LL | println!("{f:X?}"); + | ~~ + +error: aborting due to 3 previous errors + diff --git a/tests/ui/hashmap/hashmap-index-mut.stderr b/tests/ui/hashmap/hashmap-index-mut.stderr index 2381b8ecb96..ad33c6f9b15 100644 --- a/tests/ui/hashmap/hashmap-index-mut.stderr +++ b/tests/ui/hashmap/hashmap-index-mut.stderr @@ -5,12 +5,12 @@ LL | map[&0] = 1; | ^^^^^^^^^^^ cannot assign | = help: trait `IndexMut` is required to modify indexed content, but it is not implemented for `HashMap<u32, u32>` -help: to modify a `HashMap<u32, u32>`, use `.get_mut()`, `.insert()` or the entry API +help: use `.insert()` to insert a value into a `HashMap<u32, u32>`, `.get_mut()` to modify it, or the entry API for more flexibility | LL | map.insert(&0, 1); | ~~~~~~~~ ~ + -LL | map.get_mut(&0).map(|val| { *val = 1; }); - | ~~~~~~~~~ ~~~~~~~~~~~~~~~~~~ ++++ +LL | if let Some(val) = map.get_mut(&0) { *val = 1; }; + | ++++++++++++++++++ ~~~~~~~~~ ~~~~~~~~ +++ LL | let val = map.entry(&0).or_insert(1); | +++++++++ ~~~~~~~ ~~~~~~~~~~~~ + diff --git a/tests/ui/hygiene/panic-location.run.stderr b/tests/ui/hygiene/panic-location.run.stderr index b9086ecef81..5cd07dcda4c 100644 --- a/tests/ui/hygiene/panic-location.run.stderr +++ b/tests/ui/hygiene/panic-location.run.stderr @@ -1,3 +1,4 @@ + thread 'main' panicked at $DIR/panic-location.rs:LL:CC: capacity overflow note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace diff --git a/tests/ui/impl-trait/captured-invalid-lifetime.rs b/tests/ui/impl-trait/captured-invalid-lifetime.rs new file mode 100644 index 00000000000..57cd2e85dd0 --- /dev/null +++ b/tests/ui/impl-trait/captured-invalid-lifetime.rs @@ -0,0 +1,19 @@ +// This uses edition 2024 for new lifetime capture rules. +//@ edition: 2024 + +// The problem here is that the presence of the opaque which captures all lifetimes in scope +// means that the duplicated `'a` (which I'll call the dupe) is considered to be *early-bound* +// since it shows up in the output but not the inputs. This is paired with the fact that we +// were previously setting the name of the dupe to `'_` in the generic param definition, which +// means that the identity args for the function were `['a#0, '_#1]` even though the lifetime +// for the dupe should've been `'a#1`. This difference in symbol meant that NLL couldn't +// actually match the lifetime against the identity lifetimes, leading to an ICE. + +struct Foo<'a>(&'a ()); + +impl<'a> Foo<'a> { + fn pass<'a>() -> impl Sized {} + //~^ ERROR lifetime name `'a` shadows a lifetime name that is already in scope +} + +fn main() {} diff --git a/tests/ui/impl-trait/captured-invalid-lifetime.stderr b/tests/ui/impl-trait/captured-invalid-lifetime.stderr new file mode 100644 index 00000000000..c1315e34241 --- /dev/null +++ b/tests/ui/impl-trait/captured-invalid-lifetime.stderr @@ -0,0 +1,11 @@ +error[E0496]: lifetime name `'a` shadows a lifetime name that is already in scope + --> $DIR/captured-invalid-lifetime.rs:15:13 + | +LL | impl<'a> Foo<'a> { + | -- first declared here +LL | fn pass<'a>() -> impl Sized {} + | ^^ lifetime `'a` already in scope + +error: aborting due to 1 previous error + +For more information about this error, try `rustc --explain E0496`. diff --git a/tests/ui/incoherent-inherent-impls/no-other-unrelated-errors.rs b/tests/ui/incoherent-inherent-impls/no-other-unrelated-errors.rs index 8eaa0c9194a..cef017e79a4 100644 --- a/tests/ui/incoherent-inherent-impls/no-other-unrelated-errors.rs +++ b/tests/ui/incoherent-inherent-impls/no-other-unrelated-errors.rs @@ -1,4 +1,4 @@ -// E0116 caused other unrelated errors, so check no unrelated errors are emmitted. +// E0116 caused other unrelated errors, so check no unrelated errors are emitted. fn main() { let x = "hello"; diff --git a/tests/ui/indexing/indexing-spans-caller-location.rs b/tests/ui/indexing/indexing-spans-caller-location.rs index 02d8b853734..b01e3894ac1 100644 --- a/tests/ui/indexing/indexing-spans-caller-location.rs +++ b/tests/ui/indexing/indexing-spans-caller-location.rs @@ -20,7 +20,7 @@ impl std::ops::Index<usize> for A { type Output = (); fn index(&self, _idx: usize) -> &() { - // Use the relative number to make it resistent to header changes. + // Use the relative number to make it resistant to header changes. assert_eq!(caller_line(), self.prev_line + 2); &() } diff --git a/tests/ui/inference/need_type_info/issue-107745-avoid-expr-from-macro-expansion.rs b/tests/ui/inference/need_type_info/issue-107745-avoid-expr-from-macro-expansion.rs index 7f6758f47f8..3cdb488e7a5 100644 --- a/tests/ui/inference/need_type_info/issue-107745-avoid-expr-from-macro-expansion.rs +++ b/tests/ui/inference/need_type_info/issue-107745-avoid-expr-from-macro-expansion.rs @@ -2,7 +2,7 @@ // Regression test for #107745. // Previously need_type_info::update_infer_source will consider expressions originating from -// macro expressions as candiate "previous sources". This unfortunately can mean that +// macro expressions as candidate "previous sources". This unfortunately can mean that // for macros expansions such as `format!()` internal implementation details can leak, such as: // // ``` diff --git a/tests/ui/intrinsics/const-eval-select-backtrace-std.run.stderr b/tests/ui/intrinsics/const-eval-select-backtrace-std.run.stderr index a0024c0920f..71d792b7f77 100644 --- a/tests/ui/intrinsics/const-eval-select-backtrace-std.run.stderr +++ b/tests/ui/intrinsics/const-eval-select-backtrace-std.run.stderr @@ -1,3 +1,4 @@ + thread 'main' panicked at $DIR/const-eval-select-backtrace-std.rs:6:8: byte index 1 is out of bounds of `` note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace diff --git a/tests/ui/intrinsics/const-eval-select-backtrace.run.stderr b/tests/ui/intrinsics/const-eval-select-backtrace.run.stderr index 8f38d54146b..4f11f5966ed 100644 --- a/tests/ui/intrinsics/const-eval-select-backtrace.run.stderr +++ b/tests/ui/intrinsics/const-eval-select-backtrace.run.stderr @@ -1,3 +1,4 @@ + thread 'main' panicked at $DIR/const-eval-select-backtrace.rs:15:5: Aaah! note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace diff --git a/tests/ui/intrinsics/not-overridden.stderr b/tests/ui/intrinsics/not-overridden.stderr index 9b8849cea1c..b5273a4fa47 100644 --- a/tests/ui/intrinsics/not-overridden.stderr +++ b/tests/ui/intrinsics/not-overridden.stderr @@ -4,6 +4,7 @@ error: must be overridden by codegen backend, but isn't LL | unsafe { const_deallocate(std::ptr::null_mut(), 0, 0) } | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + query stack during panic: end of query stack error: aborting due to 1 previous error diff --git a/tests/ui/issues/issue-12567.stderr b/tests/ui/issues/issue-12567.stderr index 3f95f18a967..0b19299ece3 100644 --- a/tests/ui/issues/issue-12567.stderr +++ b/tests/ui/issues/issue-12567.stderr @@ -11,14 +11,16 @@ LL | (&[hd1, ..], &[hd2, ..]) | --- ...and here | = note: move occurs because these variables have types that don't implement the `Copy` trait -help: consider borrowing the pattern binding +help: consider removing the borrow | -LL | (&[], &[ref hd, ..]) | (&[hd, ..], &[]) - | +++ -help: consider borrowing the pattern binding +LL - (&[], &[hd, ..]) | (&[hd, ..], &[]) +LL + (&[], [hd, ..]) | (&[hd, ..], &[]) + | +help: consider removing the borrow + | +LL - (&[hd1, ..], &[hd2, ..]) +LL + (&[hd1, ..], [hd2, ..]) | -LL | (&[hd1, ..], &[ref hd2, ..]) - | +++ error[E0508]: cannot move out of type `[T]`, a non-copy slice --> $DIR/issue-12567.rs:2:11 @@ -33,14 +35,16 @@ LL | (&[hd1, ..], &[hd2, ..]) | --- ...and here | = note: move occurs because these variables have types that don't implement the `Copy` trait -help: consider borrowing the pattern binding +help: consider removing the borrow + | +LL - (&[], &[hd, ..]) | (&[hd, ..], &[]) +LL + (&[], [hd, ..]) | (&[hd, ..], &[]) + | +help: consider removing the borrow | -LL | (&[], &[ref hd, ..]) | (&[hd, ..], &[]) - | +++ -help: consider borrowing the pattern binding +LL - (&[hd1, ..], &[hd2, ..]) +LL + ([hd1, ..], &[hd2, ..]) | -LL | (&[ref hd1, ..], &[hd2, ..]) - | +++ error: aborting due to 2 previous errors diff --git a/tests/ui/issues/issue-41726.stderr b/tests/ui/issues/issue-41726.stderr index fe7d4df7067..250bba222bf 100644 --- a/tests/ui/issues/issue-41726.stderr +++ b/tests/ui/issues/issue-41726.stderr @@ -5,7 +5,10 @@ LL | things[src.as_str()].sort(); | ^^^^^^^^^^^^^^^^^^^^ cannot borrow as mutable | = help: trait `IndexMut` is required to modify indexed content, but it is not implemented for `HashMap<String, Vec<String>>` - = help: to modify a `HashMap<String, Vec<String>>`, use `.get_mut()`, `.insert()` or the entry API +help: to modify a `HashMap<String, Vec<String>>` use `.get_mut()` + | +LL | if let Some(val) = things.get_mut(src.as_str()) { val.sort(); }; + | ++++++++++++++++++ ~~~~~~~~~ ~~~~~~~ +++ error: aborting due to 1 previous error diff --git a/tests/ui/issues/issue-87707.run.stderr b/tests/ui/issues/issue-87707.run.stderr index 255a77a6ab1..eb1d65a081f 100644 --- a/tests/ui/issues/issue-87707.run.stderr +++ b/tests/ui/issues/issue-87707.run.stderr @@ -1,5 +1,7 @@ + thread 'main' panicked at $DIR/issue-87707.rs:14:24: Here Once instance is poisoned. note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace + thread 'main' panicked at $DIR/issue-87707.rs:16:7: Once instance has previously been poisoned diff --git a/tests/ui/layout/valid_range_oob.stderr b/tests/ui/layout/valid_range_oob.stderr index d56804a35a7..9c360b2cd6e 100644 --- a/tests/ui/layout/valid_range_oob.stderr +++ b/tests/ui/layout/valid_range_oob.stderr @@ -1,3 +1,4 @@ + 257 > 255 error: the compiler unexpectedly panicked. this is a bug. diff --git a/tests/ui/link-native-libs/issue-70093/issue-70093-link-directives.rs b/tests/ui/link-native-libs/issue-70093/issue-70093-link-directives.rs deleted file mode 100644 index 9c60affbccd..00000000000 --- a/tests/ui/link-native-libs/issue-70093/issue-70093-link-directives.rs +++ /dev/null @@ -1,10 +0,0 @@ -//@ run-pass -//@ compile-flags: -Zlink-directives=no -//@ ignore-windows - this will probably only work on unixish systems -//@ ignore-fuchsia - missing __libc_start_main for some reason (#84733) -//@ ignore-cross-compile - default-linker-libraries=yes doesn't play well with cross compiling - -#[link(name = "some-random-non-existent-library", kind = "static")] -extern "C" {} - -fn main() {} diff --git a/tests/ui/link-native-libs/issue-70093/issue-70093.rs b/tests/ui/link-native-libs/issue-70093/issue-70093.rs deleted file mode 100644 index 86974239338..00000000000 --- a/tests/ui/link-native-libs/issue-70093/issue-70093.rs +++ /dev/null @@ -1,10 +0,0 @@ -//@ run-pass -//@ compile-flags: -Zlink-native-libraries=no -Cdefault-linker-libraries=yes -//@ ignore-windows - this will probably only work on unixish systems -//@ ignore-fuchsia - missing __libc_start_main for some reason (#84733) -//@ ignore-cross-compile - default-linker-libraries=yes doesn't play well with cross compiling - -#[link(name = "some-random-non-existent-library", kind = "static")] -extern "C" {} - -fn main() {} diff --git a/tests/ui/link-native-libs/issue-70093/link-directives.rs b/tests/ui/link-native-libs/issue-70093/link-directives.rs new file mode 100644 index 00000000000..1dc44c996fc --- /dev/null +++ b/tests/ui/link-native-libs/issue-70093/link-directives.rs @@ -0,0 +1,14 @@ +// Ensure that `#[link]` attributes are entirely ignore when using `-Zlink-directives=no`. + +//@ run-pass +//@ compile-flags: -Zlink-directives=no +//@ ignore-fuchsia - missing __libc_start_main for some reason (#84733) +//@ ignore-cross-compile - default-linker-libraries=yes doesn't play well with cross compiling + +// Usually these `#[link]` attribute would cause `libsome-random-non-existent-library` +// to be passed to the linker, causing it to fail because the file doesn't exist. +// However, with -Zlink-directives=no, the `#[link]` is ignored. +#[link(name = "some-random-non-existent-library", kind = "static")] +extern "C" {} + +fn main() {} diff --git a/tests/ui/link-native-libs/issue-70093/link-native-libraries.rs b/tests/ui/link-native-libs/issue-70093/link-native-libraries.rs new file mode 100644 index 00000000000..b4dc9fb5cde --- /dev/null +++ b/tests/ui/link-native-libs/issue-70093/link-native-libraries.rs @@ -0,0 +1,26 @@ +// Ensure that rust does not pass native libraries to the linker when +// `-Zlink-native-libraries=no` is used. + +//@ run-pass +//@ compile-flags: -Zlink-native-libraries=no -Cdefault-linker-libraries=yes +//@ ignore-fuchsia - missing __libc_start_main for some reason (#84733) +//@ ignore-cross-compile - default-linker-libraries=yes doesn't play well with cross compiling + +//@ revisions: other +//@[other] ignore-msvc + +//@ revisions: msvc +// On Windows MSVC, default-linker-libraries=yes doesn't work because +// rustc drives the linker directly instead of going through another compiler. +// Therefore rustc would need to implement default-linker-libraries itself but doesn't. +// So instead we use -Clink-arg to directly set the required msvcrt.lib as a link arg. +//@[msvc] compile-flags: -Clink-arg=msvcrt.lib +//@[msvc] only-msvc + +// Usually these `#[link]` attribute would cause `libsome-random-non-existent-library` +// to be passed to the linker, causing it to fail because the file doesn't exist. +// However, -Zlink-native-libraries=no disables that. +#[link(name = "some-random-non-existent-library", kind = "static")] +extern "C" {} + +fn main() {} diff --git a/tests/ui/macros/assert-long-condition.run.stderr b/tests/ui/macros/assert-long-condition.run.stderr index 5c0ff357cb7..c2c5fe5d7d5 100644 --- a/tests/ui/macros/assert-long-condition.run.stderr +++ b/tests/ui/macros/assert-long-condition.run.stderr @@ -1,3 +1,4 @@ + thread 'main' panicked at $DIR/assert-long-condition.rs:7:5: assertion failed: 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 + 12 + 13 + 14 + 15 + 16 + 17 + 18 + 19 + 20 + 21 + 22 + 23 + 24 + 25 == 0 diff --git a/tests/ui/match/ref_pat_eat_one_layer_2024/ref_pat_eat_one_layer_2024_fail2.stderr b/tests/ui/match/ref_pat_eat_one_layer_2024/ref_pat_eat_one_layer_2024_fail2.stderr index 52f4c09e5c0..a8b81394110 100644 --- a/tests/ui/match/ref_pat_eat_one_layer_2024/ref_pat_eat_one_layer_2024_fail2.stderr +++ b/tests/ui/match/ref_pat_eat_one_layer_2024/ref_pat_eat_one_layer_2024_fail2.stderr @@ -7,10 +7,11 @@ LL | if let Some(&Some(x)) = Some(&Some(&mut 0)) { | data moved here | move occurs because `x` has type `&mut u32`, which does not implement the `Copy` trait | -help: consider borrowing the pattern binding +help: consider removing the borrow + | +LL - if let Some(&Some(x)) = Some(&Some(&mut 0)) { +LL + if let Some(Some(x)) = Some(&Some(&mut 0)) { | -LL | if let Some(&Some(ref x)) = Some(&Some(&mut 0)) { - | +++ error[E0596]: cannot borrow data in a `&` reference as mutable --> $DIR/ref_pat_eat_one_layer_2024_fail2.rs:11:10 diff --git a/tests/ui/mir/lint/storage-live.stderr b/tests/ui/mir/lint/storage-live.stderr index 7d4c3f0832a..c7012319512 100644 --- a/tests/ui/mir/lint/storage-live.stderr +++ b/tests/ui/mir/lint/storage-live.stderr @@ -11,6 +11,7 @@ note: delayed at compiler/rustc_mir_transform/src/lint.rs:LL:CC - disabled backt LL | StorageLive(a); | ^^^^^^^^^^^^^^ + aborting due to `-Z treat-err-as-bug=1` error: the compiler unexpectedly panicked. this is a bug. diff --git a/tests/ui/moves/do-not-suggest-removing-wrong-ref-pattern-issue-132806.fixed b/tests/ui/moves/do-not-suggest-removing-wrong-ref-pattern-issue-132806.fixed new file mode 100644 index 00000000000..46b05e4c0a3 --- /dev/null +++ b/tests/ui/moves/do-not-suggest-removing-wrong-ref-pattern-issue-132806.fixed @@ -0,0 +1,10 @@ +//@ run-rustfix +//! diagnostic test for #132806: make sure the suggestion to bind by-reference in patterns doesn't +//! erroneously remove the wrong `&` + +use std::collections::HashMap; + +fn main() { + let _ = HashMap::<String, i32>::new().iter().filter(|&(_k, &_v)| { true }); + //~^ ERROR cannot move out of a shared reference +} diff --git a/tests/ui/moves/do-not-suggest-removing-wrong-ref-pattern-issue-132806.rs b/tests/ui/moves/do-not-suggest-removing-wrong-ref-pattern-issue-132806.rs new file mode 100644 index 00000000000..1312fd6425b --- /dev/null +++ b/tests/ui/moves/do-not-suggest-removing-wrong-ref-pattern-issue-132806.rs @@ -0,0 +1,10 @@ +//@ run-rustfix +//! diagnostic test for #132806: make sure the suggestion to bind by-reference in patterns doesn't +//! erroneously remove the wrong `&` + +use std::collections::HashMap; + +fn main() { + let _ = HashMap::<String, i32>::new().iter().filter(|&(&_k, &_v)| { true }); + //~^ ERROR cannot move out of a shared reference +} diff --git a/tests/ui/moves/do-not-suggest-removing-wrong-ref-pattern-issue-132806.stderr b/tests/ui/moves/do-not-suggest-removing-wrong-ref-pattern-issue-132806.stderr new file mode 100644 index 00000000000..ff579f93413 --- /dev/null +++ b/tests/ui/moves/do-not-suggest-removing-wrong-ref-pattern-issue-132806.stderr @@ -0,0 +1,18 @@ +error[E0507]: cannot move out of a shared reference + --> $DIR/do-not-suggest-removing-wrong-ref-pattern-issue-132806.rs:8:58 + | +LL | let _ = HashMap::<String, i32>::new().iter().filter(|&(&_k, &_v)| { true }); + | ^^^--^^^^^^ + | | + | data moved here + | move occurs because `_k` has type `String`, which does not implement the `Copy` trait + | +help: consider removing the borrow + | +LL - let _ = HashMap::<String, i32>::new().iter().filter(|&(&_k, &_v)| { true }); +LL + let _ = HashMap::<String, i32>::new().iter().filter(|&(_k, &_v)| { true }); + | + +error: aborting due to 1 previous error + +For more information about this error, try `rustc --explain E0507`. diff --git a/tests/ui/nll/move-errors.stderr b/tests/ui/nll/move-errors.stderr index d1384121379..bcb2ab84a23 100644 --- a/tests/ui/nll/move-errors.stderr +++ b/tests/ui/nll/move-errors.stderr @@ -209,10 +209,11 @@ LL | (D(s), &t) => (), | data moved here | move occurs because `t` has type `String`, which does not implement the `Copy` trait | -help: consider borrowing the pattern binding +help: consider removing the borrow + | +LL - (D(s), &t) => (), +LL + (D(s), t) => (), | -LL | (D(s), &ref t) => (), - | +++ error[E0509]: cannot move out of type `F`, which implements the `Drop` trait --> $DIR/move-errors.rs:102:11 diff --git a/tests/ui/no_send-rc.stderr b/tests/ui/no_send-rc.stderr index 3534167870b..1430a7a29ea 100644 --- a/tests/ui/no_send-rc.stderr +++ b/tests/ui/no_send-rc.stderr @@ -12,6 +12,10 @@ note: required by a bound in `bar` | LL | fn bar<T: Send>(_: T) {} | ^^^^ required by this bound in `bar` +help: consider dereferencing here + | +LL | bar(*x); + | + error: aborting due to 1 previous error diff --git a/tests/ui/panics/default-backtrace-ice.rs b/tests/ui/panics/default-backtrace-ice.rs index c47f458f6e9..9933f548758 100644 --- a/tests/ui/panics/default-backtrace-ice.rs +++ b/tests/ui/panics/default-backtrace-ice.rs @@ -17,7 +17,7 @@ // `__rust_{begin,end}_short_backtrace` markers, which only appear in full // backtraces. The rest of the backtrace is filtered out. // -// Ignored on msvc becaue the `__rust_{begin,end}_short_backtrace` symbols +// Ignored on msvc because the `__rust_{begin,end}_short_backtrace` symbols // aren't reliable. fn main() { missing_ident; } diff --git a/tests/ui/panics/default-backtrace-ice.stderr b/tests/ui/panics/default-backtrace-ice.stderr index 046b2cca7f9..2147b0971b5 100644 --- a/tests/ui/panics/default-backtrace-ice.stderr +++ b/tests/ui/panics/default-backtrace-ice.stderr @@ -5,6 +5,7 @@ LL | fn main() { missing_ident; } | ^^^^^^^^^^^^^ not found in this scope + aborting due to `-Z treat-err-as-bug=1` stack backtrace: (end_short_backtrace) diff --git a/tests/ui/panics/fmt-only-once.run.stderr b/tests/ui/panics/fmt-only-once.run.stderr index a991706d34e..faa3cc91151 100644 --- a/tests/ui/panics/fmt-only-once.run.stderr +++ b/tests/ui/panics/fmt-only-once.run.stderr @@ -1,4 +1,5 @@ fmt + thread 'main' panicked at $DIR/fmt-only-once.rs:20:5: PrintOnFmt note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace diff --git a/tests/ui/panics/issue-47429-short-backtraces.run.stderr b/tests/ui/panics/issue-47429-short-backtraces.run.stderr index 6a22e0215fe..c6e2d13fb5d 100644 --- a/tests/ui/panics/issue-47429-short-backtraces.run.stderr +++ b/tests/ui/panics/issue-47429-short-backtraces.run.stderr @@ -1,3 +1,4 @@ + thread 'main' panicked at $DIR/issue-47429-short-backtraces.rs:26:5: explicit panic stack backtrace: diff --git a/tests/ui/panics/location-detail-panic-no-column.run.stderr b/tests/ui/panics/location-detail-panic-no-column.run.stderr index 6d8d02a3a55..f63c09652b8 100644 --- a/tests/ui/panics/location-detail-panic-no-column.run.stderr +++ b/tests/ui/panics/location-detail-panic-no-column.run.stderr @@ -1,3 +1,4 @@ + thread 'main' panicked at $DIR/location-detail-panic-no-column.rs:7:0: column-redacted note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace diff --git a/tests/ui/panics/location-detail-panic-no-file.run.stderr b/tests/ui/panics/location-detail-panic-no-file.run.stderr index 492ad37f5c7..3d1c6defa31 100644 --- a/tests/ui/panics/location-detail-panic-no-file.run.stderr +++ b/tests/ui/panics/location-detail-panic-no-file.run.stderr @@ -1,3 +1,4 @@ + thread 'main' panicked at <redacted>:7:5: file-redacted note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace diff --git a/tests/ui/panics/location-detail-panic-no-line.run.stderr b/tests/ui/panics/location-detail-panic-no-line.run.stderr index fdbc43c4311..9809ab5e2b4 100644 --- a/tests/ui/panics/location-detail-panic-no-line.run.stderr +++ b/tests/ui/panics/location-detail-panic-no-line.run.stderr @@ -1,3 +1,4 @@ + thread 'main' panicked at $DIR/location-detail-panic-no-line.rs:0:5: line-redacted note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace diff --git a/tests/ui/panics/location-detail-panic-no-location-info.run.stderr b/tests/ui/panics/location-detail-panic-no-location-info.run.stderr index 1e9002df955..f68a0d663c0 100644 --- a/tests/ui/panics/location-detail-panic-no-location-info.run.stderr +++ b/tests/ui/panics/location-detail-panic-no-location-info.run.stderr @@ -1,3 +1,4 @@ + thread 'main' panicked at <redacted>:0:0: no location info note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace diff --git a/tests/ui/panics/location-detail-unwrap-no-file.run.stderr b/tests/ui/panics/location-detail-unwrap-no-file.run.stderr index 52019f62233..af4a4997fae 100644 --- a/tests/ui/panics/location-detail-unwrap-no-file.run.stderr +++ b/tests/ui/panics/location-detail-unwrap-no-file.run.stderr @@ -1,3 +1,4 @@ + thread 'main' panicked at <redacted>:8:9: called `Option::unwrap()` on a `None` value note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace diff --git a/tests/ui/panics/panic-in-cleanup.run.stderr b/tests/ui/panics/panic-in-cleanup.run.stderr index e7def11b0e9..34383562c36 100644 --- a/tests/ui/panics/panic-in-cleanup.run.stderr +++ b/tests/ui/panics/panic-in-cleanup.run.stderr @@ -1,9 +1,12 @@ + thread 'main' panicked at $DIR/panic-in-cleanup.rs:22:5: explicit panic note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace + thread 'main' panicked at $DIR/panic-in-cleanup.rs:16:9: BOOM stack backtrace: + thread 'main' panicked at library/core/src/panicking.rs:$LINE:$COL: panic in a destructor during cleanup thread caused non-unwinding panic. aborting. diff --git a/tests/ui/panics/panic-in-ffi.run.stderr b/tests/ui/panics/panic-in-ffi.run.stderr index fe8c2b04b91..a6f3ebe5657 100644 --- a/tests/ui/panics/panic-in-ffi.run.stderr +++ b/tests/ui/panics/panic-in-ffi.run.stderr @@ -1,7 +1,9 @@ + thread 'main' panicked at $DIR/panic-in-ffi.rs:21:5: Test note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace Noisy Drop + thread 'main' panicked at library/core/src/panicking.rs:$LINE:$COL: panic in a function that cannot unwind stack backtrace: diff --git a/tests/ui/panics/runtime-switch.run.stderr b/tests/ui/panics/runtime-switch.run.stderr index 35be010d6be..458a0ee534a 100644 --- a/tests/ui/panics/runtime-switch.run.stderr +++ b/tests/ui/panics/runtime-switch.run.stderr @@ -1,3 +1,4 @@ + thread 'main' panicked at $DIR/runtime-switch.rs:29:5: explicit panic stack backtrace: diff --git a/tests/ui/panics/short-ice-remove-middle-frames-2.run.stderr b/tests/ui/panics/short-ice-remove-middle-frames-2.run.stderr index ab23ce78062..1fddcca6951 100644 --- a/tests/ui/panics/short-ice-remove-middle-frames-2.run.stderr +++ b/tests/ui/panics/short-ice-remove-middle-frames-2.run.stderr @@ -1,3 +1,4 @@ + thread 'main' panicked at $DIR/short-ice-remove-middle-frames-2.rs:63:5: debug!!! stack backtrace: diff --git a/tests/ui/panics/short-ice-remove-middle-frames.run.stderr b/tests/ui/panics/short-ice-remove-middle-frames.run.stderr index d2616911e3b..630b09d8d1e 100644 --- a/tests/ui/panics/short-ice-remove-middle-frames.run.stderr +++ b/tests/ui/panics/short-ice-remove-middle-frames.run.stderr @@ -1,3 +1,4 @@ + thread 'main' panicked at $DIR/short-ice-remove-middle-frames.rs:59:5: debug!!! stack backtrace: diff --git a/tests/ui/parser/unicode-control-codepoints.rs b/tests/ui/parser/unicode-control-codepoints.rs index df099bb62ad..14e1cfe59d3 100644 --- a/tests/ui/parser/unicode-control-codepoints.rs +++ b/tests/ui/parser/unicode-control-codepoints.rs @@ -1,3 +1,5 @@ +//@ edition: 2021 + fn main() { // if access_level != "user" { // Check if admin //~^ ERROR unicode codepoint changing visible direction of text present in comment @@ -25,6 +27,14 @@ fn main() { //~| ERROR non-ASCII character in raw byte string literal println!("{:?}", ''); //~^ ERROR unicode codepoint changing visible direction of text present in literal + + let _ = c""; + //~^ ERROR unicode codepoint changing visible direction of text present in literal + let _ = cr#""#; + //~^ ERROR unicode codepoint changing visible direction of text present in literal + + println!("{{}}"); + //~^ ERROR unicode codepoint changing visible direction of text present in format string } //"/* } if isAdmin begin admins only */" diff --git a/tests/ui/parser/unicode-control-codepoints.stderr b/tests/ui/parser/unicode-control-codepoints.stderr index 28de4ae72ab..2893194308e 100644 --- a/tests/ui/parser/unicode-control-codepoints.stderr +++ b/tests/ui/parser/unicode-control-codepoints.stderr @@ -1,5 +1,5 @@ error: unicode escape in byte string - --> $DIR/unicode-control-codepoints.rs:6:26 + --> $DIR/unicode-control-codepoints.rs:8:26 | LL | println!("{:?}", b"us\u{202B}e\u{202A}r"); | ^^^^^^^^ unicode escape in byte string @@ -7,7 +7,7 @@ LL | println!("{:?}", b"us\u{202B}e\u{202A}r"); = help: unicode escape sequences cannot be used as a byte or in a byte string error: unicode escape in byte string - --> $DIR/unicode-control-codepoints.rs:6:35 + --> $DIR/unicode-control-codepoints.rs:8:35 | LL | println!("{:?}", b"us\u{202B}e\u{202A}r"); | ^^^^^^^^ unicode escape in byte string @@ -15,7 +15,7 @@ LL | println!("{:?}", b"us\u{202B}e\u{202A}r"); = help: unicode escape sequences cannot be used as a byte or in a byte string error: non-ASCII character in byte string literal - --> $DIR/unicode-control-codepoints.rs:16:26 + --> $DIR/unicode-control-codepoints.rs:18:26 | LL | println!("{:?}", b"/*� } �if isAdmin� � begin admins only "); | ^ must be ASCII but is '\u{202e}' @@ -26,7 +26,7 @@ LL | println!("{:?}", b"/*\xE2\x80\xAE } �if isAdmin� � begin admins o | ~~~~~~~~~~~~ error: non-ASCII character in byte string literal - --> $DIR/unicode-control-codepoints.rs:16:30 + --> $DIR/unicode-control-codepoints.rs:18:30 | LL | println!("{:?}", b"/*� } �if isAdmin� � begin admins only "); | ^ must be ASCII but is '\u{2066}' @@ -37,7 +37,7 @@ LL | println!("{:?}", b"/*� } \xE2\x81\xA6if isAdmin� � begin admins o | ~~~~~~~~~~~~ error: non-ASCII character in byte string literal - --> $DIR/unicode-control-codepoints.rs:16:41 + --> $DIR/unicode-control-codepoints.rs:18:41 | LL | println!("{:?}", b"/*� } �if isAdmin� � begin admins only "); | ^ must be ASCII but is '\u{2069}' @@ -48,7 +48,7 @@ LL | println!("{:?}", b"/*� } �if isAdmin\xE2\x81\xA9 � begin admins o | ~~~~~~~~~~~~ error: non-ASCII character in byte string literal - --> $DIR/unicode-control-codepoints.rs:16:43 + --> $DIR/unicode-control-codepoints.rs:18:43 | LL | println!("{:?}", b"/*� } �if isAdmin� � begin admins only "); | ^ must be ASCII but is '\u{2066}' @@ -59,31 +59,31 @@ LL | println!("{:?}", b"/*� } �if isAdmin� \xE2\x81\xA6 begin admins o | ~~~~~~~~~~~~ error: non-ASCII character in raw byte string literal - --> $DIR/unicode-control-codepoints.rs:21:29 + --> $DIR/unicode-control-codepoints.rs:23:29 | LL | println!("{:?}", br##"/*� } �if isAdmin� � begin admins only "##); | ^ must be ASCII but is '\u{202e}' error: non-ASCII character in raw byte string literal - --> $DIR/unicode-control-codepoints.rs:21:33 + --> $DIR/unicode-control-codepoints.rs:23:33 | LL | println!("{:?}", br##"/*� } �if isAdmin� � begin admins only "##); | ^ must be ASCII but is '\u{2066}' error: non-ASCII character in raw byte string literal - --> $DIR/unicode-control-codepoints.rs:21:44 + --> $DIR/unicode-control-codepoints.rs:23:44 | LL | println!("{:?}", br##"/*� } �if isAdmin� � begin admins only "##); | ^ must be ASCII but is '\u{2069}' error: non-ASCII character in raw byte string literal - --> $DIR/unicode-control-codepoints.rs:21:46 + --> $DIR/unicode-control-codepoints.rs:23:46 | LL | println!("{:?}", br##"/*� } �if isAdmin� � begin admins only "##); | ^ must be ASCII but is '\u{2066}' error: unicode codepoint changing visible direction of text present in comment - --> $DIR/unicode-control-codepoints.rs:2:5 + --> $DIR/unicode-control-codepoints.rs:4:5 | LL | // if access_level != "us�e�r" { // Check if admin | ^^^^^^^^^^^^^^^^^^^^^^^^^-^-^^^^^^^^^^^^^^^^^^^^^^ @@ -97,7 +97,7 @@ LL | // if access_level != "us�e�r" { // Check if admin = help: if their presence wasn't intentional, you can remove them error: unicode codepoint changing visible direction of text present in comment - --> $DIR/unicode-control-codepoints.rs:30:1 + --> $DIR/unicode-control-codepoints.rs:40:1 | LL | //"/*� } �if isAdmin� � begin admins only */" | ^^^^^-^^^-^^^^^^^^^^-^-^^^^^^^^^^^^^^^^^^^^^^ @@ -112,7 +112,7 @@ LL | //"/*� } �if isAdmin� � begin admins only */" = help: if their presence wasn't intentional, you can remove them error: unicode codepoint changing visible direction of text present in literal - --> $DIR/unicode-control-codepoints.rs:11:22 + --> $DIR/unicode-control-codepoints.rs:13:22 | LL | println!("{:?}", "/*� } �if isAdmin� � begin admins only "); | ^^^-^^^-^^^^^^^^^^-^-^^^^^^^^^^^^^^^^^^^^ @@ -132,7 +132,7 @@ LL | println!("{:?}", "/*\u{202e} } \u{2066}if isAdmin\u{2069} \u{2066} begi | ~~~~~~~~ ~~~~~~~~ ~~~~~~~~ ~~~~~~~~ error: unicode codepoint changing visible direction of text present in literal - --> $DIR/unicode-control-codepoints.rs:14:22 + --> $DIR/unicode-control-codepoints.rs:16:22 | LL | println!("{:?}", r##"/*� } �if isAdmin� � begin admins only "##); | ^^^^^^-^^^-^^^^^^^^^^-^-^^^^^^^^^^^^^^^^^^^^^^ @@ -151,7 +151,7 @@ LL | println!("{:?}", r##"/*\u{202e} } \u{2066}if isAdmin\u{2069} \u{2066} b | ~~~~~~~~ ~~~~~~~~ ~~~~~~~~ ~~~~~~~~ error: unicode codepoint changing visible direction of text present in literal - --> $DIR/unicode-control-codepoints.rs:26:22 + --> $DIR/unicode-control-codepoints.rs:28:22 | LL | println!("{:?}", '�'); | ^-^ @@ -166,8 +166,56 @@ help: if you want to keep them but make them visible in your source code, you ca LL | println!("{:?}", '\u{202e}'); | ~~~~~~~~ +error: unicode codepoint changing visible direction of text present in literal + --> $DIR/unicode-control-codepoints.rs:31:13 + | +LL | let _ = c"�"; + | ^^-^ + | | | + | | '\u{202e}' + | this literal contains an invisible unicode text flow control codepoint + | + = note: these kind of unicode codepoints change the way text flows on applications that support them, but can cause confusion because they change the order of characters on the screen + = help: if their presence wasn't intentional, you can remove them +help: if you want to keep them but make them visible in your source code, you can escape them + | +LL | let _ = c"\u{202e}"; + | ~~~~~~~~ + +error: unicode codepoint changing visible direction of text present in literal + --> $DIR/unicode-control-codepoints.rs:33:13 + | +LL | let _ = cr#"�"#; + | ^^^^-^^ + | | | + | | '\u{202e}' + | this literal contains an invisible unicode text flow control codepoint + | + = note: these kind of unicode codepoints change the way text flows on applications that support them, but can cause confusion because they change the order of characters on the screen + = help: if their presence wasn't intentional, you can remove them +help: if you want to keep them but make them visible in your source code, you can escape them + | +LL | let _ = cr#"\u{202e}"#; + | ~~~~~~~~ + +error: unicode codepoint changing visible direction of text present in format string + --> $DIR/unicode-control-codepoints.rs:36:14 + | +LL | println!("{{�}}"); + | ^^^-^^^ + | | | + | | '\u{202e}' + | this format string contains an invisible unicode text flow control codepoint + | + = note: these kind of unicode codepoints change the way text flows on applications that support them, but can cause confusion because they change the order of characters on the screen + = help: if their presence wasn't intentional, you can remove them +help: if you want to keep them but make them visible in your source code, you can escape them + | +LL | println!("{{\u{202e}}}"); + | ~~~~~~~~ + error: unicode codepoint changing visible direction of text present in doc comment - --> $DIR/unicode-control-codepoints.rs:33:1 + --> $DIR/unicode-control-codepoints.rs:43:1 | LL | /** '�'); */fn foo() {} | ^^^^^^^^^^^^^ this doc comment contains an invisible unicode text flow control codepoint @@ -177,7 +225,7 @@ LL | /** '�'); */fn foo() {} = note: if you want to keep them but make them visible in your source code, you can escape them: '\u{202e}' error: unicode codepoint changing visible direction of text present in doc comment - --> $DIR/unicode-control-codepoints.rs:36:1 + --> $DIR/unicode-control-codepoints.rs:46:1 | LL | / /** LL | | * @@ -188,5 +236,5 @@ LL | | * '�'); */fn bar() {} = note: if their presence wasn't intentional, you can remove them = note: if you want to keep them but make them visible in your source code, you can escape them: '\u{202e}' -error: aborting due to 17 previous errors +error: aborting due to 20 previous errors diff --git a/tests/ui/pattern/deref-patterns/cant_move_out_of_pattern.stderr b/tests/ui/pattern/deref-patterns/cant_move_out_of_pattern.stderr index 108db6d9e4b..2cf435b1179 100644 --- a/tests/ui/pattern/deref-patterns/cant_move_out_of_pattern.stderr +++ b/tests/ui/pattern/deref-patterns/cant_move_out_of_pattern.stderr @@ -9,6 +9,11 @@ LL | deref!(x) => x, | | | data moved here | move occurs because `x` has type `Struct`, which does not implement the `Copy` trait + | +help: consider borrowing the pattern binding + | +LL | deref!(ref x) => x, + | +++ error[E0507]: cannot move out of a shared reference --> $DIR/cant_move_out_of_pattern.rs:17:11 @@ -21,6 +26,11 @@ LL | deref!(x) => x, | | | data moved here | move occurs because `x` has type `Struct`, which does not implement the `Copy` trait + | +help: consider borrowing the pattern binding + | +LL | deref!(ref x) => x, + | +++ error: aborting due to 2 previous errors diff --git a/tests/ui/proc-macro/load-panic-backtrace.stderr b/tests/ui/proc-macro/load-panic-backtrace.stderr index 0f3db6c831e..a1049f5a324 100644 --- a/tests/ui/proc-macro/load-panic-backtrace.stderr +++ b/tests/ui/proc-macro/load-panic-backtrace.stderr @@ -1,3 +1,4 @@ + at $DIR/auxiliary/test-macros.rs:38:5: panic-derive error: proc-macro derive panicked diff --git a/tests/ui/process/multi-panic.rs b/tests/ui/process/multi-panic.rs index 02b69903654..ad47925a149 100644 --- a/tests/ui/process/multi-panic.rs +++ b/tests/ui/process/multi-panic.rs @@ -6,12 +6,17 @@ fn check_for_no_backtrace(test: std::process::Output) { assert!(!test.status.success()); let err = String::from_utf8_lossy(&test.stderr); - let mut it = err.lines(); + let mut it = err.lines().filter(|l| !l.is_empty()); assert_eq!(it.next().map(|l| l.starts_with("thread '<unnamed>' panicked")), Some(true)); assert_eq!(it.next().is_some(), true); - assert_eq!(it.next(), Some("note: run with `RUST_BACKTRACE=1` \ - environment variable to display a backtrace")); + assert_eq!( + it.next(), + Some( + "note: run with `RUST_BACKTRACE=1` \ + environment variable to display a backtrace" + ) + ); assert_eq!(it.next().map(|l| l.starts_with("thread 'main' panicked at")), Some(true)); assert_eq!(it.next().is_some(), true); assert_eq!(it.next(), None); @@ -22,19 +27,22 @@ fn main() { if args.len() > 1 && args[1] == "run_test" { let _ = std::thread::spawn(|| { panic!(); - }).join(); + }) + .join(); panic!(); } else { - let test = std::process::Command::new(&args[0]).arg("run_test") - .env_remove("RUST_BACKTRACE") - .output() - .unwrap(); + let test = std::process::Command::new(&args[0]) + .arg("run_test") + .env_remove("RUST_BACKTRACE") + .output() + .unwrap(); check_for_no_backtrace(test); - let test = std::process::Command::new(&args[0]).arg("run_test") - .env("RUST_BACKTRACE","0") - .output() - .unwrap(); + let test = std::process::Command::new(&args[0]) + .arg("run_test") + .env("RUST_BACKTRACE", "0") + .output() + .unwrap(); check_for_no_backtrace(test); } } diff --git a/tests/ui/process/println-with-broken-pipe.run.stderr b/tests/ui/process/println-with-broken-pipe.run.stderr index a334c0ad204..ab414994b56 100644 --- a/tests/ui/process/println-with-broken-pipe.run.stderr +++ b/tests/ui/process/println-with-broken-pipe.run.stderr @@ -1,3 +1,4 @@ + thread 'main' panicked at library/std/src/io/stdio.rs:LL:CC: failed printing to stdout: Broken pipe (os error 32) note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace diff --git a/tests/ui/resolve/multiple_definitions_attribute_merging.stderr b/tests/ui/resolve/multiple_definitions_attribute_merging.stderr index 98cad18d442..804fa079bb9 100644 --- a/tests/ui/resolve/multiple_definitions_attribute_merging.stderr +++ b/tests/ui/resolve/multiple_definitions_attribute_merging.stderr @@ -16,7 +16,8 @@ LL | #[repr(C)] LL | struct Dealigned<T>(u8, T); | ^ | - = Box<dyn Any> + = +Box<dyn Any> query stack during panic: #0 [mir_built] building MIR for `<impl at $DIR/multiple_definitions_attribute_merging.rs:15:10: 15:19>::eq` #1 [check_unsafety] unsafety-checking `<impl at $DIR/multiple_definitions_attribute_merging.rs:15:10: 15:19>::eq` diff --git a/tests/ui/resolve/proc_macro_generated_packed.stderr b/tests/ui/resolve/proc_macro_generated_packed.stderr index 4e716704610..a5a02c9c393 100644 --- a/tests/ui/resolve/proc_macro_generated_packed.stderr +++ b/tests/ui/resolve/proc_macro_generated_packed.stderr @@ -7,7 +7,8 @@ LL | #[derive(PartialEq)] LL | struct Dealigned<T>(u8, T); | ^ | - = Box<dyn Any> + = +Box<dyn Any> query stack during panic: #0 [mir_built] building MIR for `<impl at $DIR/proc_macro_generated_packed.rs:15:10: 15:19>::eq` #1 [check_unsafety] unsafety-checking `<impl at $DIR/proc_macro_generated_packed.rs:15:10: 15:19>::eq` diff --git a/tests/ui/stats/input-stats.stderr b/tests/ui/stats/input-stats.stderr index 7183073d665..9b1568fa116 100644 --- a/tests/ui/stats/input-stats.stderr +++ b/tests/ui/stats/input-stats.stderr @@ -146,13 +146,13 @@ hir-stats Variant 144 ( 1.6%) 2 72 hir-stats GenericBound 256 ( 2.9%) 4 64 hir-stats - Trait 256 ( 2.9%) 4 hir-stats Block 288 ( 3.2%) 6 48 -hir-stats GenericParam 360 ( 4.0%) 5 72 hir-stats Pat 360 ( 4.0%) 5 72 hir-stats - Struct 72 ( 0.8%) 1 hir-stats - Wild 72 ( 0.8%) 1 hir-stats - Binding 216 ( 2.4%) 3 -hir-stats Generics 560 ( 6.3%) 10 56 -hir-stats Ty 720 ( 8.1%) 15 48 +hir-stats GenericParam 400 ( 4.5%) 5 80 +hir-stats Generics 560 ( 6.2%) 10 56 +hir-stats Ty 720 ( 8.0%) 15 48 hir-stats - Ptr 48 ( 0.5%) 1 hir-stats - Ref 48 ( 0.5%) 1 hir-stats - Path 624 ( 7.0%) 13 @@ -171,8 +171,8 @@ hir-stats - Impl 88 ( 1.0%) 1 hir-stats - Trait 88 ( 1.0%) 1 hir-stats - Fn 176 ( 2.0%) 2 hir-stats - Use 352 ( 3.9%) 4 -hir-stats Path 1_240 (13.9%) 31 40 -hir-stats PathSegment 1_920 (21.5%) 40 48 +hir-stats Path 1_240 (13.8%) 31 40 +hir-stats PathSegment 1_920 (21.4%) 40 48 hir-stats ---------------------------------------------------------------- -hir-stats Total 8_936 180 +hir-stats Total 8_976 180 hir-stats diff --git a/tests/ui/structs/manual-default-impl-could-be-derived.stderr b/tests/ui/structs/manual-default-impl-could-be-derived.stderr index e8f607fac7e..cf06d5418e1 100644 --- a/tests/ui/structs/manual-default-impl-could-be-derived.stderr +++ b/tests/ui/structs/manual-default-impl-could-be-derived.stderr @@ -31,7 +31,10 @@ LL | | y: 0, LL | | } | |_^ | - = help: to avoid divergence in behavior between `Struct { .. }` and `<Struct as Default>::default()`, derive the `Default` +help: to avoid divergence in behavior between `Struct { .. }` and `<Struct as Default>::default()`, derive the `Default` + | +LL ~ #[derive(Default)] struct B { + | error: `Default` impl doesn't use the declared default field values --> $DIR/manual-default-impl-could-be-derived.rs:43:1 diff --git a/tests/ui/suggestions/dont-suggest-ref/simple.rs b/tests/ui/suggestions/dont-suggest-ref/simple.rs index 1e40e60a1ce..4dea5319264 100644 --- a/tests/ui/suggestions/dont-suggest-ref/simple.rs +++ b/tests/ui/suggestions/dont-suggest-ref/simple.rs @@ -219,42 +219,42 @@ pub fn main() { let (&X(_t),) = (&x.clone(),); //~^ ERROR cannot move - //~| HELP consider borrowing the pattern binding + //~| HELP consider removing the borrow if let (&Either::One(_t),) = (&e.clone(),) { } //~^ ERROR cannot move - //~| HELP consider borrowing the pattern binding + //~| HELP consider removing the borrow while let (&Either::One(_t),) = (&e.clone(),) { } //~^ ERROR cannot move - //~| HELP consider borrowing the pattern binding + //~| HELP consider removing the borrow match (&e.clone(),) { //~^ ERROR cannot move (&Either::One(_t),) - //~^ HELP consider borrowing the pattern binding + //~^ HELP consider removing the borrow | (&Either::Two(_t),) => (), } fn f3((&X(_t),): (&X,)) { } //~^ ERROR cannot move - //~| HELP consider borrowing the pattern binding + //~| HELP consider removing the borrow let (&mut X(_t),) = (&mut xm.clone(),); //~^ ERROR cannot move - //~| HELP consider borrowing the pattern binding + //~| HELP consider removing the mutable borrow if let (&mut Either::One(_t),) = (&mut em.clone(),) { } //~^ ERROR cannot move - //~| HELP consider borrowing the pattern binding + //~| HELP consider removing the mutable borrow while let (&mut Either::One(_t),) = (&mut em.clone(),) { } //~^ ERROR cannot move - //~| HELP consider borrowing the pattern binding + //~| HELP consider removing the mutable borrow match (&mut em.clone(),) { //~^ ERROR cannot move (&mut Either::One(_t),) => (), - //~^ HELP consider borrowing the pattern binding + //~^ HELP consider removing the mutable borrow (&mut Either::Two(_t),) => (), - //~^ HELP consider borrowing the pattern binding + //~^ HELP consider removing the mutable borrow } fn f4((&mut X(_t),): (&mut X,)) { } //~^ ERROR cannot move - //~| HELP consider borrowing the pattern binding + //~| HELP consider removing the mutable borrow // move from &Either/&X value diff --git a/tests/ui/suggestions/dont-suggest-ref/simple.stderr b/tests/ui/suggestions/dont-suggest-ref/simple.stderr index 7d902dbccc4..41571bf9b2c 100644 --- a/tests/ui/suggestions/dont-suggest-ref/simple.stderr +++ b/tests/ui/suggestions/dont-suggest-ref/simple.stderr @@ -578,10 +578,11 @@ LL | let (&X(_t),) = (&x.clone(),); | data moved here | move occurs because `_t` has type `Y`, which does not implement the `Copy` trait | -help: consider borrowing the pattern binding +help: consider removing the borrow + | +LL - let (&X(_t),) = (&x.clone(),); +LL + let (X(_t),) = (&x.clone(),); | -LL | let (&X(ref _t),) = (&x.clone(),); - | +++ error[E0507]: cannot move out of a shared reference --> $DIR/simple.rs:223:34 @@ -592,10 +593,11 @@ LL | if let (&Either::One(_t),) = (&e.clone(),) { } | data moved here | move occurs because `_t` has type `X`, which does not implement the `Copy` trait | -help: consider borrowing the pattern binding +help: consider removing the borrow + | +LL - if let (&Either::One(_t),) = (&e.clone(),) { } +LL + if let (Either::One(_t),) = (&e.clone(),) { } | -LL | if let (&Either::One(ref _t),) = (&e.clone(),) { } - | +++ error[E0507]: cannot move out of a shared reference --> $DIR/simple.rs:226:37 @@ -606,10 +608,11 @@ LL | while let (&Either::One(_t),) = (&e.clone(),) { } | data moved here | move occurs because `_t` has type `X`, which does not implement the `Copy` trait | -help: consider borrowing the pattern binding +help: consider removing the borrow + | +LL - while let (&Either::One(_t),) = (&e.clone(),) { } +LL + while let (Either::One(_t),) = (&e.clone(),) { } | -LL | while let (&Either::One(ref _t),) = (&e.clone(),) { } - | +++ error[E0507]: cannot move out of a shared reference --> $DIR/simple.rs:229:11 @@ -623,10 +626,11 @@ LL | (&Either::One(_t),) | data moved here | move occurs because `_t` has type `X`, which does not implement the `Copy` trait | -help: consider borrowing the pattern binding +help: consider removing the borrow + | +LL - (&Either::One(_t),) +LL + (Either::One(_t),) | -LL | (&Either::One(ref _t),) - | +++ error[E0507]: cannot move out of a mutable reference --> $DIR/simple.rs:239:25 @@ -637,10 +641,11 @@ LL | let (&mut X(_t),) = (&mut xm.clone(),); | data moved here | move occurs because `_t` has type `Y`, which does not implement the `Copy` trait | -help: consider borrowing the pattern binding +help: consider removing the mutable borrow + | +LL - let (&mut X(_t),) = (&mut xm.clone(),); +LL + let (X(_t),) = (&mut xm.clone(),); | -LL | let (&mut X(ref _t),) = (&mut xm.clone(),); - | +++ error[E0507]: cannot move out of a mutable reference --> $DIR/simple.rs:242:38 @@ -651,10 +656,11 @@ LL | if let (&mut Either::One(_t),) = (&mut em.clone(),) { } | data moved here | move occurs because `_t` has type `X`, which does not implement the `Copy` trait | -help: consider borrowing the pattern binding +help: consider removing the mutable borrow + | +LL - if let (&mut Either::One(_t),) = (&mut em.clone(),) { } +LL + if let (Either::One(_t),) = (&mut em.clone(),) { } | -LL | if let (&mut Either::One(ref _t),) = (&mut em.clone(),) { } - | +++ error[E0507]: cannot move out of a mutable reference --> $DIR/simple.rs:245:41 @@ -665,10 +671,11 @@ LL | while let (&mut Either::One(_t),) = (&mut em.clone(),) { } | data moved here | move occurs because `_t` has type `X`, which does not implement the `Copy` trait | -help: consider borrowing the pattern binding +help: consider removing the mutable borrow + | +LL - while let (&mut Either::One(_t),) = (&mut em.clone(),) { } +LL + while let (Either::One(_t),) = (&mut em.clone(),) { } | -LL | while let (&mut Either::One(ref _t),) = (&mut em.clone(),) { } - | +++ error[E0507]: cannot move out of a mutable reference --> $DIR/simple.rs:248:11 @@ -683,14 +690,16 @@ LL | (&mut Either::Two(_t),) => (), | -- ...and here | = note: move occurs because these variables have types that don't implement the `Copy` trait -help: consider borrowing the pattern binding +help: consider removing the mutable borrow | -LL | (&mut Either::One(ref _t),) => (), - | +++ -help: consider borrowing the pattern binding +LL - (&mut Either::One(_t),) => (), +LL + (Either::One(_t),) => (), + | +help: consider removing the mutable borrow + | +LL - (&mut Either::Two(_t),) => (), +LL + (Either::Two(_t),) => (), | -LL | (&mut Either::Two(ref _t),) => (), - | +++ error[E0507]: cannot move out of a shared reference --> $DIR/simple.rs:261:18 @@ -947,10 +956,11 @@ LL | fn f3((&X(_t),): (&X,)) { } | data moved here | move occurs because `_t` has type `Y`, which does not implement the `Copy` trait | -help: consider borrowing the pattern binding +help: consider removing the borrow + | +LL - fn f3((&X(_t),): (&X,)) { } +LL + fn f3((X(_t),): (&X,)) { } | -LL | fn f3((&X(ref _t),): (&X,)) { } - | +++ error[E0507]: cannot move out of a mutable reference --> $DIR/simple.rs:255:11 @@ -961,10 +971,11 @@ LL | fn f4((&mut X(_t),): (&mut X,)) { } | data moved here | move occurs because `_t` has type `Y`, which does not implement the `Copy` trait | -help: consider borrowing the pattern binding +help: consider removing the mutable borrow + | +LL - fn f4((&mut X(_t),): (&mut X,)) { } +LL + fn f4((X(_t),): (&mut X,)) { } | -LL | fn f4((&mut X(ref _t),): (&mut X,)) { } - | +++ error[E0507]: cannot move out of `a.a` as enum variant `Some` which is behind a shared reference --> $DIR/simple.rs:331:20 diff --git a/tests/ui/suggestions/issue-84973-blacklist.stderr b/tests/ui/suggestions/issue-84973-blacklist.stderr index a6324a824c1..3db400418c7 100644 --- a/tests/ui/suggestions/issue-84973-blacklist.stderr +++ b/tests/ui/suggestions/issue-84973-blacklist.stderr @@ -86,6 +86,10 @@ note: required by a bound in `f_send` | LL | fn f_send<T: Send>(t: T) {} | ^^^^ required by this bound in `f_send` +help: consider dereferencing here + | +LL | f_send(*rc); + | + error: aborting due to 5 previous errors diff --git a/tests/ui/suggestions/option-content-move-from-tuple-match.stderr b/tests/ui/suggestions/option-content-move-from-tuple-match.stderr index 63314acb87c..c93570c579e 100644 --- a/tests/ui/suggestions/option-content-move-from-tuple-match.stderr +++ b/tests/ui/suggestions/option-content-move-from-tuple-match.stderr @@ -10,10 +10,11 @@ LL | (None, &c) => &c.unwrap(), | data moved here | move occurs because `c` has type `Option<String>`, which does not implement the `Copy` trait | -help: consider borrowing the pattern binding +help: consider removing the borrow + | +LL - (None, &c) => &c.unwrap(), +LL + (None, c) => &c.unwrap(), | -LL | (None, &ref c) => &c.unwrap(), - | +++ error: aborting due to 1 previous error diff --git a/tests/ui/test-attrs/terse.run.stdout b/tests/ui/test-attrs/terse.run.stdout index 2b361361ae8..ac1ac28c98d 100644 --- a/tests/ui/test-attrs/terse.run.stdout +++ b/tests/ui/test-attrs/terse.run.stdout @@ -9,15 +9,18 @@ foo2 --- FAILED failures: ---- abc stdout ---- + thread 'abc' panicked at $DIR/terse.rs:12:5: explicit panic note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace ---- foo stdout ---- + thread 'foo' panicked at $DIR/terse.rs:17:5: explicit panic ---- foo2 stdout ---- + thread 'foo2' panicked at $DIR/terse.rs:22:5: explicit panic diff --git a/tests/ui/test-attrs/test-panic-abort-nocapture.run.stderr b/tests/ui/test-attrs/test-panic-abort-nocapture.run.stderr index 16001b3eecd..25681171170 100644 --- a/tests/ui/test-attrs/test-panic-abort-nocapture.run.stderr +++ b/tests/ui/test-attrs/test-panic-abort-nocapture.run.stderr @@ -1,8 +1,10 @@ + thread 'main' panicked at $DIR/test-panic-abort-nocapture.rs:34:5: assertion `left == right` failed left: 2 right: 4 note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace + thread 'main' panicked at $DIR/test-panic-abort-nocapture.rs:28:5: assertion `left == right` failed left: 2 diff --git a/tests/ui/test-attrs/test-panic-abort.run.stdout b/tests/ui/test-attrs/test-panic-abort.run.stdout index f5d14e77da9..844808e8637 100644 --- a/tests/ui/test-attrs/test-panic-abort.run.stdout +++ b/tests/ui/test-attrs/test-panic-abort.run.stdout @@ -17,6 +17,7 @@ hello, world testing123 ---- it_fails stderr ---- testing321 + thread 'main' panicked at $DIR/test-panic-abort.rs:39:5: assertion `left == right` failed left: 2 diff --git a/tests/ui/test-attrs/test-thread-capture.run.stdout b/tests/ui/test-attrs/test-thread-capture.run.stdout index 31261aaa230..f9b9757f861 100644 --- a/tests/ui/test-attrs/test-thread-capture.run.stdout +++ b/tests/ui/test-attrs/test-thread-capture.run.stdout @@ -10,6 +10,7 @@ fee fie foe fum + thread 'thready_fail' panicked at $DIR/test-thread-capture.rs:32:5: explicit panic note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace diff --git a/tests/ui/test-attrs/test-thread-nocapture.run.stderr b/tests/ui/test-attrs/test-thread-nocapture.run.stderr index 9266fe84197..59560015fca 100644 --- a/tests/ui/test-attrs/test-thread-nocapture.run.stderr +++ b/tests/ui/test-attrs/test-thread-nocapture.run.stderr @@ -1,3 +1,4 @@ + thread 'thready_fail' panicked at $DIR/test-thread-nocapture.rs:32:5: explicit panic note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace diff --git a/tests/ui/track-diagnostics/track.stderr b/tests/ui/track-diagnostics/track.stderr index 436f9ecf93d..d2908bb9177 100644 --- a/tests/ui/track-diagnostics/track.stderr +++ b/tests/ui/track-diagnostics/track.stderr @@ -24,6 +24,7 @@ LL | break rust = note: rustc $VERSION running on $TARGET = note: compiler flags: ... -Z ui-testing ... -Z track-diagnostics + thread 'rustc' panicked at compiler/rustc_hir_typeck/src/lib.rs:LL:CC: Box<dyn Any> note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace diff --git a/tests/ui/traits/suggest-dereferences/deref-argument.fixed b/tests/ui/traits/suggest-dereferences/deref-argument.fixed new file mode 100644 index 00000000000..8235ae0b628 --- /dev/null +++ b/tests/ui/traits/suggest-dereferences/deref-argument.fixed @@ -0,0 +1,37 @@ +//@ run-rustfix +//! diagnostic test for #90997. +//! test that E0277 suggests dereferences to satisfy bounds when the referent is `Copy` or boxed. +use std::ops::Deref; + +trait Test { + fn test(self); +} +fn consume_test(x: impl Test) { x.test() } + +impl Test for u32 { + fn test(self) {} +} +struct MyRef(u32); +impl Deref for MyRef { + type Target = u32; + fn deref(&self) -> &Self::Target { + &self.0 + } +} + +struct NonCopy; +impl Test for NonCopy { + fn test(self) {} +} + +fn main() { + let my_ref = MyRef(0); + consume_test(*my_ref); + //~^ ERROR the trait bound `MyRef: Test` is not satisfied + //~| SUGGESTION * + + let nested_box = Box::new(Box::new(Box::new(NonCopy))); + consume_test(***nested_box); + //~^ ERROR the trait bound `Box<Box<Box<NonCopy>>>: Test` is not satisfied + //~| SUGGESTION *** +} diff --git a/tests/ui/traits/suggest-dereferences/deref-argument.rs b/tests/ui/traits/suggest-dereferences/deref-argument.rs new file mode 100644 index 00000000000..2f96b75c4e4 --- /dev/null +++ b/tests/ui/traits/suggest-dereferences/deref-argument.rs @@ -0,0 +1,37 @@ +//@ run-rustfix +//! diagnostic test for #90997. +//! test that E0277 suggests dereferences to satisfy bounds when the referent is `Copy` or boxed. +use std::ops::Deref; + +trait Test { + fn test(self); +} +fn consume_test(x: impl Test) { x.test() } + +impl Test for u32 { + fn test(self) {} +} +struct MyRef(u32); +impl Deref for MyRef { + type Target = u32; + fn deref(&self) -> &Self::Target { + &self.0 + } +} + +struct NonCopy; +impl Test for NonCopy { + fn test(self) {} +} + +fn main() { + let my_ref = MyRef(0); + consume_test(my_ref); + //~^ ERROR the trait bound `MyRef: Test` is not satisfied + //~| SUGGESTION * + + let nested_box = Box::new(Box::new(Box::new(NonCopy))); + consume_test(nested_box); + //~^ ERROR the trait bound `Box<Box<Box<NonCopy>>>: Test` is not satisfied + //~| SUGGESTION *** +} diff --git a/tests/ui/traits/suggest-dereferences/deref-argument.stderr b/tests/ui/traits/suggest-dereferences/deref-argument.stderr new file mode 100644 index 00000000000..3dc92fd6ab6 --- /dev/null +++ b/tests/ui/traits/suggest-dereferences/deref-argument.stderr @@ -0,0 +1,39 @@ +error[E0277]: the trait bound `MyRef: Test` is not satisfied + --> $DIR/deref-argument.rs:29:18 + | +LL | consume_test(my_ref); + | ------------ ^^^^^^ the trait `Test` is not implemented for `MyRef` + | | + | required by a bound introduced by this call + | +note: required by a bound in `consume_test` + --> $DIR/deref-argument.rs:9:25 + | +LL | fn consume_test(x: impl Test) { x.test() } + | ^^^^ required by this bound in `consume_test` +help: consider dereferencing here + | +LL | consume_test(*my_ref); + | + + +error[E0277]: the trait bound `Box<Box<Box<NonCopy>>>: Test` is not satisfied + --> $DIR/deref-argument.rs:34:18 + | +LL | consume_test(nested_box); + | ------------ ^^^^^^^^^^ the trait `Test` is not implemented for `Box<Box<Box<NonCopy>>>` + | | + | required by a bound introduced by this call + | +note: required by a bound in `consume_test` + --> $DIR/deref-argument.rs:9:25 + | +LL | fn consume_test(x: impl Test) { x.test() } + | ^^^^ required by this bound in `consume_test` +help: consider dereferencing here + | +LL | consume_test(***nested_box); + | +++ + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0277`. diff --git a/tests/ui/treat-err-as-bug/err.stderr b/tests/ui/treat-err-as-bug/err.stderr index eb7b50b4210..df5fed3fb8e 100644 --- a/tests/ui/treat-err-as-bug/err.stderr +++ b/tests/ui/treat-err-as-bug/err.stderr @@ -4,6 +4,7 @@ error: internal compiler error[E0080]: could not evaluate static initializer LL | pub static C: u32 = 0 - 1; | ^^^^^ attempt to compute `0_u32 - 1_u32`, which would overflow + error: the compiler unexpectedly panicked. this is a bug. query stack during panic: diff --git a/tests/ui/treat-err-as-bug/span_delayed_bug.stderr b/tests/ui/treat-err-as-bug/span_delayed_bug.stderr index f0e8cd0ddb9..aec1b89c766 100644 --- a/tests/ui/treat-err-as-bug/span_delayed_bug.stderr +++ b/tests/ui/treat-err-as-bug/span_delayed_bug.stderr @@ -4,6 +4,7 @@ error: internal compiler error: delayed bug triggered by #[rustc_error(delayed_b LL | fn main() {} | ^^^^^^^^^ + error: the compiler unexpectedly panicked. this is a bug. query stack during panic: |
