61832 Commits

Author SHA1 Message Date
Guillaume Gomez
b1bd60bd7f Rollup merge of - MajorBreakfast:patch-7, r=frewsxcv
Unit-like structs doc: Improve code sample

r? @steveklabnik

BTW it seems that
```Rust
let p = Proton {};
```
compiles without an error. That's why I didn't add it to the example. It's about consistency anyway.
2017-03-02 11:29:36 +01:00
Guillaume Gomez
5d08775051 Rollup merge of - GuillaumeGomez:poison-docs, r=frewsxcv
Add missing url in sync structs

r? @frewsxcv
2017-03-02 11:29:35 +01:00
bors
2be750b243 Auto merge of - nikomatsakis:issue-40029, r=eddyb
inhibit enum layout optimizations under `#[repr(C)]` or `#[repr(u8)]`

Fixes 
2017-03-02 03:34:53 +00:00
bors
d0954375e4 Auto merge of - brson:fpic, r=alexcrichton
Add a test that -fPIC is applied

r? @alexcrichton Can it really be this simple? I've tested it works, but still testing that it used to fail.
2017-03-01 22:48:17 +00:00
Niko Matsakis
2b07d0d853 inhibit enum layout optimizations under #[repr(C)] or #[repr(u8)]
Fixes 
2017-03-01 15:44:27 -05:00
Alex Crichton
55dab70f7a Don't run test on darwin 2017-03-01 08:08:53 -08:00
bors
691eba1358 Auto merge of - eddyb:you're-a-bad-transmute-and-you-should-feel-bad, r=nikomatsakis
Make transmuting from fn item types to pointer-sized types a hard error.

Closes  by removing the future compatibility lint and the associated workarounds.
This is a `[breaking-change]` if you `transmute` from a function item without casting first.
For more information on how to fix your code, see https://github.com/rust-lang/rust/issues/19925.
2017-03-01 10:03:44 +00:00
Josef Brandl
8f1a0afee1 Unit-like structs doc: Add compile fail tag 2017-03-01 10:03:07 +01:00
bors
b671c32ddc Auto merge of - frewsxcv:rollup, r=frewsxcv
Rollup of 6 pull requests

- Successful merges: , , , , , 
- Failed merges:
2017-03-01 07:57:09 +00:00
bors
7ce1fbe1f7 Auto merge of - jseyfried:simplify_tokentree, r=nrc
Simplify `TokenTree` and fix `macro_rules!` bugs

This PR
 - fixes , fixes , and fixes  (each is a [breaking-change], see issues for examples),
 - fixes ,
 - simplifies and optimizes macro invocation parsing,
 - cleans up `ext::tt::transcribe`,
 - removes `tokenstream::TokenTree::Sequence` and `Token::MatchNt`,
   - instead, adds a new type `ext::tt::quoted::TokenTree` for use by `macro_rules!` (`ext::tt`)
 - removes `parser.quote_depth` and `parser.parsing_token_tree`, and
 - removes `quote_matcher!`.
   - Instead, use `quote_tokens!` and `ext::tt::quoted::parse` the result with `expect_matchers=true`.
   - I found no outside uses of `quote_matcher!` when searching Rust code on Github.

r? @nrc
2017-03-01 05:58:09 +00:00
Corey Farwell
0b5bf67449 Rollup merge of - cengizIO:master, r=nikomatsakis
Move two large error_reporting fn's to a separate file

Hello!

I tried to make `librustc/infer/error_reporting,rs` more readable by modularizing it and moving its two largest functions to a separate file.

If you have any suggestions, please send it right away! 🚀

Thanks goes to @nikomatsakis for supporting.
2017-02-28 22:55:31 -05:00
Corey Farwell
0a008b949e Rollup merge of - withoutboats:string_from_iter, r=alexcrichton
impl FromIterator<&char> for String
2017-02-28 22:55:30 -05:00
Corey Farwell
06a0233ab3 Rollup merge of - lukaramu:issue-39925, r=alexcrichton
added Error and Display impl for std::ffi::FromBytesWithNulError

Fixes .

This is my first PR, so I wasn't quite sure about the stability annotation.
2017-02-28 22:55:29 -05:00
Corey Farwell
fda3f98746 Rollup merge of - GuillaumeGomez:associated-consts, r=frewsxcv
Improve associated constant rendering in rustdoc

Before:

<img width="1440" alt="screen shot 2017-02-19 at 00 30 51" src="https://cloud.githubusercontent.com/assets/3050060/23097697/caeed80e-f63a-11e6-98c2-5d27e4efd76d.png">

After:

