]> git.lizzy.rs Git - rust.git/blobdiff - compiler/rustc_trait_selection/src/traits/const_evaluatable.rs
Rollup merge of #82274 - andersk:test-unwrap, r=Mark-Simulacrum
[rust.git] / compiler / rustc_trait_selection / src / traits / const_evaluatable.rs
index 89820bb1417ebd60600590cb3510a76bc906bee5..8a1be7ea1726d1c957bbedf25891b6d7ce282123 100644 (file)
@@ -72,17 +72,16 @@ pub fn is_const_evaluatable<'cx, 'tcx>(
                 // We were unable to unify the abstract constant with
                 // a constant found in the caller bounds, there are
                 // now three possible cases here.
-                //
-                // - The substs are concrete enough that we can simply
-                //   try and evaluate the given constant.
-                // - The abstract const still references an inference
-                //   variable, in this case we return `TooGeneric`.
-                // - The abstract const references a generic parameter,
-                //   this means that we emit an error here.
                 #[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord)]
                 enum FailureKind {
+                    /// The abstract const still references an inference
+                    /// variable, in this case we return `TooGeneric`.
                     MentionsInfer,
+                    /// The abstract const references a generic parameter,
+                    /// this means that we emit an error here.
                     MentionsParam,
+                    /// The substs are concrete enough that we can simply
+                    /// try and evaluate the given constant.
                     Concrete,
                 }
                 let mut failure_kind = FailureKind::Concrete;
@@ -117,7 +116,7 @@ enum FailureKind {
                         {
                             err.span_help(
                                 tcx.def_span(def.did),
-                                &format!("try adding a `where` bound using this expression: where [u8; {}]: Sized", snippet),
+                                &format!("try adding a `where` bound using this expression: `where [u8; {}]: Sized`", snippet),
                             );
                         } else {
                             err.span_help(