Commit Graph

47138 Commits

Author SHA1 Message Date
Joseph Caudle
928e4b2541 Run rustfmt on librand/distributions/normal.rs 2015-10-10 00:01:57 -04: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
bors
439311d938 Auto merge of #28049 - steveklabnik:doc_write, r=alexcrichton 2015-10-09 22:15:24 +00:00
bors
7dcc4d7dcb Auto merge of #28926 - DanielKeep:syntax-index, r=steveklabnik
The intent with this chapter is to have a central place where users can
go to find out what a random bit of syntax means, be it a keyword,
symbol, or some unusual bit of composite syntax (like `for <...>`).  This
should be useful both for new users (who may not know what to call this
weird `'blah` thing), and for experienced users (who may just wish to
link someone to the appropriate section on `Trait + Trait` bounds).

Where possible, entries have been linked to an appropriate section of
the book which explains the syntax.  This was not possible in all cases.
If an entry is missing links, that's because I was unable to *find*
anything appropriate to link to.

This commit should include all stable keywords, operators and symbols,
as well as a selection of potentially confusing or unusual syntax.
2015-10-09 19:28:43 +00:00
Steve Klabnik
ef9e542b45 Improve docs for write!/writeln! macros 2015-10-09 13:53:25 -04:00
bors
e3376d8a13 Auto merge of #28929 - pnkfelix:expand-legal-cycles-test, r=alexcrichton
Major revision to the dropck_legal_cycles test.

1. Added big comment block explaining the test framework.

2. Added tests exericising Rc and Arc. This was inspired by a comment
   from eefriedman on PR #28861.

