Commit Graph

78513 Commits

Author SHA1 Message Date
bors
7942022bf7 Auto merge of #50986 - estebank:main-start-span, r=nikomatsakis
Tweak `main` type arguments and where clause spans

Tweak the spans for error when finding type arguments or where clauses
in main and start functions.
2018-05-25 03:46:14 +00:00
bors
c8e10e386a Auto merge of #50879 - petrochenkov:lintconv, r=nikomatsakis
Fix naming conventions for new lints

We actually have an RFC from Oct 2014 specifying naming conventions for lints that is still relevant - https://github.com/rust-lang/rfcs/blob/master/text/0344-conventions-galore.md#lints.
Unfortunately, human memory doesn't work for such prolonged periods of time, so a number of recently added edition-related lints don't follow the conventions.
This PR fixes names for those lints.

Unstable lints, simply renamed:
- `unused_lifetime` -> `unused_lifetimes`
- `absolute_path_not_starting_with_crate` -> `absolute_paths_not_starting_with_crate`
- `unnecessary_extern_crate` -> `unnecessary_extern_crates`

New lints stabilized in the last couple of releases, registered as renamed (old names still work with a warning):
- `single_use_lifetime` -> `single_use_lifetimes`
- `elided_lifetime_in_path` -> `elided_lifetimes_in_paths`
- `bare_trait_object` -> `bare_trait_objects`
- `unstable_name_collision` -> `unstable_name_collisions`
- `unused_doc_comment` -> `unused_doc_comments`

NOT changed, too old to rename:
- `const_err` -> `const_errors`
- `unused_allocation` -> `unused_allocations`

NOT changed, deprecation lints, no need to rename, they are going to be removed anyway:
- `invalid_type_param_default` -> `invalid_type_param_defaults`
- `missing_fragment_specifier` -> `missing_fragment_specifiers`
- `tyvar_behind_raw_pointer` -> `tyvars_behind_raw_pointer`
- `illegal_floating_point_literal_pattern` -> `illegal_floating_point_literal_patterns`
2018-05-25 01:33:45 +00:00
Vadim Petrochenkov
e60eaf59df Fix naming conventions for new lints 2018-05-25 02:35:07 +03:00
bors
b86d909f86 Auto merge of #50937 - nikomatsakis:chalkify-engine-2, r=scalexm
implement the chalk-engine traits

Preliminary implementation for the Chalk traits in rustc. Lots of `panic!()` placeholders to be filled in later.

This is currently blocked on us landing https://github.com/rust-lang-nursery/chalk/pull/131  in chalk and issuing a new release, which should occur later today.

r? @scalexm
cc @leodasvacas
2018-05-24 23:10:18 +00:00
bors
c2d46037fa Auto merge of #50984 - cramertj:unpin-changes, r=aturon
Unpin changes

r? @aturon

cc @withoutboats, @RalfJung, @pythonesque, #49150
2018-05-24 20:58:12 +00:00
bors
07465222ca Auto merge of #50909 - oli-obk:unstable_const_fn_promotion, r=eddyb
Enforce stability of const fn in promoteds

r? @eddyb

fixes #50901

what's going on here? Why do we have two promoted computation algorithms?
2018-05-24 16:43:22 +00:00
Niko Matsakis
8fd316f5b5 pacify the mercilous tidy 2018-05-24 12:01:28 -04:00
Niko Matsakis
3b1a170914 extend the crate whitelist to include rustc-hash, chalk 2018-05-24 12:01:27 -04:00
Niko Matsakis
9c548bf26d get rustc_hash from external crate 2018-05-24 12:01:27 -04:00
Niko Matsakis
6f425a9201 implement the chalk traits, albeit with many placeholders 2018-05-24 12:01:27 -04:00
Oliver Schneider
a11f7856f4 Always mark unstable const fn as not const 2018-05-24 17:22:31 +02:00
Oliver Schneider
383a5df58c Enforce stability of const fn in promoteds 2018-05-24 17:22:31 +02:00
bors
a41dd6fce2 Auto merge of #50930 - toidiu:ak-ordOutlivesPredicate, r=nikomatsakis
implement Ord for OutlivesPredicate and other types

