Commit Graph

57558 Commits

Author SHA1 Message Date
Guillaume Gomez
f45283b93e Rollup merge of #36018 - durka:patch-28, r=steveklabnik
strengthen doc warning about CString::from_raw

Saw unsound code using this function on IRC.
2016-09-24 00:15:43 +02:00
Michael Woerister
6a2666d5b0 ICH: Add ability to test the ICH of exported metadata items. 2016-09-23 17:23:23 -04:00
bors
ee959a8cbe Auto merge of #36525 - jseyfried:load_crates_in_resolve, r=nikomatsakis
Load extern crates in `resolve`

This PR loads `extern crate`s in `resolve`'s `BuildReducedGraphVistor`.

r? @nikomatsakis
2016-09-23 13:40:45 -07:00
Ulrik Sverdrup
e82d13ea4b rustdoc css: Put where in trait listings on a new line
This is about the gray area at the top of a trait's documentation page,
that lists all methods and their signatures. A big trait page like
Iterator is very crowded without this tweak.
2016-09-23 20:31:14 +02:00
Brian Anderson
2e02803c73 Revert "implement From<Vec<char>> and From<&'a [char]> for String"
This reverts commit ac73335f2f.
2016-09-23 17:25:26 +00:00
bors
cb1b1eef8d Auto merge of #36649 - eddyb:selfish-idents, r=pnkfelix
Don't let a type parameter named "Self" unchanged past HIR lowering.

Fixes #36638 by rewriting `Self` type parameters (which are a parse error) to a `gensym("Self")`.

Background: #35605 introduced code across rustc that determines `Self` by its keyword name.
Reverting the sanity checks around that would inadvertently cause confusion between the true `Self` of a `trait` and other type parameters named `Self` (which have caused parse errors already).

I do not like to use `gensym`, and we may do something different here in the future, but this should work.
2016-09-23 09:49:26 -07:00
Felix S. Klock II
3a9b7be10b Added tests and fixed corner case for trailing attributes with no attached binding in generics. 2016-09-23 17:01:04 +02:00
Felix S. Klock II
c242fc3ea3 Generic unit tests for attributes on lifetime/type formals in generics list. 2016-09-23 17:01:04 +02:00
Felix S. Klock II
4c37ad6607 Add attribute support to generic lifetime and type parameters.
I am using `ThinAttributes` rather than a vector for attributes
attached to generics, since I expect almost all lifetime and types
parameters to not carry any attributes.
2016-09-23 17:01:04 +02:00
bors
86a686c4f7 Auto merge of #36335 - mcarton:compiletest, r=GuillaumeGomez
Fix ICE test in compiletest fail-tests

While working on Clippy which uses *compiletest*, I noticed that as long as all expected error are found, *compile-fail* tests will be marked *ok* even if there is an ICE. One function seems to have not been updated with JSON errors because ICEs are now reported like this:
```json
{"message":"../src/librustc/ty/context.rs:161: Attempted to intern `_` which contains inference types/regions in the global type context","code":null,"level":"error: internal compiler error","spans":[],"children":[],"rendered":null}
```
I don't think I can add a test for that.

I guess:
r? @nikomatsakis
2016-09-23 06:17:26 -07:00
Corey Farwell
3b9734437b Minor VecDeque doc examples cleanup. 2016-09-23 09:02:35 -04:00
Jeffrey Seyfried
7b5c59ea65 Load extern crates in resolve. 2016-09-23 06:35:33 +00:00
bors
f2c53ea66b Auto merge of #36631 - frewsxcv:dir-entry-debug, r=sfackler
Implement Debug for DirEntry.

None
2016-09-22 23:12:23 -07:00
Jeffrey Seyfried
2c85733521 Fix indents. 2016-09-23 04:27:08 +00:00
Jeffrey Seyfried
1e1804db18 Cleanup. 2016-09-23 04:27:08 +00:00
Jeffrey Seyfried
167f70a52f Fix fallout in tests. 2016-09-23 04:26:59 +00:00
Jeffrey Seyfried
6c08d03039 Parse paths in item, trait item, and impl item macro invocations. 2016-09-23 04:26:59 +00:00
Jeffrey Seyfried
a0e178db79 Parse paths in statement and pattern macro invocations. 2016-09-23 04:26:56 +00:00
Mikhail Modin
20c10913ff Merge branch 'master' into 35123-map3 2016-09-23 06:52:06 +03:00
bors
533c04dbb3 Auto merge of #36573 - jseyfried:groundwork, r=nrc
resolve: groundwork for building the module graph during expansion

r? @nrc
2016-09-22 19:54:56 -07:00
Brian Anderson
fa5eb54881 rustbuild: Print out all build steps when --verbose 2016-09-23 01:37:31 +00:00
bors
3a5d975fdc Auto merge of #36154 - nrc:proc-macro-init, r=@jseyfried
Adds a `ProcMacro` form of syntax extension

