forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 6
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#133517 - compiler-errors:deep-norm, r=lcnr Deeply normalize when computing implied outlives bounds r? lcnr Unfortunately resolving regions is still slightly scuffed (though in an unrelated way). Specifically, we should be normalizing our param-env outlives when constructing the `OutlivesEnv`; otherwise, these assumptions (https://github.com/rust-lang/rust/blob/dd2837ec5de4301a692e05a7c4475e980af57a57/compiler/rustc_infer/src/infer/outlives/env.rs#L78) are not constructed correctly. Let me know if you want us to track that somewhere.
- Loading branch information
Showing
13 changed files
with
88 additions
and
29 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 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 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
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() {} |