-
Notifications
You must be signed in to change notification settings - Fork 12.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Auto merge of #80132 - matthewjasper:revert-eval-order, r=nikomatsakis
Revert change to trait evaluation order This change breaks some code and doesn't appear to enable any new code. closes #79902 r? `@nikomatsakis`
- Loading branch information
Showing
2 changed files
with
42 additions
and
3 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
// Regression test for #79902 | ||
|
||
// Check that evaluation (which is used to determine whether to copy a type in | ||
// MIR building) evaluates bounds from normalizing an impl after evaluating | ||
// any bounds on the impl. | ||
|
||
// check-pass | ||
|
||
trait A { | ||
type B; | ||
} | ||
trait M {} | ||
|
||
struct G<T, U>(*const T, *const U); | ||
|
||
impl<T, U> Clone for G<T, U> { | ||
fn clone(&self) -> Self { | ||
G { ..*self } | ||
} | ||
} | ||
|
||
impl<T, U> Copy for G<T, U::B> | ||
where | ||
T: A<B = U>, | ||
U: A, | ||
{ | ||
} | ||
|
||
impl A for () { | ||
type B = (); | ||
} | ||
|
||
fn is_m<T: M>(_: T) {} | ||
|
||
fn main() { | ||
let x = G(&(), &()); | ||
drop(x); | ||
drop(x); | ||
} |