This commit adds syntax extension forms matching the types for procedural macros 2.0 (RFC #1566), these still require the usual syntax extension boiler plate, but this is a first step towards proper implementation and should be useful for macros 1.1 stuff too.

Supports both attribute-like and function-like macros.

Note that RFC #1566 has not been accepted yet, but I think there is consensus that we want to head in vaguely that direction and so this PR will be useful in any case. It is also fairly easy to undo and does not break any existing programs.

This is related to #35957 in that I hope it can be used in the implementation of macros 1.1, however, there is no direct overlap and is more of a complement than a competing proposal. There is still a fair bit of work to do before the two can be combined.

r? @jseyfried

cc @alexcrichton, @cgswords, @eddyb, @aturon
2016-09-22 16:33:41 -07:00
Joe Neeman
902e11dd8f Change error message for intrinsic signature.
Makes it so the signature of the intrinsic in the user's code is
"found," while the signature that rustc knows about is "expected."
2016-09-22 23:58:35 +02:00
Jeffrey Seyfried
173d5b339f Split up DefCollector::root(). 2016-09-22 21:14:05 +00:00
Jeffrey Seyfried
1ee64e44a9 Use Resolver::visit_expansion only with monotonic expansions. 2016-09-22 21:14:03 +00:00
Nicholas Nethercote
cf50f5f965 [breaking-change] Remove TypedArena::with_capacity.
The function is unused by rustc. Also, it doesn't really follow the
usual meaning of a `with_capacity` function because the first chunk
allocation is now delayed until the first `alloc` call.

This change reduces the size of `TypedArena` by one `usize`.
2016-09-23 06:40:22 +10:00
bors
4c04e36f94 Auto merge of #36651 - jonathandturner:rollup, r=jonathandturner
Rollup of 7 pull requests

- Successful merges: #36330, #36423, #36539, #36571, #36589, #36600, #36632
- Failed merges:
2016-09-22 13:11:04 -07:00
Nick Cameron
3863834d9c reviewer comments and rebasing 2016-09-23 07:19:31 +12:00
Jonathan Turner
c1e39380fb Rollup merge of #36632 - CryZe:patch-3, r=sfackler
Fix outdated Doc Comment on BufReader::seek

A long time ago non-panicking `unwrap` methods were renamed to `into_inner` in this Pull Request: https://github.com/rust-lang/rust/pull/19149

Looks like this doc comment was not updated however.
2016-09-22 11:25:02 -07:00
Jonathan Turner
bc7991a54e Rollup merge of #36600 - caipre:sort-by-key-comment-fix, r=apasel422
Minor correction in `sort_by_key` doc comment

The parameter to `sort_by_key` is named `f`, not `key`.
2016-09-22 11:25:02 -07:00
Jonathan Turner
5d4c0edb69 Rollup merge of #36589 - jpadkins:option_docs_safety_wording_fix, r=bluss
fixed the safety header/wording in option.rs

Fixes #36581

screenshot of the rendered documentation: http://imgur.com/14kLVrA

r? @steveklabnik
2016-09-22 11:25:01 -07:00
Jonathan Turner
a86c83f08a Rollup merge of #36571 - kmcallister:gh-29372-rc-docs, r=GuillaumeGomez
Tweak std::rc docs

Fixes #29372.

r? @GuillaumeGomez
2016-09-22 11:25:01 -07:00
Jonathan Turner
3056630d8f Rollup merge of #36539 - mikhail-m1:36530, r=jonathandturner
fix top level attr spans

issue #36530
?r @jonathandturner
2016-09-22 11:25:01 -07:00
Jonathan Turner
b60fc5d16a Rollup merge of #36423 - GuillaumeGomez:eq_impl, r=pnkfelix
Add missing Eq implementations

Part of #36301.
2016-09-22 11:25:01 -07:00
Jonathan Turner
b474c82add Rollup merge of #36330 - aclarry:e0560-update, r=jonathandturner
Updated E0560 to new error format

Added a small bit of code to add a label for E0560.

Also renamed src/test/compile-fail/E560.rs file to E0560.rs (not sure why it was named E560).
Updated all test cases which check this error.

Closes #36199
2016-09-22 11:25:00 -07:00
Corey Farwell
6b697a375e Implement Debug for DirEntry. 2016-09-22 14:08:03 -04:00
Eduard Burtescu
795b6adc9a Don't let a type parameter named "Self" unchanged past HIR lowering. 2016-09-22 20:03:28 +03:00
bors
458f411213 Auto merge of #36261 - parched:soft-float, r=pnkfelix
Fix documentation with 'soft-float' codegen option

This option doesn't cause software FP routines
to be called, it only changes the float ABI.

Additionally, this option is ignored by all targets,
except the ARM eabihf ones.
2016-09-22 09:50:42 -07:00
mcarton
bfa3433283 Fix compile-fail syntax in error file 2016-09-22 18:32:40 +02:00
bors
a09cb57a73 Auto merge of #36618 - jseyfried:crate_root_attr_invoc, r=nrc
macros: allow attribute invocations at the crate root

Fixes #36617.
r? @nrc
2016-09-22 06:29:23 -07:00
Gianni Ciccarelli
a35275c89b #36553 specialisation error 502 is misleading
this commit correct E0502 error text.
See referenced issue for further info
2016-09-22 12:28:46 +02:00
bors
b2627b080a Auto merge of #36592 - nnethercote:TypedArena, r=bluss
Lazily allocate TypedArena's first chunk

Currently `TypedArena` allocates its first chunk, which is usually 4096
bytes, as soon as it is created. If no allocations are ever made from
the arena then this allocation (and the corresponding deallocation) is
wasted effort.

This commit changes `TypedArena` so it doesn't allocate the first chunk
until the first allocation is made.

This change speeds up rustc by a non-trivial amount because rustc uses
`TypedArena` heavily: compilation speed (producing debug builds) on
several of the rustc-benchmarks increases by 1.02--1.06x. The change
should never cause a slow-down because the hot `alloc` function is
unchanged. It does increase the size of `TypedArena` by one `usize`
field, however.

The commit also fixes some out-of-date comments.
2016-09-22 03:13:50 -07:00
Jeffrey Seyfried
272cf4e61d Refactor no_implicit_prelude: Cell<bool> -> no_implicit_prelude: bool. 2016-09-22 07:45:11 +00:00
Jeffrey Seyfried
dc7ed303f7 Refactor out parse_struct_expr. 2016-09-22 07:34:03 +00:00
Jeffrey Seyfried
85bfd82be6 Avoid reconstructing the BuildReducedGraphVisitor. 2016-09-22 07:18:16 +00:00
Jeffrey Seyfried
a344f14caa Refactor out BuildReducedGraphVisitor::visit_trait_item. 2016-09-22 07:17:23 +00:00
Jeffrey Seyfried
9a0e88a339 Refactor away ParentLink. 2016-09-22 07:13:54 +00:00
bors
6ad10844db Auto merge of #36585 - jonathandturner:misc_error_touchups, r=nrc
Add the ability to merge spans to codemap

This PR adds the ability to merge Spans.  To do so, it builds on the Codemap's ability to verify the locations of spans, namely that following can be verified:

* the expn_id of both spans much match
* the lhs span needs to end on the same line the rhs span begins
* the lhs span must start at or before the rhs span

If all of these are met, a new span is returned that is min(lo), max(hi) of the two spans.

This PR also removes an older Span merge, as this new functionality subsumes it.

r? @nrc
2016-09-21 22:40:51 -07:00
bors
1cf592fa40 Auto merge of #36551 - eddyb:meta-games, r=nikomatsakis
Refactor away RBML from rustc_metadata.

RBML and `ty{en,de}code` have had their long-overdue purge. Summary of changes:
* Metadata is now a tree encoded in post-order and with relative backward references pointing to children nodes. With auto-deriving and type safety, this makes maintenance and adding new information to metadata painless and bug-free by default. It's also more compact and cache-friendly (cache misses should be proportional to the depth of the node being accessed, not the number of siblings as in EBML/RBML).
* Metadata sizes have been reduced, for `libcore` it went down 16% (`8.38MB` -> `7.05MB`) and for `libstd` 14% (`3.53MB` -> `3.03MB`), while encoding more or less the same information
* Specialization is used in the bundled `libserialize` (crates.io `rustc_serialize` remains unaffected) to customize the encoding (and more importantly, decoding) of various types, most notably those interned in the `TyCtxt`. Some of this abuses a soundness hole pending a fix (cc @aturon), but when that fix arrives, we'll move to macros 1.1 `#[derive]` and custom `TyCtxt`-aware serialization traits.
* Enumerating children of modules from other crates is now orthogonal to describing those items via `Def` - this is a step towards bridging crate-local HIR and cross-crate metadata
* `CrateNum` has been moved to `rustc` and both it and `NodeId` are now newtypes instead of `u32` aliases, for specializing their decoding. This is `[syntax-breaking]` (cc @Manishearth ).

cc @rust-lang/compiler
2016-09-21 19:17:24 -07:00
bors
4f9812a59a Auto merge of #36496 - pnkfelix:workaround-issue-34427, r=eddyb
Workaround #34427 by using memset of 0 on ARM to set the discriminant.

Workaround #34427 by using memset of 0 on ARM to set the discriminant.
2016-09-21 15:58:39 -07:00