about summary refs log tree commit diff
path: root/compiler/rustc_borrowck/src/diagnostics
AgeCommit message (Collapse)AuthorLines
2024-11-02compiler: Replace rustc_target with _abi in _borrowckJubilee Young-3/+3
2024-10-31Auto merge of #132301 - compiler-errors:adjust, r=lcnrbors-1/+0
Remove region from adjustments It's not necessary to store this region, because it's only used in THIR and MemCat/ExprUse, both of which already basically only deal with erased regions anyways.
2024-10-31Try to point out when edition 2024 lifetime capture rules cause borrowck issuesMichael Goulet-1/+232
2024-10-30Remap impl-trait lifetimes on HIR instead of AST lowering.Camille GILLOT-1/+1
2024-10-29Remove region from adjustmentsMichael Goulet-1/+0
2024-10-24Rollup merge of #131756 - compiler-errors:deeply-normalize-type-err, r=lcnrStuart Cook-6/+6
Deeply normalize `TypeTrace` when reporting type error in new solver Normalize the values that come from the `TypeTrace` for various type mismatches. Side-note: We can't normalize the `TypeError` itself bc it may come from instantiated binders, so it may reference values from within the probe... r? lcnr
2024-10-24Plumb through param_env to note_type_errMichael Goulet-6/+6
2024-10-23fix some manual_mapMatthias Krüger-7/+3
2024-10-19Rollup merge of #127675 - chenyukang:yukang-fix-127562-addr, r=petrochenkovMatthias Krüger-12/+21
Remove invalid help diagnostics for const pointer Partially addresses #127562
2024-10-17move `defining_opaque_types` out of `Canonical`lcnr-15/+14
2024-10-16Improve duplicate derive Copy/Clone diagnosticsVulnBandit-0/+17
2024-10-14Move trait bound modifiers into hir::PolyTraitRefMichael Goulet-3/+3
2024-10-12remove a couple of redundant String to String conversionMatthias Krüger-1/+1
2024-10-07Rollup merge of #131225 - nnethercote:rustc_borrowck-mm, r=lqdJubilee-13/+12
`rustc_borrowck` memory management tweaks Minor cleanups in `rustc_borrowck` relating to memory management. r? `@lqd`
2024-10-04rm `ItemKind::OpaqueTy`Noah Lev-8/+2
This introduce an additional collection of opaques on HIR, as they can no longer be listed using the free item list.
2024-10-04Remove unnecessary lifetime in `ConditionVisitor`.Nicholas Nethercote-10/+10
By making it own two of its fields.
2024-10-04Use `Rc` less in `MirBorrowckCtxt`.Nicholas Nethercote-3/+2
The `regioncx` and `borrow_set` fields can be references instead of `Rc`. They use the existing `'a` lifetime. This avoids some heap allocations and is a bit simpler.
2024-10-02Remove redundant in_trait from hir::TyKind::OpaqueDefMichael Goulet-1/+1
2024-09-24be even more precise about "cast" vs "coercion"Lukas Markeffsky-5/+7
2024-09-24replace "cast" with "coercion" where applicableLukas Markeffsky-2/+5
This changes the remaining span for the cast, because the new `Cast` category has a higher priority (lower `Ord`) than the old `Coercion` category, so we no longer report the region error for the "unsizing" coercion from `*const Trait` to itself.
2024-09-22Reformat using the new identifier sorting from rustfmtMichael Goulet-82/+78
2024-09-14Rollup merge of #130294 - nnethercote:more-lifetimes, r=lcnrLeón Orell Valerian Liehr-9/+9
Lifetime cleanups The last commit is very opinionated, let's see how we go. r? `@oli-obk`
2024-09-13Rename and reorder lots of lifetimes.Nicholas Nethercote-9/+9
- Replace non-standard names like 's, 'p, 'rg, 'ck, 'parent, 'this, and 'me with vanilla 'a. These are cases where the original name isn't really any more informative than 'a. - Replace names like 'cx, 'mir, and 'body with vanilla 'a when the lifetime applies to multiple fields and so the original lifetime name isn't really accurate. - Put 'tcx last in lifetime lists, and 'a before 'b.
2024-09-13Auto merge of #107251 - dingxiangfei2009:let-chain-rescope, r=jieyouxubors-17/+122
Rescope temp lifetime in if-let into IfElse with migration lint Tracking issue #124085 This PR shortens the temporary lifetime to cover only the pattern matching and consequent branch of a `if let`. At the expression location, means that the lifetime is shortened from previously the deepest enclosing block or statement in Edition 2021. This warrants an Edition change. Coming with the Edition change, this patch also implements an edition lint to warn about the change and a safe rewrite suggestion to preserve the 2021 semantics in most cases. Related to #103108. Related crater runs: https://github.com/rust-lang/rust/pull/129466.
2024-09-12Rollup merge of #130235 - compiler-errors:nested-if, r=michaelwoeristerStuart Cook-25/+22
Simplify some nested `if` statements Applies some but not all instances of `clippy::collapsible_if`. Some ended up looking worse afterwards, though, so I left those out. Also applies instances of `clippy::collapsible_else_if` Review with whitespace disabled please.
2024-09-11Rollup merge of #130114 - eduardosm:needless-returns, r=compiler-errorsJubilee-1/+1
Remove needless returns detected by clippy in the compiler
2024-09-11Simplify some nested if statementsMichael Goulet-25/+22
2024-09-11downgrade borrowck suggestion level due to possible span conflictDing Xiang Fei-14/+29
2024-09-11rescope temp lifetime in let-chain into IfElseDing Xiang Fei-17/+107
apply rules by span edition
2024-09-09Remove needless returns detected by clippy in the compilerEduardo Sánchez Muñoz-1/+1
2024-09-09Remove unnecessary lifetimes in dataflow structs.Nicholas Nethercote-24/+20
There are four related dataflow structs: `MaybeInitializedPlaces`, `MaybeUninitializedPlaces`, and `EverInitializedPlaces`, `DefinitelyInitializedPlaces`. They all have a `&Body` and a `&MoveData<'tcx>` field. The first three use different lifetimes for the two fields, but the last one uses the same lifetime for both. This commit changes the first three to use the same lifetime, removing the need for one of the lifetimes. Other structs that also lose a lifetime as a result of this are `LivenessContext`, `LivenessResults`, `InitializationData`. It then does similar things in various other structs.
2024-09-06Make `Ty::boxed_ty` return an `Option`Pavel Grigorenko-3/+4
2024-09-02chore: Fix typos in 'compiler' (batch 1)Alexander Cyon-1/+1
2024-08-30Remove `#[macro_use] extern crate tracing` from `rustc_borrowck`.Nicholas Nethercote-0/+10
2024-08-27Rollup merge of #129340 - stephen-lazaro:u/slazaro/issue-129274, ↵Matthias Krüger-2/+3
r=compiler-errors Remove Duplicate E0381 Label Aims to resolve https://github.com/rust-lang/rust/issues/129274, and adds a test for the case. Essentially, we are duplicating this span for some reason. For now, I'm just using a set to collect the spans rather than the vec. I imagine there's probably no real reason to inspect duplicates in this area, but if I'm wrong I can adjust to collect "seen spans" in just the point where this label is applied. I'm not sure why it's producing duplicate spans. Looks like this has been this way for a while? I think it gives the duplicate label on 1.75.0 for example.
2024-08-22Deduplicate Spans in Uninitialized CheckStephen Lazaro-2/+3
Prevents reporting labels or diagnostics on spans that are produced multiple times.
2024-08-16Add `warn(unreachable_pub)` to `rustc_borrowck`.Nicholas Nethercote-15/+17
2024-08-14Auto merge of #128812 - nnethercote:shrink-TyKind-FnPtr, r=compiler-errorsbors-1/+1
Shrink `TyKind::FnPtr`. By splitting the `FnSig` within `TyKind::FnPtr` into `FnSigTys` and `FnHeader`, which can be packed more efficiently. This reduces the size of the hot `TyKind` type from 32 bytes to 24 bytes on 64-bit platforms. This reduces peak memory usage by a few percent on some benchmarks. It also reduces cache misses and page faults similarly, though this doesn't translate to clear cycles or wall-time improvements on CI. r? `@compiler-errors`
2024-08-12Rollup merge of #128978 - compiler-errors:assert-matches, r=jieyouxuGuillaume Gomez-2/+4
Use `assert_matches` around the compiler more It's a useful assertion, especially since it actually prints out the LHS.
2024-08-12Rollup merge of #128886 - GrigorenkoPV:untranslatable-diagnostic, r=nnethercoteGuillaume Gomez-33/+31
Get rid of some `#[allow(rustc::untranslatable_diagnostic)]` `@rustbot` label +A-translation cc https://github.com/rust-lang/rust/issues/100717
2024-08-11Use assert_matches around the compilerMichael Goulet-2/+4
2024-08-11Rollup merge of #128762 - fmease:use-more-slice-pats, r=compiler-errorsMatthias Krüger-2/+2
Use more slice patterns inside the compiler Nothing super noteworthy. Just replacing the common 'fragile' pattern of "length check followed by indexing or unwrap" with slice patterns for legibility and 'robustness'. r? ghost
2024-08-10rustc_borrowck: fmtPavel Grigorenko-29/+31
2024-08-10rustc_borrowck: make "implicit static" suff translatablePavel Grigorenko-4/+3
2024-08-10rustc_borrowck: make some suggestion about static lifetimes translatablePavel Grigorenko-3/+2
2024-08-10rustc_borrowck: make suggestion to move closure translatablePavel Grigorenko-2/+1
2024-08-10rustc_borrowck: make dereference suggestion translatablePavel Grigorenko-3/+2
2024-08-09use stable sort to sort multipart diagnosticsFolkert-1/+1
2024-08-09Shrink `TyKind::FnPtr`.Nicholas Nethercote-1/+1
By splitting the `FnSig` within `TyKind::FnPtr` into `FnSigTys` and `FnHeader`, which can be packed more efficiently. This reduces the size of the hot `TyKind` type from 32 bytes to 24 bytes on 64-bit platforms. This reduces peak memory usage by a few percent on some benchmarks. It also reduces cache misses and page faults similarly, though this doesn't translate to clear cycles or wall-time improvements on CI.
2024-08-07Use more slice patterns inside the compilerLeón Orell Valerian Liehr-2/+2