summary refs log tree commit diff
path: root/compiler/rustc_ty_utils/src/instance.rs
AgeCommit message (Collapse)AuthorLines
2023-12-08Implement `async gen` blocksMichael Goulet-0/+15
2023-12-02Rename `HandlerInner::delay_span_bug` as `HandlerInner::span_delayed_bug`.Nicholas Nethercote-2/+2
Because the corresponding `Level` is `DelayedBug` and `span_delayed_bug` follows the pattern used everywhere else: `span_err`, `span_warning`, etc.
2023-11-21Rollup merge of #118115 - spastorino:fix-old-fn-names, r=compiler-errorsNilstrieb-1/+1
Fix occurrences of old fn names in comment and tracing
2023-11-20Fix occurrences of old fn names in comment and tracingSantiago Pastorino-1/+1
2023-11-20Reduce exposure of some items.Nicholas Nethercote-1/+1
2023-10-30Some more coroutine renamingsMichael Goulet-1/+1
2023-10-27Basic generators workOli Scherer-0/+13
2023-10-20s/generator/coroutine/Oli Scherer-6/+6
2023-10-20s/Generator/Coroutine/Oli Scherer-6/+6
2023-10-13Format all the let chains in compilerMichael Goulet-4/+1
2023-09-19Don't resolve generic instances if they may be shadowed by dynMichael Goulet-1/+24
2023-09-14treat host effect params as erased generics in codegenDeadbeef-0/+1
This fixes the changes brought to codegen tests when effect params are added to libcore, by not attempting to monomorphize functions that get the host param by being `const fn`.
2023-08-09Don't use type_of to determine if item has intrinsic shimMichael Goulet-35/+30
2023-07-25Make everything builtin!Michael Goulet-8/+11
2023-07-25Restore tuple unsizing feature gateMichael Goulet-1/+3
2023-07-14refactor(rustc_middle): Substs -> GenericArgMahdi Dibaiee-40/+35
2023-07-12Re-format let-else per rustfmt updateMark Rousskov-2/+4
2023-07-06get rid of a bit more calls to poly_selectMichael Goulet-1/+1
2023-06-20yeet ImplSource::TraitAlias tooMichael Goulet-3/+1
2023-06-17Remove even more redundant builtin candidatesMichael Goulet-77/+60
2023-06-17Simplify even more candidatesMichael Goulet-21/+19
2023-06-17Simplify some impl source candidatesMichael Goulet-4/+2
2023-06-01Rename `impl_defaultness` to `defaultness`Deadbeef-1/+1
2023-05-15Move expansion of query macros in rustc_middle to rustc_middle::queryJohn Kåre Alsaker-2/+3
2023-05-08Fix miscompilation when adding default method to `Future`Jonas Schievink-14/+11
2023-05-06make (try_)subst_and_normalize_erasing_regions take EarlyBinderKyle Matsuda-2/+1
2023-05-06More robust debug assertions for `Instance::resolve` on built-in traits with ↵Michael Goulet-13/+71
custom items
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-27rename `needs_infer` to `has_infer`Boxy-2/+2
2023-04-20Remove WithOptconstParam.Camille GILLOT-35/+8
2023-04-20Feed type_of query instead of using WithOptconstParam.Camille GILLOT-6/+0
2023-04-16fix clippy::toplevel_ref_arg and ::manual_mapMatthias Krüger-7/+4
2023-04-07Move `FnPtrAddr` error to `SessionDiagnostic`Matthew Jasper-4/+5
2023-03-27Add a builtin `FnPtr` traitlcnr-1/+18
2023-02-22Remove type-traversal trait aliasesAlan Egerton-1/+1
2023-02-16remove bound_type_of query; make type_of return EarlyBinder; change type_of ↵Kyle Matsuda-1/+1
in metadata
2023-02-16change usages of type_of to bound_type_ofKyle Matsuda-2/+3
2022-12-24Rename some compare_method functionsMichael Goulet-1/+1
2022-12-12normalize receiver substs and erase the regionsTakayuki Maeda-1/+7
use a smaller example
2022-11-27Rename `fn_trait_kind_from_{from_lang=>def_id}` to better convey meaningMaybe Waffle-1/+1
2022-11-25move 2 candidates into builtin candidatelcnr-2/+0
2022-11-24Avoid `GenFuture` shim when compiling async constructsArpad Borsos-0/+6
Previously, async constructs would be lowered to "normal" generators, with an additional `from_generator` / `GenFuture` shim in between to convert from `Generator` to `Future`. The compiler will now special-case these generators internally so that async constructs will *directly* implement `Future` without the need to go through the `from_generator` / `GenFuture` shim. The primary motivation for this change was hiding this implementation detail in stack traces and debuginfo, but it can in theory also help the optimizer as there is less abstractions to see through.
2022-10-27Accept `TyCtxt` instead of `TyCtxtAt` in `Ty::is_*` functionsMaybe Waffle-2/+2
Functions in answer: - `Ty::is_freeze` - `Ty::is_sized` - `Ty::is_unpin` - `Ty::is_copy_modulo_regions`
2022-10-10Rollup merge of #102786 - compiler-errors:no-tuple-candidate, r=lcnrDylan DPC-2/+1
Remove tuple candidate, nothing special about it r? `@lcnr` you mentioned this during the talk you gave i think
2022-10-07Remove tuple candidate, nothing special about itMichael Goulet-2/+1
2022-10-07Change InferCtxtBuilder from enter to buildCameron Steffen-13/+11
2022-10-06Rollup merge of #98496 - BoxyUwU:instancers_bad_equality, r=lcnrMatthias Krüger-31/+5
make `compare_const_impl` a query and use it in `instance.rs` Fixes #88365 the bug in #88365 was caused by some `instance.rs` code using the `PartialEq` impl on `Ty` to check that the type of the associated const in an impl is the same as the type of the associated const in the trait definition. This was wrong for two reasons: - the check typeck does is that the impl type is a subtype of the trait definition's type (see `mismatched_impl_ty_2.rs` which [was ICEing](https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=f6d60ebe6745011f0d52ab2bc712025d) before this PR on stable) - it assumes that if two types are equal then the `PartialEq` impl will reflect that which isnt true for higher ranked types or type level constants when `feature(generic_const_exprs)` is enabled (see `mismatched_impl_ty_3.rs` for higher ranked types which was [ICEing on stable](https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=d7af131a655ed515b035624626c62c71)) r? `@lcnr`
2022-10-04missing value to delay_span_buglcnr-2/+6
2022-09-30make query take `(LocalDefId, DefId)`Boxy-7/+3
2022-09-30make `compare_const_impl` a query and use it in `instance.rs`Boxy-30/+8