Commit Graph

78481 Commits

Author SHA1 Message Date
Isaac Whitfield
d95ba305b4 Catch an issue missed in rebase 2018-05-18 10:21:42 -07:00
bors
a722296b6e Auto merge of #50653 - oli-obk:bad_const, r=cramertj
Make the `const_err` lint `deny`-by-default

At best these things are runtime panics (debug mode) or overflows (release mode). More likely they are public constants that are unused in the crate declaring them.

This is not a breaking change, as dependencies won't break and root crates can `#![warn(const_err)]`, though I don't know why anyone would do that.
2018-05-18 17:17:35 +00:00
Isaac Whitfield
55a00a95cf Remove unnecessary impl methods for CrateMetadata 2018-05-18 09:38:08 -07:00
Isaac Whitfield
680f3b24ba Serialize attributes into the CrateRoot 2018-05-18 09:37:29 -07:00
Isaac Whitfield
ca60c404b6 Remove unnecessary clone call for panic_strategy 2018-05-18 09:37:29 -07:00
Isaac Whitfield
5f5ea79611 Avoid removing from cstore_impl for now 2018-05-18 09:37:29 -07:00
Isaac Whitfield
ece778e2a3 Attempt to pass CrateMetadata flags on creation 2018-05-18 09:37:29 -07:00
Isaac Whitfield
466fc6815d Avoid generating attributes more than once for CrateMetadata 2018-05-18 09:37:13 -07:00
Isaac Whitfield
f418f1dd78 Remove attribute_cache from CrateMetadata 2018-05-18 09:36:45 -07:00
bors
ba64edb3ed Auto merge of #50533 - GuillaumeGomez:rustdoc-prim-auto, r=QuietMisdreavus
add auto-impl for primitive type

Part of #50431.

I have no clue how to test this though with the rustdoc test suite...

r? @QuietMisdreavus
2018-05-18 14:52:12 +00:00
Anthony Ramine
b7db68f516 Find the largest niche when computing layouts
Otherwise we end up with `Option<Option<(&(), bool)>>` unnecessarily large.
2018-05-18 14:32:05 +02:00
Nicholas Nethercote
ad471452ba Make Directory::path a Cow.
Because we create a lot of these in the macro parser, but only very
rarely modify them.

This speeds up some html5ever runs by 2--3%.
2018-05-18 22:20:33 +10:00
Nicholas Nethercote
fcf2b24e1b Introduce MatcherPosHandle.
This lets us store most `MatcherPos` instances on the stack. This speeds
up various runs of html5ever, the best by 3%.
2018-05-18 22:20:27 +10:00
Robin Krahl
cf1f0385a8
Reorder description for snippets in rustdoc documentation
The example code snippets for the `no_run` and `compile_fail` attributes
in the rustdoc documentation were followed by the description for the
wrong attribute.  This patch reorders the descriptions to match the code
snippets.
2018-05-18 14:12:25 +02:00
bors
df40e61382 Auto merge of #50307 - petrochenkov:keyhyg2, r=nikomatsakis
Implement edition hygiene for keywords

Determine "keywordness" of an identifier in its hygienic context.
cc https://github.com/rust-lang/rust/pull/49611

I've resurrected `proc` as an Edition-2015-only keyword for testing purposes, but it should probably be buried again. EDIT: `proc` is removed again.
2018-05-18 10:57:05 +00:00
bors
fd18d2537d Auto merge of #50758 - varkor:stabilise-inclusive_range_methods, r=SimonSapin
Stabilise inclusive_range_methods

r? @SimonSapin

