]> git.lizzy.rs Git - rust.git/commitdiff
Fix failing examples
authorKagami Sascha Rosylight <saschanaz@outlook.com>
Mon, 24 Oct 2022 22:59:32 +0000 (00:59 +0200)
committerKagami Sascha Rosylight <saschanaz@outlook.com>
Mon, 24 Oct 2022 22:59:32 +0000 (00:59 +0200)
compiler/rustc_lint/src/let_underscore.rs
compiler/rustc_lint/src/opaque_hidden_inferred_bound.rs
compiler/rustc_lint_defs/src/builtin.rs

index 11ceb4e22ae8331fe78a28037584e53bbf225121..e1177c10414d8b31c8325aa562f8820b5587c009 100644 (file)
@@ -11,7 +11,7 @@
     /// scope.
     ///
     /// ### Example
-    /// ```
+    /// ```rust
     /// struct SomeStruct;
     /// impl Drop for SomeStruct {
     ///     fn drop(&mut self) {
index 7f6f4a0abb4a55413b9dd58b21a1da5d28748d92..ccc53707f7cf955a33bc24fd890171d272aedcab 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
     /// }
     /// ```
     ///
index 61ee467f595770942a2a92addcc400f2fff0e6e4..1fc2c4548649adf5d4aecada807ee150ae03bc12 100644 (file)
     ///
     /// ### Example
     ///
-    /// ```
+    /// ```rust
     /// #[warn(unused_tuple_struct_fields)]
     /// struct S(i32, i32, i32);
     /// let s = S(1, 2, 3);
     ///
     /// ### Example
     ///
-    /// ```compile_fail
+    /// ```rust,compile_fail
     /// #[repr(packed)]
     /// pub struct Foo {
     ///     field1: u64,
     ///
     /// ### Example
     ///
-    /// ```compile_fail
+    /// ```rust,compile_fail
     /// # #![allow(unused)]
     /// enum E {
     ///     A,
     ///
     /// ### Example
     ///
-    /// ```
+    /// ```rust
     /// #![allow(test_unstable_lint)]
     /// ```
     ///