diff options
| author | bors <bors@rust-lang.org> | 2022-01-23 09:16:32 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2022-01-23 09:16:32 +0000 |
| commit | 16c1a9dd7cd497b050bc957cdfa54f8d3d6e97f2 (patch) | |
| tree | cd9ddef8fcb8d502aea788b7981b559ed5ee1d21 /src/test | |
| parent | d13e8dd41d44a73664943169d5b7fe39b22c449f (diff) | |
| parent | 1a935a52be89f5b80b287a7c08a77b5dc1efaaeb (diff) | |
Auto merge of #93220 - matthiaskrgr:rollup-9bkrlk0, r=matthiaskrgr
Rollup of 8 pull requests Successful merges: - #90666 (Stabilize arc_new_cyclic) - #91122 (impl Not for !) - #93068 (Fix spacing for `·` between stability and source) - #93103 (Tweak `expr.await` desugaring `Span`) - #93113 (Unify search input and buttons size) - #93168 (update uclibc instructions for new toolchain, add link from platforms doc) - #93185 (rustdoc: Make some `pub` items crate-private) - #93196 (Remove dead code from build_helper) Failed merges: - #93188 (rustdoc: fix bump down typing search on Safari) r? `@ghost` `@rustbot` modify labels: rollup
Diffstat (limited to 'src/test')
| -rw-r--r-- | src/test/rustdoc/source-version-separator.rs | 5 | ||||
| -rw-r--r-- | src/test/ui/async-await/proper-span-for-type-error.fixed | 11 | ||||
| -rw-r--r-- | src/test/ui/async-await/proper-span-for-type-error.rs | 11 | ||||
| -rw-r--r-- | src/test/ui/async-await/proper-span-for-type-error.stderr | 16 | ||||
| -rw-r--r-- | src/test/ui/reachable/expr_unary.rs | 4 | ||||
| -rw-r--r-- | src/test/ui/reachable/expr_unary.stderr | 10 |
6 files changed, 47 insertions, 10 deletions
diff --git a/src/test/rustdoc/source-version-separator.rs b/src/test/rustdoc/source-version-separator.rs index 45a555eaa15..8d23ca91801 100644 --- a/src/test/rustdoc/source-version-separator.rs +++ b/src/test/rustdoc/source-version-separator.rs @@ -1,10 +1,9 @@ #![stable(feature = "bar", since = "1.0")] #![crate_name = "foo"] - #![feature(staged_api)] // @has foo/trait.Bar.html -// @has - '//div[@class="main-heading"]/*[@class="out-of-band"]' '1.0· source · ' +// @has - '//div[@class="main-heading"]/*[@class="out-of-band"]' '1.0 · source · ' #[stable(feature = "bar", since = "1.0")] pub trait Bar { // @has - '//div[@id="tymethod.foo"]/*[@class="rightside"]' '3.0 · source' @@ -15,7 +14,7 @@ pub trait Bar { // @has - '//div[@id="implementors-list"]//*[@class="rightside"]' '4.0 · source' // @has foo/struct.Foo.html -// @has - '//div[@class="main-heading"]/*[@class="out-of-band"]' '1.0· source · ' +// @has - '//div[@class="main-heading"]/*[@class="out-of-band"]' '1.0 · source · ' #[stable(feature = "baz", since = "1.0")] pub struct Foo; diff --git a/src/test/ui/async-await/proper-span-for-type-error.fixed b/src/test/ui/async-await/proper-span-for-type-error.fixed new file mode 100644 index 00000000000..1f1e1184dcc --- /dev/null +++ b/src/test/ui/async-await/proper-span-for-type-error.fixed @@ -0,0 +1,11 @@ +// edition:2021 +// run-rustfix +#![allow(dead_code)] + +async fn a() {} + +async fn foo() -> Result<(), i32> { + Ok(a().await) //~ ERROR mismatched types +} + +fn main() {} diff --git a/src/test/ui/async-await/proper-span-for-type-error.rs b/src/test/ui/async-await/proper-span-for-type-error.rs new file mode 100644 index 00000000000..00ccde1bf99 --- /dev/null +++ b/src/test/ui/async-await/proper-span-for-type-error.rs @@ -0,0 +1,11 @@ +// edition:2021 +// run-rustfix +#![allow(dead_code)] + +async fn a() {} + +async fn foo() -> Result<(), i32> { + a().await //~ ERROR mismatched types +} + +fn main() {} diff --git a/src/test/ui/async-await/proper-span-for-type-error.stderr b/src/test/ui/async-await/proper-span-for-type-error.stderr new file mode 100644 index 00000000000..611dc0407bf --- /dev/null +++ b/src/test/ui/async-await/proper-span-for-type-error.stderr @@ -0,0 +1,16 @@ +error[E0308]: mismatched types + --> $DIR/proper-span-for-type-error.rs:8:5 + | +LL | a().await + | ^^^^^^^^^ expected enum `Result`, found `()` + | + = note: expected enum `Result<(), i32>` + found unit type `()` +help: try wrapping the expression in `Ok` + | +LL | Ok(a().await) + | +++ + + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0308`. diff --git a/src/test/ui/reachable/expr_unary.rs b/src/test/ui/reachable/expr_unary.rs index e229d22ebc7..190c7447dcc 100644 --- a/src/test/ui/reachable/expr_unary.rs +++ b/src/test/ui/reachable/expr_unary.rs @@ -5,8 +5,8 @@ #![deny(unreachable_code)] fn foo() { - let x: ! = ! { return; }; //~ ERROR unreachable - //~| ERROR cannot apply unary operator `!` to type `!` + let x: ! = * { return; }; //~ ERROR unreachable + //~| ERROR type `!` cannot be dereferenced } fn main() { } diff --git a/src/test/ui/reachable/expr_unary.stderr b/src/test/ui/reachable/expr_unary.stderr index 063d841c25e..0a763087c6f 100644 --- a/src/test/ui/reachable/expr_unary.stderr +++ b/src/test/ui/reachable/expr_unary.stderr @@ -1,13 +1,13 @@ -error[E0600]: cannot apply unary operator `!` to type `!` +error[E0614]: type `!` cannot be dereferenced --> $DIR/expr_unary.rs:8:16 | -LL | let x: ! = ! { return; }; - | ^^^^^^^^^^^^^ cannot apply unary operator `!` +LL | let x: ! = * { return; }; + | ^^^^^^^^^^^^^ error: unreachable expression --> $DIR/expr_unary.rs:8:16 | -LL | let x: ! = ! { return; }; +LL | let x: ! = * { return; }; | ^^^^------^^^ | | | | | any code following this expression is unreachable @@ -21,4 +21,4 @@ LL | #![deny(unreachable_code)] error: aborting due to 2 previous errors -For more information about this error, try `rustc --explain E0600`. +For more information about this error, try `rustc --explain E0614`. |
