]> git.lizzy.rs Git - rust.git/log
rust.git
7 years agoadd unstable_features to ParseSess
Tim Neumann [Sat, 24 Sep 2016 17:04:07 +0000 (19:04 +0200)]
add unstable_features to ParseSess

7 years agomake emit_feature_err take a ParseSess
Tim Neumann [Sat, 24 Sep 2016 16:42:54 +0000 (18:42 +0200)]
make emit_feature_err take a ParseSess

7 years agoAuto merge of #36151 - camlorn:struct_layout_optimization, r=eddyb
bors [Mon, 26 Sep 2016 01:47:00 +0000 (18:47 -0700)]
Auto merge of #36151 - camlorn:struct_layout_optimization, r=eddyb

refactor to remove trans::adt and make rustc::ty::layout authoritative

I asked on IRC about optimizing struct layout by reordering fields from most-aligned to least-aligned and somehow ended up getting talked into doing this.  The goal here is to make `layout` authoritative and to remove `adt`.  The former has been accomplished by reimplementing `represent_type_uncached` and the latter is in progress.  @eddyb thought I should make the PR now.

My plan is to reserve the actual optimization for a second PR, as this work is useful by itself.

7 years agoIncorporate review comments.
Austin Hicks [Sun, 25 Sep 2016 23:55:43 +0000 (19:55 -0400)]
Incorporate review comments.

7 years agoAuto merge of #36442 - alexcrichton:rustbuild-cross, r=brson
bors [Sun, 25 Sep 2016 22:30:01 +0000 (15:30 -0700)]
Auto merge of #36442 - alexcrichton:rustbuild-cross, r=brson

rustbuild: Nicer error for host builds of targets

If a triple is configured only as a target, not a host, then trying to build
that triple with host artifacts would cause a panic. Fail a little nicer
instead.

Closes #36268

7 years agoAuto merge of #36616 - jseyfried:load_macros_in_resolve, r=nrc
bors [Sun, 25 Sep 2016 19:14:11 +0000 (12:14 -0700)]
Auto merge of #36616 - jseyfried:load_macros_in_resolve, r=nrc

Load macros from `#[macro_use]` extern crates in `resolve`

r? @nrc

7 years agoAuto merge of #36564 - vanjacosic:patch-2, r=GuillaumeGomez
bors [Sun, 25 Sep 2016 15:08:18 +0000 (08:08 -0700)]
Auto merge of #36564 - vanjacosic:patch-2, r=GuillaumeGomez

Docs: Update to "Ownership" section

Found #34865 while looking for easy docs wins I could contribute with.

7 years agoAuto merge of #36713 - TimNN:fix-36708, r=arielb1
bors [Sun, 25 Sep 2016 09:46:18 +0000 (02:46 -0700)]
Auto merge of #36713 - TimNN:fix-36708, r=arielb1

don't unwrap non-local span

Fixes #36708.

7 years agofix 36708
Tim Neumann [Sun, 25 Sep 2016 06:21:51 +0000 (08:21 +0200)]
fix 36708

7 years agoAuto merge of #36709 - Mark-Simulacrum:fix-wsl-tidy, r=Aatch
bors [Sun, 25 Sep 2016 05:20:25 +0000 (22:20 -0700)]
Auto merge of #36709 - Mark-Simulacrum:fix-wsl-tidy, r=Aatch

Skip binary tidy check when on Windows Linux Subsystem

While it's possible that other linux systems will include "Microsoft" in
their /proc/version, this is deemed unlikely, and since this is a tidy
check, will likely be caught by buildbot/travis either way.

Fixes #36706.

7 years agoSkip binary tidy check when on Windows Linux Subsystem
Mark-Simulacrum [Sun, 25 Sep 2016 03:06:32 +0000 (21:06 -0600)]
Skip binary tidy check when on Windows Linux Subsystem

While it's possible that other linux systems will include "Microsoft" in
their /proc/version, this is deemed unlikely, and since this is a tidy
check, will likely be caught by buildbot/travis either way.

7 years agoUpdate codegen/link_section.rs.
Austin Hicks [Sun, 25 Sep 2016 01:56:26 +0000 (21:56 -0400)]
Update codegen/link_section.rs.

