-
Notifications
You must be signed in to change notification settings - Fork 13.8k
wf-check generators #97183
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
wf-check generators #97183
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
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`. |
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() {} |
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); | ||
} |
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`. |
Uh oh!
There was an error while loading. Please reload this page.