about summary refs log tree commit diff
path: root/compiler/rustc_middle/src/ty/instance.rs
AgeCommit message (Collapse)AuthorLines
2025-09-12Split AssocContainer::{InherentImpl,TraitImpl}Cameron Steffen-22/+19
2025-09-12Rename AssocItemContainer -> AssocContainerCameron Steffen-1/+1
2025-09-09erase_regions to erase_and_anonymize_regionsBoxy-1/+3
2025-08-06Add support for shortening `Instance` and use itEsteban Küber-65/+9
Replace ad-hoc type path shortening logic for recursive mono instantiation errors to use `tcx.short_string()` instead.
2025-08-03Rename `Printer` variables.Nicholas Nethercote-3/+3
Currently they are mostly named `cx`, which is a terrible name for a type that impls `Printer`/`PrettyPrinter`, and is easy to confuse with other types like `TyCtxt`. This commit changes them to `p`. A couple of existing `p` variables had to be renamed to make way.
2025-07-31remove rustc_attr_data_structuresJana Dönszelmann-1/+1
2025-07-09compiler: recomment `needs_fn_once_adapter_shim`Jubilee Young-8/+6
This requires digging up ffee9566bbd7728e6411e6094105d6905373255d and reading the comments there to understand that the callee in resolve_closure previously directly handled a function pointer value.
2025-07-03setup CI and tidy to use typos for spellchecking and fix few typosklensy-3/+3
2025-06-13Unimplement unsized_localsmejrs-1/+1
2025-06-05Replace some `Option<Span>` with `Span` and use DUMMY_SP instead of NoneOli Scherer-3/+3
2025-05-05Rename Instance::new to Instance::new_raw and add a note that it is rawMichael Goulet-5/+13
2025-04-28AsyncDrop implementation using shim codegen of ↵Andrew Zhogin-9/+86
async_drop_in_place::{closure}, scoped async drop added.
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-06remove compiler support for `extern "rust-intrinsic"` blocksSkgland-1/+1
2025-04-02Move methods from `Map` to `TyCtxt`, part 5.Nicholas Nethercote-2/+2
This eliminates all methods on `Map`. Actually removing `Map` will occur in a follow-up PR.
2025-03-25Auto merge of #136410 - saethlin:clean-up-cgu-internal-copy, r=compiler-errorsbors-44/+0
Remove InstanceKind::generates_cgu_internal_copy This PR should not contain any behavior changes. Before this PR, the logic for selecting instantiation mode is spread across all of * `instantiation_mode` * `cross_crate_inlinable` * `generates_cgu_internal_copy` * `requires_inline` The last two of those functions are not well-designed. The function that actually decides if we generate a CGU-internal copy is `instantiation_mode`, _not_ `generates_cgu_internal_copy`. The function `requires_inline` documents that it is about the LLVM `inline` attribute and that it is a hint. The LLVM attribute is called `inlinehint`, this function is also used by other codegen backends, and since it is part of instantiation mode selection it is *not* a hint. The goal of this PR is to start cleaning up the logic into a sequence of checks that have a more logical flow and are easier to customize in the future (to do things like improve incrementality or improve optimizations without causing obscure linker errors because you forgot to update another part of the compiler).
2025-03-24Remove InstanceKind::generates_cgu_internal_copyBen Kimock-44/+0
2025-03-18Remove existing AFIDT implementationMichael Goulet-4/+1
2025-03-07depend more on attr_data_structures and move find_attr! thereJana Dönszelmann-1/+1
2025-02-27Don't infer attributes of virtual calls based on the function bodyDianQK-2/+3
2025-02-11Simplify intra-crate qualifiers.Nicholas Nethercote-1/+1
The following is a weird pattern for a file within `rustc_middle`: ``` use rustc_middle::aaa; use crate::bbb; ``` More sensible and standard would be this: ``` use crate::{aaa, bbb}; ``` I.e. we generally prefer using `crate::` to using a crate's own name. (Exceptions are things like in macros where `crate::` doesn't work because the macro is used in multiple crates.) This commit fixes a bunch of these weird qualifiers.
2025-01-19Run `clippy --fix` for `unnecessary_map_or` lintYotam Ofek-1/+1
2025-01-13Assert that Instance::try_resolve is only used on body-like thingsMichael Goulet-2/+20
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