about summary refs log tree commit diff
path: root/compiler/rustc_middle/src/traits/select.rs
AgeCommit message (Collapse)AuthorLines
2025-07-07remove `has_nested`lcnr-7/+2
2025-03-13Only prefer Sized candidates, and only if they certainly holdMichael Goulet-2/+5
2025-03-13Prefer built-in sized impls for rigid types alwaysMichael Goulet-1/+4
2025-02-13Implement and use BikeshedGuaranteedNoDrop for union/unsafe field validityMichael Goulet-0/+2
2025-02-06Clean up trivial traversal/lift impl generator macro calls.Nicholas Nethercote-2/+0
We have four macros for generating trivial traversal (fold/visit) and lift impls. - `rustc_ir::TrivialTypeTraversalImpls` - `rustc_middle::TrivialTypeTraversalImpls` - `rustc_middle::TrivialLiftImpls` - `rustc_middle::TrivialTypeTraversalAndLiftImpls` The first two are very similar. The last one just combines the second and third one. The macros themselves are ok, but their use is a mess. This commit does the following. - Removes types that no longer need a lift and/or traversal impl from the macro calls. - Consolidates the macro calls into the smallest number of calls possible, with each one mentioning as many types as possible. - Orders the types within those macro calls alphabetically, and makes the module qualification more consistent. - Eliminates `rustc_middle::mir::type_foldable`, because the macro calls were merged and the manual `TypeFoldable` impls are better placed in `structural_impls.rs`, alongside all the other ones. This makes the code more concise. Moving forward, it also makes it more obvious where new types should be added.
2024-11-23global old solver cache: use `TypingEnv`lcnr-14/+4
2024-10-20Rip out old effects var handling code from traitsMichael Goulet-6/+1
2024-07-29Reformat `use` declarations.Nicholas Nethercote-6/+4
The previous commit updated `rustfmt.toml` appropriately. This commit is the outcome of running `x fmt --all` with the new formatting options.
2024-04-29Remove `extern crate rustc_macros` from `rustc_middle`.Nicholas Nethercote-0/+1
2024-03-31Remove EvaluatedToErrStackDependentMichael Goulet-48/+4
2024-02-23remove repetitive wordscui fliter-1/+1
Signed-off-by: cui fliter <imcusg@gmail.com>
2024-02-12Dejargnonize substShoyu Vanilla-1/+2
2024-02-06Bless tests, add commentsMichael Goulet-1/+3
2024-02-06Teach typeck/borrowck/solvers how to deal with async closuresMichael Goulet-0/+7
2024-01-12Remove unused ErrorReporting variant from overflow handlingMichael Goulet-2/+0
2023-12-18Check FnPtr/FnDef built-in fn traits correctly with effectsMichael Goulet-1/+1
2023-12-16Remove unnecessary constness from ProjectionCandidateMichael Goulet-4/+2
2023-12-08Implement `async gen` blocksMichael Goulet-2/+6
2023-12-06EvaluatedToUnknown -> EvaluatedToAmbigStackDependent, EvaluatedToRecur -> ↵Michael Goulet-10/+10
EvaluatedToErrStackDependent
2023-10-27Make `gen` blocks implement the `Iterator` traitOli Scherer-0/+4
2023-10-20s/generator/coroutine/Oli Scherer-2/+2
2023-10-20s/Generator/Coroutine/Oli Scherer-2/+2
2023-09-18Remove more unused `Lift` impls.Nicholas Nethercote-1/+1
2023-08-14Remove constness from `ImplSource::Param`Deadbeef-0/+1
2023-07-25Make everything builtin!Michael Goulet-3/+1
2023-04-26Remove unused `TypeFoldable`/`TypeVisitable` impls.Nicholas Nethercote-1/+1
2023-01-12attempt to make a minimal example workDeadbeef-1/+3
2022-11-25add commentlcnr-0/+6
2022-11-25move 2 candidates into builtin candidatelcnr-6/+0
2022-11-24Avoid `GenFuture` shim when compiling async constructsArpad Borsos-0/+4
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-10Rollup merge of #102786 - compiler-errors:no-tuple-candidate, r=lcnrDylan DPC-3/+0
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-3/+0
2022-10-07Remove `DefId` from some `SelectionCandidate` variantsDeadbeef-2/+2
2022-09-18make projection bounds with const bounds satisfy constDeadbeef-2/+3
2022-08-07Built-in implementation of Tuple traitMichael Goulet-0/+3
2022-07-27Initial (incomplete) implementation of transmutability trait.Jack Wrenn-0/+4
This initial implementation handles transmutations between types with specified layouts, except when references are involved. Co-authored-by: Igor null <m1el.2027@gmail.com>
2022-07-08Auto merge of #98614 - oli-obk:take_unsound_opaque_types, r=wesleywiserbors-4/+14
don't succeed `evaluate_obligation` query if new opaque types were registered fixes #98608 fixes #98604 The root cause of all this is that in type flag computation we entirely ignore nongeneric things like struct fields and the signature of function items. So if a flag had to be set for a struct if it is set for a field, that will only happen if the field is generic, as only the generic parameters are checked. I now believe we cannot use type flags to handle opaque types. They seem like the wrong tool for this. Instead, this PR replaces the previous logic by adding a new variant of `EvaluatedToOk`: `EvaluatedToOkModuloOpaqueTypes`, which says that there were some opaque types that got hidden types bound, but that binding may not have been legal (because we don't know if the opaque type was in its defining scope or not).
2022-07-07not knowing about opaque types is worse than not knowing about regions, make ↵Oli Scherer-2/+2
sure we don't accidentally mark something as ok-modulo-regions if there are opaque types involved
2022-07-05impl TypeVisitable in type traversal macrosAlan Egerton-1/+1
2022-07-05Add #[derive(TypeVisitable)]Alan Egerton-1/+1
2022-06-30Make `evaluate_obligation` not succeed unconditionally if it registered new ↵Oli Scherer-4/+14
hidden types for opaque types
2022-03-26Do not use ParamEnv::and to cache param-env with candidateMichael Goulet-3/+10
2022-03-25Fix ice when error reporting recursion errorslightning1141-1/+14
Fixes: #90319, #92148, #93955
2022-03-21Rename `~const Drop` to `~const Destruct`Deadbeef-2/+2
2022-01-18Check const Drop impls considering ConstIfConst boundsMichael Goulet-2/+2
2021-12-12Revert "Auto merge of #91491 - spastorino:revert-91354, r=oli-obk"Deadbeef-6/+4
This reverts commit ff2439b7b9bafcfdff86b7847128014699df8442, reversing changes made to 2a9e0831d6603d87220cedd1b1293e2eb82ef55c.
2021-12-03Revert "Auto merge of #91354 - fee1-dead:const_env, r=spastorino"Santiago Pastorino-4/+6
This reverts commit 18bb8c61a975fff6424cda831ace5b0404277145, reversing changes made to d9baa361902b172be716f96619b909f340802dea.
2021-11-29Avoid storing the ImplPolarity and Constness next to a TraitRef and use ↵Oli Scherer-1/+1
TraitPredicate instead
2021-11-29Replace `ConstnessAnd<TraitRef>` with `TraitPredicate` which conveys the ↵Oli Scherer-4/+2
same information
2021-11-29Prefer TraitPredicate over ConstnessAnd<TraitRef>Oli Scherer-1/+1