3. Made the cycle-detection not issue false-positives on acyclic dags.

   Doing this efficiently required revising the framework; instead of
   visiting all children (i.e. doing a traversal), now each test is
   responsible for supplying the path that will act as a witness to
   the cycle.

   Luckily for me, all of the pre-existing tests worked with a trivial
   path built from "always tke your first left", but new tests I added
   did require other input paths (i.e., "first turn right, then left".

   (The path representation is a bit-string and its branches are
    n-ary, not word phrases and binary branches as you might think
    from the outline above.)

cc PR #27185
2015-10-09 17:07:48 +00:00
Felix S. Klock II
a445f234a6 review comment: further refinement of comment above fn is_adt_dtorck. 2015-10-09 18:42:14 +02:00
Felix S. Klock II
34076bc0c9 Added the param-blindness attribute to Rc and Arc.
This was proven necessary after I added `Rc` and `Arc` to the rpass
test `dropck_legal_cycles.rs`; see PR #28929.
2015-10-09 18:10:52 +02:00
Felix S. Klock II
098a7a07ee Major revision to the dropck_legal_cycles test.
1. Added big comment block explaining the test framework.

2. Added tests exericising Rc and Arc. This was inspired by a comment
   from eefriedman on PR #28861.

3. Made the cycle-detection not issue false-positives on acyclic dags.

   Doing this efficiently required revising the framework; instead of
   visiting all children (i.e. doing a traversal), now each test is
   responsible for supplying the path that will act as a witness to
   the cycle.

   Luckily for me, all of the pre-existing tests worked with a trivial
   path built from "always tke your first left", but new tests I added
   did require other input paths (i.e., "first turn right, then left".

   (The path representation is a bit-string and its branches are
    n-ary, not word phrases and binary branches as you might think
    from the outline above.)
2015-10-09 18:04:18 +02:00
bors
3034541129 Auto merge of #27897 - sfackler:cursor-box-slice, r=alexcrichton 2015-10-09 13:07:07 +00:00
Steven Fackler
6b244d54e6 Implement Read, BufRead, Write and Seek for Cursor<Box<[u8]>> 2015-10-09 14:06:36 +01: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
Daniel Keep
2b5983423d Corrections to syntax index.
* removed reference to struct fields from `mut` description.
* changed `..` pattern example to not be syntactically bogus.
* changed `@` pattern example for similar reasons.

(Thanks petrochenkov)
2015-10-09 23:06:20 +11:00
Felix S. Klock II
b6a4f0393b revise cfail test, removing ugeh attribute that was erroneously cut-and-pasted into it. 2015-10-09 13:30:08 +02:00
Daniel Keep
b78614fdfa Expanded entries for generics.
* Now mentions method generics.
* Has separate entries for generic `fn`, `struct`, `enum`, and `impl`
  items.

(Thanks killercup).
2015-10-09 22:19:56 +11:00
bors
c14609035d Auto merge of #28857 - nrc:lowering, r=nikomatsakis
r? @nikomatsakis
2015-10-09 08:53:45 +00:00
Daniel Keep
702b6e552c Introduces a "Syntax Index" chapter to TRPL.
The intent with this chapter is to have a central place where users can
go to find out what a random bit of syntax means, be it a keyword,
symbol, or some unusual bit of composite syntax (like `for <...>`).  This
should be useful both for new users (who may not know what to call this
weird `'blah` thing), and for experienced users (who may just wish to
link someone to the appropriate section on `Trait + Trait` bounds).

Where possible, entries have been linked to an appropriate section of
the book which explains the syntax.  This was not possible in all cases.
If an entry is missing links, that's because I was unable to *find*
anything appropriate to link to.

This commit should include all stable keywords, operators and symbols,
as well as a selection of potentially confusing or unusual syntax.
2015-10-09 19:47:16 +11:00
Nick Cameron
a62a529eea review comments 2015-10-09 21:44:44 +13:00
bors
7cea9a7141 Auto merge of #28869 - alexcrichton:allocator-dox, r=steveklabnik
This adds a chapter to the nightly section of the book on leveraging and
implementing the `#![allocator]` attribute to write custom allocators as well as
explaining the current situation with allocators.
2015-10-09 06:29:30 +00:00
bors
a03e0ee657 Auto merge of #28817 - dcarral:installing_rust_v130, r=brson
Update "Installing Rust" section @ TRPL so it references the last stable version, v1.3.0.
2015-10-09 04:43:31 +00:00
bors
9f37fbc743 Auto merge of #28919 - huonw:placement-tracking-issue, r=alexcrichton
cc #28244
2015-10-09 02:57:38 +00:00
bors
0f536431f5 Auto merge of #28888 - arielb1:variant-ctor, r=eddyb
this makes the code cleaner, and is a complement to the cleanup on the
HIR side.

r? @eddyb
2015-10-09 01:11:45 +00:00
Huon Wilson
eacf78d8d4 Point placement_in_syntax/box_syntax lang features at tracking issue #27779.
cc #28244.
2015-10-09 10:11:04 +11:00
Nick Cameron
87b0cf4541 rustfmt'ing 2015-10-09 11:53:42 +13:00
Nick Cameron
2b4f28e531 Misc fixups 2015-10-09 11:53:42 +13:00
Nick Cameron
3d81f78544 Add a comment 2015-10-09 11:53:42 +13:00
Nick Cameron
ba43c228b5 Some cleanup of no longer used AST things 2015-10-09 11:53:42 +13:00
Nick Cameron
21205f4f9e Cache ids between lowering runs
So that lowering is reproducible
2015-10-09 11:53:42 +13:00
Nick Cameron
ce80094632 Make save-analysis work for if let etc. 2015-10-09 11:53:42 +13:00
Nick Cameron
08f3752270 hygiene for for loops, if let, while let
and some unrelated test cleanups
2015-10-09 11:53:41 +13:00
Nick Cameron
e0c74868c3 Fix stability 2015-10-09 11:53:41 +13:00
Nick Cameron
bfffa9ecfc Fixes to rustdoc, etc. 2015-10-09 11:53:41 +13:00
Nick Cameron
7f469ba6c5 Move placement in desugaring to lowering 2015-10-09 11:53:41 +13:00
Nick Cameron
bc364b4a0d if let and while let 2015-10-09 11:53:41 +13:00
Nick Cameron
04a7675d22 For loops in save-analysis 2015-10-09 11:53:41 +13:00
Nick Cameron
20083c1e1f Move for loop desugaring to lowering 2015-10-09 11:53:41 +13:00
Nick Cameron
56713a1684 Add a lowering context 2015-10-09 11:53:41 +13:00
bors
d0cae14f66 Auto merge of #28900 - cristicbz:typos, r=alexcrichton
I found these automatically, but fixed them manually to ensure the semantics are correct. I know things like these are hardly important, since they only marginally improve clarity. But at least for me typos and simple grammatical errors trigger an---unjustified---sense of unprofessionalism, despite the fact that I make them all the time and I understand that they're the sort of thing that is bound to slip through review.  

Anyway, to find most of these I used:

  * `ag '.*//.*(\b[A-Za-z]{2,}\b) \1\b'` for repeated words

  * `ag '\b(the|this|those|these|a|it) (a|the|this|those|these|it)\b'` to find constructs like 'the this' etc. many false positives, but not too hard to scroll through them to actually find the mistakes.

  * `cat ../../typos.txt | paste -d'|' - - - - - - - - - - - - - - - - - - - - - - | tr '\n' '\0' | xargs -0 -P4 -n1 ag`. Hacky way to find misspellings, but it works ok. I got `typos.txt` from [Wikipedia](https://en.wikipedia.org/wiki/Wikipedia:Lists_of_common_misspellings/For_machines)

* `ag '.*//.* a ([ae][a-z]|(o[^n])|(i[a-rt-z]))'` to find places where 'a' was followed by a vowel (requiring 'an' instead).

I also used a handful more one off regexes that are too boring to reproduce here.
2015-10-08 22:40:50 +00:00
Felix S. Klock II
61f8def63a placate check-pretty via comment rearrangement. 2015-10-08 23:02:42 +02:00
bors
11eda66df8 Auto merge of #27197 - nwin:generic-cursor-impl, r=alexcrichton
This is a revival of #23364. Github didn’t recognize my updated branch there.

The cursor implementation now uses `AsRef` which means that fixed-sized array can now be used with `Cursor`. Besides that, the generic implementation simplifies the code as the macro can be avoided.

The only drawback is, that specialized implementation for fixed-sized arrays are now ruled out unless [RFC#1210](https://github.com/rust-lang/rfcs/pull/1210) is accepted & implemented.

`Box<[u8]>` cannot be used yet, but that should be mitigated by [implementing `AsRef` for `Box` and friends](https://internals.rust-lang.org/t/forward-implement-traits-on-smart-pointers-make-smart-pointers-more-transparent/2380/3). I will submit a separate PR for that later as it is an orthogonal issue.
2015-10-08 20:53:23 +00:00
Alex Crichton
abe7874b35 book: Add documentation on custom allocators
This adds a chapter to the nightly section of the book on leveraging and
implementing the `#![allocator]` attribute to write custom allocators as well as
explaining the current situation with allocators.
2015-10-08 12:49:52 -07:00
bors
e38210b195 Auto merge of #28913 - steveklabnik:rollup, r=steveklabnik
- Successful merges: #28621, #28872, #28893, #28904, #28905, #28908, #28910
- Failed merges: #28906
2015-10-08 19:05:54 +00:00
Cristi Cobzarenco
4b308b44e1 typos: fix a grabbag of typos all over the place 2015-10-08 19:49:31 +01:00
Steve Klabnik
1625c133de Rollup merge of #28910 - frewsxcv:patch-26, r=steveklabnik 2015-10-08 13:54:05 -04:00
Steve Klabnik
17819aa8f3 Rollup merge of #28908 - GuillaumeGomez:patch-2, r=Manishearth
r? @Manishearth
2015-10-08 13:54:05 -04:00
Steve Klabnik
8ca14251c9 Rollup merge of #28905 - tshepang:typo, r=steveklabnik 2015-10-08 13:54:04 -04:00
Steve Klabnik
8600610197 Rollup merge of #28904 - panicbit:trpl-derive, r=steveklabnik 2015-10-08 13:54:04 -04:00
Steve Klabnik
ac541d3206 Rollup merge of #28893 - steveklabnik:gh28687, r=nikomatsakis
Fixes #28687
2015-10-08 13:54:03 -04:00
Steve Klabnik
252c3838df Rollup merge of #28872 - iwillspeak:master, r=Manishearth
Currently the explain command line flag requires full error codes, complete with
the leading zeros and the E at the beginning. This commit changes that,
if you don't supply a full error code then the error number is padded
out to the required size and the E is added to the beginning.

This means that where previously you would need to write E0001, you can
now write 0001, 001, 01 or just 1 to refer to the same error.
2015-10-08 13:54:03 -04:00
Guillaume Gomez
e4cc54ed06 Fix typo in E0101 2015-10-08 19:49:37 +02:00