Skip to content

Commit

Permalink
Rollup merge of rust-lang#130705 - compiler-errors:rtn-complete, r=ja…
Browse files Browse the repository at this point in the history
…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
matthiaskrgr authored Sep 22, 2024
2 parents 7460e4d + 95469dc commit bfcf31a
Show file tree
Hide file tree
Showing 64 changed files with 77 additions and 430 deletions.
2 changes: 1 addition & 1 deletion compiler/rustc_feature/src/unstable.rs
Original file line number Diff line number Diff line change
Expand Up @@ -578,7 +578,7 @@ declare_features! (
/// be used to describe E or vise-versa.
(unstable, result_ffi_guarantees, "1.80.0", Some(110503)),
/// Allows bounding the return type of AFIT/RPITIT.
(incomplete, return_type_notation, "1.70.0", Some(109417)),
(unstable, return_type_notation, "1.70.0", Some(109417)),
/// Allows `extern "rust-cold"`.
(unstable, rust_cold_cc, "1.63.0", Some(97544)),
/// Allows use of x86 SHA512, SM3 and SM4 target-features and intrinsics
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
//@ edition: 2021

#![feature(return_type_notation)]
//~^ WARN the feature `return_type_notation` is incomplete

trait Trait {
async fn method() {}
Expand Down
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`.
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#![feature(return_type_notation)]
//~^ WARN the feature `return_type_notation` is incomplete

trait Tr {
const CONST: usize;
Expand Down
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

Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
//@ [with] check-pass

#![feature(return_type_notation)]
//~^ WARN the feature `return_type_notation` is incomplete

trait Foo {
async fn method() -> Result<(), ()>;
Expand Down

This file was deleted.

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

Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#![feature(return_type_notation)]
//~^ WARN the feature `return_type_notation` is incomplete

trait Trait {}
fn needs_trait(_: impl Trait) {}
Expand Down
31 changes: 11 additions & 20 deletions tests/ui/associated-type-bounds/return-type-notation/display.stderr
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`.
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
//@ edition: 2021

#![feature(return_type_notation)]
//~^ WARN the feature `return_type_notation` is incomplete

use std::future::Future;

Expand Down
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

Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
//@ check-pass

#![feature(return_type_notation)]
//~^ WARN the feature `return_type_notation` is incomplete

trait Trait<'a> {
fn late<'b>(&'b self, _: &'a ()) -> impl Sized;
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
//@ edition: 2021

#![feature(return_type_notation)]
//~^ WARN the feature `return_type_notation` is incomplete

trait HealthCheck {
async fn check<const N: usize>() -> bool;
Expand Down
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

Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
//@ edition: 2021

#![feature(return_type_notation)]
//~^ WARN the feature `return_type_notation` is incomplete

trait Trait {
async fn method() {}
Expand Down
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`.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

#![allow(non_camel_case_types)]
#![feature(return_type_notation)]
//~^ WARN the feature `return_type_notation` is incomplete

trait Foo {
type test;
Expand Down
Loading

0 comments on commit bfcf31a

Please sign in to comment.