Commit Graph

42759 Commits

Author SHA1 Message Date
Manish Goregaokar
252027768e Rollup merge of #25530 - peferron:doc-closures-whitespace-fix, r=alexcrichton
Tiny fixes collected while reading through the Rust book. If they're too nitpicky please let me know and I'll ignore the next ones. :)

The spaces after the function and closure arguments might be intentional, but they do not make much sense: the usual formatting doesn't have such spaces, and they aren't helping align the three lines together either.

r? @steveklabnik (as suggested by [CONTRIBUTING.md](https://github.com/rust-lang/rust/blob/master/CONTRIBUTING.md))
2015-05-18 08:55:38 +05:30
Manish Goregaokar
6f2a069b9c Rollup merge of #25526 - chellmuth:patch-1, r=alexcrichton 2015-05-18 08:55:37 +05:30
bors
8a8583c160 Auto merge of #25541 - klutzy:remove-packed-attr, r=alexcrichton
The attribute was removed by #16499.
2015-05-18 01:32:26 +00:00
Steven Fackler
fb526cf3a1 Fix finish docs 2015-05-17 18:09:35 -07:00
Steven Fackler
bd85983d05 Make debug builders take &mut self, add entries method
[breaking-change]
2015-05-17 17:33:29 -07:00
mdinger
fb73c47e5e typo 2015-05-17 20:09:11 -04:00
bors
0cc99f9cc9 Auto merge of #25527 - inrustwetrust:const-not-overflow, r=alexcrichton
Fixes #23968.
Since the values are stored in a u64 internally, we need to be mask away the
high bits after applying the ! operator. Otherwise, these bits will be set to
one, causing overflow.
2015-05-17 23:53:41 +00:00
bors
e4d56b7b5b Auto merge of #25523 - nham:remove_E0068, r=alexcrichton
A built-in feature enabling the dereferencing of newtype structs was removed
in PR https://github.com/rust-lang/rust/pull/11188, and this error (E0068) was added at the same time to warn of
its removal. It seems to make sense to remove the error now, given that
the obsolete feature it is warning about was removed nearly a year and a
half ago.
2015-05-17 22:13:30 +00:00
Sean Collins
99868f6ba8 Add 'active' class to current page in rustbook table of contents 2015-05-17 17:05:23 -04:00
Steven Fackler
1973ee479d Make #[derive(Debug)] work with unsized fields
Closes #25394
2015-05-17 14:03:37 -07:00
Nick Hamann
c69a152018 Add error explanations for E0072, E0073, E0121, E0178, E0371, E0372. 2015-05-17 15:53:12 -05:00
bors
1c44801429 Auto merge of #25454 - steveklabnik:r_doc_fix, r=alexcrichton 2015-05-17 19:40:50 +00:00
klutzy
d0fc35f394 syntax: Remove unused packed attribute
The attribute was removed by #16499.
2015-05-18 00:30:40 +09:00
Carol Nichols
e70c8584d5 Revert "Panic if the grammar verifier sees a token it doesn't recognize"
This reverts commit 9c7d5ae57c.

This was wrong... the `continue` was to ignore the latter half of the
tokens file. Another mechanism will have to be used to keep the model
grammar's tokens in sync with the actual grammar's tokens :-/
2015-05-17 10:48:42 -04:00
peferron
82447cf500 Fix doc whitespace issues 2015-05-17 03:00:04 -07:00
bors
8b7c17db22 Auto merge of #25524 - Manishearth:unsafe_derive, r=cmr 2015-05-17 09:26:30 +00:00
Manish Goregaokar
5b63841d91 Allow #[derive()] to generate unsafe methods 2015-05-17 14:56:13 +05:30
inrustwetrust
d1605deab8 Fix compile-time integer overflow when using ! on unsigned values
Since the values are stored in a u64 internally, we need to be mask away the
high bits after applying the ! operator. Otherwise, these bits will be set to
one, causing overflow.
2015-05-17 10:04:15 +02:00
Chris Hellmuth
09a473ea7b Fix typo in references-and-borrowing docs 2015-05-17 00:19:53 -07:00
bors
9f3a7f0c2b Auto merge of #25525 - Manishearth:rollup, r=Manishearth
- Successful merges: #25465, #25469, #25472, #25474, #25476, #25484, #25490, #25493, #25503, #25506, #25508, #25510, #25516, #25522
- Failed merges:
2015-05-17 06:25:58 +00:00
Manish Goregaokar
a0815c8c74 Rollup merge of #25522 - alexcrichton:reexport-incoming, r=sfackler
This iterator was mistakenly not reexported at the top level, preventing
actually naming the type!

Closes #25519
2015-05-17 11:55:40 +05:30
Manish Goregaokar
99ed2c9f4b Rollup merge of #25516 - bstrie:cstrdoc, r=alexcrichton
No need for `&b"foo"[..]` to make a CString, `"foo"` will do.
2015-05-17 11:55:40 +05:30
Manish Goregaokar
8fa94747e4 Rollup merge of #25510 - thelostt:patch-1, r=alexcrichton
The same example for ``reverse`` were in the ``reserve_exact``'s example.
2015-05-17 11:55:40 +05:30
Manish Goregaokar
4e12a92d9b Rollup merge of #25508 - johshoff:visit_dirs_example, r=alexcrichton
The current version of the example won't compile due to unstable features.
This is an attempt to fix that, at the cost of slightly more verbose code.

Using rust 1.0.0 (a59de37e9).

It might be obvious, but I'm not well versed with rust, so feedback is very welcome.
2015-05-17 11:55:40 +05:30
Manish Goregaokar
1fd0a8455b Rollup merge of #25506 - Wilfred:master, r=alexcrichton
Newcomers to Rust need to learn the distinctinion between `&str` and
`String`, so additonally having `string` in an example risks confusion.
2015-05-17 11:55:39 +05:30
Manish Goregaokar
b3706de65a Rollup merge of #25503 - brson:betafix, r=cmr 2015-05-17 11:55:39 +05:30
Manish Goregaokar
094d29cf09 Rollup merge of #25493 - coffeejunk:update_installed_rust_version, r=alexcrichton
Rust is out of beta 🎉 

r? @steveklabnik
2015-05-17 11:55:39 +05:30
Manish Goregaokar
b40fcf5b10 Rollup merge of #25490 - huachaohuang:patch-1, r=alexcrichton 2015-05-17 11:55:39 +05:30
Manish Goregaokar
4d3db38940 Rollup merge of #25484 - sumito3478:fix-deadlink-in-complement-lang-faq, r=alexcrichton
In "The Rust Language FAQ", some of the links to example projects/modules written in Rust are dead links. This PR updates them.
2015-05-17 11:55:38 +05:30
Manish Goregaokar
bea1bba9ca Rollup merge of #25476 - rpjohnst:master, r=huonw
Closes #18173
2015-05-17 11:55:38 +05:30
Manish Goregaokar
27676ea8c2 Rollup merge of #25474 - achanda:fix_email, r=nikomatsakis 2015-05-17 11:55:38 +05:30
Manish Goregaokar
a25925a3d4 Rollup merge of #25472 - WillEngler:book-tiny-typo-fixes, r=alexcrichton
This PR fixes two little typos in the Dining Philosophers example.

Also, there are two style points that may have been oversights but may have been deliberate, so I'll just bring them up here:

1) In the last paragraph, you say

> You’ll notice we can introduce a new binding to `table` here, and it will shadow the old one. This is often used so that you don’t need to come up with two unique names.

You already said something similar to this in the Guessing Game, but maybe you intended for this example to be independent of that one.

2) In "Rust Inside Other Languages," you introduce the idea of the "global interpreter lock" and then refer to it as the GIL a few paragraphs later without explicitly stating that GIL == global interpreter lock. It's reasonable to expect readers to make the connection, but maybe that's not what you intended.