Closes #49022.
2018-05-18 08:10:23 +00:00
Zack M. Davis
59782f4829 in which the unused shorthand field pattern debacle/saga continues
In e4b1a79 (#47922), we corrected erroneous suggestions for unused
shorthand field pattern bindings, suggesting `field: _` where the
previous suggestion of `_field` wouldn't even have compiled
(#47390). Soon, it was revealed that this was insufficient (#50303), and
the fix was extended to references, slices, &c. (#50327) But even this
proved inadequate, as the erroneous suggestions were still being issued
for patterns in local (`let`) bindings (#50804). Here, we yank the
shorthand-detection and variable/node registration code into a new
common function that can be called while visiting both match arms and
`let` bindings.

Resolves #50804.
2018-05-18 01:00:22 -07:00
Anthony Ramine
032831da78 Update LLVM to 56c931901cfb85cd6f7ed44c7d7520a8de1edf97
This brings in https://github.com/rust-lang/llvm/pull/115, which fixes
https://github.com/rust-lang/rust/issues/49873.
2018-05-18 09:24:11 +02:00
bors
2a421f8e19 Auto merge of #50848 - nrc:update, r=alexcrichton
Update RLS and Rustfmt

Fixes RLS build (The Rustfmt update is insignificant)

r? @alexcrichton
2018-05-18 05:23:23 +00:00
bors
dfc07a48f6 Auto merge of #50847 - Mark-Simulacrum:rollup, r=Mark-Simulacrum
Rollup of 10 pull requests

Successful merges:

 - #50387 (Remove leftover tab in libtest outputs)
 - #50553 (Add Option::xor method)
 - #50610 (Improve format string errors)
 - #50649 (Tweak `nearest_common_ancestor()`.)
 - #50790 (Fix grammar documentation wrt Unicode identifiers)
 - #50791 (Fix null exclusions in grammar docs)
 - #50806 (Add `bless` x.py subcommand for easy ui test replacement)
 - #50818 (Speed up `opt_normalize_projection_type`)
 - #50837 (Revert #49767)
 - #50839 (Make sure people know the book is free oline)

Failed merges:
2018-05-18 02:58:13 +00:00
bors
bedbf72785 Auto merge of #50566 - nnethercote:bump, r=petrochenkov
Streamline `StringReader::bump`

These patches make `bump` smaller and nicer. They speed up most runs for coercions and tuple-stress by 1--3%.
2018-05-18 00:09:37 +00:00
iancormac84
03493941fb Fixed accidental removal of StableHasher declaration. 2018-05-17 19:43:36 -04:00
est31
7ad9ef3c45 CheckLoopVisitor: also visit closure arguments
This turns an ICE on this code:

fn main() {
    |_: [u8; break]| ();
}

from
    'assertion failed: self.tcx.sess.err_count() > 0', librustc_typeck/check/mod.rs
to
    librustc_mir/hair/cx/expr.rs:543: invalid loop id for break: not inside loop scope

which is at a later stage during compilation and most importantly
fixes of bug #50576 will fix this as well.
2018-05-17 23:54:49 +02:00
bors
612ca14b81 Auto merge of #50593 - nikomatsakis:nll-no-location, r=nikomatsakis
stop considering location when computing outlives relationships

This doesn't (yet?) use SEME regions, but it does ignore the location for outlives constraints. This makes (I believe) NLL significantly faster -- but we should do some benchmarks. It regresses the "get-default" family of use cases for NLL, which is a shame, but keeps the other benefits, and thus represents a decent step forward.

r? @pnkfelix
2018-05-17 21:36:43 +00:00
iancormac84
1839faead0 Removed yet another unused import. 2018-05-17 16:41:34 -04:00
iancormac84
18b032a96b Removed unused import. 2018-05-17 16:41:33 -04:00
iancormac84
b79edf008f Added extra hashing step. 2018-05-17 16:41:33 -04:00
iancormac84
6131c0a98c Fix more unused imports errors. 2018-05-17 16:41:31 -04:00
iancormac84
ef38712f87 Removed unused imports. 2018-05-17 16:41:30 -04:00
iancormac84
9041d81f78 Code structure edits. 2018-05-17 16:41:29 -04:00
iancormac84
659f164167 Removed TypeIdHasher. 2018-05-17 16:41:27 -04:00
iancormac84
9a746d5c1d Removed use of TypeIdHasher in symbol hash generation and replaced it with StableHasher. 2018-05-17 16:41:26 -04:00
iancormac84
a8c2332cc8 Removed use of TypeIdHasher in debuginfo and replaced it with StableHasher. Also corrected erroneous mention of TypeIdHasher in implementation of HashStable trait. 2018-05-17 16:41:18 -04:00
Vadim Petrochenkov
d8bbc1ee1a Fix rebase 2018-05-17 23:32:47 +03:00
Nikita Popov
12308139ec Emit noalias on &mut parameters by default
This used to be disabled due to LLVM bugs in the handling of
noalias information in conjunction with unwinding. However,
according to #31681 all known LLVM bugs have been fixed by
LLVM 6.0, so it's probably time to reenable this optimization.

Noalias annotations will not be emitted by default if either
-C panic=abort (as previously) or LLVM >= 6.0 (new).

-Z mutable-noalias=no is left as an escape-hatch to allow
debugging problems suspected to stem from this change.
2018-05-17 22:27:29 +02:00
Nick Cameron
8de091ed4e Update RLS and Rustfmt 2018-05-18 08:20:36 +12:00
Simonas Kazlauskas
59bb0fe66e Fix align_offset_stride1 & align_to_simple tests 2018-05-17 23:13:43 +03:00
Simonas Kazlauskas
6d5bf8b23f Remove the intrinsic for align_offset
Keep only the language item. This removes some indirection and makes
codegen worse for debug builds, but simplifies code significantly, which
is a good tradeoff to make, in my opinion.

Besides, the codegen can be improved even further with some constant
evaluation improvements that we expect to happen in the future.
2018-05-17 23:13:42 +03:00
Vadim Petrochenkov
dae5f05f43 Remove the proc keyword again 2018-05-17 23:13:09 +03:00
Vadim Petrochenkov
c4352ff198 Turn some functions from token.rs into methods on Ident 2018-05-17 23:13:09 +03:00
Vadim Petrochenkov
f4cbc2388f Pass crate editions to macro expansions, update tests 2018-05-17 23:13:09 +03:00
Vadim Petrochenkov
76bf3454da Keep crate edition in metadata 2018-05-17 23:13:09 +03:00
Vadim Petrochenkov
cd4925d1b8 Add tests 2018-05-17 23:13:09 +03:00
Vadim Petrochenkov
f89e356245 Add two keywords specific to editions 2015 and 2018 respectively 2018-05-17 23:13:09 +03:00
Simonas Kazlauskas
680031b016 Implement [T]::align_to 2018-05-17 23:13:08 +03:00
Vadim Petrochenkov
640884bad0 Add edition to expansion info 2018-05-17 23:13:08 +03:00
Vadim Petrochenkov
ee5b1e15aa Move definition of Edition from libsyntax to libsyntax_pos 2018-05-17 23:13:08 +03:00
varkor
ff0f00d318 Add doc comments mentioning unspecified behaviour upon exhaustion 2018-05-17 20:58:28 +01:00
varkor
1b3ecbcebb Stabilise into_inner 2018-05-17 20:58:28 +01:00
varkor
edad2eff0c Stabilise inclusive_range_methods 2018-05-17 20:58:28 +01:00