Commit Graph

65665 Commits

Author SHA1 Message Date
Mark Simulacrum
1a7dc0a2cb Rollup merge of #43000 - estebank:on-unimplemented-path, r=arielb1
`rustc_on_unimplemented` supports referring to trait

Add support to `rustc_on_unimplemented` to reference the full path of
the annotated trait. For the following code:

```rust
pub mod Bar {
    #[rustc_on_unimplemented = "test error `{Self}` with `{Bar}` `{Baz}` `{Quux}` in `{Foo}`"]
    pub trait Foo<Bar, Baz, Quux> {}
}
```

the error message will be:

```
test error `std::string::String` with `u8` `_` `u32` in `Bar::Foo`
```
2017-07-12 06:58:44 -06:00
Mark Simulacrum
0926f9b72f Rollup merge of #42826 - Yorwba:type-mismatch-same-absolute-paths, r=arielb1
Note different versions of same crate when absolute paths of different types match.

The current check to address #22750 only works when the paths of the mismatched types relative to the current crate are equal, but this does not always work if one of the types is only included through an indirect dependency. If reexports are involved, the indirectly included path can e.g. [contain private modules](https://github.com/rust-lang/rust/issues/22750#issuecomment-302755516).

This PR takes care of these cases by also comparing the *absolute* path, which is equal if the type hasn't moved in the module hierarchy between versions. A more coarse check would be to compare only the crate names instead of full paths, but that might lead to too many false positives.

Additionally, I believe it would be helpful to show where the differing crates came from, i.e. the information in `rustc::middle::cstore::CrateSource`, but I'm not sure yet how to nicely display all of that, so I'm leaving it to a future PR.
2017-07-12 06:58:44 -06:00
Mark Simulacrum
500518ab72 Rollup merge of #42670 - dns2utf8:panic_return_code, r=steveklabnik
Add hint about the return code of panic!

I hope the link works on all cases, since the `unreachable` doc is copied to `std::` as well.
2017-07-12 06:58:43 -06:00
Ariel Ben-Yehuda
ecf62e4cdc [LLVM] Avoid losing the !nonnull attribute in SROA
This still does not work on 32-bit archs because of an LLVM limitation,
but this is only an optimization, so let's push it on 64-bit only for now.

Fixes #37945
2017-07-12 14:38:49 +03:00
bors
b2b19ec92e Auto merge of #42897 - Mark-Simulacrum:pretty-print-refactor, r=jseyfried
Refactor pretty printing slightly

This doesn't introduce any functional changes (that I'm aware of). The primary intention here is to clean up the code a little. Each commit is intended to stand alone, reviewing commit-by-commit may be easiest.
2017-07-12 11:10:37 +00:00
bors
8bba5ad309 Auto merge of #43107 - michaelwoerister:less-span-info-in-debug, r=nikomatsakis
incr.comp.: Don't include span information in the ICH of type definitions

