about summary refs log tree commit diff
path: root/compiler/rustc_middle/src/mir/query.rs
AgeCommit message (Collapse)AuthorLines
2025-07-23Remove useless lifetime parameter.Camille GILLOT-1/+1
2025-04-08move `ClosureRegionRequirements` to `rustc_borrowck`lcnr-140/+2
2025-04-08borrowck typeck children together with their parentlcnr-11/+5
2025-03-15Squash fold into tyMichael Goulet-2/+1
2025-01-24use `fmt::from_fn` in more places, instead of using structs that impl ↵Yotam Ofek-49/+19
formatting traits
2025-01-06only avoid blaming assignments from argument patternsdianne-6/+1
2025-01-06make outlives constraints from generic arguments less boringdianne-1/+10
2025-01-06`best_blame_constraint`: prioritize blaming interesting-seeming constraintsdianne-5/+2
2025-01-06remove the unused `ConstraintCategory::ClosureBounds`dianne-5/+0
2025-01-06`best_blame_constraint`: avoid blaming assignments without user-provided typesdianne-1/+6
2024-12-18Re-export more `rustc_span::symbol` things from `rustc_span`.Nicholas Nethercote-2/+1
`rustc_span::symbol` defines some things that are re-exported from `rustc_span`, such as `Symbol` and `sym`. But it doesn't re-export some closely related things such as `Ident` and `kw`. So you can do `use rustc_span::{Symbol, sym}` but you have to do `use rustc_span::symbol::{Ident, kw}`, which is inconsistent for no good reason. This commit re-exports `Ident`, `kw`, and `MacroRulesNormalizedIdent`, and changes many `rustc_span::symbol::` qualifiers in `compiler/` to `rustc_span::`. This is a 200+ net line of code reduction, mostly because many files with two `use rustc_span` items can be reduced to one.
2024-12-08coverage: Move `CoverageIdsInfo` into `mir::coverage`Zalathar-29/+1
2024-12-01Rollup merge of #133446 - Zalathar:querify, r=cjgillotJacob Pratt-3/+13
coverage: Use a query to identify which counter/expression IDs are used Given that we already have a query to identify the highest-numbered counter ID in a MIR body, we can extend that query to also build bitsets of used counter/expression IDs. That lets us avoid some messy coverage bookkeeping during the main MIR traversal for codegen. This does mean that we fail to treat some IDs as used in certain MIR-inlining scenarios, but I think that's fine, because it means that the results will be consistent across all instantiations of a function. --- There's some more cleanup I want to do in the function coverage collector, since it isn't really collecting anything any more, but I'll leave that for future work.
2024-11-30coverage: Use a query to identify which counter/expression IDs are usedZalathar-3/+13
2024-11-28uplift fold_regions to rustc_type_irlcnr-2/+3
2024-11-04ty::BrK -> ty::BoundRegionKind::KMichael Goulet-1/+4
2024-11-03compiler: Directly use rustc_abi in metadata and middleJubilee Young-1/+1
Stop reexporting ReprOptions from middle::ty
2024-09-24be even more precise about "cast" vs "coercion"Lukas Markeffsky-2/+2
2024-09-24replace "cast" with "coercion" where applicableLukas Markeffsky-1/+3
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-1/+1
2024-07-29Reformat `use` declarations.Nicholas Nethercote-4/+5
The previous commit updated `rustfmt.toml` appropriately. This commit is the outcome of running `x fmt --all` with the new formatting options.
2024-07-12rustc_middle: derivative -> derive-wherePavel Grigorenko-9/+4
2024-07-01Handle universe leaks by rewriting the constraint graphAmanda Stjerna-0/+3
This version is a squash-rebased version of a series of exiermental commits, since large parts of them were broken out into PR #125069. It explicitly handles universe violations in higher-kinded outlives constraints by adding extra outlives static constraints.
2024-06-01Uplift TypeRelation and RelateMichael Goulet-1/+1
2024-05-14coverage: `CoverageIdsInfo::mcdc_bitmap_bytes` is never neededZalathar-4/+0
This code for recalculating `mcdc_bitmap_bytes` doesn't provide any benefit, because its result won't have changed from the value in `FunctionCoverageInfo` that was computed during the MIR instrumentation pass.
2024-04-29Remove `extern crate rustc_macros` from `rustc_middle`.Nicholas Nethercote-0/+1
2024-04-20coverage. Lowering MC/DC statements to llvm-irzhuyunxing-0/+4
2024-04-18Simplify `static_assert_size`s.Nicholas Nethercote-1/+1
We want to run them on all 64-bit platforms.
2024-04-03Rollup merge of #123401 - Zalathar:assert-size-aarch64, r=fmeaseJacob Pratt-1/+1
Check `x86_64` size assertions on `aarch64`, too (Context: https://rust-lang.zulipchat.com/#narrow/stream/131828-t-compiler/topic/Checking.20size.20assertions.20on.20aarch64.3F) Currently the compiler has around 30 sets of `static_assert_size!` for various size-critical data structures (e.g. various IR nodes), guarded by `#[cfg(all(target_arch = "x86_64", target_pointer_width = "64"))]`. (Presumably this cfg avoids having to maintain separate size values for 32-bit targets and unusual 64-bit targets. Apparently it may have been necessary before the i128/u128 alignment changes, too.) This is slightly incovenient for people on aarch64 workstations (e.g. Macs), because the assertions normally aren't checked until we push to a PR. So this PR adds `aarch64` to the `#[cfg(..)]` guarding all of those assertions in the compiler. --- Implemented with a simple find/replace. Verified by manually inspecting each `static_assert_size!` in `compiler/`, and checking that either the replacement succeeded, or adding aarch64 wouldn't have been appropriate.
2024-04-03Remove MIR unsafe checkMatthew Jasper-63/+0
This also remove safety information from MIR.
2024-04-03Check `x86_64` size assertions on `aarch64`, tooZalathar-1/+1
This makes it easier for contributors on aarch64 workstations (e.g. Macs) to notice when these assertions have been violated.
2024-03-21Stop `ConstraintCategory` `Ord` impl from relying on `Ty`'s `Ord` impl.Oli Scherer-2/+10
2024-02-15Enforce coroutine-closure layouts are identicalMichael Goulet-2/+4
2024-02-05get rid of nontrivial_structural_match lint and custom_eq const qualifRalf Jung-2/+1
2023-11-27Print list of missing target features when calling a function with target ↵Eduardo Sánchez Muñoz-3/+10
features outside an unsafe block
2023-11-23remove unused pub fnklensy-58/+0
2023-11-22Replace `custom_encodable` with `encodable`.Nicholas Nethercote-0/+1
By default, `newtype_index!` types get a default `Encodable`/`Decodable` impl. You can opt out of this with `custom_encodable`. Opting out is the opposite to how Rust normally works with autogenerated (derived) impls. This commit inverts the behaviour, replacing `custom_encodable` with `encodable` which opts into the default `Encodable`/`Decodable` impl. Only 23 of the 59 `newtype_index!` occurrences need `encodable`. Even better, there were eight crates with a dependency on `rustc_serialize` just from unused default `Encodable`/`Decodable` impls. This commit removes that dependency from those eight crates.
2023-11-20Rollup merge of #117835 - Nilstrieb:note-object-lifetime-defaults, ↵Matthias Krüger-1/+5
r=compiler-errors Note about object lifetime defaults in does not live long enough error This is a aspect of Rust that frequently trips up people who are not aware of it yet. This diagnostic attempts to explain what's happening and why the lifetime constraint, that was never mentioned in the source, arose. The implementation feels a bit questionable, I'm not sure whether there are better ways to do this. There probably are. fixes #117835 r? types
2023-11-13rename `ReLateBound` to `ReBound`lcnr-2/+2
other changes: - `Region::new_late_bound` -> `Region::new_bound` - `Region::is_late_bound` -> `Region::is_bound`
2023-11-12Note about object lifetime defaults in does not live long enough errorNilstrieb-1/+5
This is a aspect of Rust that frequently trips up people who are not aware of it yet. This diagnostic attempts to explain what's happening and why the lifetime constraint, that was never mentioned in the source, arose.
2023-10-20s/generator/coroutine/Oli Scherer-4/+4
2023-10-20s/Generator/Coroutine/Oli Scherer-10/+10
2023-10-18coverage: Store the number of counters/expressions in function coverage infoZalathar-9/+15
Coverage codegen can now allocate arrays based on the number of counters/expressions originally used by the instrumentor. The existing query that inspects coverage statements is still used for determining the number of counters passed to `llvm.instrprof.increment`. If some high-numbered counters were removed by MIR optimizations, the instrumented binary can potentially use less memory and disk space at runtime.
2023-09-24Remove span from BrAnon.Camille GILLOT-2/+1
2023-09-19move ConstValue into mirRalf Jung-2/+1
this way we have mir::ConstValue and ty::ValTree as reasonably parallel
2023-09-18Remove unused `Lift` derives.Nicholas Nethercote-1/+1
I found these by commenting out all `Lift` derives and then adding back the ones that were necessary to successfully compile.
2023-07-30inline format!() args up to and including rustc_middleMatthias Krüger-1/+1
2023-07-14refactor(rustc_middle): Substs -> GenericArgMahdi Dibaiee-4/+4
2023-07-05Specialize `DestructuredConstant` to its one user (pretty printing)Oli Scherer-2/+2
2023-06-19Store generator field names in GeneratorLayout.Camille GILLOT-0/+4