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#69591 - matthewjasper:query-response-relate…
…, r=nikomatsakis Use TypeRelating for instantiating query responses `eq` can add constraints to `RegionConstraintData`, which isn't allowed during borrow checking outside of a `CustomTypeOp`. Use `TypeRelating` instead to always push constraints to the obligations list. closes rust-lang#69490
- Loading branch information
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() {} |