forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rollup merge of rust-lang#130705 - compiler-errors:rtn-complete, r=ja…
…ckh726 No longer mark RTN as incomplete The RFC is accepted and the feature is basically fully implemented. This doesn't mean it's necesarily *ready* for stabiliation; there's probably some diagnostic improvements to be made, and as always, users uncover the most creative bugs. But marking this feature as incomplete no longer serves any purpose, so let's fix that.
- Loading branch information
Showing
64 changed files
with
77 additions
and
430 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 0 additions & 1 deletion
1
tests/ui/associated-type-bounds/return-type-notation/bad-inputs-and-output.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 10 additions & 19 deletions
29
tests/ui/associated-type-bounds/return-type-notation/bad-inputs-and-output.stderr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,66 +1,57 @@ | ||
error[E0575]: expected associated type, found associated function `Trait::method` | ||
--> $DIR/bad-inputs-and-output.rs:28:36 | ||
--> $DIR/bad-inputs-and-output.rs:27:36 | ||
| | ||
LL | fn foo_qualified<T: Trait>() where <T as Trait>::method(i32): Send {} | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^ not a associated type | ||
|
||
error[E0575]: expected associated type, found associated function `Trait::method` | ||
--> $DIR/bad-inputs-and-output.rs:31:36 | ||
--> $DIR/bad-inputs-and-output.rs:30:36 | ||
| | ||
LL | fn bar_qualified<T: Trait>() where <T as Trait>::method() -> (): Send {} | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ not a associated type | ||
|
||
error[E0575]: expected associated type, found associated function `Trait::method` | ||
--> $DIR/bad-inputs-and-output.rs:34:36 | ||
--> $DIR/bad-inputs-and-output.rs:33:36 | ||
| | ||
LL | fn baz_qualified<T: Trait>() where <T as Trait>::method(): Send {} | ||
| ^^^^^^^^^^^^^^^^^^^^^^ not a associated type | ||
|
||
warning: the feature `return_type_notation` is incomplete and may not be safe to use and/or cause compiler crashes | ||
--> $DIR/bad-inputs-and-output.rs:3:12 | ||
| | ||
LL | #![feature(return_type_notation)] | ||
| ^^^^^^^^^^^^^^^^^^^^ | ||
| | ||
= note: see issue #109417 <https://github.com/rust-lang/rust/issues/109417> for more information | ||
= note: `#[warn(incomplete_features)]` on by default | ||
|
||
error: argument types not allowed with return type notation | ||
--> $DIR/bad-inputs-and-output.rs:10:23 | ||
--> $DIR/bad-inputs-and-output.rs:9:23 | ||
| | ||
LL | fn foo<T: Trait<method(i32): Send>>() {} | ||
| ^^^^^ help: remove the input types: `()` | ||
|
||
error: return type not allowed with return type notation | ||
--> $DIR/bad-inputs-and-output.rs:13:25 | ||
--> $DIR/bad-inputs-and-output.rs:12:25 | ||
| | ||
LL | fn bar<T: Trait<method() -> (): Send>>() {} | ||
| ^^^^^^ help: remove the return type | ||
|
||
error: return type notation arguments must be elided with `..` | ||
--> $DIR/bad-inputs-and-output.rs:16:23 | ||
--> $DIR/bad-inputs-and-output.rs:15:23 | ||
| | ||
LL | fn baz<T: Trait<method(): Send>>() {} | ||
| ^^ help: add `..`: `(..)` | ||
|
||
error: argument types not allowed with return type notation | ||
--> $DIR/bad-inputs-and-output.rs:19:40 | ||
--> $DIR/bad-inputs-and-output.rs:18:40 | ||
| | ||
LL | fn foo_path<T: Trait>() where T::method(i32): Send {} | ||
| ^^^^^ help: remove the input types: `()` | ||
|
||
error: return type not allowed with return type notation | ||
--> $DIR/bad-inputs-and-output.rs:22:42 | ||
--> $DIR/bad-inputs-and-output.rs:21:42 | ||
| | ||
LL | fn bar_path<T: Trait>() where T::method() -> (): Send {} | ||
| ^^^^^^ help: remove the return type | ||
|
||
error: return type notation arguments must be elided with `..` | ||
--> $DIR/bad-inputs-and-output.rs:25:40 | ||
--> $DIR/bad-inputs-and-output.rs:24:40 | ||
| | ||
LL | fn baz_path<T: Trait>() where T::method(): Send {} | ||
| ^^ help: add `..`: `(..)` | ||
|
||
error: aborting due to 9 previous errors; 1 warning emitted | ||
error: aborting due to 9 previous errors | ||
|
||
For more information about this error, try `rustc --explain E0575`. |
1 change: 0 additions & 1 deletion
1
tests/ui/associated-type-bounds/return-type-notation/bare-path.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 3 additions & 12 deletions
15
tests/ui/associated-type-bounds/return-type-notation/bare-path.stderr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,14 @@ | ||
warning: the feature `return_type_notation` is incomplete and may not be safe to use and/or cause compiler crashes | ||
--> $DIR/bare-path.rs:1:12 | ||
| | ||
LL | #![feature(return_type_notation)] | ||
| ^^^^^^^^^^^^^^^^^^^^ | ||
| | ||
= note: see issue #109417 <https://github.com/rust-lang/rust/issues/109417> for more information | ||
= note: `#[warn(incomplete_features)]` on by default | ||
|
||
error: return type notation not allowed in this position yet | ||
--> $DIR/bare-path.rs:15:23 | ||
--> $DIR/bare-path.rs:14:23 | ||
| | ||
LL | let _ = T::CONST::(..); | ||
| ^^^^ | ||
|
||
error: return type notation not allowed in this position yet | ||
--> $DIR/bare-path.rs:17:12 | ||
--> $DIR/bare-path.rs:16:12 | ||
| | ||
LL | let _: T::method(..); | ||
| ^^^^^^^^^^^^^ | ||
|
||
error: aborting due to 2 previous errors; 1 warning emitted | ||
error: aborting due to 2 previous errors | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 0 additions & 11 deletions
11
tests/ui/associated-type-bounds/return-type-notation/basic.with.stderr
This file was deleted.
Oops, something went wrong.
17 changes: 4 additions & 13 deletions
17
tests/ui/associated-type-bounds/return-type-notation/basic.without.stderr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,20 @@ | ||
warning: the feature `return_type_notation` is incomplete and may not be safe to use and/or cause compiler crashes | ||
--> $DIR/basic.rs:5:12 | ||
| | ||
LL | #![feature(return_type_notation)] | ||
| ^^^^^^^^^^^^^^^^^^^^ | ||
| | ||
= note: see issue #109417 <https://github.com/rust-lang/rust/issues/109417> for more information | ||
= note: `#[warn(incomplete_features)]` on by default | ||
|
||
error: future cannot be sent between threads safely | ||
--> $DIR/basic.rs:23:13 | ||
--> $DIR/basic.rs:22:13 | ||
| | ||
LL | is_send(foo::<T>()); | ||
| ^^^^^^^^^^ future returned by `foo` is not `Send` | ||
| | ||
= help: within `impl Future<Output = Result<(), ()>>`, the trait `Send` is not implemented for `impl Future<Output = Result<(), ()>> { <T as Foo>::method(..) }`, which is required by `impl Future<Output = Result<(), ()>>: Send` | ||
note: future is not `Send` as it awaits another future which is not `Send` | ||
--> $DIR/basic.rs:13:5 | ||
--> $DIR/basic.rs:12:5 | ||
| | ||
LL | T::method().await?; | ||
| ^^^^^^^^^^^ await occurs here on type `impl Future<Output = Result<(), ()>> { <T as Foo>::method(..) }`, which is not `Send` | ||
note: required by a bound in `is_send` | ||
--> $DIR/basic.rs:17:20 | ||
--> $DIR/basic.rs:16:20 | ||
| | ||
LL | fn is_send(_: impl Send) {} | ||
| ^^^^ required by this bound in `is_send` | ||
|
||
error: aborting due to 1 previous error; 1 warning emitted | ||
error: aborting due to 1 previous error | ||
|
1 change: 0 additions & 1 deletion
1
tests/ui/associated-type-bounds/return-type-notation/display.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
31 changes: 11 additions & 20 deletions
31
tests/ui/associated-type-bounds/return-type-notation/display.stderr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,78 +1,69 @@ | ||
warning: the feature `return_type_notation` is incomplete and may not be safe to use and/or cause compiler crashes | ||
--> $DIR/display.rs:1:12 | ||
| | ||
LL | #![feature(return_type_notation)] | ||
| ^^^^^^^^^^^^^^^^^^^^ | ||
| | ||
= note: see issue #109417 <https://github.com/rust-lang/rust/issues/109417> for more information | ||
= note: `#[warn(incomplete_features)]` on by default | ||
|
||
error[E0277]: the trait bound `impl Sized { <T as Assoc>::method(..) }: Trait` is not satisfied | ||
--> $DIR/display.rs:15:17 | ||
--> $DIR/display.rs:14:17 | ||
| | ||
LL | needs_trait(T::method()); | ||
| ----------- ^^^^^^^^^^^ the trait `Trait` is not implemented for `impl Sized { <T as Assoc>::method(..) }` | ||
| | | ||
| required by a bound introduced by this call | ||
| | ||
note: required by a bound in `needs_trait` | ||
--> $DIR/display.rs:5:24 | ||
--> $DIR/display.rs:4:24 | ||
| | ||
LL | fn needs_trait(_: impl Trait) {} | ||
| ^^^^^ required by this bound in `needs_trait` | ||
|
||
error[E0277]: the trait bound `impl Sized { <T as Assoc>::method_with_lt(..) }: Trait` is not satisfied | ||
--> $DIR/display.rs:17:17 | ||
--> $DIR/display.rs:16:17 | ||
| | ||
LL | needs_trait(T::method_with_lt()); | ||
| ----------- ^^^^^^^^^^^^^^^^^^^ the trait `Trait` is not implemented for `impl Sized { <T as Assoc>::method_with_lt(..) }` | ||
| | | ||
| required by a bound introduced by this call | ||
| | ||
note: required by a bound in `needs_trait` | ||
--> $DIR/display.rs:5:24 | ||
--> $DIR/display.rs:4:24 | ||
| | ||
LL | fn needs_trait(_: impl Trait) {} | ||
| ^^^^^ required by this bound in `needs_trait` | ||
|
||
error[E0277]: the trait bound `impl Sized: Trait` is not satisfied | ||
--> $DIR/display.rs:19:17 | ||
--> $DIR/display.rs:18:17 | ||
| | ||
LL | needs_trait(T::method_with_ty()); | ||
| ----------- ^^^^^^^^^^^^^^^^^^^ the trait `Trait` is not implemented for `impl Sized` | ||
| | | ||
| required by a bound introduced by this call | ||
| | ||
help: this trait has no implementations, consider adding one | ||
--> $DIR/display.rs:4:1 | ||
--> $DIR/display.rs:3:1 | ||
| | ||
LL | trait Trait {} | ||
| ^^^^^^^^^^^ | ||
note: required by a bound in `needs_trait` | ||
--> $DIR/display.rs:5:24 | ||
--> $DIR/display.rs:4:24 | ||
| | ||
LL | fn needs_trait(_: impl Trait) {} | ||
| ^^^^^ required by this bound in `needs_trait` | ||
|
||
error[E0277]: the trait bound `impl Sized: Trait` is not satisfied | ||
--> $DIR/display.rs:21:17 | ||
--> $DIR/display.rs:20:17 | ||
| | ||
LL | needs_trait(T::method_with_ct()); | ||
| ----------- ^^^^^^^^^^^^^^^^^^^ the trait `Trait` is not implemented for `impl Sized` | ||
| | | ||
| required by a bound introduced by this call | ||
| | ||
help: this trait has no implementations, consider adding one | ||
--> $DIR/display.rs:4:1 | ||
--> $DIR/display.rs:3:1 | ||
| | ||
LL | trait Trait {} | ||
| ^^^^^^^^^^^ | ||
note: required by a bound in `needs_trait` | ||
--> $DIR/display.rs:5:24 | ||
--> $DIR/display.rs:4:24 | ||
| | ||
LL | fn needs_trait(_: impl Trait) {} | ||
| ^^^^^ required by this bound in `needs_trait` | ||
|
||
error: aborting due to 4 previous errors; 1 warning emitted | ||
error: aborting due to 4 previous errors | ||
|
||
For more information about this error, try `rustc --explain E0277`. |
1 change: 0 additions & 1 deletion
1
tests/ui/associated-type-bounds/return-type-notation/equality.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 2 additions & 11 deletions
13
tests/ui/associated-type-bounds/return-type-notation/equality.stderr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,8 @@ | ||
warning: the feature `return_type_notation` is incomplete and may not be safe to use and/or cause compiler crashes | ||
--> $DIR/equality.rs:3:12 | ||
| | ||
LL | #![feature(return_type_notation)] | ||
| ^^^^^^^^^^^^^^^^^^^^ | ||
| | ||
= note: see issue #109417 <https://github.com/rust-lang/rust/issues/109417> for more information | ||
= note: `#[warn(incomplete_features)]` on by default | ||
|
||
error: return type notation is not allowed to use type equality | ||
--> $DIR/equality.rs:12:18 | ||
--> $DIR/equality.rs:11:18 | ||
| | ||
LL | fn test<T: Trait<method(..) = Box<dyn Future<Output = ()>>>>() {} | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
|
||
error: aborting due to 1 previous error; 1 warning emitted | ||
error: aborting due to 1 previous error | ||
|
1 change: 0 additions & 1 deletion
1
tests/ui/associated-type-bounds/return-type-notation/higher-ranked-bound-works.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 0 additions & 11 deletions
11
tests/ui/associated-type-bounds/return-type-notation/higher-ranked-bound-works.stderr
This file was deleted.
Oops, something went wrong.
1 change: 0 additions & 1 deletion
1
tests/ui/associated-type-bounds/return-type-notation/issue-120208-higher-ranked-const.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 2 additions & 11 deletions
13
tests/ui/associated-type-bounds/return-type-notation/issue-120208-higher-ranked-const.stderr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,11 @@ | ||
warning: the feature `return_type_notation` is incomplete and may not be safe to use and/or cause compiler crashes | ||
--> $DIR/issue-120208-higher-ranked-const.rs:3:12 | ||
| | ||
LL | #![feature(return_type_notation)] | ||
| ^^^^^^^^^^^^^^^^^^^^ | ||
| | ||
= note: see issue #109417 <https://github.com/rust-lang/rust/issues/109417> for more information | ||
= note: `#[warn(incomplete_features)]` on by default | ||
|
||
error: return type notation is not allowed for functions that have const parameters | ||
--> $DIR/issue-120208-higher-ranked-const.rs:12:21 | ||
--> $DIR/issue-120208-higher-ranked-const.rs:11:21 | ||
| | ||
LL | async fn check<const N: usize>() -> bool; | ||
| -------------- const parameter declared here | ||
... | ||
LL | HC: HealthCheck<check(..): Send> + Send + 'static, | ||
| ^^^^^^^^^^^^^^^ | ||
|
||
error: aborting due to 1 previous error; 1 warning emitted | ||
error: aborting due to 1 previous error | ||
|
1 change: 0 additions & 1 deletion
1
tests/ui/associated-type-bounds/return-type-notation/missing.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 2 additions & 11 deletions
13
tests/ui/associated-type-bounds/return-type-notation/missing.stderr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,9 @@ | ||
warning: the feature `return_type_notation` is incomplete and may not be safe to use and/or cause compiler crashes | ||
--> $DIR/missing.rs:3:12 | ||
| | ||
LL | #![feature(return_type_notation)] | ||
| ^^^^^^^^^^^^^^^^^^^^ | ||
| | ||
= note: see issue #109417 <https://github.com/rust-lang/rust/issues/109417> for more information | ||
= note: `#[warn(incomplete_features)]` on by default | ||
|
||
error[E0220]: associated function `methid` not found for `Trait` | ||
--> $DIR/missing.rs:10:17 | ||
--> $DIR/missing.rs:9:17 | ||
| | ||
LL | fn bar<T: Trait<methid(..): Send>>() {} | ||
| ^^^^^^ help: there is an associated function with a similar name: `method` | ||
|
||
error: aborting due to 1 previous error; 1 warning emitted | ||
error: aborting due to 1 previous error | ||
|
||
For more information about this error, try `rustc --explain E0220`. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.