Matt Brubeck
a35ea15442
Update Rust version in the Rustonomicon Vec chapter
...
I verified that the final code compiles in Rust 1.9.0-nightly.
8 years ago
Florian Hahn
44b7a53b97
Capitalize some occurences of Rust in documentation
8 years ago
Ulrik Sverdrup
a29e5a7589
Fix spacing style of `T: Bound` in docs
...
The space between `T` and `Bound` is the typical style used in code and
produced by rustdoc's rendering. Fixed first in Reflect's docs and then
I fixed all occurrences in docs I could find.
8 years ago
Jonas Tepe
6a7e5b5b04
Fixed indent from tabs to spaces
8 years ago
Jonas Tepe
c7fff43d50
added zst iterator additions to final code
8 years ago
Jonas Tepe
7529d7b852
Semicolon was at wrong place in let statement
8 years ago
jonastepe
20ac46402c
len needs to be prefixed by self for this to work. The final code in this section of the book is correct.
8 years ago
jonastepe
5060b9c061
heap::deallocate expects a *mut u8 but here a *mut T is given. The final code is correct, the example here would not compile without the cast. I used *mut _ instead of *mut u8 to be consistent with the final code.
8 years ago
Steve Wooster
ae44e86c13
Change "big ask" to "tall order" in Rustonomicon.
...
The Rustonomicon's Lifetimes chapter uses the idiom "big ask", which is obscure compared to "tall order" (check Google ngrams). Also, it's easily mistaken for a typo; either "a big task" or "a big thing to ask" could plausibly work there.
8 years ago
Ulrik Sverdrup
ef1cd4dd45
nomicon: Mention contravariance
8 years ago
Ulrik Sverdrup
9a11f6e3ff
nomicon: Fix variance in example
...
&'b mut B was described incorrectly (just in this example, is correct in
the actual text).
8 years ago
Steve Klabnik
31e414c51a
Remove nomicon reference to copy_lifetime
...
Fixes #29784
8 years ago
Steve Klabnik
8dc4b7608d
Nomicon: mention tuple structs with repr(c)
...
Fixes #29526
8 years ago
Jake Worth
9bfb59ca83
Fix typo
8 years ago
Alexis Beingessner
799b247059
don't use drop_in_place as an intrinsic
8 years ago
Scott Olson
150a6b4a85
Add missing "to" in Rustonomicon Atomics.
8 years ago
Alex Burka
11bbe8cd1a
fix markdown in nomicon/dropck
8 years ago
Scott Olson
eab1e095c6
Fix minor syntax error in example.
8 years ago
Andrew Paseltiner
b7627fc68d
Correct spelling in docs
8 years ago
DenisKolodin
25daea46ac
Update explanation about offset method
8 years ago
Andrew Paseltiner
703285826a
Correct spelling in docs
8 years ago
Kyle Robinson Young
d264bf6b3b
doc: fixing typos
8 years ago
Felix S. Klock II
a8362b6890
review comment: point out that the dropck analysis is now trivial.
8 years ago
Felix S. Klock II
c2c76b3366
Document the new more conservative dropck rule and the escape hatch.
8 years ago
Carlos Liam
30ae4bc89b
Replace multiple trailing newlines with a single trailing newline
...
Sorry I didn’t get this in the last PR (#28864 ), I hadn’t thought of it.
8 years ago
Ms2ger
0e784eb884
Fix some typos.
8 years ago
Simon Mazur
3e25f93084
docs: anchors fixes
8 years ago
Pascal Hertleif
83ce66888e
Nomicon: Fix Links
...
The style `[name][]` does not work with Pandoc, whereas `[name]` does.
I hope hoedown accepts this as well.
8 years ago
Alex Crichton
4c56ec91c3
std: Internalize almost all of `std::rt`
...
This commit does some refactoring to make almost all of the `std::rt` private.
Specifically, the following items are no longer part of its API:
* DEFAULT_ERROR_CODE
* backtrace
* unwind
* args
* at_exit
* cleanup
* heap (this is just alloc::heap)
* min_stack
* util
The module is now tagged as `#[doc(hidden)]` as the only purpose it's serve is
an entry point for the `panic!` macro via the `begin_unwind` and
`begin_unwind_fmt` reexports.
8 years ago
Jørn Lode
a0b4fdad02
Rustonomicon: Reword potentially confusing comment in Vec::drain.
8 years ago
Jørn Lode
2574990a3f
Rustonomicon: Fix bug in implementation of Vec::drain()
...
In the last code snippet on the following page there is a bug in the
implementation of Vec::drain().
https://doc.rust-lang.org/nightly/nomicon/vec-drain.html
```rust
pub fn drain(&mut self) -> Drain<T> {
// Oops, setting it to 0 while we still need the old value!
self.len = 0;
unsafe {
Drain {
// len is used to create a &[T] from &self here,
// so we end up always creating an empty slice.
iter: RawValIter::new(&self),
vec: PhantomData,
}
}
}
```
A simple test to verify that Drain is broken can be found here:
https://play.rust-lang.org/?gist=30f579565e4bbf4836ce&version=nightly
And here's one with a fixed implementation:
https://play.rust-lang.org/?gist=2ec0c1a6dcf5defd7a53&version=nightly
8 years ago
Jake Kerr
00fdb72cc8
Reverse AtomicBool value in nomicon example to agree with its comment.
...
Makes the code agree with the comment: 'value answers "am I locked?"'.
8 years ago
Andrew Paseltiner
649ba39bc4
Remove superfluous line from Nomicon
8 years ago
Tshepang Lekhonkhobe
4b1781c350
nomicon: insert missing words
8 years ago
Tshepang Lekhonkhobe
80604b471d
nomicon: use current syntax
8 years ago
Steve Klabnik
5dfcb738b1
Remove reference to diabetes
...
1. this isn't actually true about diabetes
2. people with diabetes will get *real sad* when reading this
3. it isn't actually necessary.
8 years ago
Taliesin Beynon
2bea608ff4
Some rerp-rust improvements.
...
* Some clarifying rephrasing.
* Rename B.x back to B.a.
* Make null pointer optimization section bit more concrete.
8 years ago
Jeehoon Kang
d787bec7d5
Revise TARPL's description for allocating 0 bytes
...
In Section 3.2, TARPL says that "standard allocators (including jemalloc, the one used by default in Rust) generally consider passing in 0 for the size of an allocation as Undefined Behaviour."
However, the C standard and jemalloc manual says allocating zero bytes
should succeed:
- C11 7.22.3 paragraph 1: "If the size of the space requested is zero, the behavior is implementation-defined: either a null pointer is returned, or the behavior is as if the size were some nonzero value, except that the returned pointer shall not be used to access an object."
- [jemalloc manual](http://www.freebsd.org/cgi/man.cgi?query=jemalloc&sektion=3 ): "The malloc and calloc functions return a pointer to the allocated memory if successful; otherwise a NULL pointer is returned and errno is set to ENOMEM."
+ Note that the description for `allocm` says "Behavior is undefined if size is 0," but it is an experimental API.
8 years ago
Ivan Jager
399efd4cdc
Fix some grammar in The Advanced Rust Programming Language
8 years ago
Alexis Beingessner
f6e739a54c
Fix variance ordering
...
I thought this was actually a huge error and I'd have to rewrite a bunch but
it looks like everything else was correct.
Closes #27457
8 years ago
Alexis Beingessner
5dea771dbb
rename TARPL to The Rustinomicon
8 years ago
Oliver Schneider
99e464326c
fix code and error to match the surronding text
8 years ago
Cole Reynolds
a15e56cb52
Minor grammatical changes to send-and-sync.
...
Corrects formatting of bullet-ed sentences and changes 'pervasive use raw pointers' to 'pervasive use of raw pointers'
8 years ago
Taliesin Beynon
8a932e55b9
fix switched-round 'b' and 'c'
8 years ago
Alexis Beingessner
37d42cdcef
last of the emphasis cleanup
8 years ago
Alexis Beingessner
42582a28ed
frob emphasis
8 years ago
Alexis Beingessner
85a6d02a45
make the intro less scary
8 years ago
Alexis Beingessner
a9c2c6ee32
fix title-casing
8 years ago
Alex Crichton
ec806b24f4
tarpl: Change norun to no_run
...
Needs the underscore for rustdoc to not actually run it.
8 years ago
Alexis Beingessner
baab22d05e
Maybe ignore the explicit examples of a race condition
8 years ago