-
Notifications
You must be signed in to change notification settings - Fork 13k
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
Fix more #121208 fallout #121480
Merged
Merged
Fix more #121208 fallout #121480
Changes from 1 commit
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
pub trait Iterable { | ||
type Item<'a> | ||
where | ||
Self: 'a; | ||
|
||
fn iter(&self) -> impl Iterator; | ||
} | ||
|
||
impl<'a, I: 'a + Iterable> Iterable for &'a I { | ||
type Item = u32; | ||
//~^ ERROR lifetime parameters or bounds on type `Item` do not match the trait declaration | ||
|
||
fn iter(&self) -> impl for<'missing> Iterator<Item = Self::Item<'missing>> {} | ||
//~^ ERROR binding for associated type `Item` references lifetime `'missing` | ||
//~| ERROR `()` is not an iterator | ||
} | ||
|
||
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,30 @@ | ||
error[E0582]: binding for associated type `Item` references lifetime `'missing`, which does not appear in the trait input types | ||
--> $DIR/span-bug-issue-121457.rs:13:51 | ||
| | ||
LL | fn iter(&self) -> impl for<'missing> Iterator<Item = Self::Item<'missing>> {} | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
|
||
error[E0195]: lifetime parameters or bounds on type `Item` do not match the trait declaration | ||
--> $DIR/span-bug-issue-121457.rs:10:14 | ||
| | ||
LL | type Item<'a> | ||
| ---- lifetimes in impl do not match this type in trait | ||
LL | where | ||
LL | Self: 'a; | ||
| -- this bound might be missing in the impl | ||
... | ||
LL | type Item = u32; | ||
| ^ lifetimes do not match type in trait | ||
|
||
error[E0277]: `()` is not an iterator | ||
--> $DIR/span-bug-issue-121457.rs:13:23 | ||
| | ||
LL | fn iter(&self) -> impl for<'missing> Iterator<Item = Self::Item<'missing>> {} | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `()` is not an iterator | ||
| | ||
= help: the trait `Iterator` is not implemented for `()` | ||
|
||
error: aborting due to 3 previous errors | ||
|
||
Some errors have detailed explanations: E0195, E0277, E0582. | ||
For more information about an error, try `rustc --explain E0195`. |
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,15 @@ | ||
#![feature(never_type)] | ||
|
||
fn test2() { | ||
let x: !; | ||
let c2 = SingleVariant::Points(0) | ||
| match x { //~ ERROR no implementation for `SingleVariant | ()` | ||
_ => (), | ||
}; | ||
} | ||
|
||
enum SingleVariant { | ||
Points(u32), | ||
} | ||
|
||
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 @@ | ||
error[E0369]: no implementation for `SingleVariant | ()` | ||
--> $DIR/span-bug-issue-121445.rs:6:9 | ||
| | ||
LL | let c2 = SingleVariant::Points(0) | ||
| ------------------------ SingleVariant | ||
LL | | match x { | ||
| _________^_- | ||
LL | | _ => (), | ||
LL | | }; | ||
| |_________- () | ||
| | ||
note: an implementation of `BitOr<()>` might be missing for `SingleVariant` | ||
--> $DIR/span-bug-issue-121445.rs:11:1 | ||
| | ||
LL | enum SingleVariant { | ||
| ^^^^^^^^^^^^^^^^^^ must implement `BitOr<()>` | ||
note: the trait `BitOr` must be implemented | ||
--> $SRC_DIR/core/src/ops/bit.rs:LL:COL | ||
|
||
error: aborting due to 1 previous error | ||
|
||
For more information about this error, try `rustc --explain E0369`. |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is the error message worse without that
if let
?if not please remove it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just doing
Ty::new_error
has no effect on test outputs, so I did this.