-
Notifications
You must be signed in to change notification settings - Fork 13.4k
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 | ||
| | ||
Comment on lines
+1
to
+9
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Don't know if it's just me, but I'm having a difficult time actually figuring out what the problem here is... There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yea, but that's not a generator issue, closures would have the same issue. |
||
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 | ||
Comment on lines
+1
to
+17
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This error seems incorrect, given that there is a There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We do not throw away bounds on type alias impl trait though. Performing the suggested change will actually work. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Oh that's interesting! |
||
|
||
For more information about this error, try `rustc --explain E0277`. |
Uh oh!
There was an error while loading. Please reload this page.