Excellent work on the examples! Congrats on 1.0!

r? @steveklabnik
2015-05-17 11:55:38 +05:30
Manish Goregaokar
e06eb1c733 Rollup merge of #25469 - ecoal95:patch-1, r=alexcrichton
Just detected it while reading.
2015-05-17 11:55:38 +05:30
Manish Goregaokar
e8d29a9cfb Rollup merge of #25465 - Ryman:patch-2, r=alexcrichton
r? @steveklabnik
2015-05-17 11:55:37 +05:30
Nick Hamann
f47cb0ecfb Remove error about obsolete dereferencing of newtype structs.
A built-in feature enabling the dereferencing of newtype structs was removed
in PR #11188, and this error (E0068) was added at the same time to warn of
its removal. It seems to make sense to remove the error now, given that
the obsolete feature it is warning about was removed nearly a year and a
half ago.
2015-05-17 01:12:11 -05:00
Alex Crichton
e5e722bd32 std: Reexport std::net::tcp::Incoming
This iterator was mistakenly not reexported at the top level, preventing
actually naming the type!

Closes #25519
2015-05-16 22:24:13 -07:00
Ben Striegel
e1f73b8e2b Simplify CString doc comment
No need for `&b"foo"[..]` to make a CString, `"foo"` will do.
2015-05-16 22:30:25 -04:00
bors
4f83c4b851 Auto merge of #25458 - P1start:arc-dst, r=huonw 2015-05-17 01:41:52 +00:00
bors
c23a9d42ea Auto merge of #25387 - eddyb:syn-file-loader, r=nikomatsakis
This allows compiling entire crates from memory or preprocessing source files before they are tokenized.

