Skip to content

Commit b727bb7

Browse files
committed
manual: fix a broken example
1 parent 838a57b commit b727bb7

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/doc/rust.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -875,7 +875,7 @@ and `extern crate` declarations.
875875
An example of what will and will not work for `use` items:
876876

877877
~~~~
878-
# #[allow(unused_imports)];
878+
# #![allow(unused_imports)]
879879
use foo::native::start; // good: foo is at the root of the crate
880880
use foo::baz::foobaz; // good: foo is at the root of the crate
881881
@@ -1701,7 +1701,7 @@ hash apply to the item that follows the attribute.
17011701

17021702
An example of attributes:
17031703

1704-
~~~~
1704+
~~~~ {.rust}
17051705
// General metadata applied to the enclosing module or crate.
17061706
#![license = "BSD"]
17071707
@@ -1719,7 +1719,7 @@ mod bar {
17191719
17201720
// A lint attribute used to suppress a warning/error
17211721
#[allow(non_camel_case_types)]
1722-
pub type int8_t = i8;
1722+
type int8_t = i8;
17231723
~~~~
17241724

17251725
> **Note:** At some point in the future, the compiler will distinguish between
@@ -2160,7 +2160,7 @@ be unstable for the purposes of the lint. One can give an optional
21602160
string that will be displayed when the lint flags the use of an item.
21612161

21622162
~~~~ {.ignore}
2163-
#[warn(unstable)];
2163+
#![warn(unstable)]
21642164
21652165
#[deprecated="replaced by `best`"]
21662166
fn bad() {
@@ -3978,7 +3978,7 @@ Rust provides several macros to log information. Here's a simple Rust program
39783978
that demonstrates all four of them:
39793979

39803980
~~~~
3981-
#[feature(phase)];
3981+
#![feature(phase)]
39823982
#[phase(syntax, link)] extern crate log;
39833983
39843984
fn main() {

0 commit comments

Comments
 (0)