about summary refs log tree commit diff
path: root/compiler/rustc_ty_utils/src/instance.rs
AgeCommit message (Collapse)AuthorLines
2025-08-09rename `TraitRef::from_method` to `from_assoc`Deadbeef-2/+2
also add a note to `GenericArgs::truncate_to`
2025-07-28Rename trait_of_item -> trait_of_assocCameron Steffen-1/+1
2025-05-05Rename Instance::new to Instance::new_raw and add a note that it is rawMichael Goulet-5/+5
2025-04-28AsyncDrop implementation using shim codegen of ↵Andrew Zhogin-8/+16
async_drop_in_place::{closure}, scoped async drop added.
2025-04-03add `TypingMode::Borrowck`lcnr-0/+1
2025-03-15Stop relying on rustc_type_ir in non-type-system cratesMichael Goulet-2/+1
2025-03-12remove unnecessary variantlcnr-5/+3
2025-02-27Delete tuple unsizingAlice Ryhl-2/+1
2025-02-21don't leave assoc const unnormalized due to unconstrained paramsLukas Markeffsky-0/+1
2025-02-01Rename `tcx.ensure()` to `tcx.ensure_ok()`Zalathar-1/+1
2025-01-17new solver: prefer trivial builtin impls over where-clausesRémy Rakic-1/+1
for now, only builtin `Sized` impls are tracked as being `Trivial`
2024-12-22Begin to implement type system layer of unsafe bindersMichael Goulet-1/+2
2024-11-30Move refinement check out of compare_impl_itemMichael Goulet-0/+2
2024-11-30Make compare_impl_item into a queryMichael Goulet-7/+5
2024-11-28support revealing defined opaque post borrowcklcnr-1/+2
2024-11-23remove remaining references to `Reveal`lcnr-2/+4
2024-11-23no more Reveal :(lcnr-1/+1
2024-11-19resolve_instance: stop relying on `Reveal`lcnr-17/+17
2024-11-18use `TypingEnv` when no `infcx` is availablelcnr-13/+17
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-03Rename the FIXMEs, remove a few that dont matter anymoreMichael Goulet-1/+0
2024-10-29TypingMode :thinking:lcnr-2/+2
2024-09-22Reformat using the new identifier sorting from rustfmtMichael Goulet-2/+2
2024-08-23document & impl the transmutation modeled by `BikeshedIntrinsicFrom`Jack Wrenn-0/+5
Documents that `BikeshedIntrinsicFrom` models transmute-via-union, which is slightly more expressive than the transmute-via-cast implemented by `transmute_copy`. Additionally, we provide an implementation of transmute-via-union as a method on the `BikeshedIntrinsicFrom` trait with additional documentation on the boundary between trait invariants and caller obligations. Whether or not transmute-via-union is the right kind of transmute to model remains up for discussion [1]. Regardless, it seems wise to document the present behavior. [1] https://rust-lang.zulipchat.com/#narrow/stream/216762-project-safe-transmute/topic/What.20'kind'.20of.20transmute.20to.20model.3F/near/426331967
2024-08-09Shrink `TyKind::FnPtr`.Nicholas Nethercote-1/+1
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-07-29Reformat `use` declarations.Nicholas Nethercote-2/+1
The previous commit updated `rustfmt.toml` appropriately. This commit is the outcome of running `x fmt --all` with the new formatting options.
2024-07-24Make sure that args are compatible in resolve_associated_itemMichael Goulet-2/+13
2024-07-02Miscellaneous renamingMichael Goulet-2/+2
2024-06-16Rename InstanceDef -> InstanceKindMichael Goulet-14/+14
2024-06-16Auto merge of #126505 - compiler-errors:no-vtable, r=lcnrbors-6/+16
Only compute vtable information during codegen This PR removes vtable information from the `Object` and `TraitUpcasting` candidate sources in the trait solvers, and defers the computation of relevant information to `Instance::resolve`. This is because vtables really aren't a thing in the trait world -- they're an implementation detail in codegen. Previously it was just easiest to tangle this information together since we were already doing the work of looking at all the supertraits in the trait solver, and specifically because we use traits to represent when it's possible to call a method via a vtable (`Object` candidate) and do upcasting (`Unsize` candidate). but I am somewhat suspicious we're doing a *lot* of extra work, especially in polymorphic contexts, so let's see what perf says.
2024-06-14Only compute vtable information during codegenMichael Goulet-6/+16
2024-06-14Use is_lang_item more aggressivelyMichael Goulet-6/+6
2024-05-29Optimize async drop glue for some old typesDaria Sukhonina-1/+2
2024-05-23Remove `#[macro_use] extern crate tracing` from `rustc_ty_utils`.Nicholas Nethercote-0/+1
2024-05-13Remove `extern crate rustc_middle` from `rustc_ty_utils`.Nicholas Nethercote-0/+1
2024-04-25Don't ICE when codegen_select returns ambiguity in new solverMichael Goulet-12/+5
2024-04-18Fix disabling the export of noop async_drop_in_place_rawDaria Sukhonina-1/+1
2024-04-17Use non-exhaustive matches for TyKindDaria Sukhonina-36/+17
Also no longer export noop async_drop_in_place_raw
2024-04-16Add simple async drop glue generationzetanumbers-0/+41
Explainer: https://zetanumbers.github.io/book/async-drop-design.html https://github.com/rust-lang/rust/pull/121801
2024-03-19Fix ABI for FnMut/Fn impls for async closuresMichael Goulet-0/+2
2024-03-19Only split by-ref/by-move futures for async closuresMichael Goulet-20/+13
2024-03-09Remove `Ord` from `ClosureKind`Deadbeef-17/+20
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-04make `intrinsic` query legal for any `DefId`Oli Scherer-3/+1
2024-02-20Fix stray trait mismatch in resolve_associated_item for AsyncFnMichael Goulet-15/+3
2024-02-12Make `is_intrinsic` query return the intrinsic nameOli Scherer-1/+2
2024-02-11Auto merge of #120619 - compiler-errors:param, r=lcnrbors-3/+1
Assert that params with the same *index* have the same *name* Found this bug when trying to build libcore with the new solver, since it will canonicalize two params with the same index into *different* placeholders if those params differ by name.
2024-02-07Stop using is_copy_modulo_regions when building clone shimMichael Goulet-3/+1
2024-02-06Coroutine closures implement regular Fn traits, when possibleMichael Goulet-0/+18
2024-02-06Regular closures now built-in impls for AsyncFn*Michael Goulet-0/+13
2024-02-06More comments, final tweaksMichael Goulet-0/+7
2024-02-06Build a shim to call async closures with different AsyncFn trait kindsMichael Goulet-3/+14