Brian Green
9d2c45d0e7
doc: Fix tiny typo in vec-alloc.md
...
Change `fast an loose` to `fast and loose`.
2016-05-09 14:28:42 -07:00
c4rlo
abf00c65c2
subtyping.md: typo fix
2016-04-23 11:58:58 +01:00
Ariel Ben-Yehuda
728d20f7cc
improve error message
2016-04-05 20:58:58 +03:00
Ariel Ben-Yehuda
8a461d940c
suggest adding a where-clause when that can help
...
suggest adding a where-clause when there is an unmet trait-bound that
can be satisfied if some type can implement it.
2016-04-05 20:58:58 +03:00
Matt Brubeck
d93fb02a5e
Update Rust version in the Rustonomicon Vec chapter
...
I verified that the final code compiles in Rust 1.9.0-nightly.
2016-03-30 16:59:38 -07:00
Florian Hahn
145190bd2a
Capitalize some occurences of Rust in documentation
2016-02-24 19:56:28 +01:00
Ulrik Sverdrup
f4fac9b0fa
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.
2016-01-17 23:44:33 +01:00
Jonas Tepe
5c62178658
Fixed indent from tabs to spaces
2016-01-16 20:51:55 +01:00
Jonas Tepe
9c5b296dd3
added zst iterator additions to final code
2016-01-16 13:13:44 +01:00
Jonas Tepe
b3f44c1335
Semicolon was at wrong place in let statement
2016-01-16 13:07:46 +01:00
jonastepe
a0731008fd
len needs to be prefixed by self for this to work. The final code in this section of the book is correct.
2016-01-07 12:13:22 +01:00
jonastepe
eb30c661c0
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.
2016-01-06 12:13:47 +01:00
Steve Wooster
fc862182c9
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.
2015-12-17 09:40:02 -08:00
Ulrik Sverdrup
2a30f0ea41
nomicon: Mention contravariance
2015-12-12 06:14:06 +01:00
Ulrik Sverdrup
a0101624ad
nomicon: Fix variance in example
...
&'b mut B was described incorrectly (just in this example, is correct in
the actual text).
2015-12-11 18:24:10 +01:00
Manish Goregaokar
bf565467c0
Rollup merge of #29875 - steveklabnik:gh29784, r=Manishearth
...
Fixes #29784
2015-11-17 15:12:15 +05:30
Steve Klabnik
646128d79a
Remove nomicon reference to copy_lifetime
...
Fixes #29784
2015-11-16 16:58:52 -05:00
Steve Klabnik
ca4ab32a1e
Nomicon: mention tuple structs with repr(c)
...
Fixes #29526
2015-11-16 12:04:25 -05:00
Jake Worth
ac19178078
Fix typo
2015-11-07 12:27:58 -06:00
Alexis Beingessner
e351595c61
don't use drop_in_place as an intrinsic
2015-10-30 11:24:54 -04:00
Scott Olson
6003b479a0
Add missing "to" in Rustonomicon Atomics.
2015-10-22 03:33:47 -06:00
Steve Klabnik
2fb3b856c5
Rollup merge of #29175 - durka:patch-8, r=Gankro
...
Yay, markdown isn't standardized and rustbook's parser has subtle incompatibilities with Github's! So in the Github preview you don't see that this list fails to separate from the previous paragraph. I think this should fix it, but I didn't check.
2015-10-20 09:43:47 -04:00
Steve Klabnik
53c4b4d412
Rollup merge of #29162 - tsion:fix-nomicon-typo, r=alexcrichton
...
r? @steveklabnik
2015-10-20 09:43:47 -04:00
Alex Burka
f1e06db8c2
fix markdown in nomicon/dropck
2015-10-19 20:14:38 -04:00
Andrew Paseltiner
9431f3cc7b
Correct spelling in docs
2015-10-19 13:48:42 -04:00
Scott Olson
8222970f79
Fix minor syntax error in example.
2015-10-19 01:43:48 -06:00
DenisKolodin
5736c1d90a
Update explanation about offset method
2015-10-16 19:10:01 +03:00
Andrew Paseltiner
1162b3752c
Correct spelling in docs
2015-10-13 09:44:11 -04:00
Kyle Robinson Young
a6aa6456ee
doc: fixing typos
2015-10-10 09:15:55 -07:00
bors
87cd2c0827
Auto merge of #28861 - pnkfelix:fsk-nonparam-dropck-issue28498, r=arielb1
...
implement RFC 1238: nonparametric dropck.
cc #28498
cc @nikomatsakis
2015-10-10 00:39:29 +00:00
Felix S. Klock II
e1aba75a97
review comment: point out that the dropck analysis is now trivial.
2015-10-09 14:08:06 +02:00
Felix S. Klock II
9ed5faa9d5
Document the new more conservative dropck rule and the escape hatch.
2015-10-08 15:34:54 +02:00
Carlos Liam
aba267fd0d
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.
2015-10-06 13:06:39 -04:00
bors
c2be91ede0
Auto merge of #28847 - Ms2ger:typos, r=steveklabnik
2015-10-05 20:02:02 +00:00
Simon Mazur
fcf8dedb99
docs: anchors fixes
2015-10-05 19:25:54 +03:00
Ms2ger
6b5349a45e
Fix some typos.
2015-10-05 16:48:57 +02:00
Pascal Hertleif
4828c88af6
Nomicon: Fix Links
...
The style `[name][]` does not work with Pandoc, whereas `[name]` does.
I hope hoedown accepts this as well.
2015-09-12 12:13:24 +02:00
Alex Crichton
f4be2026df
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.
2015-09-11 11:19:20 -07:00
Jørn Lode
97dd25094c
Rustonomicon: Reword potentially confusing comment in Vec::drain.
2015-09-06 18:21:57 +02:00
Jørn Lode
c08deef982
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
2015-09-06 03:44:13 +02:00
Jake Kerr
8213f01a76
Reverse AtomicBool value in nomicon example to agree with its comment.
...
Makes the code agree with the comment: 'value answers "am I locked?"'.
2015-09-01 17:32:22 +09:00
Andrew Paseltiner
010b7f3621
Remove superfluous line from Nomicon
2015-08-28 22:07:02 -04:00
Steve Klabnik
b3e9615ed4
Rollup merge of #27921 - tshepang:missing-words, r=steveklabnik
2015-08-22 19:15:43 -04:00
Tshepang Lekhonkhobe
71d654a641
nomicon: insert missing words
2015-08-20 21:37:12 +02:00
Tshepang Lekhonkhobe
a274a64669
nomicon: use current syntax
2015-08-20 21:17:20 +02:00
Steve Klabnik
ad9a0713fd
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.
2015-08-06 20:18:49 -04:00
bors
fb92de75c1
Auto merge of #27556 - taliesinb:tarpl-clarity-2, r=Gankro
...
* Some clarifying rephrasing.
* Rename B.x back to B.a.
* Make null pointer optimization section bit more concrete.
r? @Gankro
2015-08-06 17:36:21 +00:00
Jeehoon Kang
9bfb8d3add
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.
2015-08-06 15:40:41 +09:00
Taliesin Beynon
2ca3dda3c4
Some rerp-rust improvements.
...
* Some clarifying rephrasing.
* Rename B.x back to B.a.
* Make null pointer optimization section bit more concrete.
2015-08-06 02:04:11 -04:00
Manish Goregaokar
8effc61816
Rollup merge of #27527 - aij:tarpl, r=Gankro
...
Just some grammar fixes and an assumed missing word.
r? @Gankro
2015-08-05 13:45:38 +05:30