about summary refs log tree commit diff
path: root/compiler/rustc_infer/src/infer/lexical_region_resolve
AgeCommit message (Collapse)AuthorLines
2025-07-31Overhaul `Constraint`.Nicholas Nethercote-112/+122
This commit changes it to store a `Region` instead of a `RegionVid` for the `Var` cases: - We avoid having to call `Region::new_var` to re-create `Region`s from `RegionVid`s in a few places, avoiding the interning process, giving a small perf win. (At the cost of the type allowing some invalid combinations of values.) - All the cases now store two `Region`s, so the commit also separates the `ConstraintKind` (a new type) from the `sub` and `sup` arguments in `Constraint`.
2025-05-06Rename `graph::implementation::Graph` to `LinkedGraph`Zalathar-4/+4
2025-04-08clean code: remove Deref<Target=RegionKind> impl for Region and use `.kind()`xizheyin-14/+14
Signed-off-by: xizheyin <xizheyin@smail.nju.edu.cn>
2025-03-15Squash fold into tyMichael Goulet-2/+1
2025-02-21Allow SliceIndex to be indexed by ranges.Jason Newcomb-1/+1
2024-11-28uplift fold_regions to rustc_type_irlcnr-2/+2
2024-09-22Reformat using the new identifier sorting from rustfmtMichael Goulet-1/+1
2024-08-30Remove `#[macro_use] extern crate tracing` from `rustc_infer`.Nicholas Nethercote-0/+1
2024-08-27Add `warn(unreachable_pub)` to `rustc_infer`.Nicholas Nethercote-1/+1
2024-07-29Reformat `use` declarations.Nicholas Nethercote-13/+10
The previous commit updated `rustfmt.toml` appropriately. This commit is the outcome of running `x fmt --all` with the new formatting options.
2024-05-13Remove `extern crate rustc_middle` from `rustc_infer`.Nicholas Nethercote-0/+1
2024-03-21Stop sorting via `DefId`s in region resolutionOli Scherer-8/+11
2024-02-14Use fewer delayed bugs.Nicholas Nethercote-8/+6
For some cases where it's clear that an error has already occurred, e.g.: - there's a comment stating exactly that, or - things like HIR lowering, where we are lowering an error kind The commit also tweaks some comments around delayed bug sites.
2024-02-02Normalize the whole PolyTypeOutlivesPredicate, more simplificationsMichael Goulet-1/+1
2024-01-30Deeply normalize when processing registered region obligationsMichael Goulet-1/+4
2023-12-24Remove `Session` methods that duplicate `DiagCtxt` methods.Nicholas Nethercote-1/+1
Also add some `dcx` methods to types that wrap `TyCtxt`, for easier access.
2023-12-22Auto merge of #118824 - aliemjay:perf-region-cons, r=compiler-errorsbors-3/+9
use Vec for region constraints instead of BTreeMap ~1% perf gain Diagnostic regressions need more investigation. r? `@ghost`
2023-12-19Remove unnecessary param-env from lexical region resolution and fully ↵Michael Goulet-9/+3
structural relations
2023-12-17use Vec for region constraintsAli MJ Al-Nasrawy-3/+9
2023-12-02Rename `HandlerInner::delay_span_bug` as `HandlerInner::span_delayed_bug`.Nicholas Nethercote-1/+1
Because the corresponding `Level` is `DelayedBug` and `span_delayed_bug` follows the pattern used everywhere else: `span_err`, `span_warning`, etc.
2023-11-21Fix some unnecessary castsNilstrieb-8/+4
`x clippy compiler -Aclippy::all -Wclippy::unnecessary_cast --fix` with some manual review to ensure every fix is correct.
2023-11-14finish `RegionKind` renamelcnr-14/+12
- `ReFree` -> `ReLateParam` - `ReEarlyBound` -> `ReEarlyParam`
2023-11-13rename `ReLateBound` to `ReBound`lcnr-4/+4
other changes: - `Region::new_late_bound` -> `Region::new_bound` - `Region::is_late_bound` -> `Region::is_bound`
2023-10-13Format all the let chains in compilerMichael Goulet-1/+3
2023-08-26Merge if and match expressions that don't make sense to have separatedSantiago Pastorino-15/+10
2023-08-25Check that universe can name other universe instead of equalitySantiago Pastorino-4/+5
2023-08-25Remove lub_empty from lexical region resolveSantiago Pastorino-46/+19
2023-08-01Suppress unnecessary outlivesMichael Goulet-0/+4
2023-07-30inline format!() args up to and including rustc_codegen_llvmMatthias Krüger-3/+2
2023-05-29Rename `tcx.mk_re_*` => `Region::new_*`Maybe Waffle-1/+1
2023-05-04Use fulfillment to check Drop impl compatibilityMichael Goulet-0/+11
2023-05-03Restrict `From<S>` for `{D,Subd}iagnosticMessage`.Nicholas Nethercote-1/+1
Currently a `{D,Subd}iagnosticMessage` can be created from any type that impls `Into<String>`. That includes `&str`, `String`, and `Cow<'static, str>`, which are reasonable. It also includes `&String`, which is pretty weird, and results in many places making unnecessary allocations for patterns like this: ``` self.fatal(&format!(...)) ``` This creates a string with `format!`, takes a reference, passes the reference to `fatal`, which does an `into()`, which clones the reference, doing a second allocation. Two allocations for a single string, bleh. This commit changes the `From` impls so that you can only create a `{D,Subd}iagnosticMessage` from `&str`, `String`, or `Cow<'static, str>`. This requires changing all the places that currently create one from a `&String`. Most of these are of the `&format!(...)` form described above; each one removes an unnecessary static `&`, plus an allocation when executed. There are also a few places where the existing use of `&String` was more reasonable; these now just use `clone()` at the call site. As well as making the code nicer and more efficient, this is a step towards possibly using `Cow<'static, str>` in `{D,Subd}iagnosticMessage::{Str,Eager}`. That would require changing the `From<&'a str>` impls to `From<&'static str>`, which is doable, but I'm not yet sure if it's worthwhile.
2023-04-24Split `{Idx, IndexVec, IndexSlice}` into their own modulesMaybe Waffle-1/+1
2023-04-19In `LexicalResolver`, don't construct graph unless necessary.Nicholas Nethercote-4/+7
A small but easy perf win.
2023-04-03Doc-comment `IndexVec::from_elem` and use it in a few more placesScott McMurray-1/+1
2023-04-02Use `&IndexSlice` instead of `&IndexVec` where possibleScott McMurray-3/+3
All the same reasons as for `[T]`: more general, less pointer chasing, and `&mut IndexSlice` emphasizes that it doesn't change *length*.
2023-03-26remove obsolete `givens` from regionckAli MJ Al-Nasrawy-46/+1
2023-03-15Revert "Auto merge of #107376 - aliemjay:remove-givens, r=lcnr"Rémy Rakic-1/+46
This reverts commit e84e5ff04a647ce28540300244a26ba120642eea, reversing changes made to 1716932743a7b3705cbf0c34db0c4e070ed1930d.
2023-03-09remove obsolete `givens` from regionckAli MJ Al-Nasrawy-46/+1
2023-03-03Match unmatched backticks in compiler/ that are part of rustdocest31-1/+1
2023-02-26Don't trigger ICE for ReError when the other region is empty.Lenko Donchev-2/+10
2023-02-22Auto merge of #108357 - matthiaskrgr:rollup-ceo3q2s, r=matthiaskrgrbors-1/+1
Rollup of 6 pull requests Successful merges: - #107736 ( Rename atomic 'as_mut_ptr' to 'as_ptr' to match Cell (ref #66893) ) - #108176 (Don't delay `ReError` bug during lexical region resolve) - #108315 (Lint dead code in closures and generators) - #108342 (apply query response: actually define opaque types) - #108344 (Fix test filename for #105700) - #108353 (resolve: Remove `ImportResolver`) Failed merges: - #107911 (Add check for invalid #[macro_export] arguments) r? `@ghost` `@rustbot` modify labels: rollup
2023-02-22Remove type-traversal trait aliasesAlan Egerton-1/+1
2023-02-17Don't delay ReError bug during lexical region resolveMichael Goulet-1/+1
2023-02-15Add specialized variants of `mk_region`.Nicholas Nethercote-2/+2
Much like there are specialized variants of `mk_ty`. This will enable some optimization in the next commit. Also rename the existing `re_error*` functions as `mk_re_error*`, for consistency.
2023-02-09Use `ErrorGuaranteed` more in `ReError`Esteban Küber-3/+5
2023-02-09Change to `ReError(ErrorGuaranteed)`Esteban Küber-5/+5
2023-02-09review commentsEsteban Küber-1/+3
2023-02-09Introduce `ReError`Esteban Küber-5/+7
CC #69314
2023-01-20Auto merge of #106090 - WaffleLapkin:dereffffffffff, r=Nilstriebbors-11/+11
Remove some `ref` patterns from the compiler Previous PR: https://github.com/rust-lang/rust/pull/105368 r? `@Nilstrieb`