Skip to content

Remove comment about semicolons for inner attributes from docs. #13920

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 4, 2014
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions src/doc/guide-pointers.md
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ enum List<T> {
Nil,
Cons(T, ~List<T>),
}

fn main() {
let list: List<int> = Cons(1, ~Cons(2, ~Cons(3, ~Nil)));
println!("{:?}", list);
Expand Down Expand Up @@ -251,7 +251,7 @@ struct.

> **Note**: the `@` form of managed pointers is deprecated and behind a
> feature gate (it requires a `#![feature(managed_pointers)]` attribute on
> the crate root; remember the semicolon!). There are replacements, currently
> the crate root). There are replacements, currently
> there is `std::rc::Rc` and `std::gc::Gc` for shared ownership via reference
> counting and garbage collection respectively.

Expand All @@ -266,7 +266,7 @@ struct Point {
x: int,
y: int,
}

fn main() {
let a = ~Point { x: 10, y: 20 };
let b = a;
Expand Down Expand Up @@ -297,7 +297,7 @@ struct Point {
x: int,
y: int,
}

fn main() {
let a = @Point { x: 10, y: 20 };
let b = a;
Expand Down Expand Up @@ -361,7 +361,7 @@ So how is this hard? Well, because we're ignoring ownership, the compiler needs
to take great care to make sure that everything is safe. Despite their complete
safety, a reference's representation at runtime is the same as that of
an ordinary pointer in a C program. They introduce zero overhead. The compiler
does all safety checks at compile time.
does all safety checks at compile time.

This theory is called 'region pointers,' and involve a concept called
'lifetimes'. Here's the simple explanation: would you expect this code to
Expand Down Expand Up @@ -477,7 +477,7 @@ fn main() {
You may think that this gives us terrible performance: return a value and then
immediately box it up?!?! Isn't that the worst of both worlds? Rust is smarter
than that. There is no copy in this code. `main` allocates enough room for the
`@int`, passes a pointer to that memory into `foo` as `x`, and then `foo` writes
`@int`, passes a pointer to that memory into `foo` as `x`, and then `foo` writes
the value straight into that pointer. This writes the return value directly into
the allocated box.

Expand Down
3 changes: 2 additions & 1 deletion src/libsyntax/parse/attr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,8 @@ impl<'a> ParserAttr for Parser<'a> {
};
}

// Parse attributes that appear after the opening of an item, each
// Parse attributes that appear after the opening of an item. These should
// be preceded by an exclaimation mark, but we accept and warn about one
// terminated by a semicolon. In addition to a vector of inner attributes,
// this function also returns a vector that may contain the first outer
// attribute of the next item (since we can't know whether the attribute
Expand Down