about summary refs log tree commit diff
path: root/compiler/rustc_ty_utils/src/needs_drop.rs
AgeCommit message (Collapse)AuthorLines
2025-09-08fixup limit handling codeJana Dönszelmann-1/+1
2025-07-31Extract borrowck coroutine drop-liveness hackMichael Goulet-17/+26
2025-04-28AsyncDrop implementation using shim codegen of ↵Andrew Zhogin-2/+36
async_drop_in_place::{closure}, scoped async drop added.
2025-02-22Greatly simplify lifetime captures in edition 2024Michael Goulet-1/+1
2024-12-22Begin to implement type system layer of unsafe bindersMichael Goulet-0/+5
2024-12-02remove `Ty::is_copy_modulo_regions`lcnr-1/+1
2024-11-23rebaselcnr-3/+3
2024-11-20reduce false positives of tail-expr-drop-order from consumed valuesDing Xiang Fei-13/+55
take 2 open up coroutines tweak the wordings the lint works up until 2021 We were missing one case, for ADTs, which was causing `Result` to yield incorrect results. only include field spans with significant types deduplicate and eliminate field spans switch to emit spans to impl Drops Co-authored-by: Niko Matsakis <nikomat@amazon.com> collect drops instead of taking liveness diff apply some suggestions and add explantory notes small fix on the cache let the query recurse through coroutine new suggestion format with extracted variable name fine-tune the drop span and messages bugfix on runtime borrows tweak message wording filter out ecosystem types earlier apply suggestions clippy check lint level at session level further restrict applicability of the lint translate bid into nop for stable mir detect cycle in type structure
2024-11-19move `fn is_item_raw` to `TypingEnv`lcnr-1/+1
2024-11-18use `TypingEnv` when no `infcx` is availablelcnr-20/+26
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-09-22Reformat using the new identifier sorting from rustfmtMichael Goulet-1/+1
2024-08-24Fix `elided_named_lifetimes` in codePavel Grigorenko-1/+1
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-05-29Optimize async drop glue for some old typesDaria Sukhonina-1/+1
2024-05-29Start implementing needs_async_drop and relatedDaria Sukhonina-0/+16
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-08Actually create ranged int types in the type system.Oli Scherer-0/+1
2024-02-12Dejargnonize substShoyu Vanilla-4/+7
2024-02-06Add CoroutineClosure to TyKind, AggregateKind, UpvarArgsMichael Goulet-0/+6
2023-12-28Remove movability from TyKind::CoroutineMichael Goulet-1/+1
2023-12-24Remove `Session` methods that duplicate `DiagCtxt` methods.Nicholas Nethercote-1/+1
Also add some `dcx` methods to types that wrap `TyCtxt`, for easier access.
2023-11-02review + add testslcnr-4/+4
2023-11-02dropck_outlives check generator witness needs_droplcnr-3/+29
2023-10-20s/generator/coroutine/Oli Scherer-2/+2
2023-10-20s/Generator/Coroutine/Oli Scherer-2/+2
2023-09-23Remove GeneratorWitness and rename GeneratorWitnessMIR.Camille GILLOT-1/+0
2023-09-23Enable drop_tracking_mir by default.Camille GILLOT-25/+2
2023-09-07Don't require `Drop` for `[PhantomData<T>; N]` where `N` and `T` are ↵Oli Scherer-2/+22
generic, if `T` requires `Drop`
2023-08-01Use upvar_tys in more places, make it a listMichael Goulet-2/+6
2023-07-25inline format!() args from rustc_codegen_llvm to the end (4)Matthias Krüger-1/+1
r? @WaffleLapkin
2023-07-18some additional refactorlcnr-3/+3
also, treat placeholders equal to params
2023-07-17exhaustive matches are goodlcnr-1/+25
2023-07-14refactor(rustc_middle): Substs -> GenericArgMahdi Dibaiee-19/+19
2023-05-29EarlyBinder::new -> EarlyBinder::bindlcnr-1/+1
2023-05-28Replace EarlyBinder(x) with EarlyBinder::new(x)Kyle Matsuda-1/+1
2023-05-15Move expansion of query macros in rustc_middle to rustc_middle::queryJohn Kåre Alsaker-2/+3
2023-05-03Restrict `From<S>` for `{D,Subd}iagnosticMessage`.Nicholas Nethercote-1/+1
Currently a `{D,Subd}iagnosticMessage` can be created from any type that impls `Into<String>`. That includes `&str`, `String`, and `Cow<'static, str>`, which are reasonable. It also includes `&String`, which is pretty weird, and results in many places making unnecessary allocations for patterns like this: ``` self.fatal(&format!(...)) ``` This creates a string with `format!`, takes a reference, passes the reference to `fatal`, which does an `into()`, which clones the reference, doing a second allocation. Two allocations for a single string, bleh. This commit changes the `From` impls so that you can only create a `{D,Subd}iagnosticMessage` from `&str`, `String`, or `Cow<'static, str>`. This requires changing all the places that currently create one from a `&String`. Most of these are of the `&format!(...)` form described above; each one removes an unnecessary static `&`, plus an allocation when executed. There are also a few places where the existing use of `&String` was more reasonable; these now just use `clone()` at the call site. As well as making the code nicer and more efficient, this is a step towards possibly using `Cow<'static, str>` in `{D,Subd}iagnosticMessage::{Str,Eager}`. That would require changing the `From<&'a str>` impls to `From<&'static str>`, which is doable, but I'm not yet sure if it's worthwhile.
2023-04-17Spelling - compilerJosh Soref-1/+1
* account * achieved * advising * always * ambiguous * analysis * annotations * appropriate * build * candidates * cascading * category * character * clarification * compound * conceptually * constituent * consts * convenience * corresponds * debruijn * debug * debugable * debuggable * deterministic * discriminant * display * documentation * doesn't * ellipsis * erroneous * evaluability * evaluate * evaluation * explicitly * fallible * fulfill * getting * has * highlighting * illustrative * imported * incompatible * infringing * initialized * into * intrinsic * introduced * javascript * liveness * metadata * monomorphization * nonexistent * nontrivial * obligation * obligations * offset * opaque * opportunities * opt-in * outlive * overlapping * paragraph * parentheses * poisson * precisely * predecessors * predicates * preexisting * propagated * really * reentrant * referent * responsibility * rustonomicon * shortcircuit * simplifiable * simplifications * specify * stabilized * structurally * suggestibility * translatable * transmuting * two * unclosed * uninhabited * visibility * volatile * workaround Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
2023-02-24Rename many interner functions.Nicholas Nethercote-2/+2
(This is a large commit. The changes to `compiler/rustc_middle/src/ty/context.rs` are the most important ones.) The current naming scheme is a mess, with a mix of `_intern_`, `intern_` and `mk_` prefixes, with little consistency. In particular, in many cases it's easy to use an iterator interner when a (preferable) slice interner is available. The guiding principles of the new naming system: - No `_intern_` prefixes. - The `intern_` prefix is for internal operations. - The `mk_` prefix is for external operations. - For cases where there is a slice interner and an iterator interner, the former is `mk_foo` and the latter is `mk_foo_from_iter`. Also, `slice_interners!` and `direct_interners!` can now be `pub` or non-`pub`, which helps enforce the internal/external operations division. It's not perfect, but I think it's a clear improvement. The following lists show everything that was renamed. slice_interners - const_list - mk_const_list -> mk_const_list_from_iter - intern_const_list -> mk_const_list - substs - mk_substs -> mk_substs_from_iter - intern_substs -> mk_substs - check_substs -> check_and_mk_substs (this is a weird one) - canonical_var_infos - intern_canonical_var_infos -> mk_canonical_var_infos - poly_existential_predicates - mk_poly_existential_predicates -> mk_poly_existential_predicates_from_iter - intern_poly_existential_predicates -> mk_poly_existential_predicates - _intern_poly_existential_predicates -> intern_poly_existential_predicates - predicates - mk_predicates -> mk_predicates_from_iter - intern_predicates -> mk_predicates - _intern_predicates -> intern_predicates - projs - intern_projs -> mk_projs - place_elems - mk_place_elems -> mk_place_elems_from_iter - intern_place_elems -> mk_place_elems - bound_variable_kinds - mk_bound_variable_kinds -> mk_bound_variable_kinds_from_iter - intern_bound_variable_kinds -> mk_bound_variable_kinds direct_interners - region - intern_region (unchanged) - const - mk_const_internal -> intern_const - const_allocation - intern_const_alloc -> mk_const_alloc - layout - intern_layout -> mk_layout - adt_def - intern_adt_def -> mk_adt_def_from_data (unusual case, hard to avoid) - alloc_adt_def(!) -> mk_adt_def - external_constraints - intern_external_constraints -> mk_external_constraints Other - type_list - mk_type_list -> mk_type_list_from_iter - intern_type_list -> mk_type_list - tup - mk_tup -> mk_tup_from_iter - intern_tup -> mk_tup
2023-02-16remove bound_type_of query; make type_of return EarlyBinder; change type_of ↵Kyle Matsuda-3/+3
in metadata
2023-02-16change usages of type_of to bound_type_ofKyle Matsuda-4/+10
2023-01-27Pacify tidy.Camille GILLOT-2/+2
2023-01-27Always require Drop for generators.Camille GILLOT-0/+7
2022-12-13Combine identical alias armsMichael Goulet-4/+1
2022-12-13Combine projection and opaque into aliasMichael Goulet-1/+4
2022-10-27Accept `TyCtxt` instead of `TyCtxtAt` in `Ty::is_*` functionsMaybe Waffle-1/+1
Functions in answer: - `Ty::is_freeze` - `Ty::is_sized` - `Ty::is_unpin` - `Ty::is_copy_modulo_regions`
2022-10-14more dupe word typosRageking8-1/+1
2022-09-19remove the `Subst` trait, always use `EarlyBinder`lcnr-1/+0
2022-08-26Migrate rustc_ty_utils to use SessionDiagnosticPeter Medus-4/+3