Compiler is still slow in rejecting "Invalid left-hand side of assignment" · Issue #103411 · rust-lang/rust (original) (raw)
Navigation Menu
- Explore
- Pricing
Provide feedback
Saved searches
Use saved searches to filter your results more quickly
Appearance settings
Description
rustc takes 75ms to reject each line of 1 = ();
.
Testcase (100 repetitions)
fn main() { 1 = (); 1 = (); 1 = (); 1 = (); 1 = (); 1 = (); 1 = (); 1 = (); 1 = (); 1 = (); 1 = (); 1 = (); 1 = (); 1 = (); 1 = (); 1 = (); 1 = (); 1 = (); 1 = (); 1 = (); 1 = (); 1 = (); 1 = (); 1 = (); 1 = (); 1 = (); 1 = (); 1 = (); 1 = (); 1 = (); 1 = (); 1 = (); 1 = (); 1 = (); 1 = (); 1 = (); 1 = (); 1 = (); 1 = (); 1 = (); 1 = (); 1 = (); 1 = (); 1 = (); 1 = (); 1 = (); 1 = (); 1 = (); 1 = (); 1 = (); 1 = (); 1 = (); 1 = (); 1 = (); 1 = (); 1 = (); 1 = (); 1 = (); 1 = (); 1 = (); 1 = (); 1 = (); 1 = (); 1 = (); 1 = (); 1 = (); 1 = (); 1 = (); 1 = (); 1 = (); 1 = (); 1 = (); 1 = (); 1 = (); 1 = (); 1 = (); 1 = (); 1 = (); 1 = (); 1 = (); 1 = (); 1 = (); 1 = (); 1 = (); 1 = (); 1 = (); 1 = (); 1 = (); 1 = (); 1 = (); 1 = (); 1 = (); 1 = (); 1 = (); 1 = (); 1 = (); 1 = (); 1 = (); 1 = (); 1 = (); }
Meta
rustc --version --verbose
:
rustc 1.66.0-nightly (dcb376115 2022-10-20)
binary: rustc
commit-hash: dcb376115066d111dbf5f13d5ac2a2dbe8c12add
commit-date: 2022-10-20
host: x86_64-apple-darwin
release: 1.66.0-nightly
LLVM version: 15.0.2
Observations
- This is left over from Exponential compilation time on chained "invalid left-hand side of assignment" #103219. Now it's linear (not exponential), but the constant factor is very high.
- The slow pass is still
item_bodies_checking
. - Nearly 100% of the time is spent in
probe_for_return_type
. - I flattened this testcase from
1 = 1 = ... = 1;
to repeats of1 = ();
. This doesn't affect the speed, but may make the sample tree easier to read. - It becomes 5x faster if I add
#![no_std]
. This strikes me as odd because I wouldn't expect anything instd
to make this assignment valid.
@rustbot label +I-compiletime