Commit Graph

58281 Commits

Author SHA1 Message Date
Niko Matsakis
3dbf4d1e24 test case for changing a private fn in root of another crate 2016-10-21 18:31:34 -04:00
Michael Woerister
e46c1ad9c9 Adapt codegen test to new naming scheme for generated symbols. 2016-10-21 18:29:25 -04:00
Niko Matsakis
86b3f6cbbe add a test case for changing a private impl method across crates
Currently doesn't work that well at all in terms of getting reuse
afterwards, see #37333. =)
2016-10-21 18:02:47 -04:00
Michael Woerister
c52836c888 debuginfo: Use TypeIdHasher to create global type identifiers for debuginfo. 2016-10-21 17:56:36 -04:00
Michael Woerister
6f3edb034c type_id: Make result of std::intrinsics::type_id() endian-independent. 2016-10-21 17:53:49 -04:00
Devon Hollowood
5d31a818df Fix use of result_unwrap_or_default feature 2016-10-21 14:33:20 -07:00
Niko Matsakis
320055396b add test case for changes to a private fn 2016-10-21 17:30:12 -04:00
Michael Woerister
e6aa92c432 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.
2016-10-21 14:58:53 -04:00
Aidan Hobson Sayers
dceb2c9cd2 as_bytes is not the iterator, bytes is 2016-10-21 18:28:02 +01:00
Simon Sapin
7e603d4e3b 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-21 17:42:29 +02:00
Niko Matsakis
483bc864ca add regression test for #37154
Fixes #37154
2016-10-21 11:13:36 -04:00
Niko Matsakis
567b11fc3a only remove keys that mention skolemized regions 2016-10-21 11:13:36 -04:00
Niko Matsakis
974817d493 when pop skol, also remove from proj cache 2016-10-21 11:13:34 -04:00
Артём Павлов [Artyom Pavlov]
34576da935
Small docstring changes for include_bytes and include_str 2016-10-21 18:03:22 +03:00
Артём Павлов [Artyom Pavlov]
b374c53ae6
Small doc change for include! 2016-10-21 17:44:19 +03:00
Артём Павлов [Artyom Pavlov]
ce8e4e71f8
libcore documentation for builtin macros 2016-10-21 17:23:50 +03:00
Guillaume Gomez
1fadd868cd Improve E0277 help message 2016-10-21 16:13:52 +02:00
bors
5509ae399e Auto merge of #37290 - petrochenkov:pnp, r=jseyfried
syntax: Tweak path parsing logic

Associated paths starting with `<<` are parsed in patterns.

Paths like `self::foo::bar` are interpreted as paths and not as `self` arguments in methods (cc @matklad).
Now, I believe, *all* paths are consistently parsed greedily in case of ambiguity.
Detection of `&'a mut self::` requires pretty large (but still fixed) lookahead, so I had to increase the size of parser's lookahead buffer.
Curiously, if `lookahead_distance >= lookahead_buffer_size` was used previously, the parser hung forever, I fixed this as well, now it ICEs.

r? @jseyfried
2016-10-21 06:41:45 -07:00
Ryan Senior
93655863a3 Add an error explaination for E0399 2016-10-21 07:23:41 -05:00
Ryan Senior
e7d01cfe02 Add an error explaination for E0230 2016-10-21 07:23:41 -05:00
Ryan Senior
5402271ceb Add an error explaination for E0182 2016-10-21 07:23:40 -05:00
Nicholas Nethercote
b817cf8b57 Replace the String in ParseResult::Failure with Token.
This lets us delay creation of failure messages until they are needed,
which avoids ~1.6M allocations in html5ever.
2016-10-21 20:27:15 +11:00
bors
da5b6467c3 Auto merge of #37247 - jseyfried:future_proof_no_link, r=nrc
macros: Future proof `#[no_link]`

