summary refs log tree commit diff
path: root/compiler/rustc_middle/src/ty/instance.rs
AgeCommit message (Collapse)AuthorLines
2024-12-16rename rustc_attr to rustc_attr_parsing and create rustc_attr_data_structuresJonathan Dönszelmann-1/+1
2024-12-15Add hir::AttributeJonathan Dönszelmann-1/+1
2024-12-10Implement projection and shim for AFIDTMichael Goulet-17/+20
2024-12-06Remove polymorphizationBen Kimock-112/+2
2024-11-28Share inline(never) generics across cratesMark Rousskov-7/+11
This reduces code sizes and better respects programmer intent when marking inline(never). Previously such a marking was essentially ignored for generic functions, as we'd still inline them in remote crates.
2024-11-23remove remaining references to `Reveal`lcnr-2/+2
2024-11-19`InterpCx` store `TypingEnv` instead of a `ParamEnv`lcnr-3/+1
2024-11-18use `TypingEnv` when no `infcx` is availablelcnr-22/+19
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-07 remove 'platform-intrinsic' ABI leftoversRalf Jung-1/+1
2024-11-04ty::KContainer -> ty::AssocItemContainer::KMichael Goulet-1/+1
2024-10-26Effects cleanupDeadbeef-1/+1
- removed extra bits from predicates queries that are no longer needed in the new system - removed the need for `non_erasable_generics` to take in tcx and DefId, removed unused arguments in callers
2024-10-24Remove associated type based effects logicMichael Goulet-1/+0
2024-09-25Compiler: Rename "object safe" to "dyn compatible"León Orell Valerian Liehr-1/+1
2024-09-22Reformat using the new identifier sorting from rustfmtMichael Goulet-2/+2
2024-09-02chore: Fix typos in 'compiler' (batch 2)Alexander Cyon-1/+1
2024-08-26Stop using a special inner body for the coroutine by-move body for async ↵Michael Goulet-13/+3
closures
2024-08-21Use bool in favor of Option<()> for diagnosticsMichael Goulet-2/+2
2024-08-13Use is_lang_item moreMichael Goulet-1/+1
2024-07-29Reformat `use` declarations.Nicholas Nethercote-10/+11
The previous commit updated `rustfmt.toml` appropriately. This commit is the outcome of running `x fmt --all` with the new formatting options.
2024-07-12Gate the type length limit check behind a nightly flagMichael Goulet-1/+3
2024-07-03cache type sizes in type-size limit visitorRémy Rakic-3/+16
2024-07-02Instance::resolve -> Instance::try_resolve, and other nitsMichael Goulet-5/+17
2024-07-02Fix spansMichael Goulet-7/+14
2024-07-02Re-implement a type-size based limitMichael Goulet-9/+73
2024-07-02Give Instance::expect_resolve a spanMichael Goulet-5/+7
2024-07-02Miscellaneous renamingMichael Goulet-58/+62
2024-06-21Rename a bunch of thingsMichael Goulet-1/+1
2024-06-18Apply suggestions from oli-obk's reviewDaria Sukhonina-24/+11
Co-authored-by: Oli Scherer <github35764891676564198441@oli-obk.de>
2024-06-18Make async drop code more consistent with regular drop codeDaria Sukhonina-3/+25
Fixes #126573
2024-06-16Rename InstanceDef -> InstanceKindMichael Goulet-102/+102
2024-06-14Use is_lang_item more aggressivelyMichael Goulet-5/+4
2024-05-26Give EarlyBinder a tcx parameterMichael Goulet-3/+3
We are gonna need it to uplift EarlyBinder
2024-05-23Remove `#[macro_use] extern crate tracing` from `rustc_middle`.Nicholas Nethercote-0/+1
2024-04-29Remove `extern crate rustc_macros` from `rustc_middle`.Nicholas Nethercote-1/+3
2024-04-18Fix disabling the export of noop async_drop_in_place_rawDaria Sukhonina-1/+3
2024-04-17Use non-exhaustive matches for TyKindDaria Sukhonina-2/+3
Also no longer export noop async_drop_in_place_raw
2024-04-16Add simple async drop glue generationzetanumbers-6/+23
Explainer: https://zetanumbers.github.io/book/async-drop-design.html https://github.com/rust-lang/rust/pull/121801
2024-04-08CFI: Fix ICE in KCFI non-associated function pointersMatthew Maurer-1/+4
We oddly weren't testing the more usual case of casting non-methods to function pointers. The KCFI shim insertion logic would ICE on these due to asking for an irrefutable associated item if we cast a function to a function pointer without needing a traditional shim.
2024-04-02CFI: Support function pointers for trait methodsMatthew Maurer-0/+18
Adds support for both CFI and KCFI for attaching concrete and abstract types to functions. KCFI does this through generation of `ReifyShim` on any function pointer that could go in a vtable, and checking the `ReifyReason` when emitting the instance. CFI does this by attaching both the concrete and abstract type to every instance. TypeID codegen tests are switched to be anchored on the left rather than the right in order to allow emission of additional type attachments. Fixes #115953
2024-04-02Track reason for creating a `ReifyShim`Matthew Maurer-8/+40
KCFI needs to be able to tell which kind of `ReifyShim` it is examining in order to decide whether to use a concrete type (`FnPtr` case) or an abstract case (`Vtable` case). You can *almost* tell this from context, but there is one case where you can't - if a trait has a method which is *not* `#[track_caller]`, with an impl that *is* `#[track_caller]`, both the vtable and a function pointer created from that method will be `ReifyShim(def_id)`. Currently, the reason is optional to ensure no additional unique `ReifyShim`s are added without KCFI on. However, the case in which an extra `ReifyShim` is created is sufficiently rare that this may be worth revisiting to reduce complexity.
2024-03-25Instance is CopyMichael Goulet-4/+4
2024-03-22Auto merge of #122580 - saethlin:compiler-builtins-can-panic, r=pnkfelixbors-0/+6
"Handle" calls to upstream monomorphizations in compiler_builtins This is pretty cooked, but I think it works. compiler-builtins has a long-standing problem that at link time, its rlib cannot contain any calls to `core`. And yet, in codegen we _love_ inserting calls to symbols in `core`, generally from various panic entrypoints. I intend this PR to attack that problem as completely as possible. When we generate a function call, we now check if we are generating a function call from `compiler_builtins` and whether the callee is a function which was not lowered in the current crate, meaning we will have to link to it. If those conditions are met, actually generating the call is asking for a linker error. So we don't. If the callee diverges, we lower to an abort with the same behavior as `core::intrinsics::abort`. If the callee does not diverge, we produce an error. This means that compiler-builtins can contain panics, but they'll SIGILL instead of panicking. I made non-diverging calls a compile error because I'm guessing that they'd mostly get into compiler-builtins by someone making a mistake while working on the crate, and compile errors are better than linker errors. We could turn such calls into aborts as well if that's preferred.
2024-03-20Add a testBen Kimock-0/+6
2024-03-19Add a few more commentsMichael Goulet-1/+1
2024-03-19Fix ABI for FnMut/Fn impls for async closuresMichael Goulet-1/+10
2024-03-19Only split by-ref/by-move futures for async closuresMichael Goulet-13/+5
2024-03-09Rollup merge of #122237 - fee1-dead-contrib:rmord, r=compiler-errorsMatthias Krüger-1/+1
Remove `Ord` from `ClosureKind` Using `Ord` to accomplish a meaning of subset relationship can be hard to read. The existing uses for that are easily replaced with a `match`, and in my opinion, more readable without needing to resorting to comments to explain the intention. cc `@compiler-errors`
2024-03-09Remove `Ord` from `ClosureKind`Deadbeef-1/+1
Using `Ord` to accomplish a meaning of subset relationship can be hard to read. The existing uses for that are easily replaced with a `match`, and in my opinion, more readable without needing to resorting to comments to explain the intention.
2024-03-07sync (try_)instantiate_mir_and_normalize_erasing_regions implementationklensy-2/+4
try_instantiate_mir_and_normalize_erasing_regions was changed in https://github.com/rust-lang/rust/commit/dbc2cc8717dd8c8006595d9e9c91ad472109165a, but not instantiate_mir_and_normalize_erasing_regions
2024-02-12Rollup merge of #120958 - ShoyuVanilla:remove-subst, r=oli-obkMatthias Krüger-8/+8
Dejargonize `subst` In favor of #110793, replace almost every occurence of `subst` and `substitution` from rustc codes, but they still remains in subtrees under `src/tools/` like clippy and test codes (I'd like to replace them after this)