about summary refs log tree commit diff
path: root/compiler/rustc_sanitizers/src
AgeCommit message (Collapse)AuthorLines
2024-08-21Simplify some redundant field namesMichael Goulet-1/+1
2024-08-16CFI: Erase regions when projecting ADT to its transparent non-1zst fieldMichael Goulet-1/+1
2024-08-09Shrink `TyKind::FnPtr`.Nicholas Nethercote-2/+7
By splitting the `FnSig` within `TyKind::FnPtr` into `FnSigTys` and `FnHeader`, which can be packed more efficiently. This reduces the size of the hot `TyKind` type from 32 bytes to 24 bytes on 64-bit platforms. This reduces peak memory usage by a few percent on some benchmarks. It also reduces cache misses and page faults similarly, though this doesn't translate to clear cycles or wall-time improvements on CI.
2024-08-02Use ParamEnv::reveal_all in CFIMichael Goulet-2/+3
2024-07-29Rollup merge of #127882 - compiler-errors:cfi-sized-self-gat, r=oli-obkMatthias Krüger-0/+1
Don't elaborate associated types with Sized bounds in `trait_object_ty` in cfi The elaboration mechanism introduced in #123005 didn't filter for associated types with `Self: Sized` bounds, which since #112319 has excluded them from the object type. Fixes #127881 cc `@maurer` `@rcvalle`
2024-07-29Reformat `use` declarations.Nicholas Nethercote-7/+9
The previous commit updated `rustfmt.toml` appropriately. This commit is the outcome of running `x fmt --all` with the new formatting options.
2024-07-20Rollup merge of #127980 - nyurik:compiler-refs, r=oli-obkMatthias Krüger-14/+14
Avoid ref when using format! in compiler Clean up a few minor refs in `format!` macro, as it has a performance cost. Apparently the compiler is unable to inline `format!("{}", &variable)`, and does a run-time double-reference instead (format macro already does one level referencing). Inlining format args prevents accidental `&` misuse. See also https://github.com/rust-lang/rust-clippy/issues/10851
2024-07-19Avoid ref when using format! in compilerYuri Astrakhan-14/+14
Clean up a few minor refs in `format!` macro, as it has a performance cost. Apparently the compiler is unable to inline `format!("{}", &variable)`, and does a run-time double-reference instead (format macro already does one level referencing). Inlining format args prevents accidental `&` misuse.
2024-07-17Don't elaborate associated types with Sized bounds in trait_object_ty in cfiMichael Goulet-0/+1
2024-07-17CFI: Support provided methods on traitsMatthew Maurer-37/+58
Provided methods currently don't get type erasure performed on them because they are not in an `impl` block. If we are instantiating a method that is an associated item, but *not* in an impl block, treat it as a provided method instead.
2024-06-24Split out IntoIterator and non-Iterator constructors for ↵Michael Goulet-3/+4
AliasTy/AliasTerm/TraitRef/projection
2024-06-21Rename a bunch of thingsMichael Goulet-1/+1
2024-06-20Add blank lines after module-level `//!` comments.Nicholas Nethercote-0/+5
Most modules have such a blank line, but some don't. Inserting the blank line makes it clearer that the `//!` comments are describing the entire module, rather than the `use` declaration(s) that immediately follows.
2024-06-18Make async drop code more consistent with regular drop codeDaria Sukhonina-0/+1
Fixes #126573
2024-06-16Rename InstanceDef -> InstanceKindMichael Goulet-8/+8
2024-06-14Use is_lang_item more aggressivelyMichael Goulet-1/+1
2024-06-12Use `tidy` to sort crate attributes for all compiler crates.Nicholas Nethercote-1/+5
We already do this for a number of crates, e.g. `rustc_middle`, `rustc_span`, `rustc_metadata`, `rustc_span`, `rustc_errors`. For the ones we don't, in many cases the attributes are a mess. - There is no consistency about order of attribute kinds (e.g. `allow`/`deny`/`feature`). - Within attribute kind groups (e.g. the `feature` attributes), sometimes the order is alphabetical, and sometimes there is no particular order. - Sometimes the attributes of a particular kind aren't even grouped all together, e.g. there might be a `feature`, then an `allow`, then another `feature`. This commit extends the existing sorting to all compiler crates, increasing consistency. If any new attribute line is added there is now only one place it can go -- no need for arbitrary decisions. Exceptions: - `rustc_log`, `rustc_next_trait_solver` and `rustc_type_ir_macros`, because they have no crate attributes. - `rustc_codegen_gcc`, because it's quasi-external to rustc (e.g. it's ignored in `rustfmt.toml`).
2024-06-05Misc fixes (pattern type lowering, cfi, pretty printing)Boxy-10/+24
2024-06-05Add `Ty` to `ConstKind::Value`Boxy-3/+1
2024-06-05Basic removal of `Ty` from places (boring)Boxy-4/+7
2024-06-03check_is_object_safe -> is_object_safeMichael Goulet-1/+1
2024-05-18Fix typos (taking into account review comments)blyxyas-1/+1
2024-05-11Apply nits, uplift ExistentialPredicate tooMichael Goulet-1/+2
2024-04-22Stabilize the size of incr comp object file namesBen Kimock-3/+5
2024-04-14Update encode.rsTobias Decking-2/+2
2024-04-08sanitizers: Create the rustc_sanitizers crateRamon de C Valle-0/+1455
Create the rustc_sanitizers crate and move the source code for the CFI and KCFI sanitizers to it. Co-authored-by: David Wood <agile.lion3441@fuligin.ink>