This PR future proofs `#[no_link]` for macro modularization (cc #35896).

First, we resolve all `#[no_link] extern crate`s. `#[no_link]` crates without `#[macro_use]` or `#[macro_reexport]` are not resolved today, this is a [breaking-change]. For example,
```rust
```
Any breakage can be fixed by simply removing the `#[no_link] extern crate`.

Second, `#[no_link] extern crate`s will define an empty module in type namespace to eventually allow importing the crate's macros with `use`. This is a [breaking-change], for example:
```rust
mod syntax {} //< This becomes a duplicate error.
```

r? @nrc
2016-10-21 01:48:31 -07:00
Devon Hollowood
095850594f Fix test_unwrap_or_default 2016-10-21 00:48:39 -07:00
Devon Hollowood
fb1ef4f42c Make Result's unwrap_or_default unstable 2016-10-20 23:50:33 -07:00
bors
e4708273b5 Auto merge of #37280 - alexcrichton:debuginfo, r=brson
Enable line number debuginfo in releases

This commit enables by default passing the `-C debuginfo=1` argument to the
compiler for the stable, beta, and nightly release channels. A new configure
option was also added, `--enable-debuginfo-lines`, to enable this behavior in
developer builds as well.

Closes #36452
2016-10-20 22:34:29 -07:00
Nicholas Nethercote
e382267cfb Avoid an unnecessary clone in generic_extensions.
This avoids ~800,000 allocations in html5ever.
2016-10-21 12:58:14 +11:00
Nicholas Nethercote
a935481ae9 Avoid an unnecessary clone in macro_parser::parse.
This avoids ~800,000 allocations in html5ever.
2016-10-21 12:58:06 +11:00
bors
041d14b23c Auto merge of #37272 - cuviper:local_stage0-proc_macro, r=alexcrichton
Add libproc_macro from local rust to stage0

This library is now required to run rustc 1.14.0.
2016-10-20 18:33:28 -07:00
Oliver Middleton
8faa503a6b Fix a few links in the docs 2016-10-21 00:49:47 +01:00
Tshepang Lekhonkhobe
3e26a93a36 doc: a more simple description of Iterator::nth 2016-10-21 00:38:00 +02:00
Tim Neumann
f1356975a4 trans: pad const structs to aligned size 2016-10-20 22:27:06 +02:00
Mikhail Modin
e85277596e improve "Doesn't live long enough" error 2016-10-20 22:51:51 +03:00
Vadim Petrochenkov
fea630ef9d Tweak path parsing logic 2016-10-20 20:28:10 +03:00
Vadim Petrochenkov
65ff4ca294 Refactor parser lookahead buffer and increase its size 2016-10-20 20:28:10 +03:00
Vadim Chugunov
209fe0df24 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.
2016-10-20 09:33:04 -07:00
bors
f094206851 Auto merge of #37261 - raphlinus:update_llvm, r=bluss
LLVM: Add triple for Fuchsia

Update subproject commit.

Fixes #36920
2016-10-20 08:18:13 -07:00
Vangelis Katsikaros
cf0fc72a3e TRPL: guessing game: minor clarification 2016-10-20 18:00:12 +03:00
bors
7bccb829d0 Auto merge of #37273 - cuviper:major-minor-rebuild, r=alexcrichton
Detect local-rebuild by just the MAJOR.MINOR version

A new point-release shouldn't change any language semantics, so a local
stage0 that matches MAJOR.MINOR version should still be considered a
local-rebuild as far as `--cfg stageN` features go.

e.g. `1.14.0` should be considered a local-rebuild for any `1.14.X`.

(Bootstrap keys used to be an issue too, until #37265.)
2016-10-20 05:16:49 -07:00
Guillaume Gomez
9ec7c655e6 Add missing urls in collections module 2016-10-20 12:34:38 +02:00
Guillaume Gomez
599ad8ed61 Add missing urls on Vec docs 2016-10-20 11:59:47 +02:00
Devon Hollowood
1c2151b7f9 Add unwrap_or_default method to Result 2016-10-19 22:08:49 -07:00
bors
eb38d426c4 Auto merge of #36973 - nnethercote:dep_graph, r=nikomatsakis
Don't enqueue onto a disabled dep_graph.

This commit guards all calls to `DepGraphThreadData::enqueue` with a
check to make sure it is enabled. This avoids some useless allocation
and vector manipulations when it is disabled (i.e. when incremental
compilation is off) which improves speed by 1--2% on most of the
rustc-benchmarks.

This commit has an observable functional change: when the dep_graph is
disabled its `shadow_graph` will no longer receive messages. This should
be ok because these message are only used when debug assertions are
enabled.

r? @nikomatsakis
2016-10-19 22:05:13 -07:00
Nicholas Nethercote
94771a177b Use fast decompression in deflate_bytes.
This commit changes the parameters of `deflate` to do faster,
lower-quality compression. For the compression of LLVM bytecode -- which
is the main use of `deflate_bytes` -- it makes compression almost twice
as fast while the size of the compressed files is only ~2% worse.
2016-10-20 15:08:01 +11:00
John Hodge
ba70ecc414 test - Add missing ! to crate_type/crate_id attributes 2016-10-20 11:29:09 +08:00
Nicholas Nethercote
feefe77125 Remove {in,de}flate_bytes_zlib.
These functions are unused.
2016-10-20 13:56:52 +11:00
bors
dfd98ebd3e Auto merge of #37289 - GuillaumeGomez:rollup, r=GuillaumeGomez
Rollup of 7 pull requests

- Successful merges: #37165, #37187, #37241, #37283, #37285, #37287, #37288
- Failed merges:
2016-10-19 17:41:49 -07:00
Guillaume Gomez
dd3a014ed9 Rollup merge of #37288 - srinivasreddy:snapshot_map, r=eddyb
run rustfmt on snapshot_map
2016-10-19 23:15:01 +02:00
Guillaume Gomez
655ecd89ed Rollup merge of #37287 - srinivasreddy:unify, r=eddyb
run rustfmt on unify folder
2016-10-19 23:15:01 +02:00
Guillaume Gomez
e7dc035f92 Rollup merge of #37285 - srinivasreddy:cfg, r=nikomatsakis
run rustfmt on control_flow_graph folder
2016-10-19 23:15:01 +02:00