<img width="1440" alt="screen shot 2017-02-19 at 00 30 39" src="https://cloud.githubusercontent.com/assets/3050060/23097698/cfb4874e-f63a-11e6-80cf-ffbf5c5c6162.png">

cc @SergioBenitez

r? @rust-lang/docs
2017-02-28 22:55:28 -05:00
Corey Farwell
43df65fb3f Rollup merge of - djzin:inclusive_rangeargument, r=alexcrichton
impl RangeArgument for RangeInclusive and add appropriate tests

Now that `RangeArgument` returns a `Bound`, the impl for `RangeInclusive` is natural to implement and all that's required are tests around it.
2017-02-28 22:55:27 -05:00
Corey Farwell
4ba49ab39f Rollup merge of - jseyfried:simplify_tokentree, r=nrc
Simplify `TokenTree` and fix `macro_rules!` bugs

This PR
 - fixes , fixes , and fixes  (each is a [breaking-change], see issues for examples),
 - fixes ,
 - simplifies and optimizes macro invocation parsing,
 - cleans up `ext::tt::transcribe`,
 - removes `tokenstream::TokenTree::Sequence` and `Token::MatchNt`,
   - instead, adds a new type `ext::tt::quoted::TokenTree` for use by `macro_rules!` (`ext::tt`)
 - removes `parser.quote_depth` and `parser.parsing_token_tree`, and
 - removes `quote_matcher!`.
   - Instead, use `quote_tokens!` and `ext::tt::quoted::parse` the result with `expect_matchers=true`.
   - I found no outside uses of `quote_matcher!` when searching Rust code on Github.

r? @nrc
2017-02-28 22:55:26 -05:00
bors
2f52386f10 Auto merge of - steveklabnik:rollup, r=steveklabnik
Rollup of 5 pull requests

- Successful merges: , , , , 
- Failed merges:
2017-03-01 00:58:13 +00:00
Steve Klabnik
4fd2aeddd4 Rollup merge of - steveklabnik:alphabetize-unstable-book, r=frewsxcv
sort unstable book alphabetically

I made these the same order as they were in the compiler, but for no good reason. Much easier to find out what you need when they're sorted alphabetically

r? @frewsxcv
2017-02-28 15:38:43 -08:00
Steve Klabnik
2a14d4bb86 Rollup merge of - steveklabnik:update-mdbook, r=frewsxcv
update mdbook version

This contains two important bugfixes
2017-02-28 15:38:42 -08:00
Steve Klabnik
40069bb9d1 Rollup merge of - topecongiro:compile-fail-test-cfg-target-has-atomic, r=alexcrichton
Add compile test for cfg_target_has_atomic

Issue .
I am concerned about whether the test is excessive.
2017-02-28 15:38:41 -08:00
Steve Klabnik
9b55f531ca Rollup merge of - MajorBreakfast:patch-4, r=steveklabnik
Structs doc: Change "pointers" to "references"

Let's call them "references" instead of "pointers". That's how they're called in chapter 4.9 "References and Borrowing".

r? @steveklabnik
2017-02-28 15:38:40 -08:00
Steve Klabnik
aff269b5dc Rollup merge of - alexcrichton:fix-musl-again, r=nikomatsakis
travis: Fix typos in linux-tested-targets

These flags were supposed to be relevant for musl, not for gnu

cc 
2017-02-28 15:38:39 -08:00
Jeffrey Seyfried
839398a0b4 Add regression test. 2017-02-28 22:15:13 +00:00
Jeffrey Seyfried
61a9a14d29 Add warning cycle. 2017-02-28 22:15:12 +00:00
Jeffrey Seyfried
7f822c800d Refactor out parser.expect_delimited_token_tree(). 2017-02-28 22:15:11 +00:00
Jeffrey Seyfried
752413005e Merge repeat_idx and repeat_len. 2017-02-28 22:15:10 +00:00
Jeffrey Seyfried
0cc7053efa Remove Token::MatchNt. 2017-02-28 22:15:09 +00:00
Jeffrey Seyfried
d8b34e9a74 Add syntax::ext::tt::quoted::{TokenTree, ..} and remove tokenstream::TokenTree::Sequence. 2017-02-28 22:14:29 +00:00
Jeffrey Seyfried
2471888033 Avoid Token::{OpenDelim, CloseDelim}. 2017-02-28 22:13:39 +00:00
Jeffrey Seyfried
8c4960bfde Remove ext::tt::transcribe::tt_next_token. 2017-02-28 22:13:38 +00:00
Jeffrey Seyfried
abdc68973e Clean up ext::tt::transcribe::TtFrame, rename to Frame. 2017-02-28 22:13:37 +00:00
Jeffrey Seyfried
d09e512158 Remove a loop in ext::tt::transcribe. 2017-02-28 22:13:34 +00:00
Eduard Burtescu
7650afc1ce Make transmuting from fn item types to pointer-sized types a hard error. 2017-02-28 23:47:55 +02:00
Steve Klabnik
3a0437d448 sort unstable book alphabetically
I made these the same order as they were in the compiler, but for no good reason. Much easier to find out what you need when they're sorted alphabetically
2017-02-28 14:06:05 -05:00
Steve Klabnik
d076e840bc update mdbook version
This contains two important bugfixes
2017-02-28 12:32:32 -05:00
topecongiro
3bffc9e150 Add compile test for cfg_target_has_atomic 2017-03-01 01:35:59 +09:00
bors
be760566cf Auto merge of - frewsxcv:rollup, r=frewsxcv
Rollup of 9 pull requests

