about summary refs log tree commit diff
path: root/compiler/rustc_lint/src/if_let_rescope.rs
AgeCommit message (Collapse)AuthorLines
2025-07-16future-incompat lints: don't link to the nightly edition-guide versiondianne-1/+1
2025-07-03setup CI and tidy to use typos for spellchecking and fix few typosklensy-1/+1
2025-04-16Move eager translation to a method on `Diag`Jake Goulding-9/+3
This will allow us to eagerly translate messages on a top-level diagnostic, such as a `LintDiagnostic`. As a bonus, we can remove the awkward closure passed into Subdiagnostic and make better use of `Into`.
2025-02-26Print out destructorMichael Goulet-18/+59
2025-02-24Consider lvalues of field and index as possibly temporary placesMichael Goulet-0/+8
2025-02-24More commentsMichael Goulet-8/+16
2025-02-24Improve behavior of IF_LET_RESCOPE around temporaries and place expressionsMichael Goulet-77/+63
2025-02-21Move methods from Map to TyCtxt, part 3.Nicholas Nethercote-2/+2
Continuing the work from #137162. Every method gains a `hir_` prefix.
2025-02-08Rustfmtbjorn3-14/+19
2025-01-23Auto merge of #132666 - dingxiangfei2009:skip-if-let-rescope-lint, ↵bors-6/+5
r=compiler-errors Skip `if-let-rescope` lint unless requested by migration Tracked by #124085 Related to https://github.com/rust-lang/rust/pull/131984#issuecomment-2448329667 Given that `if-let-rescope` is a lint to be enabled globally by an edition migration, there is no point in extracting the precise lint level on the HIR expression. This mitigates the performance regression discovered by the earlier perf-run. cc `@Kobzol` `@rylev` `@traviscross` I propose a `rust-timer` run to measure how much performance that we can recover from the mitigation. :bow:
2024-12-15Use links to edition guide for edition migrationsEric Huss-1/+1
2024-12-12Add unwrap_unsafe_binder and wrap_unsafe_binder macro operatorsMichael Goulet-0/+1
2024-12-02reduce false positives on some common cases from if-let-rescopeDing Xiang Fei-2/+5
2024-11-18use `TypingEnv` when no `infcx` is availablelcnr-1/+1
the behavior of the type system not only depends on the current assumptions, but also the currentnphase of the compiler. This is mostly necessary as we need to decide whether and how to reveal opaque types. We track this via the `TypingMode`.
2024-11-06skip if-let-rescope lint unless requested by migrationDing Xiang Fei-6/+5
2024-10-24stabilize if_let_rescopeDing Xiang Fei-2/+1
2024-10-23nightly feature tracking: get rid of the per-feature bool fieldsRalf Jung-1/+1
2024-10-15update bootstrap configsJosh Stone-1/+1
2024-09-30Rollup merge of #131035 - dingxiangfei2009:tweak-if-let-rescope-lint, r=jieyouxuMatthias Krüger-2/+28
Preserve brackets around if-lets and skip while-lets r? `@jieyouxu` Tracked by #124085 Fresh out of #129466, we have discovered 9 crates that the lint did not successfully migrate because the span of `if let` includes the surrounding brackets `(..)` like the following, which surprised me a bit. ```rust if (if let .. { .. } else { .. }) { // ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // the span somehow includes the surrounding brackets } ``` There is one crate that failed the migration because some suggestion spans cross the macro expansion boundaries. Surely there is no way to patch them with `match` rewrite. To handle this case, we will instead require all spans to be tested for admissibility as suggestion spans. Besides, there are 4 false negative cases discovered with desugared-`while let`. We don't need to lint them, because the `else` branch surely contains exactly one statement because the drop order is not changed whatsoever in this case. ```rust while let Some(value) = droppy().get() { .. } // is desugared into loop { if let Some(value) = droppy().get() { .. } else { break; // here can be nothing observable in this block } } ``` I believe this is the one and only false positive that I have found. I think we have finally nailed all the corner cases this time.
2024-09-30apply suggestionsDing Xiang Fei-1/+2
2024-09-30preserve brackets around if-lets and skip while-letsDing Xiang Fei-2/+27
2024-09-29cleanup: don't `.into()` identical typesMatthias Krüger-1/+1
2024-09-22Reformat using the new identifier sorting from rustfmtMichael Goulet-20/+15
2024-09-14Make some lint doctests compatible with `--stage=0`Zalathar-1/+1
2024-09-13simplify the suggestion notesDing Xiang Fei-108/+123
2024-09-11coalesce lint suggestions that can intersectDing Xiang Fei-108/+211
2024-09-11rescope temp lifetime in let-chain into IfElseDing Xiang Fei-0/+312
apply rules by span edition