It became necessary while implementing https://github.com/rust-lang/rust/pull/50070 to have `Ord` implemented for `OutlivesPredicate`.

This PR implements `Ord` for `OutlivesPredicate` as well as other types needed for the implementation.
2018-05-24 14:30:58 +00:00
bors
d022dd48cc Auto merge of #51023 - kennytm:rollup, r=kennytm
Rollup of 9 pull requests

Successful merges:

 - #50864 (Add NetBSD/arm target specs)
 - #50956 (rust-gdb: work around the re-used -d argument in cgdb)
 - #50964 (Make sure that queries have predictable symbol names.)
 - #50965 (Update LLVM to pull in another wasm fix)
 - #50972 (Add -Z no-parallel-llvm flag)
 - #50979 (Fix span for type-only arguments)
 - #50981 (Shrink `LiveNode`.)
 - #50995 (move type out of unsafe block)
 - #51011 ( rustdoc: hide macro export statements from docs)

Failed merges:
2018-05-24 12:05:47 +00:00
kennytm
98606cfe12
Rollup merge of #51011 - QuietMisdreavus:duplicitous-macros, r=ollie27
rustdoc: hide macro export statements from docs

As mentioned in https://github.com/rust-lang/rust/issues/50647, rustdoc now prints both the import statement and the macro itself when re-exporting macros. This is a stopgap solution to clean up the std docs and get something small backported into beta.

What this does: When rustdoc finds an export statement for a macro, instead of printing the export and bailing, now it will instead hide the export and bail. Until we can solve https://github.com/rust-lang/rust/issues/34843 or have a better way to find the attributes on an export statement when inlining macros, this will at least match the current behavior and clean up the re-export statements from the docs.
2018-05-24 17:34:55 +08:00
kennytm
99de8ab38b
Rollup merge of #50995 - fbstj:patch-1, r=cramertj
move type out of unsafe block

from https://github.com/rust-lang/rust/pull/50863#discussion_r190213000

move the union definition outside of the unsafe block as it's definition is not unsafe
2018-05-24 17:34:54 +08:00
bors
a76bff86e6 Auto merge of #50949 - eddyb:debuginfo, r=mw
rustc_codegen_llvm: remove some debuginfo cruft.

(The second commit passes tests locally but might not on older LLVM versions)

r? @nikomatsakis
2018-05-24 09:27:15 +00:00
kennytm
79a2676ce0
Rollup merge of #50981 - nnethercote:shrink-LiveNode, r=nikomatsakis
Shrink `LiveNode`.

`Liveness::users` is a vector that is occasionally enormous. For
example, doing a "clean incremental" check build of `inflate`, there is
one instance that represents 5,499 live nodes and 1087 vars, which
requires 5,977,413 entries. At 24 bytes per entry, that is 143MB.

This patch changes LiveNode from a usize to a u32. On 64-bit machines
that halves the size of these entries, significantly reducing peak
memory usage and memory traffic, and speeding up "clean incremental"
builds of `inflate` by about 10%.
2018-05-24 16:02:44 +08:00
kennytm
6441ebe5a7
Rollup merge of #50979 - Manishearth:type-only, r=estebank
Fix span for type-only arguments

Currently it points to the comma or parenthesis before the type, which is broken

cc @mark-i-m this is what broke #48309

r? @estebank
2018-05-24 16:02:42 +08:00
kennytm
e14bc2d3d4
Rollup merge of #50972 - nikic:no-parallel, r=michaelwoerister
Add -Z no-parallel-llvm flag

Codegen issues commonly only manifest under specific circumstances,
e.g. if multiple codegen units are used and ThinLTO is enabled.
However, these configuration are threaded, making the use of LLVM
debugging facilities hard, as output is interleaved.

