about summary refs log tree commit diff
path: root/compiler/rustc_borrowck/src
AgeCommit message (Collapse)AuthorLines
2024-11-04Move some `use` declarations.Nicholas Nethercote-13/+12
So they're all in the one place. Also prepend with `crate::`, à la the `unqualified_local_imports` lint.
2024-11-04ty::BrK -> ty::BoundRegionKind::KMichael Goulet-22/+19
2024-11-04Remove BorrowKind glob, make names longerMichael Goulet-1/+1
2024-11-04Reduce visibilities.Nicholas Nethercote-21/+23
2024-11-02compiler: Replace rustc_target with _abi in _borrowckJubilee Young-6/+6
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-31Encode cross-crate opaque type originMichael Goulet-1/+1
2024-10-30Remap impl-trait lifetimes on HIR instead of AST lowering.Camille GILLOT-1/+1
2024-10-30Rollup merge of #132338 - nnethercote:rm-Engine, r=nnethercoteMatthias Krüger-15/+16
Remove `Engine` It's just unnecessary plumbing. Removing it results in less code, and simpler code. r? ``@cjgillot``
2024-10-30Remove `Analysis::into_engine`.Nicholas Nethercote-15/+16
This is a standard pattern: ``` MyAnalysis.into_engine(tcx, body).iterate_to_fixpoint() ``` `into_engine` and `iterate_to_fixpoint` are always called in pairs, but sometimes with a builder-style `pass_name` call between them. But a builder-style interface is overkill here. This has been bugging me a for a while. This commit: - Merges `Engine::new` and `Engine::iterate_to_fixpoint`. This removes the need for `Engine` to have fields, leaving it as a trivial type that the next commit will remove. - Renames `Analysis::into_engine` as `Analysis::iterate_to_fixpoint`, gives it an extra argument for the optional pass name, and makes it call `Engine::iterate_to_fixpoint` instead of `Engine::new`. This turns the pattern from above into this: ``` MyAnalysis.iterate_to_fixpoint(tcx, body, None) ``` which is shorter at every call site, and there's less plumbing required to support it.
2024-10-29TypingMode :thinking:lcnr-8/+10
2024-10-29Remove region from adjustmentsMichael Goulet-1/+0
2024-10-28fix clippy::clone_on_ref_ptr for compilerklensy-6/+6
2024-10-24Rollup merge of #131756 - compiler-errors:deeply-normalize-type-err, r=lcnrStuart Cook-6/+7
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/+7
2024-10-23fix some manual_mapMatthias Krüger-7/+3
2024-10-23nightly feature tracking: get rid of the per-feature bool fieldsRalf Jung-1/+1
2024-10-21Auto merge of #130950 - compiler-errors:yeet-eval, r=BoxyUwUbors-4/+3
Continue to get rid of `ty::Const::{try_}eval*` This PR mostly does: * Removes all of the `try_eval_*` and `eval_*` helpers from `ty::Const`, and replace their usages with `try_to_*`. * Remove `ty::Const::eval`. * Rename `ty::Const::normalize` to `ty::Const::normalize_internal`. This function is still used in the normalization code itself. * Fix some weirdness around the `TransmuteFrom` goal. I'm happy to split it out further; for example, I could probably land the first part which removes the helpers, or the changes to codegen which are more obvious than the changes to tools. r? BoxyUwU Part of https://github.com/rust-lang/rust/issues/130704
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-19Get rid of const eval_* and try_eval_* helpersMichael Goulet-4/+3
2024-10-17move `defining_opaque_types` out of `Canonical`lcnr-15/+14
2024-10-17`DropckOutlives` to `rustc_middle`lcnr-3/+2
2024-10-17remove type_op constructorslcnr-5/+5
2024-10-17`ImpliedOutlivesBounds` to `rustc_middle`lcnr-1/+1
2024-10-16Improve duplicate derive Copy/Clone diagnosticsVulnBandit-0/+17
2024-10-16Auto merge of #131481 - nnethercote:rm-GenKillSet, r=cjgillotbors-39/+25
Remove `GenKillAnalysis` There are two kinds of dataflow analysis in the compiler: `Analysis`, which is the basic kind, and `GenKillAnalysis`, which is a more specialized kind for gen/kill analyses that is intended as an optimization. However, it turns out that `GenKillAnalysis` is actually a pessimization! It's faster (and much simpler) to do all the gen/kill analyses via `Analysis`. This lets us remove `GenKillAnalysis`, and `GenKillSet`, and a few other things, and also merge `AnalysisDomain` into `Analysis`. The PR removes 500 lines of code and improves performance. r? `@tmiasko`
2024-10-16Auto merge of #131422 - GnomedDev:smallvec-predicate-obligations, ↵bors-2/+2
r=compiler-errors Use `ThinVec` for PredicateObligation storage ~~I noticed while profiling clippy on a project that a large amount of time is being spent allocating `Vec`s for `PredicateObligation`, and the `Vec`s are often quite small. This is an attempt to optimise this by using SmallVec to avoid heap allocations for these common small Vecs.~~ This PR turns all the `Vec<PredicateObligation>` into a single type alias while avoiding referring to `Vec` around it, then swaps the type over to `ThinVec<PredicateObligation>` and fixes the fallout. This also contains an implementation of `ThinVec::extract_if`, copied from `Vec::extract_if` and currently being upstreamed to https://github.com/Gankra/thin-vec/pull/66. This leads to a small (0.2-0.7%) performance gain in the latest perf run.
2024-10-14Move trait bound modifiers into hir::PolyTraitRefMichael Goulet-3/+3
2024-10-14Add defaults for `Analysis::apply_{call_return_effect,terminator_effect}`.Nicholas Nethercote-11/+1
To avoid some low-value boilerplate code.
2024-10-14Merge `AnalysisDomain` into `Analysis`.Nicholas Nethercote-16/+14
With `GenKillAnalysis` gone, there is no need for them to be separate.
2024-10-14Remove `GenKillAnalysis`.Nicholas Nethercote-12/+6
It's now functionally identical to `Analysis`.
2024-10-14Minimize use of `GenKill`.Nicholas Nethercote-2/+6
Thanks to the previous couple of commits, many uses of the `GenKill` trait can be replaced with a concrete type.
2024-10-14Tweak `GenKillAnalysis` method arguments.Nicholas Nethercote-2/+2
`GenKillAnalysis` has very similar methods to `Analysis`, but the first two have a notable difference: the second argument is `&mut impl GenKill<Self::Idx>` instead of `&mut Self::Domain`. But thanks to the previous commit, this difference is no longer necessary.
2024-10-12Rollup merge of #131626 - matthiaskrgr:dont_string, r=lqdTrevor Gross-1/+1
remove a couple of redundant String to String conversion
2024-10-12remove a couple of redundant String to String conversionMatthias Krüger-1/+1
2024-10-12Swap Vec<PredicateObligation> to type aliasGnomedDev-2/+2
2024-10-12yeet some clonesMatthias Krüger-1/+1
2024-10-10Auto merge of #131444 - onur-ozkan:hotfix-ci, r=Kobzolbors-1/+1
stabilize `ci_rustc_if_unchanged_logic` test Makes `ci_rustc_if_unchanged_logic` test more stable and re-enables it. Previously, it was expecting CI-rustc to be used all the time when there were no changes, which wasn’t always the case. Purpose of this test is making sure we don't use CI-rustc while there are changes in compiler and/or library, but we don't really need to cover cases where CI-rustc is not enabled. Second commit was pushed for making a change in the compiler tree, so `ci_rustc_if_unchanged_logic` can be tested properly in merge CI.
2024-10-10Make super combine into fnsMichael Goulet-4/+4
2024-10-10Uplift super_combineMichael Goulet-0/+1
2024-10-10update `rustc_borrowck::places_conflict` doc-commentonur-ozkan-1/+1
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2024-10-07Rollup merge of #131225 - nnethercote:rustc_borrowck-mm, r=lqdJubilee-70/+58
`rustc_borrowck` memory management tweaks Minor cleanups in `rustc_borrowck` relating to memory management. r? `@lqd`
2024-10-06various fixes for `naked_asm!` implementationFolkert de Vries-0/+2
- fix for divergence - fix error message - fix another cranelift test - fix some cranelift things - don't set the NORETURN option for naked asm - fix use of naked_asm! in doc comment - fix use of naked_asm! in run-make test - use `span_bug` in unreachable branch
2024-10-05Auto merge of #129244 - cjgillot:opaque-hir, r=compiler-errorsbors-10/+4
Make opaque types regular HIR nodes Having opaque types as HIR owner introduces all sorts of complications. This PR proposes to make them regular HIR nodes instead. I haven't gone through all the test changes yet, so there may be a few surprises. Many thanks to `@camelid` for the first draft. Fixes https://github.com/rust-lang/rust/issues/129023 Fixes #129099 Fixes #125843 Fixes #119716 Fixes #121422
2024-10-04rm `ItemKind::OpaqueTy`Noah Lev-10/+4
This introduce an additional collection of opaques on HIR, as they can no longer be listed using the free item list.
2024-10-04Rollup merge of #131264 - compiler-errors:fix-pub-crate, r=jieyouxuJubilee-2/+2
Fix some `pub(crate)` that were undetected bc of `#[instrument]` Self-explanatory, minor clean up.
2024-10-04Rollup merge of #130518 - scottmcm:stabilize-controlflow-extra, r=dtolnayJubilee-1/+0
Stabilize the `map`/`value` methods on `ControlFlow` And fix the stability attribute on the `pub use` in `core::ops`. libs-api in https://github.com/rust-lang/rust/issues/75744#issuecomment-2231214910 seemed reasonably happy with naming for these, so let's try for an FCP. Summary: ```rust impl<B, C> ControlFlow<B, C> { pub fn break_value(self) -> Option<B>; pub fn map_break<T>(self, f: impl FnOnce(B) -> T) -> ControlFlow<T, C>; pub fn continue_value(self) -> Option<C>; pub fn map_continue<T>(self, f: impl FnOnce(C) -> T) -> ControlFlow<B, T>; } ``` Resolves #75744 ``@rustbot`` label +needs-fcp +t-libs-api -t-libs --- Aside, in case it keeps someone else from going down the same dead end: I looked at the `{break,continue}_value` methods and tried to make them `const` as part of this, but that's disallowed because of not having `const Drop`, so put it back to not even unstably-const.
2024-10-04Fix some pub(crate) that were undetected bc of instrumentMichael Goulet-2/+2
2024-10-04Remove unnecessary lifetime in `ConditionVisitor`.Nicholas Nethercote-10/+10
By making it own two of its fields.