]> git.lizzy.rs Git - rust.git/blobdiff - compiler/rustc_lint/src/opaque_hidden_inferred_bound.rs
Merge branch 'master' into patch-2
[rust.git] / compiler / rustc_lint / src / opaque_hidden_inferred_bound.rs
index 00bf287ba6bdd9a49031dd3a61c7ca34b67aa49c..619582c0539b86dd0f3d04d6c09b4c557306f383 100644 (file)
     ///
     /// ### Example
     ///
-    /// ```
+    /// ```rust
+    /// trait Duh {}
+    ///
+    /// impl Duh for i32 {}
+    ///
     /// trait Trait {
-    ///     type Assoc: Send;
+    ///     type Assoc: Duh;
     /// }
     ///
     /// struct Struct;
     ///
-    /// impl Trait for Struct {
-    ///     type Assoc = i32;
+    /// impl<F: Duh> Trait for F {
+    ///     type Assoc = F;
     /// }
     ///
     /// fn test() -> impl Trait<Assoc = impl Sized> {
-    ///     Struct
+    ///     42
     /// }
     /// ```
     ///
@@ -150,8 +154,9 @@ struct OpaqueHiddenInferredBoundLint<'tcx> {
 }
 
 #[derive(Subdiagnostic)]
-#[suggestion_verbose(
+#[suggestion(
     lint_opaque_hidden_inferred_bound_sugg,
+    style = "verbose",
     applicability = "machine-applicable",
     code = " + {trait_ref}"
 )]