- Successful merges: , , , , , , , , 
- Failed merges: 
2017-02-28 14:06:39 +00:00
Corey Farwell
a851fc1441 Rollup merge of - MajorBreakfast:patch-3, r=steveklabnik
Make lifetime elision docs clearer

Previously it said
"It's forbidden to allow reasoning about types based on the item signature alone."

I think that sentence is wrong. Rust **uses** the item signatures to perform type inference within the body. I think what's meant is the other way around: It does not infer types for item signatures.

r? @steveklabnik
2017-02-28 08:33:10 -05:00
Corey Farwell
c4b6c98f35 Rollup merge of - GuillaumeGomez:fmt-write-docs, r=frewsxcv
Add missing docs and examples for fmt::Write

r? @frewsxcv
2017-02-28 08:33:09 -05:00
Corey Farwell
da703a810b Rollup merge of - koba-e964:patch-1, r=steveklabnik
Remove unnecessary "for"
2017-02-28 08:33:08 -05:00
Corey Farwell
6ac7bf5c67 Rollup merge of - robinst:process-add-example-for-writing-to-stdin, r=alexcrichton
Example for how to provide stdin using std::process::Command

Spawning a child process and writing to its stdin is a bit tricky due to
`as_mut` and having to use a limited borrow. An example for this might
help newer users.

r? @steveklabnik
2017-02-28 08:33:07 -05:00
Corey Farwell
15cd43b4aa Rollup merge of - GuillaumeGomez:html-issue, r=frewsxcv
Fix nightly-only experimental API display

Before:

<img width="1440" alt="screen shot 2017-02-23 at 12 53 09" src="https://cloud.githubusercontent.com/assets/3050060/23258119/0c9cf6f2-f9c7-11e6-9989-15b4346dade0.png">

After:

<img width="1440" alt="screen shot 2017-02-23 at 12 51 40" src="https://cloud.githubusercontent.com/assets/3050060/23258076/e6881118-f9c6-11e6-826c-442a73502b59.png">

r? @frewsxcv
2017-02-28 08:33:05 -05:00
Corey Farwell
2623d35a21 Rollup merge of - keeperofdakeys:contributing, r=alexcrichton
Replace ./configure with config.toml in README.md and CONTRIBUTING.md

Replace ./configure with config.toml in README.md and CONTRIBUTING.md, so that new users aren't confused about which build system to use, and how to configure the build process.
2017-02-28 08:33:04 -05:00
Corey Farwell
922a262c43 Rollup merge of - topecongiro:master, r=est31
Add compile fail test for unboxed_closures feature

Hello, this is my first contribution to rust.
Issue .
2017-02-28 08:33:02 -05:00
Corey Farwell
5be0d9ff04 Rollup merge of - GuillaumeGomez:condvar-docs, r=frewsxcv
Add missing urls and examples for Condvar docs

r? @frewsxcv
2017-02-28 08:33:01 -05:00
Corey Farwell
227285fd86 Rollup merge of - frewsxcv:error-reporting-cleanup, r=eddyb
librustc error_reporting.rs cleanup.

Read some code in librustc, mainly in error_reporting.rs, and cleaned up some things along the way. I recommend looking at each commit individually or looking at the [whitespace insensitive diff](https://github.com/rust-lang/rust/pull/39977/files?w=1).
2017-02-28 08:33:00 -05:00
Josh Driver
fb2d763eee Replace ./configure with config.toml in README.md and CONTRIBUTING.md 2017-02-28 21:40:00 +10:30
Josef Brandl
3c5001f0dd Unit-like structs doc: Improve code sample 2017-02-28 11:28:54 +01:00
Guillaume Gomez
992dd205dd Add missing url in sync structs 2017-02-28 11:22:30 +01:00
Guillaume Gomez
5933560324 Add missing docs and examples for fmt::Write 2017-02-28 11:14:32 +01:00