about summary refs log tree commit diff
path: root/compiler/rustc_middle/src/ty/codec.rs
AgeCommit message (Collapse)AuthorLines
2025-09-05rustc_middle: clippy fixesMarijn Schouten-8/+2
2025-07-31Remove unused `impl_decodable_via_ref!` entries.Nicholas Nethercote-3/+0
2025-07-01Update `cfg(bootstrap)`Josh Stone-2/+2
2025-06-16library/compiler: add `PointeeSized` boundsDavid Wood-2/+2
As core uses an extern type (`ptr::VTable`), the default `?Sized` to `MetaSized` migration isn't sufficient, and some code that previously accepted `VTable` needs relaxed to continue to accept extern types. Similarly, the compiler uses many extern types in `rustc_codegen_llvm` and in the `rustc_middle::ty::List` implementation (`OpaqueListContents`) some bounds must be relaxed to continue to accept these types. Unfortunately, due to the current inability to relax `Deref::Target`, some of the bounds in the standard library are forced to be stricter than they ideally would be.
2025-05-23yeet `CanonicalVarInfo`lcnr-3/+3
2025-04-28Add or-patterns to pattern typesOli Scherer-0/+10
2025-04-08borrowck typeck children together with their parentlcnr-1/+1
2025-03-15Move codec module back into middleMichael Goulet-67/+88
2025-02-28Use mk_ty_from_kind a bit less, clean up lifetime handling in borrowckMichael Goulet-1/+1
2025-02-13intern valtreesLukas Markeffsky-6/+9
2025-02-11Simplify intra-crate qualifiers.Nicholas Nethercote-3/+2
The following is a weird pattern for a file within `rustc_middle`: ``` use rustc_middle::aaa; use crate::bbb; ``` More sensible and standard would be this: ``` use crate::{aaa, bbb}; ``` I.e. we generally prefer using `crate::` to using a crate's own name. (Exceptions are things like in macros where `crate::` doesn't work because the macro is used in multiple crates.) This commit fixes a bunch of these weird qualifiers.
2024-12-18Re-export more `rustc_span::symbol` things from `rustc_span`.Nicholas Nethercote-1/+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-11-23no more Reveal :(lcnr-3/+1
2024-11-12Querify MonoItem collectionBen Kimock-0/+11
2024-11-03compiler: Directly use rustc_abi in metadata and middleJubilee Young-1/+1
Stop reexporting ReprOptions from middle::ty
2024-10-24Implement const effect predicate in new solverMichael Goulet-0/+11
2024-09-10const-eval interning: accpt interior mutable pointers in final value (but ↵Ralf Jung-6/+3
keep rejecting mutable references)
2024-08-28coverage: `CodeRegion` is never stored in an arenaZalathar-1/+0
This might have been left over when coverage regions were stored in individual MIR statements, instead of a separate table attached to the MIR body.
2024-07-29Reformat `use` declarations.Nicholas Nethercote-13/+11
The previous commit updated `rustfmt.toml` appropriately. This commit is the outcome of running `x fmt --all` with the new formatting options.
2024-06-05Basic removal of `Ty` from places (boring)Boxy-2/+2
2024-05-21Uplift binderMichael Goulet-51/+7
2024-04-08Auto merge of #122077 - oli-obk:eager_opaque_checks4, r=lcnrbors-0/+6
Pass list of defineable opaque types into canonical queries This eliminates `DefiningAnchor::Bubble` for good and brings the old solver closer to the new one wrt cycles and nested obligations. At that point the difference between `DefiningAnchor::Bind([])` and `DefiningAnchor::Error` was academic. We only used the difference for some sanity checks, which actually had to be worked around in places, so I just removed `DefiningAnchor` entirely and just stored the list of opaques that may be defined. fixes #108498 fixes https://github.com/rust-lang/rust/issues/116877 * [x] run crater - https://github.com/rust-lang/rust/pull/122077#issuecomment-2013293931
2024-04-08Eliminate `DefiningAnchor` now that is just a single-variant enumOli Scherer-0/+6
2024-04-08Actually create ranged int types in the type system.Oli Scherer-0/+12
2024-04-04cache type info for ParamEnvLukas Markeffsky-2/+4
2024-04-03Remove MIR unsafe checkMatthew Jasper-1/+0
This also remove safety information from MIR.
2024-03-11Make `DefiningAnchor::Bind` only store the opaque types that may be ↵Oli Scherer-0/+10
constrained, instead of the current infcx root item. This makes `Bind` almost always be empty, so we can start forwarding it to queries, allowing us to remove `Bubble` entirely
2023-12-07ctfe interpreter: extend provenance so that it can track whether a pointer ↵Ralf Jung-0/+17
is immutable
2023-11-21Fix `clippy::needless_borrow` in the compilerNilstrieb-1/+1
`x clippy compiler -Aclippy::all -Wclippy::needless_borrow --fix`. Then I had to remove a few unnecessary parens and muts that were exposed now.
2023-10-31Enums in offset_of: update based on est31, scottmcm & llogiq reviewGeorge Bateman-6/+8
2023-10-31Support enum variants in offset_of!George Bateman-1/+11
2023-10-20Uplift ClauseKind and PredicateKindMichael Goulet-2/+2
2023-10-03Optimize some `alloc_from_iter` call sites.Nicholas Nethercote-6/+8
There's no need to collect an iterator into a `Vec`, or to call `into_iter` at the call sites.
2023-09-23Enable drop_tracking_mir by default.Camille GILLOT-1/+0
2023-07-27Remove `constness` from `ParamEnv`Deadbeef-3/+1
2023-07-14refactor(rustc_middle): Substs -> GenericArgMahdi Dibaiee-4/+4
2023-07-04Replace `mk_const` with `Const::new_x` methodsBoxy-1/+1
2023-06-26Migrate predicates_of and caller_bounds to ClauseMichael Goulet-14/+4
2023-06-22migrate inferred_outlives_of to ClauseMichael Goulet-10/+0
2023-06-22Expect clause moreMichael Goulet-1/+1
2023-06-22Migrate item_bounds to ty::ClauseMichael Goulet-0/+21
2023-06-19s/Clause/ClauseKindMichael Goulet-1/+3
2023-05-29Rename `tcx.mk_re_*` => `Region::new_*`Maybe Waffle-1/+1
2023-05-04Remove unneeded encode/decode methods.Nicholas Nethercote-5/+0
In #110927 the encode/decode methods for `i8`, `char`, `bool`, and `str` were made inherent. This commit removes some unnecessary implementations of these methods that were missed in that PR.
2023-05-04Reorder some `MemDecoder` methods.Nicholas Nethercote-6/+6
So they match the order in the `Decoder` trait.
2023-04-26Remove QueryEngine traitJohn Kåre Alsaker-1/+0
2023-04-26Auto merge of #110634 - saethlin:pointy-decoder, r=cjgillotbors-0/+10
Rewrite MemDecoder around pointers not a slice This is basically https://github.com/rust-lang/rust/pull/109910 but I'm being a lot more aggressive. The pointer-based structure means that it makes a lot more sense to absorb more complexity into `MemDecoder`, most of the diff is just complexity moving from one place to another. The primary argument for this structure is that we only incur a single bounds check when doing multi-byte reads from a `MemDecoder`. With the slice-based implementation we need to do those with `data[position..position + len]` , which needs to account for `position + len` wrapping. It would be possible to dodge the first bounds check if we stored a slice that starts at `position`, but that would require updating the pointer and length on every read. This PR also embeds the failure path in a separate function, which means that this PR should subsume all the perf wins observed in https://github.com/rust-lang/rust/pull/109867.
2023-04-23Rewrite MemDecoder around pointers not a sliceBen Kimock-0/+10
2023-04-21intern offsetof fieldsDrMeepster-0/+11
2023-04-06Remove f32 & f64 from MemDecoder/MemEncoderScott McMurray-2/+0