-
Notifications
You must be signed in to change notification settings - Fork 13.1k
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 #68772 - matthewjasper:relate-opt, r=davidtwco
Avoid exponential behaviour when relating types When equating bound types we check subtyping in both directions. Since closures are invariant in their substs, we end up comparing the two types an exponential number of times. If there are no bound variables this isn't needed. Closes #68061
- Loading branch information
Showing
3 changed files
with
42 additions
and
2 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
// Check that this can be compiled in a reasonable time. | ||
|
||
// build-pass | ||
|
||
fn main() { | ||
// 96 nested closures | ||
let x = (); | ||
|| || || || || || || || | ||
|| || || || || || || || | ||
|| || || || || || || || | ||
|| || || || || || || || | ||
|
||
|| || || || || || || || | ||
|| || || || || || || || | ||
|| || || || || || || || | ||
|| || || || || || || || | ||
|
||
|| || || || || || || || | ||
|| || || || || || || || | ||
|| || || || || || || || | ||
|| || || || || || || || | ||
[&(), &x]; | ||
} |