-
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.
Deeply normalize when computing implied outlives bounds
- Loading branch information
1 parent
f2abf82
commit 3f2a57a
Showing
3 changed files
with
51 additions
and
4 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
46 changes: 46 additions & 0 deletions
46
tests/ui/traits/next-solver/normalize-in-implied_outlives_bounds.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,46 @@ | ||
//@ check-pass | ||
//@ compile-flags: -Znext-solver | ||
|
||
// Minimized example from `rustc_type_ir` that demonstrates a missing deep normalization | ||
// in the new solver when computing the implies outlives bounds of an impl. | ||
|
||
use std::marker::PhantomData; | ||
use std::ops::Deref; | ||
|
||
pub struct SearchGraph<D: Delegate, X = <D as Delegate>::Cx> { | ||
d: PhantomData<D>, | ||
x: PhantomData<X>, | ||
} | ||
|
||
pub trait Delegate { | ||
type Cx; | ||
} | ||
|
||
struct SearchGraphDelegate<D: SolverDelegate> { | ||
_marker: PhantomData<D>, | ||
} | ||
|
||
impl<D> Delegate for SearchGraphDelegate<D> | ||
where | ||
D: SolverDelegate, | ||
{ | ||
type Cx = D::Interner; | ||
} | ||
|
||
pub trait SolverDelegate { | ||
type Interner; | ||
} | ||
|
||
struct EvalCtxt<'a, D, I> | ||
where | ||
D: SolverDelegate<Interner = I>, | ||
{ | ||
search_graph: &'a SearchGraph<SearchGraphDelegate<D>>, | ||
} | ||
|
||
impl<'a, D, I> EvalCtxt<'a, D, <D as SolverDelegate>::Interner> | ||
where | ||
D: SolverDelegate<Interner = I> | ||
{} | ||
|
||
fn main() {} |