about summary refs log tree commit diff
path: root/compiler/rustc_sanitizers/src/cfi
AgeCommit message (Collapse)AuthorLines
2025-09-30Split Bound into Canonical and Boundjackh726-2/+3
2025-09-17Remove `DynKind`León Orell Valerian Liehr-8/+6
2025-09-12Introduce trait_item_ofCameron Steffen-2/+1
2025-08-09rename `TraitRef::from_method` to `from_assoc`Deadbeef-2/+2
also add a note to `GenericArgs::truncate_to`
2025-07-28Rename impl_of_method -> impl_of_assocCameron Steffen-1/+1
2025-07-28Rename trait_of_item -> trait_of_assocCameron Steffen-3/+3
2025-07-01Remove support for dyn*Michael Goulet-1/+0
2025-06-05Replace some `Option<Span>` with `Span` and use DUMMY_SP instead of NoneOli Scherer-4/+4
2025-06-03Rollup merge of #141569 - workingjubilee:canonicalize-abi, r=bjorn3Matthias Krüger-2/+3
Replace ad-hoc ABI "adjustments" with an `AbiMap` to `CanonAbi` Our `conv_from_spec_abi`, `adjust_abi`, and `is_abi_supported` combine to give us a very confusing way of reasoning about what _actual_ calling convention we want to lower our code to and whether we want to compile the resulting code at all. Instead of leaving this code as a miniature adventure game in which someone tries to combine stateful mutations into a Rube Goldberg machine that will let them escape the maze and arrive at the promised land of codegen, we let `AbiMap` devour this complexity. Once you have an `AbiMap`, you can answer which `ExternAbi`s will lower to what `CanonAbi`s (and whether they will lower at all). Removed: - `conv_from_spec_abi` replaced by `AbiMap::canonize_abi` - `adjust_abi` replaced by same - `Conv::PreserveAll` as unused - `Conv::Cold` as unused - `enum Conv` replaced by `enum CanonAbi` target-spec.json changes: - If you have a target-spec.json then now your "entry-abi" key will be specified in terms of one of the `"{abi}"` strings Rust recognizes, e.g. ```json "entry-abi": "C", "entry-abi": "win64", "entry-abi": "aapcs", ```
2025-06-03compiler: change Conv to CanonAbiJubilee Young-2/+3
2025-05-27Rename unpack to kindMichael Goulet-2/+2
2025-05-07Add `DefPathData::OpaqueLifetime` to avoid conflicts for remapped opaque ↵John Kåre Alsaker-0/+1
lifetimes
2025-05-02Add `DefPathData::NestedStatic` instead of reusing `DefPathData::AnonConst`John Kåre Alsaker-0/+1
2025-04-29Remove global `next_disambiguator` state and handle it with a ↵John Kåre Alsaker-1/+1
`DisambiguatorState` type
2025-04-15Move `opt_rpitit_info` field to `hir::AssocKind::Type`.Nicholas Nethercote-1/+1
From `hir::AssocItem`.
2025-04-14Move `has_self` field to `hir::AssocKind::Fn`.Nicholas Nethercote-1/+1
`hir::AssocItem` currently has a boolean `fn_has_self_parameter` field, which is misplaced, because it's only relevant for associated fns, not for associated consts or types. This commit moves it (and renames it) to the `AssocKind::Fn` variant, where it belongs. This requires introducing a new C-style enum, `AssocTag`, which is like `AssocKind` but without the fields. This is because `AssocKind` values are passed to various functions like `find_by_ident_and_kind` to indicate what kind of associated item should be searched for, and having to specify `has_self` isn't relevant there. New methods: - Predicates `AssocItem::is_fn` and `AssocItem::is_method`. - `AssocItem::as_tag` which converts `AssocItem::kind` to `AssocTag`. Removed `find_by_name_and_kinds`, which is unused. `AssocItem::descr` can now distinguish between methods and associated functions, which slightly improves some error messages.
2025-04-11Introduce `DefPathData::AnonAssocTy`.Nicholas Nethercote-1/+2
PR #137977 changed `DefPathData::TypeNs` to contain `Option<Symbol>` to account for RPITIT assoc types being anonymous. This commit changes it back to `Symbol` and gives anonymous assoc types their own variant. It makes things a bit nicer overall.
2025-03-30Encode synthetic by-move coroutine body with a different DefPathDataMichael Goulet-0/+1
2025-03-15Squash fold into tyMichael Goulet-2/+1
2025-02-24Change span field accesses to method callsJana Dönszelmann-2/+2
2025-01-30check the types in `ty::Value` to value conversionLukas Markeffsky-2/+8
and remove `ty::Const::try_to_scalar` because it becomes redundant
2025-01-30introduce `ty::Value`Lukas Markeffsky-11/+11
Co-authored-by: FedericoBruzzone <federico.bruzzone.i@gmail.com>
2025-01-07Eliminate an unnecessary `Symbol::to_string`; use `as_str`Josh Triplett-5/+4
2024-12-22Begin to implement type system layer of unsafe bindersMichael Goulet-1/+7
2024-12-10Remove more traces of anonymous ADTsMichael Goulet-2/+1
2024-11-18use `TypingEnv` when no `infcx` is availablelcnr-12/+14
the behavior of the type system not only depends on the current assumptions, but also the currentnphase of the compiler. This is mostly necessary as we need to decide whether and how to reveal opaque types. We track this via the `TypingMode`.
2024-11-02compiler: Add rustc_abi to _sanitizersJubilee Young-5/+4
2024-10-22Rollup merge of #131049 - compiler-errors:more-validation, r=spastorinoMatthias Krüger-8/+13
Validate args are correct for `UnevaluatedConst`, `ExistentialTraitRef`/`ExistentialProjection` For the `Existential*` ones, we have to do some adjustment to the args list to deal with the missing `Self` type, so we introduce a `debug_assert_existential_args_compatible` function to the interner as well.
2024-10-19Get rid of const eval_* and try_eval_* helpersMichael Goulet-2/+6
2024-10-04Fix some pub(crate) that were undetected bc of instrumentMichael Goulet-2/+2
2024-09-30Validate ExistentialPredicate argsMichael Goulet-8/+13
2024-09-25Compiler: Rename "object safe" to "dyn compatible"León Orell Valerian Liehr-2/+2
2024-09-22Reformat using the new identifier sorting from rustfmtMichael Goulet-7/+7
2024-09-20Only expect mono consts in CFIMichael Goulet-2/+2
2024-09-20Normalize transparent struct field type in CFIMichael Goulet-1/+4
2024-09-11Also fix if in elseMichael Goulet-7/+5
2024-09-03Auto merge of #129777 - nnethercote:unreachable_pub-4, r=Urgaubors-6/+6
Add `unreachable_pub`, round 4 A follow-up to #129732. r? `@Urgau`
2024-09-03Add `warn(unreachable_pub)` to `rustc_sanitizers`.Nicholas Nethercote-6/+6
2024-09-02chore: Fix typos in 'compiler' (batch 2)Alexander Cyon-3/+3
2024-08-21Rollup merge of #129345 - compiler-errors:scratch4, r=jieyouxuMatthias Krüger-1/+1
Use shorthand field initialization syntax more aggressively in the compiler Caught these when cleaning up #129344 and decided to run clippy to find the rest
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-6/+7
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.