Commit Graph

58182 Commits

Author SHA1 Message Date
Nicholas Nethercote
3fd90d8aa5 Use SmallVector for TtReader::stack.
This avoids 800,000 heap allocations when compiling html5ever. It
requires tweaking `SmallVector` a little.
2016-10-25 11:48:25 +11:00
Nicholas Nethercote
0a16a11c39 Use SmallVector for the stack in macro_parser::parse.
This avoids 800,000 heap allocations when compiling html5ever.
2016-10-25 11:48:20 +11:00
Taylor Cramer
ab6119a38f Fix coercin -> coercion typo 2016-10-24 17:33:41 -07:00
Taylor Cramer
4bb6d4e740 rustc_typeck: Allow reification from fn item to unsafe ptr 2016-10-24 17:05:58 -07:00
Raph Levien
c4651dba5f Support for aarch64 architecture on Fuchsia
This patch adds support for the aarch64-unknown-fuchsia target. Also
updates src/liblibc submodule to include required libc change.
2016-10-24 16:58:35 -07:00
Raph Levien
592d7bfb3a Add support for kernel randomness for Fuchsia
Wire up cprng syscall as provider for rand::os::OsRng on Fuchsia.
2016-10-24 16:48:45 -07:00
bors
7a208648da Auto merge of #37382 - jonathandturner:rollup, r=jonathandturner
Rollup of 7 pull requests

- Successful merges: #37228, #37304, #37324, #37328, #37336, #37349, #37372
- Failed merges:
2016-10-24 16:47:38 -07:00
Jonathan Turner
e948cf17bc Rollup merge of #37372 - vtduncan:pathbuf-docs-link, r=steveklabnik
Link to PathBuf from the Path docs

I got stuck trying to use `Path` when `PathBuf` was what I needed. Hopefully this makes `PathBuf` and the module docs a bit easier to find for others.

r? @steveklabnik
2016-10-24 15:41:29 -07:00
Jonathan Turner
59b7ea4c59 Rollup merge of #37349 - srinivasreddy:meta_1, r=nikomatsakis
rustfmt on metadata folder
2016-10-24 15:41:29 -07:00
Jonathan Turner
691ab948ce Rollup merge of #37336 - michaelwoerister:debuginfo-type-ids, r=eddyb
debuginfo: Use TypeIdHasher for generating global debuginfo type IDs.

