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.
Use TypeRelating for instantiating query responses
- Loading branch information
1 parent
04e7f96
commit cbf5f7d
Showing
2 changed files
with
111 additions
and
7 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
33 changes: 33 additions & 0 deletions
33
src/test/ui/nll/user-annotations/type-annotation-with-hrtb.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,33 @@ | ||
// Regression test for issue #69490 | ||
|
||
// check-pass | ||
|
||
pub trait Trait<T> { | ||
const S: &'static str; | ||
} | ||
|
||
impl<T> Trait<()> for T | ||
where | ||
T: for<'a> Trait<&'a ()>, | ||
{ | ||
// Use of `T::S` here caused an ICE | ||
const S: &'static str = T::S; | ||
} | ||
|
||
// Some similar cases that didn't ICE: | ||
|
||
impl<'a, T> Trait<()> for (T,) | ||
where | ||
T: Trait<&'a ()>, | ||
{ | ||
const S: &'static str = T::S; | ||
} | ||
|
||
impl<T> Trait<()> for [T; 1] | ||
where | ||
T: Trait<for<'a> fn(&'a ())>, | ||
{ | ||
const S: &'static str = T::S; | ||
} | ||
|
||
fn main() {} |