7 years agoClean up matches that determine integers for specific alignment requirements
Austin Hicks [Sat, 24 Sep 2016 21:37:24 +0000 (17:37 -0400)]
Clean up matches that determine integers for specific alignment requirements

7 years agoOptimize struct_field_ptr
Austin Hicks [Sat, 24 Sep 2016 20:06:38 +0000 (16:06 -0400)]
Optimize struct_field_ptr

7 years agoCompletely kill `represent_type` and the `adt::Repr` type that goes with it.
Austin Hicks [Mon, 29 Aug 2016 00:44:19 +0000 (20:44 -0400)]
Completely kill `represent_type` and the `adt::Repr` type that goes with it.

7 years agoAuto merge of #36657 - nnethercote:rm-TypedArena-with_capacity, r=eddyb
bors [Sat, 24 Sep 2016 22:17:07 +0000 (15:17 -0700)]
Auto merge of #36657 - nnethercote:rm-TypedArena-with_capacity, r=eddyb

[breaking-change] Remove TypedArena::with_capacity

This is a follow-up to #36592.

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`.

@eddyb: we discussed this on IRC. Would you like to review it?

7 years agoLoad macros from `#[macro_use]` extern crates in `resolve`.
Jeffrey Seyfried [Wed, 21 Sep 2016 06:25:09 +0000 (06:25 +0000)]
Load macros from `#[macro_use]` extern crates in `resolve`.

7 years agoAuto merge of #36639 - pcwalton:const-prop, r=eddyb
bors [Sat, 24 Sep 2016 17:48:42 +0000 (10:48 -0700)]
Auto merge of #36639 - pcwalton:const-prop, r=eddyb

librustc_mir: Propagate constants during copy propagation.

This optimization kicks in a lot when bootstrapping the compiler.

r? @eddyb

7 years agolibrustc_mir: Propagate constants during copy propagation.
Patrick Walton [Wed, 21 Sep 2016 19:17:56 +0000 (12:17 -0700)]
librustc_mir: Propagate constants during copy propagation.

This optimization kicks in a lot when bootstrapping the compiler.

7 years agoAuto merge of #36685 - brson:rev-string-from, r=sfackler
bors [Sat, 24 Sep 2016 09:03:18 +0000 (02:03 -0700)]
Auto merge of #36685 - brson:rev-string-from, r=sfackler

Revert "implement `From<Vec<char>>` and `From<&'a [char]>` for `String`"

This reverts commit ac73335f2f5421c914fa3900567696cc6dc73d8d.

This is a revert of https://github.com/rust-lang/rust/pull/35054, which resulted in at least 7 known regressions, reported [here](https://internals.rust-lang.org/t/regression-report-stable-2016-08-16-vs-beta-2016-09-21/4119) and [here](https://github.com/rust-lang/rust/issues/36352), which will hit stable next week.

I think this breakage was somewhat unanticipated, and we did not realize so many crates were broken until this week, so reverting is the conservative thing to do until we figure out how not to cause so much breakage. I've run crater on the revert and did not find any new breakage from the revert.

Fixes https://github.com/rust-lang/rust/issues/36352

cc @pwoolcoc @rust-lang/libs

7 years agoAuto merge of #36370 - michaelwoerister:incr-comp-metadata-hashes-check, r=nikomatsakis
bors [Sat, 24 Sep 2016 04:14:53 +0000 (21:14 -0700)]
Auto merge of #36370 - michaelwoerister:incr-comp-metadata-hashes-check, r=nikomatsakis

ICH: Add ability to test the ICH of exported metadata items.

Also adds an example test case for ICH testing.

r? @nikomatsakis

7 years agoRefactor `ext::tt::macro_rules::compile` to take a `ParseSess` instead of an `ExtCtxt`.
Jeffrey Seyfried [Tue, 20 Sep 2016 20:29:13 +0000 (20:29 +0000)]
Refactor `ext::tt::macro_rules::compile` to take a `ParseSess` instead of an `ExtCtxt`.

7 years agoAuto merge of #36684 - GuillaumeGomez:rollup, r=GuillaumeGomez
bors [Sat, 24 Sep 2016 00:00:28 +0000 (17:00 -0700)]
Auto merge of #36684 - GuillaumeGomez:rollup, r=GuillaumeGomez

Rollup of 7 pull requests

