-
Notifications
You must be signed in to change notification settings - Fork 12.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use regular type equating instead of a custom query
- Loading branch information
Showing
9 changed files
with
50 additions
and
66 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
This file was deleted.
Oops, something went wrong.
12 changes: 12 additions & 0 deletions
12
tests/ui/coherence/negative-coherence/generic_const_type_mismatch.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,12 @@ | ||
//! This test used to ICE (#119381), because relating the `u8` and `i8` generic | ||
//! const with the array length of the `Self` type was succeeding under the | ||
//! assumption that an error had already been reported. | ||
|
||
#![feature(with_negative_coherence)] | ||
trait Trait {} | ||
impl<const N: u8> Trait for [(); N] {} | ||
//~^ ERROR: mismatched types | ||
impl<const N: i8> Trait for [(); N] {} | ||
//~^ ERROR: mismatched types | ||
|
||
fn main() {} |
15 changes: 15 additions & 0 deletions
15
tests/ui/coherence/negative-coherence/generic_const_type_mismatch.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,15 @@ | ||
error[E0308]: mismatched types | ||
--> $DIR/generic_const_type_mismatch.rs:7:34 | ||
| | ||
LL | impl<const N: u8> Trait for [(); N] {} | ||
| ^ expected `usize`, found `u8` | ||
|
||
error[E0308]: mismatched types | ||
--> $DIR/generic_const_type_mismatch.rs:9:34 | ||
| | ||
LL | impl<const N: i8> Trait for [(); N] {} | ||
| ^ expected `usize`, found `i8` | ||
|
||
error: aborting due to 2 previous errors | ||
|
||
For more information about this error, try `rustc --explain E0308`. |
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,8 @@ | ||
error: internal compiler error: compiler/rustc_borrowck/src/universal_regions.rs:LL:CC: cannot convert `'{erased}` to a region vid | ||
|
||
query stack during panic: | ||
#0 [mir_borrowck] borrow-checking `<impl at $DIR/issue-105821.rs:21:1: 23:24>::R` | ||
#1 [analysis] running analysis passes on this crate | ||
end of query stack | ||
error: aborting due to 1 previous error | ||
|