-
-
Notifications
You must be signed in to change notification settings - Fork 14.8k
Exponential compile times for chained RPITIT #102527
Copy link
Copy link
Open
Labels
A-impl-traitArea: `impl Trait`. Universally / existentially quantified anonymous types with static dispatch.Area: `impl Trait`. Universally / existentially quantified anonymous types with static dispatch.C-bugCategory: This is a bug.Category: This is a bug.F-impl_trait_in_assoc_type`#![feature(impl_trait_in_assoc_type)]``#![feature(impl_trait_in_assoc_type)]`I-compiletimeIssue: Problems and improvements with respect to compile times.Issue: Problems and improvements with respect to compile times.
Metadata
Metadata
Assignees
Labels
A-impl-traitArea: `impl Trait`. Universally / existentially quantified anonymous types with static dispatch.Area: `impl Trait`. Universally / existentially quantified anonymous types with static dispatch.C-bugCategory: This is a bug.Category: This is a bug.F-impl_trait_in_assoc_type`#![feature(impl_trait_in_assoc_type)]``#![feature(impl_trait_in_assoc_type)]`I-compiletimeIssue: Problems and improvements with respect to compile times.Issue: Problems and improvements with respect to compile times.
Type
Fields
Give feedbackNo fields configured for issues without a type.
Projects
Status
Non-blocking
I tried this code:
I expected this to compile reasonably quickly.
Instead the above example took about a minute and a half. With 20
.nest()s in sequence, it takes between two and three seconds. For each subsequent.nest(), it takes about twice the time.When I replace
|| self()with justself, it compiles almost instantly. The same happens when I remove the apparently inconsequentialval;statement, or when I use an owned type instead of a&'static str.Meta
rustc --version --verbose: