Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
74648b5
First attempt at fixing #20591
tbelaire Apr 25, 2015
168615f
Now passing in the ImportResolver to check_conflict...
tbelaire Apr 25, 2015
69a5c37
Maybe it works
tbelaire Apr 25, 2015
5c05278
Fixed types, and slimmed down code
tbelaire Apr 25, 2015
372c69d
Fixed test text
tbelaire Apr 27, 2015
db9d018
Fixed some nits
tbelaire May 1, 2015
efb3872
Fix use of UFCS syntax to call methods on associated types.
quantheory May 7, 2015
51a1e83
doc: Remove mention of 30 minute intro
brson May 8, 2015
7d9e605
Add error explanation for E0317.
meqif May 10, 2015
c0412bc
Fix documentation URL in diagnostic message.
meqif May 10, 2015
f3a3684
Add error explanation for E0154.
meqif May 10, 2015
e7fa00a
Add error explanation for E0259.
meqif May 10, 2015
60ec4ab
Add error explanation for E0260.
meqif May 10, 2015
bff1707
Fixed one textual mistake and one casing error.
michal-czardybon May 8, 2015
ef03055
Improve wording in error explanation.
meqif May 11, 2015
aa529ef
Add missing keyword in `extern crate` declarations.
meqif May 11, 2015
52efe55
Handle overflow properly in core::slice
lilyball May 11, 2015
e1e34e9
Reintroduce non-null assumptions in core::slice iterators
lilyball May 11, 2015
f2614f5
Avoid returning a slice with a null pointer from Iter.as_slice()
lilyball May 11, 2015
d13f765
Make mention of `if` more generic
frewsxcv May 12, 2015
8bcb3cb
rustc::metadata: use u64 for DefId's instead of strings.
eddyb May 12, 2015
aeb92ba
rustc: rename ty::populate_implementations_for_type_if_necessary to m…
eddyb May 12, 2015
592165f
Fix ty::populate_implementations_for_trait_if_necessary to load the t…
eddyb May 12, 2015
75cd8f9
rustc_typeck: remove the "preload all impls ever" workaround in coher…
eddyb May 12, 2015
93c21c7
Correct claims about &T's Copyness.
Ms2ger May 12, 2015
feac9f1
Auto merge of #24818 - tbelaire:double-import, r=nrc
bors May 12, 2015
a5cac55
Add wait and waitpid to libc.
mfs May 12, 2015
1d1570a
Add regression test for #18075
May 11, 2015
23300a3
Add regression test for #20413
May 12, 2015
67dfc17
Auto merge of #25323 - eddyb:coherent-coherence, r=pnkfelix
bors May 12, 2015
6faa8d6
Add a link to the error index to the main doc page.
michaelsproul May 12, 2015
0ad2026
Auto merge of #25171 - quantheory:associated_time_long_paths, r=nikom…
bors May 12, 2015
2a5a320
Auto merge of #25300 - kballard:core-slice-overflow, r=Gankro
bors May 12, 2015
e780fb2
TRPL: Borrow and AsRef
steveklabnik Apr 30, 2015
12dc6ee
Rollup merge of #24996 - steveklabnik:gh24163, r=aturon
Manishearth May 12, 2015
bea12a9
Rollup merge of #25220 - brson:doc1, r=steveklabnik
Manishearth May 12, 2015
e91d272
Rollup merge of #25221 - michal-czardybon:master, r=steveklabnik
Manishearth May 12, 2015
bb15c47
Rollup merge of #25267 - meqif:explain_e0317, r=alexcrichton
Manishearth May 12, 2015
e216057
Rollup merge of #25322 - frewsxcv:patch-23, r=steveklabnik
Manishearth May 12, 2015
78cf0f8
Rollup merge of #25327 - Ms2ger:copy-ref, r=pnkfelix
Manishearth May 12, 2015
866991e
Rollup merge of #25329 - jooert:tests, r=alexcrichton
Manishearth May 12, 2015
210f4b9
Rollup merge of #25330 - mfs:add-wait-waitpid, r=alexcrichton
Manishearth May 12, 2015
3981481
Rollup merge of #25331 - michaelsproul:err-idx-doc-link, r=Manishearth
Manishearth May 12, 2015
2581565
Rollup merge of #25335 - nikomatsakis:updates-to-reference-manual, r=…
Manishearth May 12, 2015
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
Prev Previous commit
Next Next commit
Fixed one textual mistake and one casing error.
Corrected "Ownership":

- [`Variable bindings`] link was not processed properly.
- Changed the paragraph about move semantics with two vectors, because it was confusing.
- Removed "So it may not be as inefficient as it initially seems", because there is nothing that seems inefficient in copying pointers only.
- Other text corrections.

Fixed copied-and-pasted text mistakes.

Revised the paragraph about moving a vector (taking into account suggestions by echochamber).

Fixed markdown.

Fixes requested by steveklabnik.

Brought back a sentence about supposed inefficiency.
  • Loading branch information
michal-czardybon committed May 11, 2015
commit bff170786cd99bfca7669430fdcc0889a01d2906
2 changes: 1 addition & 1 deletion src/doc/trpl/lifetimes.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Rust’s most unique and compelling features, with which Rust developers should
become quite acquainted. Ownership is how Rust achieves its largest goal,
memory safety. There are a few distinct concepts, each with its own chapter:

* [ownership][ownership], ownership, the key concept
* [ownership][ownership], the key concept
* [borrowing][borrowing], and their associated feature ‘references’
* lifetimes, which you’re reading now

Expand Down
28 changes: 14 additions & 14 deletions src/doc/trpl/ownership.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ become quite acquainted. Ownership is how Rust achieves its largest goal,
memory safety. There are a few distinct concepts, each with its own
chapter:

* ownership, which you’re reading now.
* ownership, which you’re reading now
* [borrowing][borrowing], and their associated feature ‘references’
* [lifetimes][lifetimes], an advanced concept of borrowing

Expand All @@ -23,7 +23,7 @@ Before we get to the details, two important notes about the ownership system.
Rust has a focus on safety and speed. It accomplishes these goals through many
‘zero-cost abstractions’, which means that in Rust, abstractions cost as little
as possible in order to make them work. The ownership system is a prime example
of a zero cost abstraction. All of the analysis we’ll talk about in this guide
of a zero-cost abstraction. All of the analysis we’ll talk about in this guide
is _done at compile time_. You do not pay any run-time cost for any of these
features.

Expand All @@ -41,7 +41,7 @@ With that in mind, let’s learn about ownership.

# Ownership

[`Variable bindings`][bindings] have a property in Rust: they ‘have ownership’
[Variable bindings][bindings] have a property in Rust: they ‘have ownership’
of what they’re bound to. This means that when a binding goes out of scope, the
resource that they’re bound to are freed. For example:

Expand Down Expand Up @@ -106,8 +106,8 @@ take(v);
println!("v[0] is: {}", v[0]);
```

Same error: use of moved value.” When we transfer ownership to something else,
we say that we’ve ‘moved’ the thing we refer to. You don’t need some sort of
Same error: use of moved value’. When we transfer ownership to something else,
we say that we’ve ‘moved’ the thing we refer to. You don’t need any sort of
special annotation here, it’s the default thing that Rust does.

## The details
Expand All @@ -121,19 +121,19 @@ let v = vec![1, 2, 3];
let v2 = v;
```

The first line creates some data for the vector on the [stack][sh], `v`. The
vector’s data, however, is stored on the [heap][sh], and so it contains a
pointer to that data. When we move `v` to `v2`, it creates a copy of that pointer,
for `v2`. Which would mean two pointers to the contents of the vector on the
heap. That would be a problem: it would violate Rust’s safety guarantees by
introducing a data race. Therefore, Rust forbids using `v` after we’ve done the
move.
The first line allocates memory for the vector object, `v`, and for the data it
contains. The vector object is stored on the [stack][sh] and contains a pointer
to the content (`[1, 2, 3]`) stored on the [heap][sh]. When we move `v` to `v2`,
it creates a copy of that pointer, for `v2`. Which means that there would be two
pointers to the content of the vector on the heap. It would violate Rust’s
safety guarantees by introducing a data race. Therefore, Rust forbids using `v`
after we’ve done the move.

[sh]: the-stack-and-the-heap.html

It’s also important to note that optimizations may remove the actual copy of
the bytes, depending on circumstances. So it may not be as inefficient as it
initially seems.
the bytes on the stack, depending on circumstances. So it may not be as
inefficient as it initially seems.

## `Copy` types

Expand Down
4 changes: 2 additions & 2 deletions src/doc/trpl/references-and-borrowing.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ become quite acquainted. Ownership is how Rust achieves its largest goal,
memory safety. There are a few distinct concepts, each with its own
chapter:

* [ownership][ownership], ownership, the key concept
* [ownership][ownership], the key concept
* borrowing, which you’re reading now
* [lifetimes][lifetimes], an advanced concept of borrowing

Expand Down Expand Up @@ -368,4 +368,4 @@ statement 1 at 3:14

println!("{}", y);
}
```
```
2 changes: 1 addition & 1 deletion src/doc/trpl/while-loops.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
% while loops
% while Loops

Rust also has a `while` loop. It looks like this:

Expand Down