Rollup merge of #109193 - spastorino:new-rpitit-11, r=compiler-errors
Add revisions for -Zlower-impl-trait-in-trait-to-assoc-ty fixed tests Needs to go on top of #109198 r? ``@compiler-errors``
This commit is contained in:
commit
a79925d63f
42
tests/ui/async-await/async-trait-fn.current.stderr
Normal file
42
tests/ui/async-await/async-trait-fn.current.stderr
Normal file
@ -0,0 +1,42 @@
|
|||||||
|
error[E0706]: functions in traits cannot be declared `async`
|
||||||
|
--> $DIR/async-trait-fn.rs:6:5
|
||||||
|
|
|
||||||
|
LL | async fn foo() {}
|
||||||
|
| -----^^^^^^^^^
|
||||||
|
| |
|
||||||
|
| `async` because of this
|
||||||
|
|
|
||||||
|
= note: `async` trait functions are not currently supported
|
||||||
|
= note: consider using the `async-trait` crate: https://crates.io/crates/async-trait
|
||||||
|
= note: see issue #91611 <https://github.com/rust-lang/rust/issues/91611> for more information
|
||||||
|
= help: add `#![feature(async_fn_in_trait)]` to the crate attributes to enable
|
||||||
|
|
||||||
|
error[E0706]: functions in traits cannot be declared `async`
|
||||||
|
--> $DIR/async-trait-fn.rs:7:5
|
||||||
|
|
|
||||||
|
LL | async fn bar(&self) {}
|
||||||
|
| -----^^^^^^^^^^^^^^
|
||||||
|
| |
|
||||||
|
| `async` because of this
|
||||||
|
|
|
||||||
|
= note: `async` trait functions are not currently supported
|
||||||
|
= note: consider using the `async-trait` crate: https://crates.io/crates/async-trait
|
||||||
|
= note: see issue #91611 <https://github.com/rust-lang/rust/issues/91611> for more information
|
||||||
|
= help: add `#![feature(async_fn_in_trait)]` to the crate attributes to enable
|
||||||
|
|
||||||
|
error[E0706]: functions in traits cannot be declared `async`
|
||||||
|
--> $DIR/async-trait-fn.rs:8:5
|
||||||
|
|
|
||||||
|
LL | async fn baz() {
|
||||||
|
| -----^^^^^^^^^
|
||||||
|
| |
|
||||||
|
| `async` because of this
|
||||||
|
|
|
||||||
|
= note: `async` trait functions are not currently supported
|
||||||
|
= note: consider using the `async-trait` crate: https://crates.io/crates/async-trait
|
||||||
|
= note: see issue #91611 <https://github.com/rust-lang/rust/issues/91611> for more information
|
||||||
|
= help: add `#![feature(async_fn_in_trait)]` to the crate attributes to enable
|
||||||
|
|
||||||
|
error: aborting due to 3 previous errors
|
||||||
|
|
||||||
|
For more information about this error, try `rustc --explain E0706`.
|
42
tests/ui/async-await/async-trait-fn.next.stderr
Normal file
42
tests/ui/async-await/async-trait-fn.next.stderr
Normal file
@ -0,0 +1,42 @@
|
|||||||
|
error[E0706]: functions in traits cannot be declared `async`
|
||||||
|
--> $DIR/async-trait-fn.rs:6:5
|
||||||
|
|
|
||||||
|
LL | async fn foo() {}
|
||||||
|
| -----^^^^^^^^^
|
||||||
|
| |
|
||||||
|
| `async` because of this
|
||||||
|
|
|
||||||
|
= note: `async` trait functions are not currently supported
|
||||||
|
= note: consider using the `async-trait` crate: https://crates.io/crates/async-trait
|
||||||
|
= note: see issue #91611 <https://github.com/rust-lang/rust/issues/91611> for more information
|
||||||
|
= help: add `#![feature(async_fn_in_trait)]` to the crate attributes to enable
|
||||||
|
|
||||||
|
error[E0706]: functions in traits cannot be declared `async`
|
||||||
|
--> $DIR/async-trait-fn.rs:7:5
|
||||||
|
|
|
||||||
|
LL | async fn bar(&self) {}
|
||||||
|
| -----^^^^^^^^^^^^^^
|
||||||
|
| |
|
||||||
|
| `async` because of this
|
||||||
|
|
|
||||||
|
= note: `async` trait functions are not currently supported
|
||||||
|
= note: consider using the `async-trait` crate: https://crates.io/crates/async-trait
|
||||||
|
= note: see issue #91611 <https://github.com/rust-lang/rust/issues/91611> for more information
|
||||||
|
= help: add `#![feature(async_fn_in_trait)]` to the crate attributes to enable
|
||||||
|
|
||||||
|
error[E0706]: functions in traits cannot be declared `async`
|
||||||
|
--> $DIR/async-trait-fn.rs:8:5
|
||||||
|
|
|
||||||
|
LL | async fn baz() {
|
||||||
|
| -----^^^^^^^^^
|
||||||
|
| |
|
||||||
|
| `async` because of this
|
||||||
|
|
|
||||||
|
= note: `async` trait functions are not currently supported
|
||||||
|
= note: consider using the `async-trait` crate: https://crates.io/crates/async-trait
|
||||||
|
= note: see issue #91611 <https://github.com/rust-lang/rust/issues/91611> for more information
|
||||||
|
= help: add `#![feature(async_fn_in_trait)]` to the crate attributes to enable
|
||||||
|
|
||||||
|
error: aborting due to 3 previous errors
|
||||||
|
|
||||||
|
For more information about this error, try `rustc --explain E0706`.
|
@ -1,4 +1,5 @@
|
|||||||
// edition:2018
|
// edition:2018
|
||||||
|
|
||||||
trait T {
|
trait T {
|
||||||
async fn foo() {} //~ ERROR functions in traits cannot be declared `async`
|
async fn foo() {} //~ ERROR functions in traits cannot be declared `async`
|
||||||
async fn bar(&self) {} //~ ERROR functions in traits cannot be declared `async`
|
async fn bar(&self) {} //~ ERROR functions in traits cannot be declared `async`
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
error[E0706]: functions in traits cannot be declared `async`
|
error[E0706]: functions in traits cannot be declared `async`
|
||||||
--> $DIR/async-trait-fn.rs:3:5
|
--> $DIR/async-trait-fn.rs:4:5
|
||||||
|
|
|
|
||||||
LL | async fn foo() {}
|
LL | async fn foo() {}
|
||||||
| -----^^^^^^^^^
|
| -----^^^^^^^^^
|
||||||
@ -12,7 +12,7 @@ LL | async fn foo() {}
|
|||||||
= help: add `#![feature(async_fn_in_trait)]` to the crate attributes to enable
|
= help: add `#![feature(async_fn_in_trait)]` to the crate attributes to enable
|
||||||
|
|
||||||
error[E0706]: functions in traits cannot be declared `async`
|
error[E0706]: functions in traits cannot be declared `async`
|
||||||
--> $DIR/async-trait-fn.rs:4:5
|
--> $DIR/async-trait-fn.rs:5:5
|
||||||
|
|
|
|
||||||
LL | async fn bar(&self) {}
|
LL | async fn bar(&self) {}
|
||||||
| -----^^^^^^^^^^^^^^
|
| -----^^^^^^^^^^^^^^
|
||||||
@ -25,7 +25,7 @@ LL | async fn bar(&self) {}
|
|||||||
= help: add `#![feature(async_fn_in_trait)]` to the crate attributes to enable
|
= help: add `#![feature(async_fn_in_trait)]` to the crate attributes to enable
|
||||||
|
|
||||||
error[E0706]: functions in traits cannot be declared `async`
|
error[E0706]: functions in traits cannot be declared `async`
|
||||||
--> $DIR/async-trait-fn.rs:5:5
|
--> $DIR/async-trait-fn.rs:6:5
|
||||||
|
|
|
|
||||||
LL | async fn baz() {
|
LL | async fn baz() {
|
||||||
| -----^^^^^^^^^
|
| -----^^^^^^^^^
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
error[E0670]: `async fn` is not permitted in Rust 2015
|
error[E0670]: `async fn` is not permitted in Rust 2015
|
||||||
--> $DIR/edition-deny-async-fns-2015.rs:3:1
|
--> $DIR/edition-deny-async-fns-2015.rs:5:1
|
||||||
|
|
|
|
||||||
LL | async fn foo() {}
|
LL | async fn foo() {}
|
||||||
| ^^^^^ to use `async fn`, switch to Rust 2018 or later
|
| ^^^^^ to use `async fn`, switch to Rust 2018 or later
|
||||||
@ -8,7 +8,7 @@ LL | async fn foo() {}
|
|||||||
= note: for more on editions, read https://doc.rust-lang.org/edition-guide
|
= note: for more on editions, read https://doc.rust-lang.org/edition-guide
|
||||||
|
|
||||||
error[E0670]: `async fn` is not permitted in Rust 2015
|
error[E0670]: `async fn` is not permitted in Rust 2015
|
||||||
--> $DIR/edition-deny-async-fns-2015.rs:5:12
|
--> $DIR/edition-deny-async-fns-2015.rs:7:12
|
||||||
|
|
|
|
||||||
LL | fn baz() { async fn foo() {} }
|
LL | fn baz() { async fn foo() {} }
|
||||||
| ^^^^^ to use `async fn`, switch to Rust 2018 or later
|
| ^^^^^ to use `async fn`, switch to Rust 2018 or later
|
||||||
@ -17,7 +17,7 @@ LL | fn baz() { async fn foo() {} }
|
|||||||
= note: for more on editions, read https://doc.rust-lang.org/edition-guide
|
= note: for more on editions, read https://doc.rust-lang.org/edition-guide
|
||||||
|
|
||||||
error[E0670]: `async fn` is not permitted in Rust 2015
|
error[E0670]: `async fn` is not permitted in Rust 2015
|
||||||
--> $DIR/edition-deny-async-fns-2015.rs:7:1
|
--> $DIR/edition-deny-async-fns-2015.rs:9:1
|
||||||
|
|
|
|
||||||
LL | async fn async_baz() {
|
LL | async fn async_baz() {
|
||||||
| ^^^^^ to use `async fn`, switch to Rust 2018 or later
|
| ^^^^^ to use `async fn`, switch to Rust 2018 or later
|
||||||
@ -26,7 +26,7 @@ LL | async fn async_baz() {
|
|||||||
= note: for more on editions, read https://doc.rust-lang.org/edition-guide
|
= note: for more on editions, read https://doc.rust-lang.org/edition-guide
|
||||||
|
|
||||||
error[E0670]: `async fn` is not permitted in Rust 2015
|
error[E0670]: `async fn` is not permitted in Rust 2015
|
||||||
--> $DIR/edition-deny-async-fns-2015.rs:8:5
|
--> $DIR/edition-deny-async-fns-2015.rs:10:5
|
||||||
|
|
|
|
||||||
LL | async fn bar() {}
|
LL | async fn bar() {}
|
||||||
| ^^^^^ to use `async fn`, switch to Rust 2018 or later
|
| ^^^^^ to use `async fn`, switch to Rust 2018 or later
|
||||||
@ -35,7 +35,7 @@ LL | async fn bar() {}
|
|||||||
= note: for more on editions, read https://doc.rust-lang.org/edition-guide
|
= note: for more on editions, read https://doc.rust-lang.org/edition-guide
|
||||||
|
|
||||||
error[E0670]: `async fn` is not permitted in Rust 2015
|
error[E0670]: `async fn` is not permitted in Rust 2015
|
||||||
--> $DIR/edition-deny-async-fns-2015.rs:14:5
|
--> $DIR/edition-deny-async-fns-2015.rs:16:5
|
||||||
|
|
|
|
||||||
LL | async fn foo() {}
|
LL | async fn foo() {}
|
||||||
| ^^^^^ to use `async fn`, switch to Rust 2018 or later
|
| ^^^^^ to use `async fn`, switch to Rust 2018 or later
|
||||||
@ -44,7 +44,7 @@ LL | async fn foo() {}
|
|||||||
= note: for more on editions, read https://doc.rust-lang.org/edition-guide
|
= note: for more on editions, read https://doc.rust-lang.org/edition-guide
|
||||||
|
|
||||||
error[E0670]: `async fn` is not permitted in Rust 2015
|
error[E0670]: `async fn` is not permitted in Rust 2015
|
||||||
--> $DIR/edition-deny-async-fns-2015.rs:18:5
|
--> $DIR/edition-deny-async-fns-2015.rs:20:5
|
||||||
|
|
|
|
||||||
LL | async fn foo() {}
|
LL | async fn foo() {}
|
||||||
| ^^^^^ to use `async fn`, switch to Rust 2018 or later
|
| ^^^^^ to use `async fn`, switch to Rust 2018 or later
|
||||||
@ -53,7 +53,7 @@ LL | async fn foo() {}
|
|||||||
= note: for more on editions, read https://doc.rust-lang.org/edition-guide
|
= note: for more on editions, read https://doc.rust-lang.org/edition-guide
|
||||||
|
|
||||||
error[E0670]: `async fn` is not permitted in Rust 2015
|
error[E0670]: `async fn` is not permitted in Rust 2015
|
||||||
--> $DIR/edition-deny-async-fns-2015.rs:36:9
|
--> $DIR/edition-deny-async-fns-2015.rs:38:9
|
||||||
|
|
|
|
||||||
LL | async fn bar() {}
|
LL | async fn bar() {}
|
||||||
| ^^^^^ to use `async fn`, switch to Rust 2018 or later
|
| ^^^^^ to use `async fn`, switch to Rust 2018 or later
|
||||||
@ -62,7 +62,7 @@ LL | async fn bar() {}
|
|||||||
= note: for more on editions, read https://doc.rust-lang.org/edition-guide
|
= note: for more on editions, read https://doc.rust-lang.org/edition-guide
|
||||||
|
|
||||||
error[E0670]: `async fn` is not permitted in Rust 2015
|
error[E0670]: `async fn` is not permitted in Rust 2015
|
||||||
--> $DIR/edition-deny-async-fns-2015.rs:26:9
|
--> $DIR/edition-deny-async-fns-2015.rs:28:9
|
||||||
|
|
|
|
||||||
LL | async fn foo() {}
|
LL | async fn foo() {}
|
||||||
| ^^^^^ to use `async fn`, switch to Rust 2018 or later
|
| ^^^^^ to use `async fn`, switch to Rust 2018 or later
|
||||||
@ -71,7 +71,7 @@ LL | async fn foo() {}
|
|||||||
= note: for more on editions, read https://doc.rust-lang.org/edition-guide
|
= note: for more on editions, read https://doc.rust-lang.org/edition-guide
|
||||||
|
|
||||||
error[E0670]: `async fn` is not permitted in Rust 2015
|
error[E0670]: `async fn` is not permitted in Rust 2015
|
||||||
--> $DIR/edition-deny-async-fns-2015.rs:31:13
|
--> $DIR/edition-deny-async-fns-2015.rs:33:13
|
||||||
|
|
|
|
||||||
LL | async fn bar() {}
|
LL | async fn bar() {}
|
||||||
| ^^^^^ to use `async fn`, switch to Rust 2018 or later
|
| ^^^^^ to use `async fn`, switch to Rust 2018 or later
|
||||||
@ -80,7 +80,7 @@ LL | async fn bar() {}
|
|||||||
= note: for more on editions, read https://doc.rust-lang.org/edition-guide
|
= note: for more on editions, read https://doc.rust-lang.org/edition-guide
|
||||||
|
|
||||||
error[E0706]: functions in traits cannot be declared `async`
|
error[E0706]: functions in traits cannot be declared `async`
|
||||||
--> $DIR/edition-deny-async-fns-2015.rs:18:5
|
--> $DIR/edition-deny-async-fns-2015.rs:20:5
|
||||||
|
|
|
|
||||||
LL | async fn foo() {}
|
LL | async fn foo() {}
|
||||||
| -----^^^^^^^^^
|
| -----^^^^^^^^^
|
98
tests/ui/async-await/edition-deny-async-fns-2015.next.stderr
Normal file
98
tests/ui/async-await/edition-deny-async-fns-2015.next.stderr
Normal file
@ -0,0 +1,98 @@
|
|||||||
|
error[E0670]: `async fn` is not permitted in Rust 2015
|
||||||
|
--> $DIR/edition-deny-async-fns-2015.rs:5:1
|
||||||
|
|
|
||||||
|
LL | async fn foo() {}
|
||||||
|
| ^^^^^ to use `async fn`, switch to Rust 2018 or later
|
||||||
|
|
|
||||||
|
= help: pass `--edition 2021` to `rustc`
|
||||||
|
= note: for more on editions, read https://doc.rust-lang.org/edition-guide
|
||||||
|
|
||||||
|
error[E0670]: `async fn` is not permitted in Rust 2015
|
||||||
|
--> $DIR/edition-deny-async-fns-2015.rs:7:12
|
||||||
|
|
|
||||||
|
LL | fn baz() { async fn foo() {} }
|
||||||
|
| ^^^^^ to use `async fn`, switch to Rust 2018 or later
|
||||||
|
|
|
||||||
|
= help: pass `--edition 2021` to `rustc`
|
||||||
|
= note: for more on editions, read https://doc.rust-lang.org/edition-guide
|
||||||
|
|
||||||
|
error[E0670]: `async fn` is not permitted in Rust 2015
|
||||||
|
--> $DIR/edition-deny-async-fns-2015.rs:9:1
|
||||||
|
|
|
||||||
|
LL | async fn async_baz() {
|
||||||
|
| ^^^^^ to use `async fn`, switch to Rust 2018 or later
|
||||||
|
|
|
||||||
|
= help: pass `--edition 2021` to `rustc`
|
||||||
|
= note: for more on editions, read https://doc.rust-lang.org/edition-guide
|
||||||
|
|
||||||
|
error[E0670]: `async fn` is not permitted in Rust 2015
|
||||||
|
--> $DIR/edition-deny-async-fns-2015.rs:10:5
|
||||||
|
|
|
||||||
|
LL | async fn bar() {}
|
||||||
|
| ^^^^^ to use `async fn`, switch to Rust 2018 or later
|
||||||
|
|
|
||||||
|
= help: pass `--edition 2021` to `rustc`
|
||||||
|
= note: for more on editions, read https://doc.rust-lang.org/edition-guide
|
||||||
|
|
||||||
|
error[E0670]: `async fn` is not permitted in Rust 2015
|
||||||
|
--> $DIR/edition-deny-async-fns-2015.rs:16:5
|
||||||
|
|
|
||||||
|
LL | async fn foo() {}
|
||||||
|
| ^^^^^ to use `async fn`, switch to Rust 2018 or later
|
||||||
|
|
|
||||||
|
= help: pass `--edition 2021` to `rustc`
|
||||||
|
= note: for more on editions, read https://doc.rust-lang.org/edition-guide
|
||||||
|
|
||||||
|
error[E0670]: `async fn` is not permitted in Rust 2015
|
||||||
|
--> $DIR/edition-deny-async-fns-2015.rs:20:5
|
||||||
|
|
|
||||||
|
LL | async fn foo() {}
|
||||||
|
| ^^^^^ to use `async fn`, switch to Rust 2018 or later
|
||||||
|
|
|
||||||
|
= help: pass `--edition 2021` to `rustc`
|
||||||
|
= note: for more on editions, read https://doc.rust-lang.org/edition-guide
|
||||||
|
|
||||||
|
error[E0670]: `async fn` is not permitted in Rust 2015
|
||||||
|
--> $DIR/edition-deny-async-fns-2015.rs:38:9
|
||||||
|
|
|
||||||
|
LL | async fn bar() {}
|
||||||
|
| ^^^^^ to use `async fn`, switch to Rust 2018 or later
|
||||||
|
|
|
||||||
|
= help: pass `--edition 2021` to `rustc`
|
||||||
|
= note: for more on editions, read https://doc.rust-lang.org/edition-guide
|
||||||
|
|
||||||
|
error[E0670]: `async fn` is not permitted in Rust 2015
|
||||||
|
--> $DIR/edition-deny-async-fns-2015.rs:28:9
|
||||||
|
|
|
||||||
|
LL | async fn foo() {}
|
||||||
|
| ^^^^^ to use `async fn`, switch to Rust 2018 or later
|
||||||
|
|
|
||||||
|
= help: pass `--edition 2021` to `rustc`
|
||||||
|
= note: for more on editions, read https://doc.rust-lang.org/edition-guide
|
||||||
|
|
||||||
|
error[E0670]: `async fn` is not permitted in Rust 2015
|
||||||
|
--> $DIR/edition-deny-async-fns-2015.rs:33:13
|
||||||
|
|
|
||||||
|
LL | async fn bar() {}
|
||||||
|
| ^^^^^ to use `async fn`, switch to Rust 2018 or later
|
||||||
|
|
|
||||||
|
= help: pass `--edition 2021` to `rustc`
|
||||||
|
= note: for more on editions, read https://doc.rust-lang.org/edition-guide
|
||||||
|
|
||||||
|
error[E0706]: functions in traits cannot be declared `async`
|
||||||
|
--> $DIR/edition-deny-async-fns-2015.rs:20:5
|
||||||
|
|
|
||||||
|
LL | async fn foo() {}
|
||||||
|
| -----^^^^^^^^^
|
||||||
|
| |
|
||||||
|
| `async` because of this
|
||||||
|
|
|
||||||
|
= note: `async` trait functions are not currently supported
|
||||||
|
= note: consider using the `async-trait` crate: https://crates.io/crates/async-trait
|
||||||
|
= note: see issue #91611 <https://github.com/rust-lang/rust/issues/91611> for more information
|
||||||
|
= help: add `#![feature(async_fn_in_trait)]` to the crate attributes to enable
|
||||||
|
|
||||||
|
error: aborting due to 10 previous errors
|
||||||
|
|
||||||
|
Some errors have detailed explanations: E0670, E0706.
|
||||||
|
For more information about an error, try `rustc --explain E0670`.
|
@ -1,4 +1,6 @@
|
|||||||
// edition:2015
|
// edition:2015
|
||||||
|
// [next] compile-flags: -Zlower-impl-trait-in-trait-to-assoc-ty
|
||||||
|
// revisions: current next
|
||||||
|
|
||||||
async fn foo() {} //~ ERROR `async fn` is not permitted in Rust 2015
|
async fn foo() {} //~ ERROR `async fn` is not permitted in Rust 2015
|
||||||
|
|
||||||
|
@ -0,0 +1,16 @@
|
|||||||
|
error[E0053]: method `foo` has an incompatible generic parameter for trait `Foo`
|
||||||
|
--> $DIR/generics-mismatch.rs:13:18
|
||||||
|
|
|
||||||
|
LL | trait Foo {
|
||||||
|
| ---
|
||||||
|
LL | async fn foo<T>();
|
||||||
|
| - expected type parameter
|
||||||
|
...
|
||||||
|
LL | impl Foo for () {
|
||||||
|
| ---------------
|
||||||
|
LL | async fn foo<const N: usize>() {}
|
||||||
|
| ^^^^^^^^^^^^^^ found const parameter of type `usize`
|
||||||
|
|
||||||
|
error: aborting due to previous error
|
||||||
|
|
||||||
|
For more information about this error, try `rustc --explain E0053`.
|
16
tests/ui/async-await/in-trait/generics-mismatch.next.stderr
Normal file
16
tests/ui/async-await/in-trait/generics-mismatch.next.stderr
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
error[E0053]: method `foo` has an incompatible generic parameter for trait `Foo`
|
||||||
|
--> $DIR/generics-mismatch.rs:13:18
|
||||||
|
|
|
||||||
|
LL | trait Foo {
|
||||||
|
| ---
|
||||||
|
LL | async fn foo<T>();
|
||||||
|
| - expected type parameter
|
||||||
|
...
|
||||||
|
LL | impl Foo for () {
|
||||||
|
| ---------------
|
||||||
|
LL | async fn foo<const N: usize>() {}
|
||||||
|
| ^^^^^^^^^^^^^^ found const parameter of type `usize`
|
||||||
|
|
||||||
|
error: aborting due to previous error
|
||||||
|
|
||||||
|
For more information about this error, try `rustc --explain E0053`.
|
15
tests/ui/async-await/in-trait/generics-mismatch.rs
Normal file
15
tests/ui/async-await/in-trait/generics-mismatch.rs
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
// edition: 2021
|
||||||
|
|
||||||
|
#![feature(async_fn_in_trait)]
|
||||||
|
#![allow(incomplete_features)]
|
||||||
|
|
||||||
|
trait Foo {
|
||||||
|
async fn foo<T>();
|
||||||
|
}
|
||||||
|
|
||||||
|
impl Foo for () {
|
||||||
|
async fn foo<const N: usize>() {}
|
||||||
|
//~^ ERROR: method `foo` has an incompatible generic parameter for trait `Foo` [E0053]
|
||||||
|
}
|
||||||
|
|
||||||
|
fn main() {}
|
16
tests/ui/async-await/in-trait/generics-mismatch.stderr
Normal file
16
tests/ui/async-await/in-trait/generics-mismatch.stderr
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
error[E0053]: method `foo` has an incompatible generic parameter for trait `Foo`
|
||||||
|
--> $DIR/generics-mismatch.rs:11:18
|
||||||
|
|
|
||||||
|
LL | trait Foo {
|
||||||
|
| ---
|
||||||
|
LL | async fn foo<T>();
|
||||||
|
| - expected type parameter
|
||||||
|
...
|
||||||
|
LL | impl Foo for () {
|
||||||
|
| ---------------
|
||||||
|
LL | async fn foo<const N: usize>() {}
|
||||||
|
| ^^^^^^^^^^^^^^ found const parameter of type `usize`
|
||||||
|
|
||||||
|
error: aborting due to previous error
|
||||||
|
|
||||||
|
For more information about this error, try `rustc --explain E0053`.
|
@ -1,5 +1,5 @@
|
|||||||
warning: the feature `async_fn_in_trait` is incomplete and may not be safe to use and/or cause compiler crashes
|
warning: the feature `async_fn_in_trait` is incomplete and may not be safe to use and/or cause compiler crashes
|
||||||
--> $DIR/return-type-suggestion.rs:3:12
|
--> $DIR/return-type-suggestion.rs:5:12
|
||||||
|
|
|
|
||||||
LL | #![feature(async_fn_in_trait)]
|
LL | #![feature(async_fn_in_trait)]
|
||||||
| ^^^^^^^^^^^^^^^^^
|
| ^^^^^^^^^^^^^^^^^
|
||||||
@ -8,7 +8,7 @@ LL | #![feature(async_fn_in_trait)]
|
|||||||
= note: `#[warn(incomplete_features)]` on by default
|
= note: `#[warn(incomplete_features)]` on by default
|
||||||
|
|
||||||
error[E0308]: mismatched types
|
error[E0308]: mismatched types
|
||||||
--> $DIR/return-type-suggestion.rs:8:9
|
--> $DIR/return-type-suggestion.rs:10:9
|
||||||
|
|
|
|
||||||
LL | Ok(())
|
LL | Ok(())
|
||||||
| ^^^^^^- help: consider using a semicolon here: `;`
|
| ^^^^^^- help: consider using a semicolon here: `;`
|
@ -0,0 +1,23 @@
|
|||||||
|
warning: the feature `async_fn_in_trait` is incomplete and may not be safe to use and/or cause compiler crashes
|
||||||
|
--> $DIR/return-type-suggestion.rs:5:12
|
||||||
|
|
|
||||||
|
LL | #![feature(async_fn_in_trait)]
|
||||||
|
| ^^^^^^^^^^^^^^^^^
|
||||||
|
|
|
||||||
|
= note: see issue #91611 <https://github.com/rust-lang/rust/issues/91611> for more information
|
||||||
|
= note: `#[warn(incomplete_features)]` on by default
|
||||||
|
|
||||||
|
error[E0308]: mismatched types
|
||||||
|
--> $DIR/return-type-suggestion.rs:10:9
|
||||||
|
|
|
||||||
|
LL | Ok(())
|
||||||
|
| ^^^^^^- help: consider using a semicolon here: `;`
|
||||||
|
| |
|
||||||
|
| expected `()`, found `Result<(), _>`
|
||||||
|
|
|
||||||
|
= note: expected unit type `()`
|
||||||
|
found enum `Result<(), _>`
|
||||||
|
|
||||||
|
error: aborting due to previous error; 1 warning emitted
|
||||||
|
|
||||||
|
For more information about this error, try `rustc --explain E0308`.
|
@ -1,4 +1,6 @@
|
|||||||
// edition: 2021
|
// edition: 2021
|
||||||
|
// [next] compile-flags: -Zlower-impl-trait-in-trait-to-assoc-ty
|
||||||
|
// revisions: current next
|
||||||
|
|
||||||
#![feature(async_fn_in_trait)]
|
#![feature(async_fn_in_trait)]
|
||||||
//~^ WARN the feature `async_fn_in_trait` is incomplete and may not be safe to use and/or cause compiler crashes
|
//~^ WARN the feature `async_fn_in_trait` is incomplete and may not be safe to use and/or cause compiler crashes
|
||||||
|
@ -1,11 +1,11 @@
|
|||||||
error: concrete type differs from previous defining opaque type use
|
error: concrete type differs from previous defining opaque type use
|
||||||
--> $DIR/default-body-with-rpit.rs:11:9
|
--> $DIR/default-body-with-rpit.rs:13:9
|
||||||
|
|
|
|
||||||
LL | ""
|
LL | ""
|
||||||
| ^^ expected `impl Debug`, got `&'static str`
|
| ^^ expected `impl Debug`, got `&'static str`
|
||||||
|
|
|
|
||||||
note: previous use here
|
note: previous use here
|
||||||
--> $DIR/default-body-with-rpit.rs:10:39
|
--> $DIR/default-body-with-rpit.rs:12:39
|
||||||
|
|
|
|
||||||
LL | async fn baz(&self) -> impl Debug {
|
LL | async fn baz(&self) -> impl Debug {
|
||||||
| _______________________________________^
|
| _______________________________________^
|
||||||
@ -14,7 +14,7 @@ LL | | }
|
|||||||
| |_____^
|
| |_____^
|
||||||
|
|
||||||
error[E0720]: cannot resolve opaque type
|
error[E0720]: cannot resolve opaque type
|
||||||
--> $DIR/default-body-with-rpit.rs:10:28
|
--> $DIR/default-body-with-rpit.rs:12:28
|
||||||
|
|
|
|
||||||
LL | async fn baz(&self) -> impl Debug {
|
LL | async fn baz(&self) -> impl Debug {
|
||||||
| ^^^^^^^^^^ cannot resolve opaque type
|
| ^^^^^^^^^^ cannot resolve opaque type
|
@ -0,0 +1,24 @@
|
|||||||
|
error: concrete type differs from previous defining opaque type use
|
||||||
|
--> $DIR/default-body-with-rpit.rs:13:9
|
||||||
|
|
|
||||||
|
LL | ""
|
||||||
|
| ^^ expected `impl Debug`, got `&'static str`
|
||||||
|
|
|
||||||
|
note: previous use here
|
||||||
|
--> $DIR/default-body-with-rpit.rs:12:39
|
||||||
|
|
|
||||||
|
LL | async fn baz(&self) -> impl Debug {
|
||||||
|
| _______________________________________^
|
||||||
|
LL | | ""
|
||||||
|
LL | | }
|
||||||
|
| |_____^
|
||||||
|
|
||||||
|
error[E0720]: cannot resolve opaque type
|
||||||
|
--> $DIR/default-body-with-rpit.rs:12:28
|
||||||
|
|
|
||||||
|
LL | async fn baz(&self) -> impl Debug {
|
||||||
|
| ^^^^^^^^^^ cannot resolve opaque type
|
||||||
|
|
||||||
|
error: aborting due to 2 previous errors
|
||||||
|
|
||||||
|
For more information about this error, try `rustc --explain E0720`.
|
@ -1,5 +1,7 @@
|
|||||||
// edition:2021
|
// edition:2021
|
||||||
// known-bug: #108304
|
// known-bug: #108304
|
||||||
|
// [next] compile-flags: -Zlower-impl-trait-in-trait-to-assoc-ty
|
||||||
|
// revisions: current next
|
||||||
|
|
||||||
#![feature(async_fn_in_trait, return_position_impl_trait_in_trait)]
|
#![feature(async_fn_in_trait, return_position_impl_trait_in_trait)]
|
||||||
#![allow(incomplete_features)]
|
#![allow(incomplete_features)]
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
error[E0277]: `()` doesn't implement `std::fmt::Display`
|
error[E0277]: `()` doesn't implement `std::fmt::Display`
|
||||||
--> $DIR/doesnt-satisfy.rs:9:17
|
--> $DIR/doesnt-satisfy.rs:12:17
|
||||||
|
|
|
|
||||||
LL | fn bar() -> () {}
|
LL | fn bar() -> () {}
|
||||||
| ^^ `()` cannot be formatted with the default formatter
|
| ^^ `()` cannot be formatted with the default formatter
|
||||||
@ -7,7 +7,7 @@ LL | fn bar() -> () {}
|
|||||||
= help: the trait `std::fmt::Display` is not implemented for `()`
|
= help: the trait `std::fmt::Display` is not implemented for `()`
|
||||||
= note: in format strings you may be able to use `{:?}` (or {:#?} for pretty-print) instead
|
= note: in format strings you may be able to use `{:?}` (or {:#?} for pretty-print) instead
|
||||||
note: required by a bound in `Foo::bar::{opaque#0}`
|
note: required by a bound in `Foo::bar::{opaque#0}`
|
||||||
--> $DIR/doesnt-satisfy.rs:5:22
|
--> $DIR/doesnt-satisfy.rs:8:22
|
||||||
|
|
|
|
||||||
LL | fn bar() -> impl std::fmt::Display;
|
LL | fn bar() -> impl std::fmt::Display;
|
||||||
| ^^^^^^^^^^^^^^^^^ required by this bound in `Foo::bar::{opaque#0}`
|
| ^^^^^^^^^^^^^^^^^ required by this bound in `Foo::bar::{opaque#0}`
|
17
tests/ui/impl-trait/in-trait/doesnt-satisfy.next.stderr
Normal file
17
tests/ui/impl-trait/in-trait/doesnt-satisfy.next.stderr
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
error[E0277]: `()` doesn't implement `std::fmt::Display`
|
||||||
|
--> $DIR/doesnt-satisfy.rs:12:17
|
||||||
|
|
|
||||||
|
LL | fn bar() -> () {}
|
||||||
|
| ^^ `()` cannot be formatted with the default formatter
|
||||||
|
|
|
||||||
|
= help: the trait `std::fmt::Display` is not implemented for `()`
|
||||||
|
= note: in format strings you may be able to use `{:?}` (or {:#?} for pretty-print) instead
|
||||||
|
note: required by a bound in `Foo::{opaque#0}`
|
||||||
|
--> $DIR/doesnt-satisfy.rs:8:22
|
||||||
|
|
|
||||||
|
LL | fn bar() -> impl std::fmt::Display;
|
||||||
|
| ^^^^^^^^^^^^^^^^^ required by this bound in `Foo::`
|
||||||
|
|
||||||
|
error: aborting due to previous error
|
||||||
|
|
||||||
|
For more information about this error, try `rustc --explain E0277`.
|
@ -1,3 +1,6 @@
|
|||||||
|
// [next] compile-flags: -Zlower-impl-trait-in-trait-to-assoc-ty
|
||||||
|
// revisions: current next
|
||||||
|
|
||||||
#![feature(return_position_impl_trait_in_trait)]
|
#![feature(return_position_impl_trait_in_trait)]
|
||||||
#![allow(incomplete_features)]
|
#![allow(incomplete_features)]
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user