forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rollup merge of rust-lang#121480 - nnethercote:fix-more-121208-fallou…
…t, r=lcnr Fix more rust-lang#121208 fallout rust-lang#121208 converted lots of delayed bugs to bugs. Unsurprisingly, there were a few invalid conversion found via fuzzing. r? `@lcnr`
- Loading branch information
Showing
6 changed files
with
94 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
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`. |