Commit Graph

1654 Commits

Author SHA1 Message Date
John Kåre Alsaker
c819ba043a Add comments and misc changes 2018-06-06 15:25:18 +02:00
John Kåre Alsaker
302aae5864 Use raw pointers 2018-06-06 15:25:18 +02:00
John Kåre Alsaker
090b8341bc Add and use OnDrop::disable 2018-06-06 15:25:17 +02:00
John Kåre Alsaker
77259af56a Use try_lock in collect_active_jobs 2018-06-06 15:25:17 +02:00
John Kåre Alsaker
f9e6fbc4f7 Make queries block and handle query cycles 2018-06-06 15:25:16 +02:00
bors
1b3d737716 Auto merge of #51015 - nikomatsakis:issue-50672-remove-extern-crate-idiom, r=alexcrichton
merge unused-extern-crate and unnecessary-extern-crate lints

Extend the `unused_extern_crates` lint to offer a suggestion to remove the extern crate and remove the `unnecessary_extern_crate` lint.

Still a few minor issues to fix:
- [x] this *does* now leave a blank line... (defer to https://github.com/rust-lang/rust/issues/51176)
  - idea: extend the span to be replaced by 1 character if the next character is a `\n`
- [x] what about macros? do we need to watch out for that? (defer to https://github.com/rust-lang/rust/issues/48704)
- [x] also it doesn't work for `extern crate foo; fn main() { foo::bar(); }`
  - this is subtle: the `foo` might be shadowing a glob import too, can't always remove
  - defer to https://github.com/rust-lang/rust/issues/51177
- [x] we also don't do the `pub use` rewrite thang (https://github.com/rust-lang/rust/issues/51013)

Spun off from https://github.com/rust-lang/rust/pull/51010

Fixes #50672

r? @alexcrichton
2018-06-02 11:14:14 +00:00
Niko Matsakis
8b39808ffe merge UNNECESSARY_EXTERN_CRATE and UNUSED_EXTERN_CRATES 2018-06-01 11:00:18 -04:00
John Kåre Alsaker
2119d04b2d Add Sync impl for Slice 2018-06-01 15:22:37 +02:00
John Kåre Alsaker
c6dbb14097 Assert that GlobalCtxt is Sync 2018-06-01 14:57:08 +02:00
John Kåre Alsaker
d402d2d0d4 Have worker-local GlobalArenas 2018-06-01 14:57:08 +02:00
John Kåre Alsaker
85acb1d046 Ensure ImplicitCtxt is Sync 2018-06-01 14:55:58 +02:00
Michael Woerister
24dfcbef9c Make const decoding from the incremental cache thread-safe. 2018-06-01 09:32:24 +02:00
bors
2408095f34 Auto merge of #51017 - estebank:crate-name-in-path, r=michaelwoerister
Use crate name for reexported `extern crate` paths

Fix #43189.
2018-05-30 07:10:16 +00:00
Felix S. Klock II
173315e353 rust-lang/rust#27282: emit ReadForMatch on each match arm.
Also, turn on ReadForMatch emission by default (when using NLL).
2018-05-29 23:02:39 +02:00
Felix S. Klock II
47bb3fd505 Debug flag to bypass restriction of mutation in match guards.
Now, if you pass `-Z disable-ast-check-for-mutation-in-guard`, then we
will just allow you to mutably-borrow and assign in guards of `match`
arms.

This is wildly unsound with AST-borrowck. It is also unsound with
MIR-borrowck without further adjustments, which come in later in the
commit series on this Pull Request.

See also rust-lang/rust#24535 and rust-lang/rfcs#1006.
2018-05-29 23:01:36 +02:00
bors
5ae5361cdd Auto merge of #50475 - csmoe:debr, r=nikomatsakis
Refactor DebruijnIndex to be 0-based

Fixes #49813
2018-05-29 01:11:24 +00:00
Niko Matsakis
783fe4f880 change to 0-based indices
Co-authored-by: csmoe <35686186+csmoe@users.noreply.github.com>
2018-05-28 19:47:05 -04:00
Niko Matsakis
22a25d9b49 make depth private
Co-authored-by: csmoe <35686186+csmoe@users.noreply.github.com>
2018-05-28 19:47:05 -04:00
Niko Matsakis
7e15e0baff remove use of depth from TyS and replace with a debruijn index
Co-authored-by: csmoe <35686186+csmoe@users.noreply.github.com>
2018-05-28 19:47:05 -04:00
Niko Matsakis
06b2a3fbdb convert LateBoundRegionsCollector to track a debruijn index
Co-authored-by: csmoe <35686186+csmoe@users.noreply.github.com>
2018-05-28 19:47:04 -04:00
Niko Matsakis
4aeb6efb6d replace use of DebruijnIndex in for_each_free_region
Co-authored-by: csmoe <35686186+csmoe@users.noreply.github.com>
2018-05-28 19:47:04 -04:00
Niko Matsakis
f965b79ccf rewrite the hasher to not access depth field
Co-authored-by: csmoe <35686186+csmoe@users.noreply.github.com>
2018-05-28 19:47:04 -04:00
Niko Matsakis
8bd4bffe50 stop invoking DebruijnIndex::new directly
Co-authored-by: csmoe <35686186+csmoe@users.noreply.github.com>
2018-05-28 19:47:04 -04:00
Niko Matsakis
b5018de0ed make shifted_in and shifted_out const fns
Co-authored-by: csmoe <35686186+csmoe@users.noreply.github.com>
2018-05-28 19:47:03 -04:00
Niko Matsakis
9c5a45044a port fold_regions and friends to use debruijn indices directly
They no longer talk about plain integers.

Co-authored-by: csmoe <35686186+csmoe@users.noreply.github.com>
2018-05-28 19:47:03 -04:00
Niko Matsakis
69ab6f2995 introduce shifted_in, shifted_out and friends
Co-authored-by: csmoe <35686186+csmoe@users.noreply.github.com>
2018-05-28 14:25:55 -04:00
Zack M. Davis
1b7488d40b scrap find_node_for_hir_id in favor of hir_to_node_id
Michael Woerister pointed out that `hir_to_node_id` (introduced in
August 2017's 28ddd7a4e) supersedes the functionality of
`find_node_for_hir_id` (just a hash lookup compared to that linear
search).
2018-05-28 09:20:14 -07:00
Zack M. Davis
1329605a3d operate on HirId in hir::Pat::each_binding, and consequences of that
Changing the `each_binding` utility method to take the `HirId` of a
binding pattern rather than its `NodeId` seems like a modest first step
in support of the `HirId`ification initiative #50928. (The inspiration
for choosing this in particular came from the present author's previous
work on diagnostics issued during liveness analysis, which is the most
greatly affected module in this change.)
2018-05-28 09:20:14 -07:00
John Kåre Alsaker
fb4e3b62e0 Add fields to Slice 2018-05-27 17:28:35 +02:00
John Kåre Alsaker
0b6586b989 Add assertions for TyS and TypeVariants sizes 2018-05-27 17:28:35 +02:00
John Kåre Alsaker
6c2d875261 Make &Slice a thin pointer 2018-05-27 17:28:35 +02:00
bors
1e504d301c Auto merge of #51072 - petrochenkov:ifield, r=eddyb
Use `Ident`s for fields in HIR

Continuation of https://github.com/rust-lang/rust/pull/49718, part of https://github.com/rust-lang/rust/issues/49300
2018-05-26 16:56:22 +00:00
Vadim Petrochenkov
189c0a1297 Use Idents for fields in HIR 2018-05-26 14:41:58 +03:00
kennytm
e667e7be60
Rollup merge of #51047 - spastorino:use_polonius_engine_facts, r=nikomatsakis
Use AllFacts from polonius-engine
2018-05-26 19:32:22 +08:00
bors
990d8aa743 Auto merge of #50967 - oli-obk:miri_api_refactor, r=eddyb
Miri api refactor

r? @eddyb

cc @Zoxc

based on https://github.com/rust-lang/rust/pull/50916
2018-05-25 13:59:48 +00: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
Santiago Pastorino
8429d11a0b
Use AllFacts from polonius-engine 2018-05-24 19:56:02 -03:00
Oliver Schneider
85de4efdd8 Rename amt variables to shift 2018-05-24 20:49:38 +02:00
Oliver Schneider
5c8741f32e Use in-band-lifetimes instead of unused explicit lifetimes 2018-05-24 20:49:38 +02:00
Oliver Schneider
bdd23bf215 tcx.lift_to_global > tcx.global_tcx().lift 2018-05-24 20:49:38 +02:00
Oliver Schneider
1f9fa53738 Sanity check the bits argument to the from_bits function 2018-05-24 20:49:38 +02:00
Oliver Schneider
c420531304 Replace ScalarKind with Primitive 2018-05-24 20:49:37 +02:00
Oliver Schneider
cc60a22b10 Get rid of scalar_size 2018-05-24 20:49:37 +02:00
Oliver Schneider
f82256e473 primval -> scalar rename 2018-05-24 20:49:37 +02:00
Oliver Schneider
bf39c7f87c Floats are scalars! 2018-05-24 20:49:37 +02:00
Oliver Schneider
64a75ecc80 change Value::Bytes to Value::Bits 2018-05-24 20:49:37 +02:00
Oliver Schneider
d7324631ae Rename MemoryPointer to Pointer 2018-05-24 20:48:54 +02:00
Oliver Schneider
1606e137e7 Rename PrimVal to Scalar 2018-05-24 20:47:35 +02:00
Oliver Schneider
9cc5d927c9 Add constant for Size::from_bytes(0) 2018-05-24 20:46:07 +02:00
Niko Matsakis
8fd316f5b5 pacify the mercilous tidy 2018-05-24 12:01:28 -04:00