Fix async-std at the price of breaking half the test suite

- Don't mark impl trait as an error
This commit is contained in:
Joshua Nelson 2020-08-03 21:13:13 -04:00
parent f042d749b0
commit 31fcda170a
17 changed files with 29 additions and 119 deletions

View file

@ -1,10 +1,7 @@
// edition:2018
// check-pass
/// This used to work with ResolveBodyWithLoop.
/// However now that we ignore type checking instead of modifying the function body,
/// the return type is seen as `impl Future<Output = u32>`, not a `u32`.
/// So it no longer allows errors in the function body.
/// Should compile fine
pub async fn a() -> u32 {
error::_in::async_fn()
//~^ ERROR failed to resolve
}

View file

@ -1,12 +0,0 @@
error[E0433]: failed to resolve: could not resolve path `error::_in::async_fn`
--> $DIR/async.rs:8:5
|
LL | error::_in::async_fn()
| ^^^^^^^^^^^^^^^^^^^^ could not resolve path `error::_in::async_fn`
|
= note: this error was originally ignored because you are running `rustdoc`
= note: try running again with `rustc` or `cargo check` and you may get a more detailed error
error: aborting due to previous error
For more information about this error, try `rustc --explain E0433`.

View file

@ -1,5 +1,5 @@
// check-pass
// manually desugared version of an `async fn` (but with a closure instead of a generator)
pub fn a() -> impl Fn() -> u32 {
|| content::doesnt::matter()
//~^ ERROR failed to resolve
}

View file

@ -1,12 +0,0 @@
error[E0433]: failed to resolve: could not resolve path `content::doesnt::matter`
--> $DIR/closure.rs:3:8
|
LL | || content::doesnt::matter()
| ^^^^^^^^^^^^^^^^^^^^^^^ could not resolve path `content::doesnt::matter`
|
= note: this error was originally ignored because you are running `rustdoc`
= note: try running again with `rustc` or `cargo check` and you may get a more detailed error
error: aborting due to previous error
For more information about this error, try `rustc --explain E0433`.

View file

@ -1,7 +1,7 @@
// check-pass
trait ValidTrait {}
/// This has docs
pub fn f() -> impl ValidTrait {
Vec::<DoesNotExist>::new()
//~^ ERROR failed to resolve
}

View file

@ -1,12 +0,0 @@
error[E0433]: failed to resolve: could not resolve path `DoesNotExist`
--> $DIR/generic-argument.rs:5:11
|
LL | Vec::<DoesNotExist>::new()
| ^^^^^^^^^^^^ could not resolve path `DoesNotExist`
|
= note: this error was originally ignored because you are running `rustdoc`
= note: try running again with `rustc` or `cargo check` and you may get a more detailed error
error: aborting due to previous error
For more information about this error, try `rustc --explain E0433`.

View file

@ -1,6 +1,6 @@
// check-pass
pub trait ValidTrait {}
/// This returns impl trait
pub fn g() -> impl ValidTrait {
(|| error::_in::impl_trait::alias::nested::closure())()
//~^ ERROR failed to resolve
}

View file

@ -1,12 +0,0 @@
error[E0433]: failed to resolve: could not resolve path `error::_in::impl_trait::alias::nested::closure`
--> $DIR/impl-keyword-closure.rs:4:9
|
LL | (|| error::_in::impl_trait::alias::nested::closure())()
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ could not resolve path `error::_in::impl_trait::alias::nested::closure`
|
= note: this error was originally ignored because you are running `rustdoc`
= note: try running again with `rustc` or `cargo check` and you may get a more detailed error
error: aborting due to previous error
For more information about this error, try `rustc --explain E0433`.

View file

@ -1,6 +1,6 @@
// check-pass
pub trait ValidTrait {}
/// This returns impl trait
pub fn g() -> impl ValidTrait {
error::_in::impl_trait()
//~^ ERROR failed to resolve
}

View file

@ -1,12 +0,0 @@
error[E0433]: failed to resolve: could not resolve path `error::_in::impl_trait`
--> $DIR/impl-keyword.rs:4:5
|
LL | error::_in::impl_trait()
| ^^^^^^^^^^^^^^^^^^^^^^ could not resolve path `error::_in::impl_trait`
|
= note: this error was originally ignored because you are running `rustdoc`
= note: try running again with `rustc` or `cargo check` and you may get a more detailed error
error: aborting due to previous error
For more information about this error, try `rustc --explain E0433`.

View file

@ -1,3 +1,4 @@
// check-pass
#![feature(type_alias_impl_trait)]
pub trait ValidTrait {}
@ -6,5 +7,4 @@ type ImplTrait = impl ValidTrait;
/// This returns impl trait, but using a type alias
pub fn h() -> ImplTrait {
(|| error::_in::impl_trait::alias::nested::closure())()
//~^ ERROR failed to resolve
}

View file

@ -1,12 +0,0 @@
error[E0433]: failed to resolve: could not resolve path `error::_in::impl_trait::alias::nested::closure`
--> $DIR/trait-alias-closure.rs:8:9
|
LL | (|| error::_in::impl_trait::alias::nested::closure())()
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ could not resolve path `error::_in::impl_trait::alias::nested::closure`
|
= note: this error was originally ignored because you are running `rustdoc`
= note: try running again with `rustc` or `cargo check` and you may get a more detailed error
error: aborting due to previous error
For more information about this error, try `rustc --explain E0433`.

View file

@ -1,3 +1,4 @@
// check-pass
#![feature(type_alias_impl_trait)]
pub trait ValidTrait {}
@ -6,5 +7,4 @@ type ImplTrait = impl ValidTrait;
/// This returns impl trait, but using a type alias
pub fn h() -> ImplTrait {
error::_in::impl_trait::alias()
//~^ ERROR failed to resolve
}

View file

@ -1,12 +0,0 @@
error[E0433]: failed to resolve: could not resolve path `error::_in::impl_trait::alias`
--> $DIR/trait-alias.rs:8:5
|
LL | error::_in::impl_trait::alias()
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ could not resolve path `error::_in::impl_trait::alias`
|
= note: this error was originally ignored because you are running `rustdoc`
= note: try running again with `rustc` or `cargo check` and you may get a more detailed error
error: aborting due to previous error
For more information about this error, try `rustc --explain E0433`.