-
Notifications
You must be signed in to change notification settings - Fork 13.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Check generators for well formedness
- Loading branch information
Showing
7 changed files
with
101 additions
and
10 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
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
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
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 |
---|---|---|
@@ -0,0 +1,27 @@ | ||
error[E0277]: the size for values of type `A` cannot be known at compilation time | ||
--> $DIR/issue-88287.rs:35:9 | ||
| | ||
LL | type SearchFutureTy<'f, A, B: 'f> | ||
| - this type parameter needs to be `std::marker::Sized` | ||
... | ||
LL | async move { todo!() } | ||
| ^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time | ||
| | ||
note: required by a bound in `<T as SearchableResourceExt<Criteria>>` | ||
--> $DIR/issue-88287.rs:25:6 | ||
| | ||
LL | impl<T, Criteria> SearchableResourceExt<Criteria> for T | ||
| ^ required by this bound in `<T as SearchableResourceExt<Criteria>>` | ||
help: consider removing the `?Sized` bound to make the type parameter `Sized` | ||
| | ||
LL - A: SearchableResource<B> + ?Sized + 'f, | ||
LL + A: SearchableResource<B> + 'f, | ||
| | ||
help: consider relaxing the implicit `Sized` restriction | ||
| | ||
LL | T: SearchableResource<Criteria> + ?Sized, | ||
| ++++++++ | ||
|
||
error: aborting due to previous error | ||
|
||
For more information about this error, try `rustc --explain E0277`. |
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 |
---|---|---|
@@ -0,0 +1,22 @@ | ||
// edition:2018 | ||
// check-pass | ||
|
||
trait Trait<Input> { | ||
type Output; | ||
} | ||
|
||
async fn walk<F>(filter: F) | ||
where | ||
for<'a> F: Trait<&'a u32> + 'a, | ||
for<'a> <F as Trait<&'a u32>>::Output: 'a, | ||
{ | ||
} | ||
|
||
async fn walk2<F: 'static>(filter: F) | ||
where | ||
for<'a> F: Trait<&'a u32> + 'a, | ||
for<'a> <F as Trait<&'a u32>>::Output: 'a, | ||
{ | ||
} | ||
|
||
fn main() {} |
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 |
---|---|---|
@@ -0,0 +1,22 @@ | ||
#![feature(type_alias_impl_trait)] | ||
|
||
// edition:2021 | ||
// compile-flags: --crate-type=lib | ||
|
||
use std::future::Future; | ||
|
||
trait Bar { | ||
fn bar(&self); | ||
} | ||
|
||
type FooFuture<B> = impl Future<Output = ()>; | ||
|
||
fn foo<B: Bar>(bar: B) -> FooFuture<B> { | ||
async move { bar.bar() } | ||
//~^ ERROR: the trait bound `B: Bar` is not satisfied | ||
} | ||
|
||
pub fn mainish(ctx: &mut std::task::Context) { | ||
let boom: FooFuture<u32> = unsafe { core::mem::zeroed() }; | ||
Box::pin(boom).as_mut().poll(ctx); | ||
} |
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 |
---|---|---|
@@ -0,0 +1,19 @@ | ||
error[E0277]: the trait bound `B: Bar` is not satisfied | ||
--> $DIR/future.rs:15:5 | ||
| | ||
LL | async move { bar.bar() } | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Bar` is not implemented for `B` | ||
| | ||
note: required by a bound in `foo` | ||
--> $DIR/future.rs:14:11 | ||
| | ||
LL | fn foo<B: Bar>(bar: B) -> FooFuture<B> { | ||
| ^^^ required by this bound in `foo` | ||
help: consider restricting type parameter `B` | ||
| | ||
LL | type FooFuture<B: Bar> = impl Future<Output = ()>; | ||
| +++++ | ||
|
||
error: aborting due to previous error | ||
|
||
For more information about this error, try `rustc --explain E0277`. |