about summary refs log tree commit diff
diff options
context:
space:
mode:
authorlcnr <rust@lcnr.de>2022-11-23 17:39:51 +0100
committerlcnr <rust@lcnr.de>2022-11-25 11:59:08 +0100
commit84e97907c64646b6ad960f6721aafc0a1c1c0503 (patch)
tree312307d66a85c60811d845492df28723374245dd
parent31431ccda9bbedccb09381d05700b8171eae3ae7 (diff)
downloadrust-84e97907c64646b6ad960f6721aafc0a1c1c0503.tar.gz
rust-84e97907c64646b6ad960f6721aafc0a1c1c0503.zip
add comment
-rw-r--r--compiler/rustc_middle/src/traits/select.rs6
1 files changed, 6 insertions, 0 deletions
diff --git a/compiler/rustc_middle/src/traits/select.rs b/compiler/rustc_middle/src/traits/select.rs
index 5bb8842ebe9..ec69864c951 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,