Commit Graph

62150 Commits

Author SHA1 Message Date
Corey Farwell
43df65fb3f Rollup merge of #39936 - 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 #39419 - jseyfried:simplify_tokentree, r=nrc
Simplify `TokenTree` and fix `macro_rules!` bugs

This PR
 - fixes #39390, fixes #39403, and fixes #39404 (each is a [breaking-change], see issues for examples),
 - fixes #39889,
 - 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
Austin Bonander
2fcbb48c72 Implement function-like procedural macros ( #[proc_macro]) 2017-02-28 18:34:22 -08:00
bors
2f52386f10 Auto merge of #40164 - steveklabnik:rollup, r=steveklabnik
Rollup of 5 pull requests

- Successful merges: #40130, #40142, #40150, #40151, #40153
- Failed merges:
2017-03-01 00:58:13 +00:00
Aidan Hobson Sayers
c58fff2bb7 Allow types passed to [] to coerce, like .index()
Fixes #40085
2017-03-01 00:15:13 +00:00
Steve Klabnik
4fd2aeddd4 Rollup merge of #40153 - 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 #40151 - 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 #40150 - topecongiro:compile-fail-test-cfg-target-has-atomic, r=alexcrichton
Add compile test for cfg_target_has_atomic

Issue #39059.
I am concerned about whether the test is excessive.
2017-02-28 15:38:41 -08:00
Steve Klabnik
9b55f531ca Rollup merge of #40142 - 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 #40130 - 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 #39979
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
Niko Matsakis
f704ef5ff7 simplify check-item-types too 2017-02-28 16:08:01 -05:00
Steve Klabnik
3aa6f189d4 add unstable book to the bookshelf 2017-02-28 14:09:27 -05: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
Theodore DeRego
2123d6a278 std::process for fuchsia: updated to latest liblaunchpad 2017-02-28 10:28:46 -08:00
Eduard-Mihai Burtescu
4c8b39d973 rustbuild: sort rules by the order of matching CLI paths. 2017-02-28 20:13:21 +02:00
Eduard-Mihai Burtescu
146c462e1a rustbuild: use a BTreeMap for the ruleset for determinism. 2017-02-28 20:12:26 +02:00
Niko Matsakis
384f044d82 convert MIR to iterate over the bodies vector 2017-02-28 12:32:54 -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
Simonas Kazlauskas
21c61336bb Remove the TypedConstVal
Replace it with ConstUsize instead, which is more appropriate; we are not using the rest of the
TypedConstVal anyway
2017-02-28 17:12:56 +02:00
Simonas Kazlauskas
3a14e9e745 Make Rvalue::ty infallible 2017-02-28 17:12:55 +02:00
Niko Matsakis
a780fa3f67 rewrite typeck bodies to iterate over the bodies vector 2017-02-28 09:44:34 -05:00
Niko Matsakis
fab202c0a8 store the visit order in the Crate 2017-02-28 09:11:58 -05:00
bors
be760566cf Auto merge of #40148 - frewsxcv:rollup, r=frewsxcv
Rollup of 9 pull requests

- Successful merges: #39977, #40033, #40047, #40056, #40057, #40122, #40124, #40126, #40131
- Failed merges: #40101
2017-02-28 14:06:39 +00:00
Niko Matsakis
1bb1e16e92 switch bodies to a btreemap 2017-02-28 08:44:35 -05:00
Niko Matsakis
2b5c0267b4 kill the code path for E0388
This was specific to the old special-case handling of statics in
borrowck.
2017-02-28 08:43:47 -05:00
Niko Matsakis
d79ad36cf5 walk the bodies "in order" by traversing the crate
Otherwise the errors from borrowck come out in an unpredictable
order.
2017-02-28 08:43:47 -05:00
Niko Matsakis
3e9bddad7b remove Option from the tables field 2017-02-28 08:43:47 -05:00
Niko Matsakis
cc2e4cd7e3 use visit_all_bodies_in_krate for borrowck instead of item-likes 2017-02-28 08:43:47 -05:00
Niko Matsakis
085d71c3ef remove special-case code for statics and just use borrowck_fn
Fixes #38520
2017-02-28 08:43:47 -05:00
Niko Matsakis
a9ec8841ef make borrowck_fn and friends create bccx 2017-02-28 08:43:47 -05:00
Niko Matsakis
530b92cfdd remove the borrowck stats 2017-02-28 08:43:47 -05:00
Niko Matsakis
03e8b26f35 rewrite borrowck_fn to only use the body-id 2017-02-28 08:43:47 -05:00
Niko Matsakis
d885e4ce9d add visit_all_bodies_in_krate helper 2017-02-28 08:43:47 -05:00
Niko Matsakis
b3a482ca9b move the FreeRegionMap into TypeckTables 2017-02-28 08:43:47 -05:00
Corey Farwell
a851fc1441 Rollup merge of #40131 - 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 #40126 - 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 #40124 - koba-e964:patch-1, r=steveklabnik
Remove unnecessary "for"
2017-02-28 08:33:08 -05:00
Corey Farwell
6ac7bf5c67 Rollup merge of #40122 - 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