Repository navigation
Tracking Issue for large_assignments lint #83518
Copy link
Copy link
Open
Labels
A-lintsArea: Lints (warnings about flaws in source code) such as unused_mut.Area: Lints (warnings about flaws in source code) such as unused_mut.C-tracking-issueCategory: An issue tracking the progress of sth. like the implementation of an RFCCategory: An issue tracking the progress of sth. like the implementation of an RFCE-help-wantedCall for participation: Help is requested to fix this issue.Call for participation: Help is requested to fix this issue.E-mediumCall for participation: Medium difficulty. Experience needed to fix: Intermediate.Call for participation: Medium difficulty. Experience needed to fix: Intermediate.E-mentorCall for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion.Call for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion.S-tracking-design-concernsStatus: There are blocking design concerns.Status: There are blocking design concerns.T-langRelevant to the language teamRelevant to the language team
Description
This is a tracking issue for the implementation of the MCP rust-lang/compiler-team#420
The feature gate for the issue is #![feature(large_assignments)].
About tracking issues
Tracking issues are used to record the overall progress of implementation.
They are also used as hubs connecting to other relevant issues, e.g., bugs or open design questions.
A tracking issue is however not meant for large scale discussion, questions, or bug reports about a feature.
Instead, open a dedicated issue for the specific matter and add the relevant feature gate label.
Steps
- Implement the RFC (Implement a lint that highlights all moves larger than a configured limit #83519)
- make sure we inform the user properly about the fact that they can change the limit
E-easy
Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue. - this just needs an additional note on the diagnostic informing the user about the current limit and how to change it.
- reduce the noisiness (it's reported multiple times on different parts of an expression, but should only trigger on the innermost/first one)
E-easy
Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue. - this can be done by adding the current span to a Vec on
selfin https://github.com/oli-obk/rust/blob/85b1c67910dbeede8aabb16bc0c1c09a2fefe8ab/compiler/rustc_mir/src/monomorphize/collector.rs#L784 - and then, right before https://github.com/oli-obk/rust/blob/85b1c67910dbeede8aabb16bc0c1c09a2fefe8ab/compiler/rustc_mir/src/monomorphize/collector.rs#L760 checking if the current span overlaps with any span in the vec.
- this can be done by adding the current span to a Vec on
- stop linting in box/arc initialization
E-medium
Call for participation: Medium difficulty. Experience needed to fix: Intermediate. - make span point to specific arg when moving large args into functions (large_assignments: Lint on specific large args passed to functions #116520)
- Differentiate between
Operand::MoveandOperand::Copy, see rustc_monomorphize: Introduce check_fn_args_move_size() #116310 (comment) and https://rust-lang.zulipchat.com/#narrow/stream/182449-t-compiler.2Fhelp/topic/arg.20Spans.20for.20TerminatorKind.3A.3ACall.3F/near/393865180 - Make sure diagnostics point to correct span when
-Zinline-miris involed. Seelarge_assignments: Unactionable diagnostics with-Zinline-mir#121672 - fix lint duplication with multiple generic instantiations
- Suggest borrow instead of
#[allow(...)]if possible - enable the lint by default with a 4k threshold (Set default
move_size_limitto 4kB forlarge_assignmentslint on nightly #115684) - disable the lint in tests (by default, users can still turn it on)
E-medium
Call for participation: Medium difficulty. Experience needed to fix: Intermediate. - move lint logic out of compiler/rustc_monomorphize/src/collector.rs (we should do this after we enable the lint by default since doing this has a high risk of regressing performance)
- Adjust documentation (see instructions on rustc-dev-guide)
- Stabilization PR (see instructions on rustc-dev-guide)
Unresolved Questions
- Should this threshold be configurable via the command line?
- Should we split lint into multiple size limits lints?
Implementation history
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
A-lintsArea: Lints (warnings about flaws in source code) such as unused_mut.Area: Lints (warnings about flaws in source code) such as unused_mut.C-tracking-issueCategory: An issue tracking the progress of sth. like the implementation of an RFCCategory: An issue tracking the progress of sth. like the implementation of an RFCE-help-wantedCall for participation: Help is requested to fix this issue.Call for participation: Help is requested to fix this issue.E-mediumCall for participation: Medium difficulty. Experience needed to fix: Intermediate.Call for participation: Medium difficulty. Experience needed to fix: Intermediate.E-mentorCall for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion.Call for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion.S-tracking-design-concernsStatus: There are blocking design concerns.Status: There are blocking design concerns.T-langRelevant to the language teamRelevant to the language team
Activity
leonardo-m commentedon Mar 26, 2021
osa1 commentedon Mar 27, 2021
oli-obk commentedon Mar 29, 2021
oli-obk commentedon Mar 29, 2021
Rollup merge of rust-lang#83519 - oli-obk:assign_shrink_your_normal_c…
Rollup merge of rust-lang#83519 - oli-obk:assign_shrink_your_normal_c…
Rollup merge of rust-lang#83519 - oli-obk:assign_shrink_your_normal_c…
Rollup merge of rust-lang#83519 - oli-obk:assign_shrink_your_normal_c…
Rollup merge of rust-lang#83519 - oli-obk:assign_shrink_your_normal_c…
Rollup merge of rust-lang#83519 - oli-obk:assign_shrink_your_normal_c…
Rollup merge of rust-lang#86450 - tmiasko:move-size-limit, r=pnkfelix
Rollup merge of rust-lang#86450 - tmiasko:move-size-limit, r=pnkfelix
40 remaining items
Auto merge of rust-lang#116520 - Enselic:large-copy-into-fn, r=oli-obk
Rollup merge of rust-lang#120773 - Enselic:copy-vs-move, r=oli-obk
Unrolled build for rust-lang#120773
Rollup merge of #120773 - Enselic:copy-vs-move, r=oli-obk
Rollup merge of rust-lang#121539 - Enselic:fix-large-move, r=Nilstrieb
Unrolled build for rust-lang#121539
Rollup merge of #121539 - Enselic:fix-large-move, r=Nilstrieb
Enselic commentedon Apr 14, 2024
I managed to make some progress on this. However, other things have arisen that I would like to focus my attention on, so I will now unassign myself to unblock others from taking over the implementation of this feature. I want to thank my mentor oli-obk who was of great help during my work on this 🙏
The next natural step for this feature would be to fix #121672.
See the top issue description for a somewhat updated list of things to do after that.
@rustbot release-assignment
oli-obk commentedon Apr 14, 2024
Thanks for the work you've done!
Make color lookup tables explicitly by reference.
Rollup merge of rust-lang#139551 - jogru0:121672, r=oli-obk
Unrolled build for rust-lang#139551