This patch adds a -Z no-parallel-llvm flag, which allows disabling
parallelization of codegen and linking, while otherwise preserving
behavior with regard to codegen units and LTO.
2018-05-24 16:02:41 +08:00
kennytm
eb26c9b390
Rollup merge of #50965 - alexcrichton:update-llvm, r=TimNN
Update LLVM to pull in another wasm fix

Closes #50869
2018-05-24 16:02:40 +08:00
kennytm
4db2241212
Rollup merge of #50964 - michaelwoerister:query-symbol-names, r=nikomatsakis
Make sure that queries have predictable symbol names.

Some recent refactorings led to query names not showing up in the corresponding symbol names. [perf-focus](https://github.com/nikomatsakis/perf-focus) and manual profiling have been broken by this. This PR makes sure that query providers always get their own symbol and that that symbol has a predictable name.

Since this adds `#[inline(never)]` to a function that wraps the provider call, let's check if this does not regress performance before merging.

r? @nikomatsakis
2018-05-24 16:02:39 +08:00
kennytm
02d53f2de7
Rollup merge of #50956 - atopia:rust-gdb-with-cdgb, r=nikomatsakis
rust-gdb: work around the re-used -d argument in cgdb

Use --directory= to pass $GDB_PYTHON_MODULE_DIRECTORY instead of -d, because [cgdb](https://github.com/cgdb/cgdb) reuses '-d' to select a debugger, whereas the long option works with both gdb and cgdb.
2018-05-24 16:02:38 +08:00
kennytm
0bb7335cb8
Rollup merge of #50864 - jakllsch:add-netbsd-arm-target-specs, r=alexcrichton
Add NetBSD/arm target specs
2018-05-24 16:02:37 +08:00
bors
7426f5ccf7 Auto merge of #50971 - alexcrichton:no-stringify, r=petrochenkov
rustc: Correctly pretty-print macro delimiters

This commit updates the `Mac_` AST structure to keep track of the delimiters
that it originally had for its invocation. This allows us to faithfully
pretty-print macro invocations not using parentheses (e.g. `vec![...]`). This in
turn helps procedural macros due to #43081.

Closes #50840
2018-05-24 07:14:21 +00:00
toidiu
9a8400c3ff implement Ord for OutlivesPredicate and other types 2018-05-24 00:01:35 -04:00
bors
b4463d788b Auto merge of #50943 - oli-obk:cleanups, r=estebank
impl Trait diagnostic/test cleanups
2018-05-24 03:40:16 +00:00
QuietMisdreavus
4cf0c5fa32 fix @!has conditions in pub-use-extern-macros test 2018-05-23 20:53:45 -05:00
bors
242195d290 Auto merge of #51010 - nikomatsakis:issue-50996-renamed-extern-crate, r=acrichto
"crate-ify" paths that begin with a renamed crate

This does two things:

- crate-ify paths that begin with a renamed crate (i.e., add `crate::`) to the front

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

I also added tests for a few other scenarios.

r? @alexcrichton
2018-05-24 01:25:40 +00:00
bors
1977849257 Auto merge of #50933 - SimonSapin:anchorage, r=alexcrichton
Remove the unstable Float trait

Following up to #49896 and #50629. Fixes #32110.
2018-05-23 22:50:12 +00:00
QuietMisdreavus
d19b5edfb0 update "pub-use-extern-macros" test to hide the regular import statement 2018-05-23 16:39:47 -05:00
QuietMisdreavus
e3d9f19219 rustdoc: hide macro export statements from docs 2018-05-23 16:22:18 -05:00
Niko Matsakis
2249d65392 "crate-ify" paths that begin with a renamed crate 2018-05-23 16:21:44 -04:00
bors
29ffe51e34 Auto merge of #50916 - oli-obk:miri, r=eddyb
Allow `Size` to be any valid `u64`

cc https://github.com/solson/miri/pull/378#issuecomment-390470725

The alternative is to make mir::interpret's pointer offsets not be `Size`

fixes #50917

r? @eddyb
2018-05-23 20:13:22 +00:00
bors
27649b7032 Auto merge of #50983 - nikomatsakis:issue-50970-migration-lint-fq-path, r=alexcrichton
Issue 50970 migration lint fq path

Similar issue, but for fully qualified paths.

Fixes #50970

r? @alexcrichton
2018-05-23 17:36:28 +00:00
bors
e249596d94 Auto merge of #50891 - davidtwco:nll-kill-loans-out-of-scope-at-location-reduce-calls, r=pnkfelix
Remove extra calls to kill_loans_out_of_scope_at_location.

r? @nikomatsakis
2018-05-23 15:06:27 +00:00
Joe ST
1977c62339
move type def out of unsafe block
from https://github.com/rust-lang/rust/pull/50863#discussion_r190213000

move the union definition outside of the unsafe block
2018-05-23 15:01:11 +01:00
bors
1962a70e71 Auto merge of #50866 - michaelwoerister:relocations-in-vec, r=oli-obk
Use different datastructure for MIRI relocations

This PR makes relocations in MIRI used a sorted vector instead of a `BTreeMap` which should make a few common operations more efficient. Let's see if that's true.

r? @oli-obk
2018-05-23 12:24:48 +00:00
Niko Matsakis
688324e176 pacify the mercilous tidy 2018-05-23 08:17:04 -04:00
Niko Matsakis
42d0b363c1 handle fully qualified paths properly when linting
fixes #50970
2018-05-23 05:51:03 -04:00
bors
c3733a770e Auto merge of #50528 - whitfin:issue-50508, r=michaelwoerister
Remove attribute_cache from CrateMetadata

This PR will fix #50508 by removing the `attribute_cache` from the `CrateMetadata` struct. Seeing as performance was referenced in the original issue, I also cleaned up a `self.entry(node_id);` call which might have occasionally happened redundantly.

r? @michaelwoerister
2018-05-23 09:50:54 +00:00
bors
531e4ab7bc Auto merge of #50798 - bobtwinkles:nll_facts_invalidate, r=nikomatsakis
Generate "invalidates" facts when -Znll-facts is passed

Most of the new code is copied directly from the heart of the MIR borrowchecker. I was expecting more fundamental structural changes, hence the copying. This appears to work as it stands, but I'd like to submit a follow-up PR to reduce code duplication. I figured that could wait though, since this is blocking a large amount of work in the borrow check repository and I'm out of time for tonight =).

r? @nikomatsakis
2018-05-23 07:15:34 +00:00
bors
9a4e5df126 Auto merge of #50682 - F001:issue-50589, r=petrochenkov
Add lint for multiple associated types

Fix https://github.com/rust-lang/rust/issues/50589. cc @abonander
2018-05-23 05:09:13 +00:00
Esteban Küber
b2562fbcba Tweak main type arguments and where clause spans
Tweak the spans for error when finding type arguments or where clauses
in main and start functions.
2018-05-22 21:09:57 -07:00
bors
5ec4ab9b68 Auto merge of #50982 - alexcrichton:less-warnings, r=nikomatsakis
rustc: Fix another double-lint issue with `crate::`

This commit fixes another issue in the `absolute_path_not_starting_with_crate`
lint where it warns twice about an import which may contain `self`. It turns out
there were a few more locations that needed updating to use `root_id` and
`root_span` introduced in #50970 and after that it looks to work like a charm!

Closes #50978
2018-05-23 02:44:08 +00:00
F001
88f810f52e inverting speculative flag 2018-05-23 08:59:08 +08:00
Taylor Cramer
15d2f965d8 Add Option::as_pin_mut 2018-05-22 17:24:49 -07:00
Taylor Cramer
b7ccb24848 Add PinMut::set 2018-05-22 17:24:49 -07:00
Taylor Cramer
640f6f0749 Add Pinned type for opting out of Unpin on stable 2018-05-22 17:24:49 -07:00
Taylor Cramer
a44abfdc29 Make Unpin safe to implement 2018-05-22 17:24:49 -07:00