about summary refs log tree commit diff
path: root/compiler/rustc_borrowck/src/renumber.rs
AgeCommit message (Collapse)AuthorLines
2025-08-11remove `from_forall`lcnr-1/+1
2025-08-06Track names of existentialsAmanda Stjerna-1/+1
2025-03-15Squash fold into tyMichael Goulet-2/+1
2025-01-14mir borrowck: cleanup late-bound region handlinglcnr-1/+0
2024-11-28uplift fold_regions to rustc_type_irlcnr-1/+2
2024-10-04Fix some pub(crate) that were undetected bc of instrumentMichael Goulet-1/+1
2024-08-30Remove `#[macro_use] extern crate tracing` from `rustc_borrowck`.Nicholas Nethercote-0/+1
2024-07-29Reformat `use` declarations.Nicholas Nethercote-3/+3
The previous commit updated `rustfmt.toml` appropriately. This commit is the outcome of running `x fmt --all` with the new formatting options.
2024-06-13MIR visitor: constant -> const_operandRalf Jung-1/+1
2024-05-09Correct a comment.Nicholas Nethercote-3/+1
I tried simplifying `RegionCtxt`, which led me to finding that the fields are printed in `sccs_info`.
2024-05-06BorrowckInferCtxt: infcx by valuelcnr-2/+2
2024-02-06Invert diagnostic lints.Nicholas Nethercote-2/+0
That is, change `diagnostic_outside_of_impl` and `untranslatable_diagnostic` from `allow` to `deny`, because more than half of the compiler has be converted to use translated diagnostics. This commit removes more `deny` attributes than it adds `allow` attributes, which proves that this change is warranted.
2023-11-13add fixme to `RegionCtxt`lcnr-0/+3
2023-10-16Avoid unnecessary renumberingJonáš Fiala-0/+4
2023-09-24Remove span from BrAnon.Camille GILLOT-10/+4
2023-09-21rename mir::Constant -> mir::ConstOperand, mir::ConstKind -> mir::ConstRalf Jung-5/+4
2023-07-14refactor(rustc_middle): Substs -> GenericArgMahdi Dibaiee-4/+4
2023-05-04check array type of repeat exprs is wfBoxy-0/+8
2023-04-24Split `{Idx, IndexVec, IndexSlice}` into their own modulesMaybe Waffle-1/+1
2023-04-12Auto merge of #110249 - matthiaskrgr:rollup-7iig04q, r=matthiaskrgrbors-3/+1
Rollup of 8 pull requests Successful merges: - #110153 (Fix typos in compiler) - #110165 (rustdoc: use CSS `overscroll-behavior` instead of JavaScript) - #110175 (Symbol cleanups) - #110203 (Remove `..` from return type notation) - #110205 (rustdoc: make settings radio and checks thicker, less contrast) - #110222 (Improve the error message when forwarding a matched fragment to another macro) - #110237 (Split out a separate feature gate for impl trait in associated types) - #110241 (tidy: Issue an error when UI test limits are too high) Failed merges: - #110218 (Remove `ToRegionVid`) r? `@ghost` `@rustbot` modify labels: rollup
2023-04-12Rename `NllVisitor` as `RegionRenumberer`.Nicholas Nethercote-6/+6
It's a more descriptive name.
2023-04-11Fix `RegionCtxt::preference_value`.Nicholas Nethercote-3/+1
There's a bad pattern matching confusion present in this function. `_anon` gets assigned to, and then `_anon` is used as an unbound variable in the pattern, which is unrelated to the first `_anon`. If the `_anon` didn't start with `_` the compiler would give warnings. This was introduced in #104239. I have rewritten the function to remove the confusion and preserve the existing behaviour. This seems safest, because the original intent is not clear.
2023-04-11Rename a variable.Nicholas Nethercote-2/+2
2023-04-11Inline and remove `renumber_regions`.Nicholas Nethercote-19/+6
It has a single callsite.
2023-04-02Use `&IndexSlice` instead of `&IndexVec` where possibleScott McMurray-2/+2
All the same reasons as for `[T]`: more general, less pointer chasing, and `&mut IndexSlice` emphasizes that it doesn't change *length*.
2023-02-22Remove type-traversal trait aliasesAlan Egerton-2/+2
2023-02-20remove cfg attributesb-naber-2/+0
2023-02-19add some cfgs backb-naber-12/+15
2023-02-19remove cfgsb-naber-66/+1
2023-02-19rebaseb-naber-8/+12
2023-02-19some conditional importsb-naber-0/+1
2023-02-19collect existentials and placeholdersb-naber-3/+0
2023-02-19collect region contexts during mir renumberingb-naber-5/+110
2022-11-09lint auto passAndyJado-0/+2
Revert "lint auto pass" This reverts commit e58e4466384924c491a932d3f18ef50ffa5a5065.
2022-10-17mir constants: type traversing bye byelcnr-24/+2
2022-10-07Remove TypeckResults from InferCtxtCameron Steffen-4/+4
2022-09-15nitsb-naber-0/+5
2022-09-14address review againb-naber-23/+18
2022-09-13remove visit_const from mir visitorsb-naber-4/+0
2022-09-13renumber regions in mir constants correctlyb-naber-2/+32
2022-06-27fold_region: remove unused parameterlcnr-1/+1
2022-02-15Overhaul `Const`.Nicholas Nethercote-2/+2
Specifically, rename the `Const` struct as `ConstS` and re-introduce `Const` as this: ``` pub struct Const<'tcx>(&'tcx Interned<ConstS>); ``` This now matches `Ty` and `Predicate` more closely, including using pointer-based `eq` and `hash`. Notable changes: - `mk_const` now takes a `ConstS`. - `Const` was copy, despite being 48 bytes. Now `ConstS` is not, so need a we need separate arena for it, because we can't use the `Dropless` one any more. - Many `&'tcx Const<'tcx>`/`&Const<'tcx>` to `Const<'tcx>` changes - Many `ct.ty` to `ct.ty()` and `ct.val` to `ct.val()` changes. - Lots of tedious sigil fiddling.
2022-02-15Overhaul `RegionKind` and `Region`.Nicholas Nethercote-1/+1
Specifically, change `Region` from this: ``` pub type Region<'tcx> = &'tcx RegionKind; ``` to this: ``` pub struct Region<'tcx>(&'tcx Interned<RegionKind>); ``` This now matches `Ty` and `Predicate` more closely. Things to note - Regions have always been interned, but we haven't been using pointer-based `Eq` and `Hash`. This is now happening. - I chose to impl `Deref` for `Region` because it makes pattern matching a lot nicer, and `Region` can be viewed as just a smart wrapper for `RegionKind`. - Various methods are moved from `RegionKind` to `Region`. - There is a lot of tedious sigil changes. - A couple of types like `HighlightBuilder`, `RegionHighlightMode` now have a `'tcx` lifetime because they hold a `Ty<'tcx>`, so they can call `mk_region`. - A couple of test outputs change slightly, I'm not sure why, but the new outputs are a little better.
2022-02-15Overhaul `TyS` and `Ty`.Nicholas Nethercote-1/+1
Specifically, change `Ty` from this: ``` pub type Ty<'tcx> = &'tcx TyS<'tcx>; ``` to this ``` pub struct Ty<'tcx>(Interned<'tcx, TyS<'tcx>>); ``` There are two benefits to this. - It's now a first class type, so we can define methods on it. This means we can move a lot of methods away from `TyS`, leaving `TyS` as a barely-used type, which is appropriate given that it's not meant to be used directly. - The uniqueness requirement is now explicit, via the `Interned` type. E.g. the pointer-based `Eq` and `Hash` comes from `Interned`, rather than via `TyS`, which wasn't obvious at all. Much of this commit is boring churn. The interesting changes are in these files: - compiler/rustc_middle/src/arena.rs - compiler/rustc_middle/src/mir/visit.rs - compiler/rustc_middle/src/ty/context.rs - compiler/rustc_middle/src/ty/mod.rs Specifically: - Most mentions of `TyS` are removed. It's very much a dumb struct now; `Ty` has all the smarts. - `TyS` now has `crate` visibility instead of `pub`. - `TyS::make_for_test` is removed in favour of the static `BOOL_TY`, which just works better with the new structure. - The `Eq`/`Ord`/`Hash` impls are removed from `TyS`. `Interned`s impls of `Eq`/`Hash` now suffice. `Ord` is now partly on `Interned` (pointer-based, for the `Equal` case) and partly on `TyS` (contents-based, for the other cases). - There are many tedious sigil adjustments, i.e. adding or removing `*` or `&`. They seem to be unavoidable.
2021-11-27Visit type in process_projection_elem.Camille GILLOT-17/+1
2021-09-28More tracing instrumentationOli Scherer-13/+9
2021-09-07Move rustc_mir::borrow_check to new crate rustc_borrowck.Camille GILLOT-0/+103