about summary refs log tree commit diff
path: root/compiler/rustc_lint
diff options
context:
space:
mode:
authorKagami Sascha Rosylight <saschanaz@outlook.com>2022-10-25 00:59:32 +0200
committerKagami Sascha Rosylight <saschanaz@outlook.com>2022-10-25 00:59:32 +0200
commit30b522365bf3a2be8248c1572054e5988db0e1fd (patch)
tree9bf26fe9b47de7cdae27b4c5c91d2a0aad2488b7 /compiler/rustc_lint
parent8ecbb7e39a2bbd082fbac4b05eb715bda2c91fce (diff)
downloadrust-30b522365bf3a2be8248c1572054e5988db0e1fd.tar.gz
rust-30b522365bf3a2be8248c1572054e5988db0e1fd.zip
Fix failing examples
Diffstat (limited to 'compiler/rustc_lint')
-rw-r--r--compiler/rustc_lint/src/let_underscore.rs2
-rw-r--r--compiler/rustc_lint/src/opaque_hidden_inferred_bound.rs14
2 files changed, 10 insertions, 6 deletions
diff --git a/compiler/rustc_lint/src/let_underscore.rs b/compiler/rustc_lint/src/let_underscore.rs
index 11ceb4e22ae..e1177c10414 100644
--- a/compiler/rustc_lint/src/let_underscore.rs
+++ b/compiler/rustc_lint/src/let_underscore.rs
@@ -11,7 +11,7 @@ declare_lint! {
     /// scope.
     ///
     /// ### Example
-    /// ```
+    /// ```rust
     /// struct SomeStruct;
     /// impl Drop for SomeStruct {
     ///     fn drop(&mut self) {
diff --git a/compiler/rustc_lint/src/opaque_hidden_inferred_bound.rs b/compiler/rustc_lint/src/opaque_hidden_inferred_bound.rs
index 7f6f4a0abb4..ccc53707f7c 100644
--- a/compiler/rustc_lint/src/opaque_hidden_inferred_bound.rs
+++ b/compiler/rustc_lint/src/opaque_hidden_inferred_bound.rs
@@ -26,19 +26,23 @@ declare_lint! {
     ///
     /// ### 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
     /// }
     /// ```
     ///