summaryrefslogtreecommitdiffstats
path: root/compiler/rustc_middle/src/traits/select.rs
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/rustc_middle/src/traits/select.rs')
-rw-r--r--compiler/rustc_middle/src/traits/select.rs16
1 files changed, 10 insertions, 6 deletions
diff --git a/compiler/rustc_middle/src/traits/select.rs b/compiler/rustc_middle/src/traits/select.rs
index 85ead3171..ec69864c9 100644
--- a/compiler/rustc_middle/src/traits/select.rs
+++ b/compiler/rustc_middle/src/traits/select.rs
@@ -105,6 +105,12 @@ pub type EvaluationCache<'tcx> = Cache<
/// parameter environment.
#[derive(PartialEq, Eq, Debug, Clone, TypeFoldable, TypeVisitable)]
pub enum SelectionCandidate<'tcx> {
+ /// A builtin implementation for some specific traits, used in cases
+ /// where we cannot rely an ordinary library implementations.
+ ///
+ /// The most notable examples are `sized`, `Copy` and `Clone`. This is also
+ /// used for the `DiscriminantKind` and `Pointee` trait, both of which have
+ /// an associated type.
BuiltinCandidate {
/// `false` if there are no *further* obligations.
has_nested: bool,
@@ -131,18 +137,16 @@ pub enum SelectionCandidate<'tcx> {
/// generated for a generator.
GeneratorCandidate,
+ /// Implementation of a `Future` trait by one of the generator types
+ /// generated for an async construct.
+ FutureCandidate,
+
/// Implementation of a `Fn`-family trait by one of the anonymous
/// types generated for a fn pointer type (e.g., `fn(int) -> int`)
FnPointerCandidate {
is_const: bool,
},
- /// Builtin implementation of `DiscriminantKind`.
- DiscriminantKindCandidate,
-
- /// Builtin implementation of `Pointee`.
- PointeeCandidate,
-
TraitAliasCandidate,
/// Matching `dyn Trait` with a supertrait of `Trait`. The index is the