- Successful merges: #36018, #36498, #36500, #36559, #36566, #36578, #36664
- Failed merges:

7 years agoRollup merge of #36664 - frewsxcv:vec-deque, r=GuillaumeGomez
Guillaume Gomez [Fri, 23 Sep 2016 22:15:46 +0000 (00:15 +0200)]
Rollup merge of #36664 - frewsxcv:vec-deque, r=GuillaumeGomez

Minor `VecDeque` doc examples cleanup.

None

7 years agoRollup merge of #36578 - GuillaumeGomez:fix_typo, r=steveklabnik
Guillaume Gomez [Fri, 23 Sep 2016 22:15:46 +0000 (00:15 +0200)]
Rollup merge of #36578 - GuillaumeGomez:fix_typo, r=steveklabnik

Replace 'e.g.' by 'i.e.'

Fixes #36577.

r? @steveklabnik

7 years agoRollup merge of #36566 - frewsxcv:9837, r=nikomatsakis
Guillaume Gomez [Fri, 23 Sep 2016 22:15:45 +0000 (00:15 +0200)]
Rollup merge of #36566 - frewsxcv:9837, r=nikomatsakis

Add regression test for #9837.

Fixes https://github.com/rust-lang/rust/issues/9837

7 years agoRollup merge of #36559 - grimreaper:eax/fix/r1, r=nikomatsakis
Guillaume Gomez [Fri, 23 Sep 2016 22:15:45 +0000 (00:15 +0200)]
Rollup merge of #36559 - grimreaper:eax/fix/r1, r=nikomatsakis

Fix a variety of minor issues

CSS:
- use integer values for font-size in CSS
- use correct ordering of @import
- "invisible" isn't a tag - presume its a class
- "border-color" defines the complete border

python:
- use "not" instead of == "[]" for python
- prefer triple quoted docstrings
- prefer static functions where possible
- prefer modern style classes where possible
- remove semicolons;

global:
- remove duplicated words words

7 years agoRollup merge of #36500 - orbea:docdir, r=nikomatsakis
Guillaume Gomez [Fri, 23 Sep 2016 22:15:45 +0000 (00:15 +0200)]
Rollup merge of #36500 - orbea:docdir, r=nikomatsakis

This installs documentation not man pages

This fixes the description for docdir in configure, it was my mistake for leaving it as "man pages", oops.

7 years agoRollup merge of #36498 - jonathandturner:macro_std_lib, r=nikomatsakis
Guillaume Gomez [Fri, 23 Sep 2016 22:15:44 +0000 (00:15 +0200)]
Rollup merge of #36498 - jonathandturner:macro_std_lib, r=nikomatsakis

Fix wording for out-of-crate macro error

This fixes the wording of the note for out-of-crate macro errors to fix https://github.com/rust-lang/rust/issues/36469

The previous wording came from older logic in the PR that was replaced without updating the note.

7 years agoRollup merge of #36018 - durka:patch-28, r=steveklabnik
Guillaume Gomez [Fri, 23 Sep 2016 22:15:43 +0000 (00:15 +0200)]
Rollup merge of #36018 - durka:patch-28, r=steveklabnik

strengthen doc warning about CString::from_raw

Saw unsound code using this function on IRC.

7 years agoICH: Add ability to test the ICH of exported metadata items.
Michael Woerister [Tue, 30 Aug 2016 20:49:54 +0000 (16:49 -0400)]
ICH: Add ability to test the ICH of exported metadata items.

7 years agoAuto merge of #36525 - jseyfried:load_crates_in_resolve, r=nikomatsakis
bors [Fri, 23 Sep 2016 20:40:45 +0000 (13:40 -0700)]
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

7 years agoRevert "implement `From<Vec<char>>` and `From<&'a [char]>` for `String`"
Brian Anderson [Fri, 23 Sep 2016 17:25:26 +0000 (17:25 +0000)]
Revert "implement `From<Vec<char>>` and `From<&'a [char]>` for `String`"

This reverts commit ac73335f2f5421c914fa3900567696cc6dc73d8d.

7 years agoAuto merge of #36649 - eddyb:selfish-idents, r=pnkfelix
bors [Fri, 23 Sep 2016 16:49:26 +0000 (09:49 -0700)]
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.

