-
-
Notifications
You must be signed in to change notification settings - Fork 14.2k
NFC normalize lifetime identifiers #149192
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
This is a observable language change in that previously we didn't accept struct Foo<'a>(&'a ());
fn foo<'K>(_x: Foo<'K>, _y: Foo<'K>) {}
// ^- latin K ^- kelvin KSo when we do NFC-normalize the lifetimes, we are now accepting more code (but is consistent with the original RFC and regular identifiers). This needs a lang FCP, and probably an update to the reference on NFC-normalization. @rustbot label: +I-lang-nominated |
|
I think the reference is actually fine - I'm not sure if something changed since the original bug report or the original bug report was just a generous reading of the current reference as accepting the non-normalizing implementation. The lifetime syntax page is here, and simply references the lifetime identifiers as either |
|
We talked about this on the lang call today. We agreed that idents used for lifetimes should work in the same way here as idents in other positions. @rfcbot fcp merge lang |
|
Team member @traviscross has proposed to merge this. The next step is review by the rest of the tagged team members: No concerns currently listed. Once a majority of reviewers approve (and at most 2 approvals are outstanding), this will enter its final comment period. If you spot a major issue that hasn't been raised at any point in this process, please speak up! cc @rust-lang/lang-advisors: FCP proposed for lang, please feel free to register concerns. |
|
@rfcbot reviewed |
|
🔔 This is now entering its final comment period, as per the review above. 🔔 |
|
I absolutely think we should always have lifetimes treated like tick-then-ident, so if we're doing NFC for idents then 100% agreed we should do the same for lifetimes. @rfcbot reviewed |
|
Possibly perf-sensitive, we're now calling @bors try @rust-timer queue Implementation looks fine, feel free to r=me when FCP and perf finishes. |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
NFC normalize lifetime identifiers
This comment was marked as duplicate.
This comment was marked as duplicate.
This comment has been minimized.
This comment has been minimized.
|
Finished benchmarking commit (94d5cd8): comparison URL. Overall result: ❌✅ regressions and improvements - no action neededBenchmarking this pull request means it may be perf-sensitive – we'll automatically label it not fit for rolling up. You can override this, but we strongly advise not to, due to possible changes in compiler perf. @bors rollup=never Instruction countOur most reliable metric. Used to determine the overall result above. However, even this metric can be noisy.
Max RSS (memory usage)Results (primary 1.0%)A less reliable metric. May be of interest, but not used to determine the overall result above.
CyclesResults (primary -2.8%, secondary 4.7%)A less reliable metric. May be of interest, but not used to determine the overall result above.
Binary sizeResults (primary 0.0%, secondary 0.0%)A less reliable metric. May be of interest, but not used to determine the overall result above.
Bootstrap: 467.027s -> 468.583s (0.33%) |
|
The final comment period, with a disposition to merge, as per the review above, is now complete. As the automated representative of the governance process, I would like to thank the author for their work and everyone else who contributed. |
|
@bors r+ I'm unsure if there is a measurable perf regression, or if it's just spurious. In any case, not really something we can do differently. |
|
If there is a perf regression this suggests that the normalization code might be able to be an order of magnitude faster. Which given that we're already running this on all other identifiers - and I'd guess that there are a lot more normal identifiers than lifetime ones - might lead to a fairly sizable improvement. A way to test if this is worth pursuing would be to run benchmarks with normalization commented out for normal identifiers as well. |
|
☀️ Test successful - checks-actions |
What is this?This is an experimental post-merge analysis report that shows differences in test outcomes between the merged PR and its parent PR.Comparing 430d829 (parent) -> 2cd4ee6 (this PR) Test differencesShow 6 test diffsStage 1
Stage 2
Additionally, 4 doctest diffs were found. These are ignored, as they are noisy. Job group index
Test dashboardRun cargo run --manifest-path src/ci/citool/Cargo.toml -- \
test-dashboard 2cd4ee6bcf517345dd76d7b102d56b2e873cddbc --output-dir test-dashboardAnd then open Job duration changes
How to interpret the job duration changes?Job durations can vary a lot, based on the actual runner instance |
|
Finished benchmarking commit (2cd4ee6): comparison URL. Overall result: no relevant changes - no action needed@rustbot label: -perf-regression Instruction countThis benchmark run did not return any relevant results for this metric. Max RSS (memory usage)Results (primary 1.5%, secondary -2.5%)A less reliable metric. May be of interest, but not used to determine the overall result above.
CyclesResults (secondary -0.8%)A less reliable metric. May be of interest, but not used to determine the overall result above.
Binary sizeThis benchmark run did not return any relevant results for this metric. Bootstrap: 473.205s -> 474.624s (0.30%) |
Fixes #126759