The only requirement for debuginfo type IDs is that they are globally unique. The `TypeIdHasher` (which is used for `std::intrinsic::type_id()` provides that, so we can get rid of some redundancy by re-using it for debuginfo. Values produced by the `TypeIdHasher` are also more stable than the current `UniqueTypeId` generation algorithm produces -- these incorporate the `NodeId`s, which is not good for incremental compilation.

@alexcrichton @eddyb : Could you take a look at the endianess adaptations that I made to the `TypeIdHasher`?

Also, are we sure that a 64 bit hash is wide enough for something that is supposed to be globally unique? For debuginfo I'm using 160 bits to make sure that we don't run into conflicts there.
2016-10-24 15:41:29 -07:00
Jonathan Turner
e7da61975f Rollup merge of #37328 - michaelwoerister:stable-local-symbol-names, r=nagisa
trans: Make names of internal symbols independent of CGU translation order

Every codegen unit gets its own local counter for generating new symbol names. This makes bitcode and object files reproducible at the binary level even when incremental compilation is used.

The PR also solves a rare ICE resulting from a naming conflict between a user defined name and a generated one. E.g. try compiling the following program with 1.12.1 stable:
```rust

pub fn str7233() -> &'static str { "foo" }
```
This results in:
> error: internal compiler error: ../src/librustc_trans/common.rs:979: symbol `str7233` is already defined

Running into this is not very likely but it's also easily avoidable.
2016-10-24 15:41:29 -07:00
Jonathan Turner
050499c407 Rollup merge of #37324 - GuillaumeGomez:trait_error_message, r=jonathandturner
Improve E0277 help message

Fixes #37319.

r? @jonathandturner
2016-10-24 15:41:29 -07:00
Jonathan Turner
855f3e740c Rollup merge of #37304 - GuillaumeGomez:collections_url, r=frewsxcv
Add missing urls in collections module

r? @steveklabnik
2016-10-24 15:41:28 -07:00
Jonathan Turner
91c7a8270b Rollup merge of #37228 - loggerhead:patch-1, r=steveklabnik
Fix a error of 'book/deref-coercions.html'

The original sentence is:

> This example has two conversions: `Rc<String>` to `String` and then `String` to `&str`.

But it should be

> This example has two conversions: `Rc<String>` to `String` and then `String` to `str`.

or

> This example has two conversions: `&Rc<String>` to `&String` and then `&String` to `&str`.

I think the latter is more clearly.

r? @steveklabnik
2016-10-24 15:41:28 -07:00
Tim Neumann
db032578a4 add new test case 2016-10-24 23:11:27 +02:00
bors
3caf63cc00 Auto merge of #37313 - raphlinus:fuchsia, r=alexcrichton
Add Fuchsia support

Adds support for the x86_64-unknown-fuchsia target, which covers the
Fuchsia operating system.
2016-10-24 13:31:29 -07:00
Tim Neumann
d22f706150 adapt existing tests 2016-10-24 20:55:56 +02:00
Tim Neumann
f1695238ca disallow unsized enums 2016-10-24 20:07:14 +02:00
bors
7bd2427307 Auto merge of #37365 - alexcrichton:fix-nightlies, r=brson
Try to fix the nightlies

Touching up a few pieces after  the fix for #37280 landed.
2016-10-24 08:46:28 -07:00
Michael Woerister
992203b976 Adapt rmake-test to new naming scheme for internal symbols. 2016-10-24 11:07:45 -04:00
Michael Woerister
025b27d6c8 debuginfo: Erase regions when creating debuginfo for statics. 2016-10-24 10:29:16 -04:00
Tim Neumann
9eb0fd98c6 check target abi support 2016-10-24 15:59:53 +02:00
Duncan
27dbfffc71 Link to PathBuf from the Path docs 2016-10-24 16:34:37 +13:00
bors
ac468b67bf Auto merge of #37322 - nnethercote:CombineFields-instantiate, r=eddyb
Use `SmallVector` in `CombineFields::instantiate`.

This avoids 4% of malloc calls when compiling
rustc-benchmarks/issue-32278-big-array-of-strings, and 1--2% for other
benchmarks. A small win, but an easy one.
2016-10-23 20:10:16 -07:00
Nicholas Nethercote
9270a9217a Use SmallVector in CombineFields::instantiate.
This avoids 4% of malloc calls when compiling
rustc-benchmarks/issue-32278-big-array-of-strings, and 1--2% for other
benchmarks. A small win, but an easy one.
2016-10-24 14:08:06 +11:00
Jeffrey Seyfried
5e8951d331 Clean up CrateLoader::process_item. 2016-10-24 00:51:11 +00:00
Jeffrey Seyfried
9c514a1cc1 Refactor away CrateLoader::load_macros. 2016-10-24 00:45:12 +00:00
Jeffrey Seyfried
4968600740 Refactor away metadata::creader::Macros. 2016-10-24 00:45:04 +00:00
Jeffrey Seyfried
53de24bbd1 Refactor away fields MacroDef::{use_locally, export}. 2016-10-24 00:43:19 +00:00
Jeffrey Seyfried
e4baeaa30d Import macros in resolve instead of in metadata::macro_import. 2016-10-24 00:43:12 +00:00
Jeffrey Seyfried
4a93648689 Support use *; and use ::*;. 2016-10-23 22:02:39 +00:00
Mikhail Modin
585f835b8e Make error E0221 more helpful 2016-10-23 21:53:31 +03:00
Alex Crichton
f96a4cca81 configure: Disable debuginfo lines on MinGW
Looks like these are causing assertions on the bots, let's disable them for now
(#37364).
2016-10-23 10:25:01 -07:00
Alex Crichton
174838f7f9 mk: Filter debuginfo=1 from test flags
Fixes tests with `--enable-debuginfo-lines`.
2016-10-23 10:20:48 -07:00
bors
1e5dab1da0 Auto merge of #37358 - typelist:select-fix, r=eddyb
Fix typo that resulted in comparison-to-self

This line was introduced in commit 843db01bd9, rebased from eddyb's c5f6f84d59b853b6a3485380721b71b479ece337.

I don't know whether this fixes anything in practice, but it seems like the changed version was what was intended originally.

r? @eddyb
2016-10-23 08:23:22 -07:00
bors
1bc7f8f49f Auto merge of #37347 - srinivasreddy:llvm, r=eddyb
run rustfmt on librustc_llvm folder
2016-10-23 05:17:01 -07:00
bors
87af2324bb Auto merge of #37325 - newpavlov:master, r=frewsxcv
libcore documentation for builtin macros

Fixes: #36272

Additionally I've edited docstring for `include!` a bit. (related PR #36404)

Unfortunately it seems there is no sane way to reexport empty macros definitions for their docstrings. To avoid copying the whole documentation for builtin macros I've only copied description and added links to `std` macro pages.
2016-10-23 02:10:28 -07:00
bors
40f79ba8c9 Auto merge of #37327 - aidanhs:aphs-bytes-iter-doc, r=alexcrichton
`as_bytes` is not the iterator on String, `bytes` is

r? @steveklabnik
2016-10-22 23:02:24 -07:00
Srinivas Reddy Thatiparthy
cac3e5a935
Run rustfmt on metadata folder - (1/2) 2016-10-23 08:37:50 +05:30
bors
febfe7683b Auto merge of #37326 - SimonSapin:from-cow, r=alexcrichton
Implement `From<Cow<str>> for String` and `From<Cow<[T]>> for Vec<T>`.

Motivation: the `selectors` crate is generic over a string type, in order to support all of `String`,  `string_cache::Atom`, and `gecko_string_cache::Atom`. Multiple trait bounds are used for the various operations done with these strings. One of these operations is creating a string (as efficiently as possible, re-using an existing memory allocation if possible) from `Cow<str>`.

The `std::convert::From` trait seems natural for this, but the relevant implementation was missing before this PR. To work around this I’ve added a `FromCowStr` trait in `selectors`, but with trait coherence that means one of `selectors` or `string_cache` needs to depend on the other to implement this trait. Using a trait from `std` would solve this.

The `Vec<T>` implementation is just added for consistency. I also tried a more general `impl<'a, O, B: ?Sized + ToOwned<Owned=O>> From<Cow<'a, B>> for O`, but (the compiler thinks?) it conflicts with `From<T> for T` the impl (after moving all of `collections::borrow` into `core::borrow` to work around trait coherence).
2016-10-22 19:47:05 -07:00
Jeffrey Seyfried
dcdab2df67 Fix label scopes. 2016-10-22 23:37:54 +00:00
bors
4845adde36 Auto merge of #37301 - jseyfried:improve_metadata_modules, r=eddyb
metadata: improve some confusing type and module names

r? @eddyb
2016-10-22 16:26:54 -07:00
Johannes Muenzel
f9cb7dfc0c Fix typo that resulted in comparison-to-self 2016-10-22 13:51:31 -07:00
bors
a117bba125 Auto merge of #37318 - nnethercote:html5ever-more, r=nrc,eddyb
Avoid some allocations in the macro parser

These three commits reduce the number of heap allocations done when compiling rustc-benchmarks/html5ever-2016-08-25 by 20%, from 16.5M to 13.3M. This speeds up (debug) compilation of it with a stage1 compiler by about 7%.
2016-10-22 13:09:24 -07:00
Jeffrey Seyfried
f3993d1a7f Rename loader.rs -> locator.rs. 2016-10-22 20:01:50 +00:00
Jeffrey Seyfried
92413c9cf4 Move Library into creader.rs. 2016-10-22 20:01:49 +00:00
Jeffrey Seyfried
0e99b83f52 Rename csearch.rs -> cstore_impl.rs. 2016-10-22 20:01:42 +00:00
Jeffrey Seyfried
2b43fac2b9 Remove CrateReader, use CrateLoader instead. 2016-10-22 20:01:38 +00:00
bors
0eb4d46d03 Auto merge of #37310 - vadimcn:drop-spans, r=michaelwoerister
Fix line stepping in debugger.

Attribute drop code to block's closing brace, instead of the line where the allocation was done.
Attribute function epilogues to function body's closing brace, rather than the function header.

Fixes #37032

r? @michaelwoerister
2016-10-22 10:02:19 -07:00
Raph Levien
cea61408c3 Update libc submodule with corresponding fuchsia changes
Also trim os::fuchsia::raw architectures.
2016-10-22 07:08:07 -07:00