7 years agoAuto merge of #36335 - mcarton:compiletest, r=GuillaumeGomez
bors [Fri, 23 Sep 2016 13:17:26 +0000 (06:17 -0700)]
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

7 years agoMinor `VecDeque` doc examples cleanup.
Corey Farwell [Fri, 23 Sep 2016 02:05:41 +0000 (22:05 -0400)]
Minor `VecDeque` doc examples cleanup.

7 years agoLoad extern crates in `resolve`.
Jeffrey Seyfried [Fri, 16 Sep 2016 02:52:09 +0000 (02:52 +0000)]
Load extern crates in `resolve`.

7 years agoAuto merge of #36631 - frewsxcv:dir-entry-debug, r=sfackler
bors [Fri, 23 Sep 2016 06:12:23 +0000 (23:12 -0700)]
Auto merge of #36631 - frewsxcv:dir-entry-debug, r=sfackler

Implement Debug for DirEntry.

None

7 years agoAuto merge of #36573 - jseyfried:groundwork, r=nrc
bors [Fri, 23 Sep 2016 02:54:56 +0000 (19:54 -0700)]
Auto merge of #36573 - jseyfried:groundwork, r=nrc

resolve: groundwork for building the module graph during expansion

r? @nrc

7 years agoAuto merge of #36154 - nrc:proc-macro-init, r=@jseyfried
bors [Thu, 22 Sep 2016 23:33:41 +0000 (16:33 -0700)]
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

7 years agoSplit up `DefCollector::root()`.
Jeffrey Seyfried [Tue, 20 Sep 2016 00:42:47 +0000 (00:42 +0000)]
Split up `DefCollector::root()`.

7 years agoUse `Resolver::visit_expansion` only with monotonic expansions.
Jeffrey Seyfried [Mon, 19 Sep 2016 07:27:20 +0000 (07:27 +0000)]
Use `Resolver::visit_expansion` only with monotonic expansions.