Minor API refactoring included, which is a [breaking-change] for libsyntax users:
* `ParseSess::{next_node_id, reserve_node_ids}` moved to rustc's `Session`
* `new_parse_sess` -> `ParseSess::new`
* `new_parse_sess_special_handler` -> `ParseSess::with_span_handler`
* `mk_span_handler` -> `SpanHandler::new`
* `default_handler` -> `Handler::new`
* `mk_handler` -> `Handler::with_emitter`
* `string_to_filemap(sess source, path)` -> `sess.codemap().new_filemap(path, source)`
2015-05-17 00:05:34 +00:00
peferron
55c8bacc3a Make error message consistent with source code
The source code uses `"whatever".as_bytes()`, not `b"whatever"`.
2015-05-16 17:01:25 -07:00
Mário Feroldi
ce8fb6c6c6 Fixed reserve_exact example
The same example for ``reverse`` were in the ``reserve_exact``'s example.
2015-05-16 20:59:20 -03:00
P1start
e840393625 Make Arc support DSTs 2015-05-17 11:25:17 +12:00
Eduard Burtescu
8cc9878f8d test/compile-fail: fix expected error message for non-UTF8 source. 2015-05-17 02:15:00 +03:00
Johannes Hoff
b6e755df66 fs::walk_dir example without unstable features
The current version of the example won't compile due to unstable features.
This is an attempt to fix that, at the cost of slightly more verbose code.
2015-05-16 16:07:52 -07:00
Wilfred Hughes
ba02739ad3 Avoid calling a variable 'string' when discussing strings.
Newcomers to Rust need to learn the distinctinion between `&str` and
`String`, so additonally having `string` in an example risks confusion.
2015-05-16 23:56:45 +01:00
bors
2da9efefca Auto merge of #25463 - jeremyschlatter:master, r=alexcrichton 2015-05-16 22:29:56 +00:00
Brian Anderson
bf15d040c0 Make a test compatible with the beta channel 2015-05-16 14:53:37 -07:00
bors
0d707d15f6 Auto merge of #25485 - XuefengWu:24968_err_msg_parse_self_type_2, r=nrc
fix #24968
report more friendly error message for Self when fn args
copy from https://github.com/rust-lang/rust/pull/25096
r? @nrc  @arielb1
2015-05-16 20:53:42 +00:00
bors
d332aead90 Auto merge of #25434 - dotdash:gep, r=alexcrichton
Using regular pointer arithmetic to iterate collections of zero-sized types
doesn't work, because we'd get the same pointer all the time. Our
current solution is to convert the pointer to an integer, add an offset
and then convert back, but this inhibits certain optimizations.

What we should do instead is to convert the pointer to one that points
to an i8\*, and then use a LLVM GEP instructions without the inbounds
flag to perform the pointer arithmetic. This allows to generate pointers
that point outside allocated objects without causing UB (as long as you
don't dereference them), and it wraps around using two's complement,
i.e. it behaves exactly like the wrapping_* operations we're currently
using, with the added benefit of LLVM being able to better optimize the
resulting IR.
2015-05-16 19:17:30 +00:00
Alex Crichton
f894417e6b std: Fix missing stability on iter::Cloned
The method was stabilized but the structure was forgotten to be stabilized.

Closes #25480
2015-05-16 11:27:08 -07:00