Commit Graph

61980 Commits

Author SHA1 Message Date
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
Corey Farwell
15cd43b4aa Rollup merge of #40057 - 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 #40056 - 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 #40047 - topecongiro:master, r=est31
Add compile fail test for unboxed_closures feature

Hello, this is my first contribution to rust.
Issue #39059.
2017-02-28 08:33:02 -05:00
Corey Farwell
5be0d9ff04 Rollup merge of #40033 - 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 #39977 - 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
bors
5872a8d78b Auto merge of #40135 - alexcrichton:split-android, r=aturon
travis: Split Android into dist/test images

PRs can't land againt beta right now because the android bot is filling up on
disk space. I don't really know what's going on but the android bot is the
longest one to run anyway so it'll benefit from being split up regardless.
2017-02-28 10:00:31 +00:00
Josef Brandl
344ad9d8fc Structs doc: Change "pointers" to "references" 2017-02-28 10:58:13 +01:00
bors
e1cb9ba221 Auto merge of #40008 - eddyb:lazy-12, r=nikomatsakis
[12/12] On-demand type-checking, const-evaluation, MIR building & const-qualification.

_This is the last of a series ([prev](https://github.com/rust-lang/rust/pull/38813)) of patches designed to rework rustc into an out-of-order on-demand pipeline model for both better feature support (e.g. [MIR-based](https://github.com/solson/miri) early constant evaluation) and incremental execution of compiler passes (e.g. type-checking), with beneficial consequences to IDE support as well.
If any motivation is unclear, please ask for additional PR description clarifications or code comments._

<hr>

As this contains all of the changes that didn't fit neatly into other PRs, I'll be elaborating a bit:

### User-facing changes
* when determining whether an `impl Trait` type implements an auto-trait (e.g. `Send` or `Sync`), the function the `impl Trait` came from has to be inferred and type-checking, disallowing cycles
  * this results from not having an obvious place to put the "deferred obligation" in on-demand atm
  * while we could model side-effects like that and "post-processing passes" better, it's still more limiting than being able to know the result in the original function (e.g. specialization) *and* there are serious problems around region-checking (if a `Send` impl required `'static`, it wasn't enforced)
* early const-eval requires type-checking and const-qualification to be performed first, which means:
  * you get the intended errors before (if any) constant evaluation error that is simply fallout
  * associated consts should always work now, and `const fn` type parameters are properly tracked
    * don't get too excited, array lengths still can't depend on type parameters
* #38864 works as intended now, with `Self` being allowed in `impl` bounds
* #32205 is largely improved, with associated types being limited to "exact match" `impl`s (as opposed to traversing the specialization graph to resolve unspecified type parameters to their defaults in another `impl` or in the `trait`) *while* checking for overlaps building the specialization graph for that trait - once all the trait impls' have been checked for coherence (including ahead-of-time/on-demand), it's uniform
* [crater report](https://gist.github.com/eddyb/bbb869072468c7e08d6d808e75938051) looks clean (aside from `clippy` which broke due to `rustc` internal changes)

### Compiler-internal changes
* `ty::Generics`
  * no longer contains the actual type parameter defaults, instead they're associated with the type parameter's `DefId`, like associated types in a trait definition
    * this allows computing `ty::Generics` as a leaf (reading only its own HIR)
  * holds a mapping from `DefIndex` of type parameters to their indices
* `ty::AdtDef`
  * only tracks `#[repr(simd)]` in its `ReprOptions` `repr` field
  * doesn't contain `enum` discriminant values, but instead each variant either refers to either an explicit value for its discriminant, or the distance from the last explicit discriminant, if any
    * the `.discriminants(tcx)` method produces an iterator of `ConstInt` values, looking up explicit discriminants in a separate map, if necessary
    * this allows computing `ty::AdtDef` as a leaf (reading only its own HIR)
* Small note: the two above (`Generics`, `AdtDef`), `TraitDef` and `AssociatedItem` should probably end up as part of the HIR, eventually, as they're trivially constructed from it
* `ty::FnSig`
  * now also holds ABI and unsafety, alongside argument types, return type and C variadicity
  * `&ty::BareFnTy` and `ty::ClosureTy` have been replaced with `PolyFnSig = Binder<FnSig>`
    * `BareFnTy` was interned and `ClosureTy` was treated as non-trivial to `Clone` because they had a `PolyFnSig` and so used to contain a `Vec<Ty>` (now `&[Ty]`)
* `ty::maps`
  * all the `DepTrackingMap`s have been grouped in a structure available at `tcx.maps`
  * when creating the `tcx`, a set of `Providers` (one `fn` pointer per map) is required for the local crate, and one for all other crates (i.e. metadata loading), `librustc_driver` plugging the various crates (e.g. `librustc_metadata`, `librustc_typeck`, `librustc_mir`) into it
  * when a map is queried and the value is missing, the appropriate `fn` pointer from the `Providers` of that crate is called with the `TyCtxt` and the key being queried, to produce the value on-demand
* `rustc_const_eval`
  * demands both `typeck_tables` and `mir_const_qualif` (in preparation for miri)
  * tracks `Substs` in `ConstVal::Function` for `const fn` calls
  * returns `TypeckError` if type-checking has failed (or cases that can only be reached if it had)
    * this error kind is never reported, resulting in less noisy/redundant diagnostics
  * fixes #39548 (testcase by @larsluthman, taken from #39812, which this supersedes)
* on-demand has so far been hooked up to:
  * `rustc_metadata::cstore_impl`: `ty`, `generics`, `predicates`, `super_predicates`, `trait_def`, `adt_def`, `variances`, `associated_item_def_ids`, `associated_item`, `impl_trait_ref`, `custom_coerce_unsized_kind`, `mir`, `mir_const_qualif`, `typeck_tables`, `closure_kind`, `closure_type`
  * `rustc_typeck::collect`: `ty`, `generics`, `predicates`, `super_predicates`, `type_param_predicates`, `trait_def`, `adt_def`, `impl_trait_ref`
  * `rustc_typeck::coherence`: `coherent_trait`, `coherent_inherent_impls`
  * `rustc_typeck::check`: `typeck_tables`, `closure_type`, `closure_kind`
  * `rustc_mir::mir_map`: `mir`
  * `rustc_mir::transform::qualify_consts`: `mir_const_qualif`
2017-02-28 07:59:25 +00:00
Eduard Burtescu
f702b20dfd rustc_save_analysis: don't pollute the codemap with fake files. 2017-02-28 08:30:07 +02:00
Alex Crichton
500076e141 travis: Split Android into dist/test images
PRs can't land againt beta right now because the android bot is filling up on
disk space. I don't really know what's going on but the android bot is the
longest one to run anyway so it'll benefit from being split up regardless.
2017-02-27 21:20:23 -08:00