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.
add test for assertion failed: !value.has_infer() rust-lang#115806
Fixes rust-lang#115806
- Loading branch information
1 parent
b976142
commit 88aa71f
Showing
2 changed files
with
33 additions
and
0 deletions.
There are no files selected for viewing
19 changes: 19 additions & 0 deletions
19
tests/ui/generic-const-items/assoc-const-no-infer-ice-115806.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,19 @@ | ||
// ICE: assertion failed: !value.has_infer() | ||
// issue: rust-lang/rust#115806 | ||
#![feature(associated_const_equality)] | ||
#![allow(incomplete_features)] | ||
|
||
pub struct NoPin; | ||
|
||
impl<TA> Pins<TA> for NoPin {} | ||
|
||
pub trait PinA<PER> { | ||
const A: &'static () = &(); | ||
} | ||
|
||
pub trait Pins<USART> {} | ||
|
||
impl<USART, T> Pins<USART> for T where T: PinA<USART, A = { &() }> {} | ||
//~^ ERROR conflicting implementations of trait `Pins<_>` for type `NoPin` | ||
|
||
pub fn main() {} |
14 changes: 14 additions & 0 deletions
14
tests/ui/generic-const-items/assoc-const-no-infer-ice-115806.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,14 @@ | ||
error[E0119]: conflicting implementations of trait `Pins<_>` for type `NoPin` | ||
--> $DIR/assoc-const-no-infer-ice-115806.rs:16:1 | ||
| | ||
LL | impl<TA> Pins<TA> for NoPin {} | ||
| --------------------------- first implementation here | ||
... | ||
LL | impl<USART, T> Pins<USART> for T where T: PinA<USART, A = { &() }> {} | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `NoPin` | ||
| | ||
= note: downstream crates may implement trait `PinA<_>` for type `NoPin` | ||
|
||
error: aborting due to 1 previous error | ||
|
||
For more information about this error, try `rustc --explain E0119`. |