This should improve some of the `regex` tests on perf.rlo. Not including spans into the ICH is harmless until we also cache warnings. To really solve the problem, we need to do more refactoring (see #43088).

r? @nikomatsakis
2017-07-12 08:45:39 +00:00
bors
8ac29bdd11 Auto merge of #42697 - Mark-Simulacrum:take-limit, r=aturon
Allow setting the limit on std::io::Take.

Fixes https://github.com/rust-lang/rust/issues/27269.
2017-07-12 06:23:38 +00:00
bors
d1f1f86d7f Auto merge of #42936 - steveklabnik:update-mdbook, r=alexcrichton
update crate dependencies

I wanted to update mdbook's version. This ended up updating a bunch of other stuff too.

I am not sure if updating this much stuff is considered a Good Idea or not; happy to figure out how to make it smaller if someone can help me figure out how to use x.py to do it.
2017-07-12 04:07:32 +00:00
steveklabnik
4871dba5d4 update crate dependencies
I wanted to update mdbook's version. This ended up updating a bunch of other stuff too.
2017-07-11 21:18:44 -04:00
bors
cd71ea7338 Auto merge of #43056 - ids1024:nofollow2, r=burntsushi
Redox: Use O_NOFOLLOW for lstat()
2017-07-12 00:49:51 +00:00
Ralf Jung
62b2e5446d Refactor: {Lvalue,Rvalue,Operand}::ty only need the locals' types, not the full &Mir 2017-07-11 16:38:16 -07:00
Ian Douglas Scott
51260f4a6d
Redox: Use O_NOFOLLOW for lstat() 2017-07-11 15:05:17 -07:00
bors
b360b44ecf Auto merge of #43083 - kennytm:fix-42434-custom-stdxxx-normalization, r=nikomatsakis
compilertest (UI test): Support custom normalization.

Closes #42434.

Adds this header for UI tests:

```rust
// normalize-stderr-32bit: "fn() (32 bits)" -> "fn() ($PTR bits)"
```

It will normalize the `stderr` output on 32-bit platforms, by replacing all instances of `fn() (32 bits)` by `fn() ($PTR bits)`.

Extends the UI tests in #42304 and #41968 to 32-bit targets.

r? @nikomatsakis
2017-07-11 22:02:20 +00:00
Mark Simulacrum
40f03a1e0d Refactor call_with_pp functions to not take a payload.
This is needless noise; the closure we take is FnOnce, so move || {} is
fine to pass other parameters necessary.
2017-07-11 12:09:25 -06:00
Mark Simulacrum
0343136805 Make a few functions non-public 2017-07-11 12:09:25 -06:00
Mark Simulacrum
16b486ce6e Refactor cur_cmnt_and_lit away.
The literal index was increased in only next_lit, so it isn't
necessary: code now uses an iterator. The cur_cmnt field is also moved
to be increased in print_comment instead of after each call to
print_comment.
2017-07-11 12:09:25 -06:00
Mark Simulacrum
bac4bb9613 Refactor methods onto Printer struct.
No (intentional) changes to behavior. This is intended to avoid the
anti-pattern of having to import individual methods throughout code.
2017-07-11 12:09:19 -06:00
bors
9475ae477a Auto merge of #43116 - alexcrichton:probestack, r=sfackler
Update compiler_builtins submodule for probestack fix

Closes #43102
2017-07-11 17:52:42 +00:00
bors
1475e2c923 Auto merge of #42388 - tschottdorf:projty-substs, r=nikomatsakis
Downgrade ProjectionTy's TraitRef to its substs

Addresses the second part of #42171 by removing the `TraitRef` from
`ProjectionTy`, and directly storing its `Substs`.

Closes #42171.
2017-07-11 15:14:32 +00:00
Lee Bousfield
8b5549defb
Fix @alexcrichton comments 2017-07-11 11:04:19 -04:00
Stefan Schindler
133c1bc9ac Wrap long line 2017-07-11 16:45:39 +02:00
Tobias Schottdorf
687ee7fee4 Downgrade ProjectionTy's TraitRef to its substs
Addresses the second part of #42171 by removing the `TraitRef` from
`ProjectionTy`, and directly storing its `Substs`.

Closes #42171.
2017-07-11 10:33:09 -04:00
Mark Simulacrum
7109d03db5 Allow setting the limit on std::io::Take. 2017-07-11 06:27:37 -06:00
Simon Sapin
a148f5ba24 Enable profiler on "alternate" builds
This hopefully fixes #42967 and #43085.
2017-07-11 14:01:04 +02:00
bors
dddf24d96f Auto merge of #43006 - GuillaumeGomez:e0611-cleanup, r=nikomatsakis
Clean up some code

From #42669.

r? @nikomatsakis
2017-07-11 10:07:24 +00:00
kennytm
34209b0eaa
Merge ui/README.md into COMPILER_TESTS.md and describe how custom UI normalization works. 2017-07-11 16:57:53 +08:00
kennytm
4582ecda64
compiletest: Support custom normalization rules. 2017-07-11 16:57:52 +08:00
Guillaume Gomez
0cf8f85275 fail in case nothing to run was found 2017-07-11 10:44:19 +02:00
Niko Matsakis
24a5ceab52 tweak word ordering 2017-07-11 10:30:23 +02:00
Guillaume Gomez
ef26f1756c Clean up some code 2017-07-11 10:30:23 +02:00
kennytm
18712e6edf
compiletest: Refactor: Move the ignore-{} logic into its own method.
Prepare for `normalize-std???` which will share the same logic.
Added `ignore-32bit` and `ignore-64bit`.
2017-07-11 16:15:59 +08:00
bors
a1f180bde3 Auto merge of #43147 - oyvindln:deflate_fix, r=alexcrichton
Use similar compression settings as before updating to use flate2

Fixes #42879

(My first PR to rust-lang yay)

This changes the compression settings back to how they were before the change to use the flate2 crate rather than the in-tree flate library. The specific changes are to use the `Fast` compression level (which should be equivialent to what was used before), and use a raw deflate stream rather than wrapping the stream in a zlib wrapper. The [zlib](https://tools.ietf.org/html/rfc1950) wrapper adds an extra 2 bytes of header data, and 4 bytes for a checksum at the end. The change to use a faster compression level did give some compile speedups in the past (see #37298). Having to calculate a checksum also added a small overhead, which didn't exist before the change to flate2.

r? @alexcrichton
2017-07-11 07:42:13 +00:00
bors
1999bfaa9f Auto merge of #42913 - kennytm:fix-40569-ident-without-backtrack, r=jseyfried
Only match a fragment specifier the if it starts with certain tokens.

When trying to match a fragment specifier, we first predict whether the current token can be matched at all. If it cannot be matched, don't bother to push the Earley item to `bb_eis`. This can fix a lot of issues which otherwise requires full backtracking (#42838).

In this PR the prediction treatment is not done for `:item`, `:stmt` and `:tt`, but it could be expanded in the future.

Fixes #24189.
Fixes #26444.
Fixes #27832.
Fixes #34030.
Fixes #35650.
Fixes #39964.
Fixes the 4th comment in #40569.
Fixes the issue blocking #40984.
2017-07-11 04:04:11 +00:00
Lee Bousfield
a45c8b09e8
Use LocalKey::try_with in std 2017-07-10 20:18:36 -04:00
Josh Stone
77bd4dc654 Disable big-endian simd in swap_nonoverlapping_bytes
This is a workaround for #42778, which was git-bisected to #40454's
optimizations to `mem::swap`, later moved to `ptr` in #42819.  Natively
compiled rustc couldn't even compile stage1 libcore on powerpc64 and
s390x, but they work fine without this `repr(simd)`.  Since powerpc64le
works OK, it seems probably related to being big-endian.

The underlying problem is not yet known, but this at least makes those
architectures functional again in the meantime.

cc @arielb1
2017-07-10 17:06:38 -07:00
Lee Bousfield
32ae12b3d1
Add LocalKey::try_with as an alternative to state 2017-07-10 19:26:11 -04:00
Zack M. Davis
bc8733f806 update .mailmap 2017-07-10 14:24:48 -07:00
bors
9228d231fc Auto merge of #43028 - michaelwoerister:dedup-dep-nodes, r=nikomatsakis
incr.comp.: Deduplicate some DepNodes and introduce anonymous DepNodes

This is a parallel PR to the pending https://github.com/rust-lang/rust/pull/42769. It implements most of what is possible in terms of DepNode re-opening without having anonymous DepNodes yet (https://github.com/rust-lang/rust/issues/42298).

r? @nikomatsakis
2017-07-10 21:18:14 +00:00
Niko Matsakis
4f1f671f38 don't panic in dep_node_debug_str if self.data is None 2017-07-10 15:46:00 -04:00
bors
bf0a9e0b4d Auto merge of #43152 - Mark-Simulacrum:test-src-doc, r=alexcrichton
Test src/doc once more

This was accidentally broken in https://github.com/rust-lang/rust/pull/42437 since we filtered too early to recurse into sub-directories.

In theory, @bors p=10

r? @alexcrichton
2017-07-10 18:17:00 +00:00
Mark Simulacrum
50799265ca Test src/doc once more 2017-07-10 11:43:02 -06:00
oyvindln
37f56a2ab1 Use similar compression settings as before updating to use flate2
Fixes #42879
2017-07-10 17:54:50 +02:00
bors
eb9dfb8bd9 Auto merge of #43109 - pnkfelix:fix-link_args-gate, r=nikomatsakis
Fix feature gate for `#[link_args(..)]` attribute

Fix feature gate for `#[link_args(..)]` attribute so that it will fire regardless of context of attribute.

See also #29596 and #43106
2017-07-10 15:39:47 +00:00
Felix S. Klock II
c512dea1ed Fix feature gate for #[link_args(..)] attribute so that it will fire
regardless of context of attribute.

Extend the gating test to include the attribute in "weird" places.
2017-07-10 12:27:59 +02:00
Michael Woerister
6d049fb5bb incr.comp.: Cache DepNodes with corresponding query results. 2017-07-10 12:21:39 +02:00
Michael Woerister
0363a23c35 incr.comp.: Introduce the concept of anonymous DepNodes. 2017-07-10 12:21:39 +02:00
Michael Woerister
089860b603 incr.comp.: Manage dependency graph on main thread. 2017-07-10 12:21:39 +02:00
Michael Woerister
13e87d1dbb Fix some tidy errors. 2017-07-10 12:20:56 +02:00
Michael Woerister
f8b774f1cf Deduplicate DepNode::ConstEval() 2017-07-10 12:20:56 +02:00
Michael Woerister
e00bec2dd4 Allow 'tcx in define_dep_nodes! and deduplicate some DepNodes. 2017-07-10 12:20:56 +02:00