summary refs log tree commit diff
path: root/compiler/rustc_symbol_mangling/src
AgeCommit message (Collapse)AuthorLines
2023-01-08Add type flags support for Ty and Const late-bound regionsMichael Goulet-0/+1
2023-01-05Fix `uninlined_format_args` for some compiler cratesnils-9/+8
Convert all the crates that have had their diagnostic migration completed (except save_analysis because that will be deleted soon and apfloat because of the licensing problem).
2022-12-29CFI: Monomorphize transparent ADTs before typeidMatthew Maurer-1/+4
Monomorphise `#[repr(transparent)]` parameterized ADTs before turning them into an Itanium mangled String. `#[repr(transparent)]` ADTs currently use the single field to represent them in their CFI type ID to ensure that they are compatible. However, if that type involves a type parameter instantiated at the ADT level, as in `ManuallyDrop`, this will currently ICE as the `Parameter` type cannot be mangled. Since this happens at lowering time, it should always be concrete after substitution. Fixes #106230
2022-12-20rustc: Remove needless lifetimesJeremy Stucki-1/+1
2022-12-19clippy::complexity fixesMatthias Krüger-14/+8
filter_next needless_question_mark bind_instead_of_map manual_find derivable_impls map_identity redundant_slicing skip_while_next unnecessary_unwrap needless_bool
2022-12-14Ensure no one constructs `AliasTy`s themselvesOli Scherer-2/+2
2022-12-13Combine identical alias armsMichael Goulet-10/+6
2022-12-13Combine projection and opaque into aliasMichael Goulet-13/+9
2022-12-13squash OpaqueTy and ProjectionTy into AliasTyMichael Goulet-4/+4
2022-12-13ProjectionTy.item_def_id -> ProjectionTy.def_idMichael Goulet-4/+4
2022-12-13Use ty::OpaqueTy everywhereMichael Goulet-2/+2
2022-12-10Rollup merge of #105109 - rcvalle:rust-kcfi, r=bjorn3Matthias Krüger-0/+24
Add LLVM KCFI support to the Rust compiler This PR adds LLVM Kernel Control Flow Integrity (KCFI) support to the Rust compiler. It initially provides forward-edge control flow protection for operating systems kernels for Rust-compiled code only by aggregating function pointers in groups identified by their return and parameter types. (See llvm/llvm-project@cff5bef.) Forward-edge control flow protection for C or C++ and Rust -compiled code "mixed binaries" (i.e., for when C or C++ and Rust -compiled code share the same virtual address space) will be provided in later work as part of this project by identifying C char and integer type uses at the time types are encoded (see Type metadata in the design document in the tracking issue #89653). LLVM KCFI can be enabled with -Zsanitizer=kcfi. Thank you again, `@bjorn3,` `@eddyb,` `@nagisa,` and `@ojeda,` for all the help!
2022-12-08Add LLVM KCFI support to the Rust compilerRamon de C Valle-0/+24
This commit adds LLVM Kernel Control Flow Integrity (KCFI) support to the Rust compiler. It initially provides forward-edge control flow protection for operating systems kernels for Rust-compiled code only by aggregating function pointers in groups identified by their return and parameter types. (See llvm/llvm-project@cff5bef.) Forward-edge control flow protection for C or C++ and Rust -compiled code "mixed binaries" (i.e., for when C or C++ and Rust -compiled code share the same virtual address space) will be provided in later work as part of this project by identifying C char and integer type uses at the time types are encoded (see Type metadata in the design document in the tracking issue #89653). LLVM KCFI can be enabled with -Zsanitizer=kcfi. Co-authored-by: bjorn3 <17426603+bjorn3@users.noreply.github.com>
2022-11-26Rollup merge of #104786 - WaffleLapkin:amp-mut-help, r=compiler-errorsGuillaume Gomez-1/+1
Use the power of adding helper function to simplify code w/ `Mutability` r? `@compiler-errors`
2022-11-25Add empty ConstKind::Abstractkadmin-0/+1
Initial pass at expr/abstract const/s Address comments Switch to using a list instead of &[ty::Const], rm `AbstractConst` Remove try_unify_abstract_consts Update comments Add edits Recurse more More edits Prevent equating associated consts Move failing test to ui Changes this test from incremental to ui, and mark it as failing and a known bug. Does not cause the compiler to ICE, so should be ok.
2022-11-23Add `Mutability::{is_mut,is_not}`Maybe Waffle-1/+1
2022-11-21Unreserve braced enum variants in value namespaceVadim Petrochenkov-4/+4
2022-11-19drive-by: PolyExistentialPredicateMichael Goulet-7/+7
2022-11-07Add an optional Span to BrAnon and use it to print better error for HRTB ↵Jack Huey-2/+2
error from generator interior
2022-11-04Refactor tcx mk_const parameters.Mateusz-2/+1
2022-10-29Rename some `OwnerId` fields.Nicholas Nethercote-4/+4
spastorino noticed some silly expressions like `item_id.def_id.def_id`. This commit renames several `def_id: OwnerId` fields as `owner_id`, so those expressions become `item_id.owner_id.def_id`. `item_id.owner_id.local_def_id` would be even clearer, but the use of `def_id` for values of type `LocalDefId` is *very* widespread, so I left that alone.
2022-10-23Migrate all diagnosticsNilstrieb-1/+1
2022-10-14more dupe word typosRageking8-1/+1
2022-10-04It's not about types or consts, but the lack of regionsOli Scherer-1/+1
2022-09-24separate definitions and `HIR` ownersTakayuki Maeda-4/+4
fix a ui test use `into` fix clippy ui test fix a run-make-fulldeps test implement `IntoQueryParam<DefId>` for `OwnerId` use `OwnerId` for more queries change the type of `ParentOwnerIterator::Item` to `(OwnerId, OwnerNode)`
2022-09-21UPDATE - rename DiagnosticHandler trait to IntoDiagnosticJhonny Bill Mena-2/+2
2022-09-19remove the `Subst` trait, always use `EarlyBinder`lcnr-1/+1
2022-09-16Rollup merge of #101782 - ↵Michael Howell-32/+34
JhonnyBillM:refactor-symbol-mangling-diags-migration, r=davidtwco Update `symbol_mangling` diagnostics migration Addresses comments raised in #100831. r? `@eddyb` `@davidtwco`
2022-09-13Address code review commentsEric Holk-4/+11
2022-09-13UPDATE - merge and avoid translations for symbol mangling test outputJhonny Bill Mena-32/+34
2022-09-12Plumb dyn trait representation through ty::DynamicEric Holk-2/+2
2022-09-08Remove ReEmptyJack Huey-2/+1
2022-09-05Pack `Term` in the same way as `GenericArg`.Nicholas Nethercote-11/+7
This shrinks the `PredicateS` type, which is instanted frequently.
2022-09-01Always import all tracing macros for the entire crate instead of piecemeal ↵Oli Scherer-4/+3
by module
2022-08-30UPDATE - to support diag introduced in PR #100765Jhonny Bill Mena-4/+4
2022-08-30ADD - diagnostics lints to symbol_mangling moduleJhonny Bill Mena-0/+2
2022-08-30ADD - migrate InvalidDefPath to new diagnostics infraJhonny Bill Mena-3/+13
2022-08-30UPDATE - accept String instead of unused 'strJhonny Bill Mena-9/+9
2022-08-30ADD - migrate InvalidTraitItem and AltInvalidTraitItem errorsJhonny Bill Mena-3/+25
Thought of doing this by having a struct and an enum with Default and Alt cases, but not sure if we wanted to have the text in code instead of having “demangling()” and “demangling-alt()” in the ftl file. Don’t like the current way of having structs representing the same-ish and using long names to distinguish their expectations, instead of putting this in an enum and handling the different cases inside the type. I am fine with whichever option the team prefers; also understand having them as separate structs keeps it simple.
2022-08-30ADD - InvalidSymbolName to migrate symbol-name({}) error to new diagnostics ↵Jhonny Bill Mena-1/+18
infraestructure ADD - dependencies needed to port a module to new Diagnostics infra (rustc_macros, rustc_errors, errors file, and fluent file)
2022-08-26Change `FnAbi::fixed_count` to a `u32`.Nicholas Nethercote-1/+1
2022-07-24Auto merge of #95548 - rcvalle:rust-cfi-2, r=nagisabors-43/+949
Add fine-grained LLVM CFI support to the Rust compiler This PR improves the LLVM Control Flow Integrity (CFI) support in the Rust compiler by providing forward-edge control flow protection for Rust-compiled code only by aggregating function pointers in groups identified by their return and parameter types. Forward-edge control flow protection for C or C++ and Rust -compiled code "mixed binaries" (i.e., for when C or C++ and Rust -compiled code share the same virtual address space) will be provided in later work as part of this project by identifying C char and integer type uses at the time types are encoded (see Type metadata in the design document in the tracking issue https://github.com/rust-lang/rust/issues/89653). LLVM CFI can be enabled with -Zsanitizer=cfi and requires LTO (i.e., -Clto). Thank you again, `@eddyb,` `@nagisa,` `@pcc,` and `@tmiasko` for all the help!
2022-07-23Add fine-grained LLVM CFI support to the Rust compilerRamon de C Valle-43/+949
This commit improves the LLVM Control Flow Integrity (CFI) support in the Rust compiler by providing forward-edge control flow protection for Rust-compiled code only by aggregating function pointers in groups identified by their return and parameter types. Forward-edge control flow protection for C or C++ and Rust -compiled code "mixed binaries" (i.e., for when C or C++ and Rust -compiled code share the same virtual address space) will be provided in later work as part of this project by identifying C char and integer type uses at the time types are encoded (see Type metadata in the design document in the tracking issue #89653). LLVM CFI can be enabled with -Zsanitizer=cfi and requires LTO (i.e., -Clto).
2022-07-20consistently use VTable over Vtable (matching stable stdlib API RawWakerVTable)Ralf Jung-3/+3
2022-07-06Allow to create definitions inside the query system.Camille GILLOT-36/+37
2022-07-06Update TypeVisitor pathsAlan Egerton-2/+2
2022-07-05Relax constrained generics to TypeVisitableAlan Egerton-2/+2
2022-06-14Auto merge of #96285 - flip1995:pk-vfe, r=nagisabors-0/+25
Introduce `-Zvirtual-function-elimination` codegen flag Fixes #68262 This PR adds a codegen flag `-Zvirtual-function-elimination` to enable the VFE optimization in LLVM. To make this work, additonal information has to be added to vtables ([`!vcall_visibility` metadata](https://llvm.org/docs/TypeMetadata.html#vcall-visibility-metadata) and a `typeid` of the trait). Furthermore, instead of just `load`ing functions, the [`llvm.type.checked.load` intrinsic](https://llvm.org/docs/LangRef.html#llvm-type-checked-load-intrinsic) has to be used to map functions to vtables. For technical details of the changes, see the commit messages. I also tested this flag on https://github.com/tock/tock on different boards to verify that this fixes the issue https://github.com/tock/tock/issues/2594. This flag is able to improve the size of the resulting binary by about 8k-9k bytes by removing the unused debug print functions. [Rendered documentation update](https://github.com/flip1995/rust/blob/pk-vfe/src/doc/rustc/src/codegen-options/index.md#virtual-function-elimination)
2022-06-14rebaseb-naber-1/+1
2022-06-14address reviewb-naber-3/+2