Skip to content

Add revisions for -Zlower-impl-trait-in-trait-to-assoc-ty fixed tests #109193

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 42 additions & 0 deletions tests/ui/async-await/async-trait-fn.current.stderr
Original file line number Diff line number Diff line change
@@ -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 changes: 42 additions & 0 deletions tests/ui/async-await/async-trait-fn.next.stderr
Original file line number Diff line number Diff line change
@@ -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 change: 1 addition & 0 deletions tests/ui/async-await/async-trait-fn.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// edition:2018

trait T {
async fn foo() {} //~ ERROR functions in traits cannot be declared `async`
async fn bar(&self) {} //~ ERROR functions in traits cannot be declared `async`
Expand Down
6 changes: 3 additions & 3 deletions tests/ui/async-await/async-trait-fn.stderr
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
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() {}
| -----^^^^^^^^^
Expand All @@ -12,7 +12,7 @@ LL | async fn foo() {}
= 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:4:5
--> $DIR/async-trait-fn.rs:5:5
|
LL | async fn bar(&self) {}
| -----^^^^^^^^^^^^^^
Expand All @@ -25,7 +25,7 @@ LL | async fn bar(&self) {}
= 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:5:5
--> $DIR/async-trait-fn.rs:6:5
|
LL | async fn baz() {
| -----^^^^^^^^^
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
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() {}
| ^^^^^ to use `async fn`, switch to Rust 2018 or later
Expand All @@ -8,7 +8,7 @@ LL | async fn foo() {}
= 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:5:12
--> $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
Expand All @@ -17,7 +17,7 @@ LL | fn baz() { async fn foo() {} }
= 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:1
--> $DIR/edition-deny-async-fns-2015.rs:9:1
|
LL | async fn async_baz() {
| ^^^^^ to use `async fn`, switch to Rust 2018 or later
Expand All @@ -26,7 +26,7 @@ LL | async fn async_baz() {
= 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:8:5
--> $DIR/edition-deny-async-fns-2015.rs:10:5
|
LL | async fn bar() {}
| ^^^^^ to use `async fn`, switch to Rust 2018 or later
Expand All @@ -35,7 +35,7 @@ LL | async fn bar() {}
= 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:14:5
--> $DIR/edition-deny-async-fns-2015.rs:16:5
|
LL | async fn foo() {}
| ^^^^^ to use `async fn`, switch to Rust 2018 or later
Expand All @@ -44,7 +44,7 @@ LL | async fn foo() {}
= 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:18:5
--> $DIR/edition-deny-async-fns-2015.rs:20:5
|
LL | async fn foo() {}
| ^^^^^ to use `async fn`, switch to Rust 2018 or later
Expand All @@ -53,7 +53,7 @@ LL | async fn foo() {}
= 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:36:9
--> $DIR/edition-deny-async-fns-2015.rs:38:9
|
LL | async fn bar() {}
| ^^^^^ to use `async fn`, switch to Rust 2018 or later
Expand All @@ -62,7 +62,7 @@ LL | async fn bar() {}
= 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:26:9
--> $DIR/edition-deny-async-fns-2015.rs:28:9
|
LL | async fn foo() {}
| ^^^^^ to use `async fn`, switch to Rust 2018 or later
Expand All @@ -71,7 +71,7 @@ LL | async fn foo() {}
= 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:31:13
--> $DIR/edition-deny-async-fns-2015.rs:33:13
|
LL | async fn bar() {}
| ^^^^^ to use `async fn`, switch to Rust 2018 or later
Expand All @@ -80,7 +80,7 @@ LL | async fn bar() {}
= 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:18:5
--> $DIR/edition-deny-async-fns-2015.rs:20:5
|
LL | async fn foo() {}
| -----^^^^^^^^^
Expand Down
98 changes: 98 additions & 0 deletions tests/ui/async-await/edition-deny-async-fns-2015.next.stderr
Original file line number Diff line number Diff line change
@@ -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`.
2 changes: 2 additions & 0 deletions tests/ui/async-await/edition-deny-async-fns-2015.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
// 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

Expand Down
16 changes: 16 additions & 0 deletions tests/ui/async-await/in-trait/generics-mismatch.current.stderr
Original file line number Diff line number Diff line change
@@ -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 changes: 16 additions & 0 deletions tests/ui/async-await/in-trait/generics-mismatch.next.stderr
Original file line number Diff line number Diff line change
@@ -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 changes: 15 additions & 0 deletions tests/ui/async-await/in-trait/generics-mismatch.rs
Original file line number Diff line number Diff line change
@@ -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 changes: 16 additions & 0 deletions tests/ui/async-await/in-trait/generics-mismatch.stderr
Original file line number Diff line number Diff line change
@@ -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`.
Original file line number Diff line number Diff line change
@@ -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
--> $DIR/return-type-suggestion.rs:3:12
--> $DIR/return-type-suggestion.rs:5:12
|
LL | #![feature(async_fn_in_trait)]
| ^^^^^^^^^^^^^^^^^
Expand All @@ -8,7 +8,7 @@ LL | #![feature(async_fn_in_trait)]
= note: `#[warn(incomplete_features)]` on by default

error[E0308]: mismatched types
--> $DIR/return-type-suggestion.rs:8:9
--> $DIR/return-type-suggestion.rs:10:9
|
LL | Ok(())
| ^^^^^^- help: consider using a semicolon here: `;`
Expand Down
Loading