]> git.lizzy.rs Git - rust.git/commitdiff
Add E0534 error explanation
authorGuillaume Gomez <guillaume1.gomez@gmail.com>
Sun, 3 Jul 2016 14:34:47 +0000 (16:34 +0200)
committerGuillaume Gomez <guillaume1.gomez@gmail.com>
Mon, 11 Jul 2016 21:24:49 +0000 (23:24 +0200)
src/libsyntax/attr.rs
src/libsyntax/diagnostic_list.rs

index e01bd2a93aacdfcb9b806a0af3e5960fdff47d12..a4a8655ce37d845644e3e0c64a98c974584ab9ab 100644 (file)
@@ -373,7 +373,7 @@ pub fn find_inline_attr(diagnostic: Option<&Handler>, attrs: &[Attribute]) -> In
                     InlineAttr::None
                 }
             }
-            _ => ia
+            _ => ia,
         }
     })
 }
index 3000d639fd648a6fae503872ba9205efd672fe74..c823d03015789e7e9b32d5934884b84ae653be96 100644 (file)
@@ -38,10 +38,43 @@ fn main() {}
 ```
 "##,
 
+E0534: r##"
+The inline attribute was badly used.
+
+Erroneous code example:
+
+```compile_fail,E0534
+#[inline()] // error: expected one argument
+pub fn something() {}
+
+fn main() {}
+```
+
+The inline attribute can be used without arguments:
+
+```
+#[inline] // ok!
+pub fn something() {}
+
+fn main() {}
+```
+
+Or with arguments (and parens have to be used for this case!):
+
+```
+#[inline(always)] // ok!
+pub fn something() {}
+
+fn main() {}
+```
+
+For more information about the inline attribute, take a look here:
+https://doc.rust-lang.org/reference.html#inline-attributes)
+"##,
+
 }
 
 register_diagnostics! {
-    E0534, // expected one argument
     E0535, // invalid argument
     E0536, // expected 1 cfg-pattern
     E0537, // invalid predicate