-
Notifications
You must be signed in to change notification settings - Fork 13.4k
Use root obligation on E0277 for some cases #121826
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
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 |
---|---|---|
|
@@ -70,13 +70,12 @@ help: use parentheses to call this function | |
LL | let x: () = foo::<'static>(); | ||
| ++ | ||
|
||
error[E0277]: the size for values of type `str` cannot be known at compilation time | ||
error[E0277]: the trait bound `str: Foo<'_, '_, u8>` is not satisfied | ||
--> $DIR/substs-ppaux.rs:49:6 | ||
| | ||
LL | <str as Foo<u8>>::bar; | ||
| ^^^ doesn't have a size known at compile-time | ||
| ^^^ the trait `Sized` is not implemented for `str`, which is required by `str: Foo<'_, '_, u8>` | ||
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. I haven't read the implementation or the most recent Zulip comments and just saw this stderr diff, so sorry if this has been discussed already. Is this intentional? Shouldn't we still use the 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. It is somewhat intentional. When you have 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. Also, I do want to do a full refactor of this logic, too many ad-hoc hacks have piled beyond maintainability (in no small part due to me), but now that we know what the output we want to keep and change is, it will be easier to clean this up in a way that makes sense. This PR is about putting the output piece closer to that "ideal end state" in anticipation of that work. |
||
| | ||
= help: the trait `Sized` is not implemented for `str`, which is required by `str: Foo<'_, '_, u8>` | ||
note: required for `str` to implement `Foo<'_, '_, u8>` | ||
--> $DIR/substs-ppaux.rs:11:17 | ||
| | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
//@ run-rustfix | ||
fn main() { | ||
let _ = vec![true, false].into_iter().map(|v| !v).collect::<Vec<_>>(); | ||
//~^ ERROR no method named `map` found for struct `Vec<bool>` in the current scope | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
//@ run-rustfix | ||
fn main() { | ||
vec![true, false].map(|v| !v).collect::<Vec<_>>(); | ||
//~^ ERROR `Vec<bool>` is not an iterator | ||
let _ = vec![true, false].map(|v| !v).collect::<Vec<_>>(); | ||
//~^ ERROR no method named `map` found for struct `Vec<bool>` in the current scope | ||
} |
Uh oh!
There was an error while loading. Please reload this page.