-
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.
Rollup merge of #112442 - compiler-errors:next-solver-deduplicate-reg…
…ion-constraints, r=lcnr Deduplicate identical region constraints in new solver the new solver doesn't track whether we've already proven a goal like the fulfillment context's obligation forest does, so we may be instantiating a canonical response (and specifically, its nested region obligations) quite a few times. This may lead to exponentially gathering up identical region constraints for things like auto traits, so let's deduplicate region constraints when in `compute_external_query_constraints`. r? ``@lcnr``
- Loading branch information
Showing
2 changed files
with
36 additions
and
1 deletion.
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,31 @@ | ||
// compile-flags: -Ztrait-solver=next | ||
// check-pass | ||
|
||
struct A(*mut ()); | ||
|
||
unsafe impl Send for A where A: 'static {} | ||
|
||
macro_rules! mk { | ||
($name:ident $ty:ty) => { | ||
struct $name($ty, $ty, $ty, $ty, $ty, $ty, $ty, $ty, $ty, $ty); | ||
}; | ||
} | ||
|
||
mk!(B A); | ||
mk!(C B); | ||
mk!(D C); | ||
mk!(E D); | ||
mk!(F E); | ||
mk!(G F); | ||
mk!(H G); | ||
mk!(I H); | ||
mk!(J I); | ||
mk!(K J); | ||
mk!(L K); | ||
mk!(M L); | ||
|
||
fn needs_send<T: Send>() {} | ||
|
||
fn main() { | ||
needs_send::<M>(); | ||
} |