-
Notifications
You must be signed in to change notification settings - Fork 12.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Auto merge of #69614 - estebank:ice-age, r=davidtwco
`delay_span_bug` when codegen cannot select obligation Fix #69602, introduced in #60126 by letting the compiler continue past type checking after encountering errors.
- Loading branch information
Showing
6 changed files
with
55 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
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
22 changes: 22 additions & 0 deletions
22
src/test/ui/issues/issue-69602-type-err-during-codegen-ice.rs
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 @@ | ||
trait TraitA { | ||
const VALUE: usize; | ||
} | ||
|
||
struct A; | ||
impl TraitA for A { | ||
const VALUE: usize = 0; | ||
} | ||
|
||
trait TraitB { | ||
type MyA: TraitA; | ||
const VALUE: usize = Self::MyA::VALUE; | ||
} | ||
|
||
struct B; | ||
impl TraitB for B { //~ ERROR not all trait items implemented, missing: `MyA` | ||
type M = A; //~ ERROR type `M` is not a member of trait `TraitB` | ||
} | ||
|
||
fn main() { | ||
let _ = [0; B::VALUE]; | ||
} |
19 changes: 19 additions & 0 deletions
19
src/test/ui/issues/issue-69602-type-err-during-codegen-ice.stderr
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,19 @@ | ||
error[E0437]: type `M` is not a member of trait `TraitB` | ||
--> $DIR/issue-69602-type-err-during-codegen-ice.rs:17:5 | ||
| | ||
LL | type M = A; | ||
| ^^^^^^^^^^^^^ not a member of trait `TraitB` | ||
|
||
error[E0046]: not all trait items implemented, missing: `MyA` | ||
--> $DIR/issue-69602-type-err-during-codegen-ice.rs:16:1 | ||
| | ||
LL | type MyA: TraitA; | ||
| ----------------- `MyA` from trait | ||
... | ||
LL | impl TraitB for B { | ||
| ^^^^^^^^^^^^^^^^^ missing `MyA` in implementation | ||
|
||
error: aborting due to 2 previous errors | ||
|
||
Some errors have detailed explanations: E0046, E0437. | ||
For more information about an error, try `rustc --explain E0046`. |