7 years ago[breaking-change] Remove TypedArena::with_capacity.
Nicholas Nethercote [Wed, 21 Sep 2016 23:47:14 +0000 (09:47 +1000)]
[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`.

7 years agoAuto merge of #36651 - jonathandturner:rollup, r=jonathandturner
bors [Thu, 22 Sep 2016 20:11:04 +0000 (13:11 -0700)]
Auto merge of #36651 - jonathandturner:rollup, r=jonathandturner

Rollup of 7 pull requests

- Successful merges: #36330, #36423, #36539, #36571, #36589, #36600, #36632
- Failed merges:

7 years agoreviewer comments and rebasing
Nick Cameron [Tue, 6 Sep 2016 05:57:58 +0000 (17:57 +1200)]
reviewer comments and rebasing

7 years agoRollup merge of #36632 - CryZe:patch-3, r=sfackler
Jonathan Turner [Thu, 22 Sep 2016 18:25:02 +0000 (11:25 -0700)]
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.

7 years agoRollup merge of #36600 - caipre:sort-by-key-comment-fix, r=apasel422
Jonathan Turner [Thu, 22 Sep 2016 18:25:02 +0000 (11:25 -0700)]
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`.

7 years agoRollup merge of #36589 - jpadkins:option_docs_safety_wording_fix, r=bluss
Jonathan Turner [Thu, 22 Sep 2016 18:25:01 +0000 (11:25 -0700)]
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

7 years agoRollup merge of #36571 - kmcallister:gh-29372-rc-docs, r=GuillaumeGomez
Jonathan Turner [Thu, 22 Sep 2016 18:25:01 +0000 (11:25 -0700)]
Rollup merge of #36571 - kmcallister:gh-29372-rc-docs, r=GuillaumeGomez

Tweak std::rc docs

Fixes #29372.

r? @GuillaumeGomez

7 years agoRollup merge of #36539 - mikhail-m1:36530, r=jonathandturner
Jonathan Turner [Thu, 22 Sep 2016 18:25:01 +0000 (11:25 -0700)]
Rollup merge of #36539 - mikhail-m1:36530, r=jonathandturner

fix top level attr spans

issue #36530
?r @jonathandturner

7 years agoRollup merge of #36423 - GuillaumeGomez:eq_impl, r=pnkfelix
Jonathan Turner [Thu, 22 Sep 2016 18:25:01 +0000 (11:25 -0700)]
Rollup merge of #36423 - GuillaumeGomez:eq_impl, r=pnkfelix

Add missing Eq implementations

Part of #36301.

7 years agoRollup merge of #36330 - aclarry:e0560-update, r=jonathandturner
Jonathan Turner [Thu, 22 Sep 2016 18:25:00 +0000 (11:25 -0700)]
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

7 years agoImplement Debug for DirEntry.
Corey Farwell [Wed, 21 Sep 2016 18:57:04 +0000 (14:57 -0400)]
Implement Debug for DirEntry.

7 years agoDon't let a type parameter named "Self" unchanged past HIR lowering.
Eduard Burtescu [Thu, 22 Sep 2016 17:03:28 +0000 (20:03 +0300)]
Don't let a type parameter named "Self" unchanged past HIR lowering.

7 years agoAuto merge of #36261 - parched:soft-float, r=pnkfelix
bors [Thu, 22 Sep 2016 16:50:42 +0000 (09:50 -0700)]
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.

7 years agoFix compile-fail syntax in error file
mcarton [Thu, 22 Sep 2016 16:32:40 +0000 (18:32 +0200)]
Fix compile-fail syntax in error file

7 years agoAuto merge of #36618 - jseyfried:crate_root_attr_invoc, r=nrc
bors [Thu, 22 Sep 2016 13:29:23 +0000 (06:29 -0700)]
Auto merge of #36618 - jseyfried:crate_root_attr_invoc, r=nrc

macros: allow attribute invocations at the crate root

Fixes #36617.
r? @nrc

7 years agoAuto merge of #36592 - nnethercote:TypedArena, r=bluss
bors [Thu, 22 Sep 2016 10:13:50 +0000 (03:13 -0700)]
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.

7 years agoRefactor `no_implicit_prelude: Cell<bool>` -> `no_implicit_prelude: bool`.
Jeffrey Seyfried [Mon, 19 Sep 2016 05:25:17 +0000 (05:25 +0000)]
Refactor `no_implicit_prelude: Cell<bool>` -> `no_implicit_prelude: bool`.

7 years agoAvoid reconstructing the `BuildReducedGraphVisitor`.
Jeffrey Seyfried [Fri, 16 Sep 2016 22:21:46 +0000 (22:21 +0000)]
Avoid reconstructing the `BuildReducedGraphVisitor`.

7 years agoRefactor out `BuildReducedGraphVisitor::visit_trait_item`.
Jeffrey Seyfried [Wed, 14 Sep 2016 23:39:13 +0000 (23:39 +0000)]
Refactor out `BuildReducedGraphVisitor::visit_trait_item`.

7 years agoRefactor away `ParentLink`.
Jeffrey Seyfried [Sun, 18 Sep 2016 09:45:06 +0000 (09:45 +0000)]
Refactor away `ParentLink`.

7 years agoAuto merge of #36585 - jonathandturner:misc_error_touchups, r=nrc
bors [Thu, 22 Sep 2016 05:40:51 +0000 (22:40 -0700)]
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

7 years agoAuto merge of #36551 - eddyb:meta-games, r=nikomatsakis
bors [Thu, 22 Sep 2016 02:17:24 +0000 (19:17 -0700)]
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

7 years agoAuto merge of #36496 - pnkfelix:workaround-issue-34427, r=eddyb
bors [Wed, 21 Sep 2016 22:58:39 +0000 (15:58 -0700)]
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.

7 years agoAdd regression test.
Jeffrey Seyfried [Wed, 21 Sep 2016 09:23:17 +0000 (09:23 +0000)]
Add regression test.

7 years agoAdds a `ProcMacro` form of syntax extension
Nick Cameron [Mon, 29 Aug 2016 04:16:43 +0000 (16:16 +1200)]
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.

7 years agoFix outdated Doc Comment on BufReader::seek
Christopher Serr [Wed, 21 Sep 2016 19:11:53 +0000 (21:11 +0200)]
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.

7 years agoTweak std::rc docs
Keegan McAllister [Sat, 17 Sep 2016 18:22:04 +0000 (11:22 -0700)]
Tweak std::rc docs

Fixes #29372.

7 years agoAuto merge of #35074 - ashleygwilliams:assert_ne, r=steveklabnik
bors [Wed, 21 Sep 2016 15:12:37 +0000 (08:12 -0700)]
Auto merge of #35074 - ashleygwilliams:assert_ne, r=steveklabnik

add debug_assert_ne + assert_ne

~~✨ work in progress, please do not merge ✨~~

fixes #35073

7 years agoadd assert_ne and debug_assert_ne macros
Ashley Williams [Wed, 27 Jul 2016 17:47:19 +0000 (10:47 -0700)]
add assert_ne and debug_assert_ne macros

7 years agoAllow attribute macro invocations at the crate root.
Jeffrey Seyfried [Wed, 21 Sep 2016 09:20:42 +0000 (09:20 +0000)]
Allow attribute macro invocations at the crate root.

7 years agoAuto merge of #36524 - michaelwoerister:trans-inline-only-on-demand, r=nikomatsakis
bors [Wed, 21 Sep 2016 08:33:37 +0000 (01:33 -0700)]
Auto merge of #36524 - michaelwoerister:trans-inline-only-on-demand, r=nikomatsakis

trans: Only instantiate #[inline] functions in codegen units referencing them

This PR changes how `#[inline]` functions are translated. Before, there was one "master instance" of the function with `external` linkage and a number of on-demand instances with `available_externally` linkage in each codegen unit that referenced the function. This had two downsides:

* Public functions marked with `#[inline]` would be present in machine code of libraries unnecessarily (see #36280 for an example)
* LLVM would crash on `i686-pc-windows-msvc` due to what I suspect to be a bug in LLVM's Win32 exception handling code, because it doesn't like `available_externally` there (#36309).

This PR changes the behavior, so that there is no master instance and only on-demand instances with `internal` linkage. The downside of this is potential code-bloat if LLVM does not completely inline away the `internal` instances because then there'd be N instances of the function instead of 1. However, this can only become a problem when using more than one codegen unit per crate.

cc @rust-lang/compiler

7 years agoCheck for overlapping and simplify unit test
Jonathan Turner [Tue, 20 Sep 2016 22:39:05 +0000 (15:39 -0700)]
Check for overlapping and simplify unit test

7 years agoUpdate E0560 to include label
aclarry [Fri, 16 Sep 2016 04:10:32 +0000 (00:10 -0400)]
Update E0560 to include label

7 years agorustc_trans: don't do on-demand drop glue instantiation.
Eduard Burtescu [Mon, 19 Sep 2016 01:26:38 +0000 (04:26 +0300)]
rustc_trans: don't do on-demand drop glue instantiation.

7 years agorustc: allow less and handle fn pointers in the type hashing algorithm.
Eduard Burtescu [Mon, 19 Sep 2016 09:37:12 +0000 (12:37 +0300)]
rustc: allow less and handle fn pointers in the type hashing algorithm.

7 years agorustc_trans: simplify vtable and symbol handling.
Eduard Burtescu [Mon, 19 Sep 2016 09:47:47 +0000 (12:47 +0300)]
rustc_trans: simplify vtable and symbol handling.

7 years agorustc_resolve: bring back "struct called like a function" cross-crate.
Eduard Burtescu [Mon, 19 Sep 2016 00:45:38 +0000 (03:45 +0300)]
rustc_resolve: bring back "struct called like a function" cross-crate.

7 years agorustc_metadata: don't die with --test because CFG_VERSION is missing.
Eduard Burtescu [Sun, 18 Sep 2016 11:05:49 +0000 (14:05 +0300)]
rustc_metadata: don't die with --test because CFG_VERSION is missing.

7 years agorustc: don't hash the --extern crate name, but the original one, in DefPath.
Eduard Burtescu [Sun, 18 Sep 2016 08:12:29 +0000 (11:12 +0300)]
rustc: don't hash the --extern crate name, but the original one, in DefPath.

7 years agoserialize: allow specifying the default behavior for specializations.
Eduard Burtescu [Sat, 17 Sep 2016 20:31:03 +0000 (23:31 +0300)]
serialize: allow specifying the default behavior for specializations.

7 years agorustc: don't recurse through nested items in decoded HIR fragments.
Eduard Burtescu [Sat, 17 Sep 2016 16:06:21 +0000 (19:06 +0300)]
rustc: don't recurse through nested items in decoded HIR fragments.

7 years agorustc_metadata: fix for the new `?` ambiguity around collect.
Eduard Burtescu [Sat, 17 Sep 2016 11:25:19 +0000 (14:25 +0300)]
rustc_metadata: fix for the new `?` ambiguity around collect.

7 years agorustc_metadata: move opt_item_name to TyCtxt::item_name.
Eduard Burtescu [Sat, 17 Sep 2016 10:34:55 +0000 (13:34 +0300)]
rustc_metadata: move opt_item_name to TyCtxt::item_name.

7 years agorustc_metadata: reduce Lazy{,Seq} overhead by using a relative encoding.
Eduard Burtescu [Sat, 17 Sep 2016 07:33:47 +0000 (10:33 +0300)]
rustc_metadata: reduce Lazy{,Seq} overhead by using a relative encoding.

7 years agorustc_metadata: replace RBML with a simple and type-safe scheme.
Eduard Burtescu [Fri, 16 Sep 2016 14:25:54 +0000 (17:25 +0300)]
rustc_metadata: replace RBML with a simple and type-safe scheme.

7 years agorustc_metadata: split the Def description of a DefId from item_children.
Eduard Burtescu [Thu, 15 Sep 2016 08:05:45 +0000 (11:05 +0300)]
rustc_metadata: split the Def description of a DefId from item_children.

7 years agorustc_metadata: move all encoding/decoding helpers to methods.
Eduard Burtescu [Thu, 15 Sep 2016 08:04:00 +0000 (11:04 +0300)]
rustc_metadata: move all encoding/decoding helpers to methods.

7 years agorustc_metadata: use the shorthand encoding for predicates also.
Eduard Burtescu [Thu, 8 Sep 2016 18:36:22 +0000 (21:36 +0300)]
rustc_metadata: use the shorthand encoding for predicates also.

7 years agorustc_metadata: store dense indexes in little-endian instead of big.
Eduard Burtescu [Thu, 8 Sep 2016 16:54:29 +0000 (19:54 +0300)]
rustc_metadata: store dense indexes in little-endian instead of big.

7 years agorustc_metadata: group information into less tags.
Eduard Burtescu [Thu, 8 Sep 2016 16:05:50 +0000 (19:05 +0300)]
rustc_metadata: group information into less tags.

7 years agorustc_metadata: remove all unnecessary tables from astencode.
Eduard Burtescu [Mon, 5 Sep 2016 10:38:26 +0000 (13:38 +0300)]
rustc_metadata: remove all unnecessary tables from astencode.

7 years agorustc_metadata: group the tags into root tags and item tags.
Eduard Burtescu [Mon, 5 Sep 2016 09:18:45 +0000 (12:18 +0300)]
rustc_metadata: group the tags into root tags and item tags.

7 years agorustc: remove ImplOrTraitItemId and TraitDef's associated_type_names.
Eduard Burtescu [Mon, 5 Sep 2016 07:54:38 +0000 (10:54 +0300)]
rustc: remove ImplOrTraitItemId and TraitDef's associated_type_names.

7 years agorustc_metadata: move more RBML tags to auto-serialization.
Eduard Burtescu [Mon, 19 Sep 2016 20:49:01 +0000 (23:49 +0300)]
rustc_metadata: move more RBML tags to auto-serialization.

7 years agorustc_metadata: remove ty{en,de}code and move to auto-derived serialization.
Eduard Burtescu [Fri, 2 Sep 2016 08:08:16 +0000 (11:08 +0300)]
rustc_metadata: remove ty{en,de}code and move to auto-derived serialization.

7 years agorustc_metadata: side-step ty{en,de}code for everything but Ty.
Eduard Burtescu [Thu, 1 Sep 2016 21:49:29 +0000 (00:49 +0300)]
rustc_metadata: side-step ty{en,de}code for everything but Ty.

7 years agoRemove librbml and the RBML-tagged auto-encoder/decoder.
Eduard Burtescu [Thu, 1 Sep 2016 13:55:33 +0000 (16:55 +0300)]
Remove librbml and the RBML-tagged auto-encoder/decoder.

7 years agorustc_trans: use the TypeId hashing mechanism instead of metadata.
Eduard Burtescu [Thu, 1 Sep 2016 08:04:21 +0000 (11:04 +0300)]
rustc_trans: use the TypeId hashing mechanism instead of metadata.