Skip to content

Commit ed1f26d

Browse files
committed
Auto merge of #41702 - frewsxcv:rollup, r=frewsxcv
Rollup of 6 pull requests - Successful merges: #41661, #41662, #41673, #41688, #41692, #41693 - Failed merges:
2 parents 96e2c34 + e0bfd19 commit ed1f26d

File tree

108 files changed

+1387
-1232
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

108 files changed

+1387
-1232
lines changed

src/bootstrap/bootstrap.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -414,8 +414,8 @@ def build_triple(self):
414414
# The goal here is to come up with the same triple as LLVM would,
415415
# at least for the subset of platforms we're willing to target.
416416
if ostype == 'Linux':
417-
os = subprocess.check_output(['uname', '-o']).strip().decode(default_encoding)
418-
if os == 'Android':
417+
os_from_sp = subprocess.check_output(['uname', '-o']).strip().decode(default_encoding)
418+
if os_from_sp == 'Android':
419419
ostype = 'linux-android'
420420
else:
421421
ostype = 'unknown-linux-gnu'

src/libcore/convert.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,7 @@ pub trait Into<T>: Sized {
276276
pub trait From<T>: Sized {
277277
/// Performs the conversion.
278278
#[stable(feature = "rust1", since = "1.0.0")]
279-
fn from(T) -> Self;
279+
fn from(_: T) -> Self;
280280
}
281281

282282
/// An attempted conversion that consumes `self`, which may or may not be

src/libcore/hash/sip.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -403,8 +403,8 @@ impl<S: Sip> Default for Hasher<S> {
403403

404404
#[doc(hidden)]
405405
trait Sip {
406-
fn c_rounds(&mut State);
407-
fn d_rounds(&mut State);
406+
fn c_rounds(_: &mut State);
407+
fn d_rounds(_: &mut State);
408408
}
409409

410410
#[derive(Debug, Clone, Default)]

src/libcore/ops.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2878,10 +2878,10 @@ pub trait Carrier {
28782878
type Error;
28792879

28802880
/// Create a `Carrier` from a success value.
2881-
fn from_success(Self::Success) -> Self;
2881+
fn from_success(_: Self::Success) -> Self;
28822882

28832883
/// Create a `Carrier` from an error value.
2884-
fn from_error(Self::Error) -> Self;
2884+
fn from_error(_: Self::Error) -> Self;
28852885

28862886
/// Translate this `Carrier` to another implementation of `Carrier` with the
28872887
/// same associated types.

src/librand/distributions/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ pub trait Sample<Support> {
5353
// trait called `Sample` and the other should be `DependentSample`.
5454
pub trait IndependentSample<Support>: Sample<Support> {
5555
/// Generate a random value.
56-
fn ind_sample<R: Rng>(&self, &mut R) -> Support;
56+
fn ind_sample<R: Rng>(&self, _: &mut R) -> Support;
5757
}
5858

5959
/// A wrapper for generating types that implement `Rand` via the

src/librand/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -329,7 +329,7 @@ impl<'a, R: fmt::Debug> fmt::Debug for AsciiGenerator<'a, R> {
329329
/// the same stream of randomness multiple times.
330330
pub trait SeedableRng<Seed>: Rng {
331331
/// Reseed an RNG with the given seed.
332-
fn reseed(&mut self, Seed);
332+
fn reseed(&mut self, _: Seed);
333333

334334
/// Create a new RNG with the given seed.
335335
fn from_seed(seed: Seed) -> Self;

src/librustc/cfg/construct.rs

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,11 @@ use syntax::ast;
1515
use syntax::ptr::P;
1616

1717
use hir::{self, PatKind};
18+
use hir::def_id::DefId;
1819

1920
struct CFGBuilder<'a, 'tcx: 'a> {
2021
tcx: TyCtxt<'a, 'tcx, 'tcx>,
22+
owner_def_id: DefId,
2123
tables: &'a ty::TypeckTables<'tcx>,
2224
graph: CFGGraph,
2325
fn_exit: CFGIndex,
@@ -56,6 +58,7 @@ pub fn construct<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
5658

5759
let mut cfg_builder = CFGBuilder {
5860
tcx: tcx,
61+
owner_def_id,
5962
tables: tables,
6063
graph: graph,
6164
fn_exit: fn_exit,
@@ -583,11 +586,12 @@ impl<'a, 'tcx> CFGBuilder<'a, 'tcx> {
583586
scope_id: ast::NodeId,
584587
to_index: CFGIndex) {
585588
let mut data = CFGEdgeData { exiting_scopes: vec![] };
586-
let mut scope = self.tcx.region_maps.node_extent(from_expr.id);
587-
let target_scope = self.tcx.region_maps.node_extent(scope_id);
589+
let mut scope = self.tcx.node_extent(from_expr.id);
590+
let target_scope = self.tcx.node_extent(scope_id);
591+
let region_maps = self.tcx.region_maps(self.owner_def_id);
588592
while scope != target_scope {
589-
data.exiting_scopes.push(scope.node_id(&self.tcx.region_maps));
590-
scope = self.tcx.region_maps.encl_scope(scope);
593+
data.exiting_scopes.push(scope.node_id());
594+
scope = region_maps.encl_scope(scope);
591595
}
592596
self.graph.add_edge(from_index, to_index, data);
593597
}

src/librustc/dep_graph/dep_node.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ pub enum DepNode<D: Clone + Debug> {
5656
WorkProduct(Arc<WorkProductId>),
5757

5858
// Represents different phases in the compiler.
59-
RegionResolveCrate,
59+
RegionMaps(D),
6060
Coherence,
6161
Resolve,
6262
CoherenceCheckTrait(D),
@@ -197,7 +197,6 @@ impl<D: Clone + Debug> DepNode<D> {
197197
BorrowCheckKrate => Some(BorrowCheckKrate),
198198
MirKrate => Some(MirKrate),
199199
TypeckBodiesKrate => Some(TypeckBodiesKrate),
200-
RegionResolveCrate => Some(RegionResolveCrate),
201200
Coherence => Some(Coherence),
202201
Resolve => Some(Resolve),
203202
Variance => Some(Variance),
@@ -223,6 +222,7 @@ impl<D: Clone + Debug> DepNode<D> {
223222
def_ids.map(MirShim)
224223
}
225224
BorrowCheck(ref d) => op(d).map(BorrowCheck),
225+
RegionMaps(ref d) => op(d).map(RegionMaps),
226226
RvalueCheck(ref d) => op(d).map(RvalueCheck),
227227
TransCrateItem(ref d) => op(d).map(TransCrateItem),
228228
TransInlinedItem(ref d) => op(d).map(TransInlinedItem),

src/librustc/hir/intravisit.rs

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ use syntax::codemap::Spanned;
3939
use syntax_pos::Span;
4040
use hir::*;
4141
use hir::def::Def;
42-
use hir::map::Map;
42+
use hir::map::{self, Map};
4343
use super::itemlikevisit::DeepVisitor;
4444

4545
use std::cmp;
@@ -140,6 +140,23 @@ impl<'this, 'tcx> NestedVisitorMap<'this, 'tcx> {
140140
/// to monitor future changes to `Visitor` in case a new method with a
141141
/// new default implementation gets introduced.)
142142
pub trait Visitor<'v> : Sized {
143+
/// Invokes the suitable visitor method for the given `Node`
144+
/// extracted from the hir map.
145+
fn visit_hir_map_node(&mut self, node: map::Node<'v>) {
146+
match node {
147+
map::NodeItem(a) => self.visit_item(a),
148+
map::NodeForeignItem(a) => self.visit_foreign_item(a),
149+
map::NodeTraitItem(a) => self.visit_trait_item(a),
150+
map::NodeImplItem(a) => self.visit_impl_item(a),
151+
map::NodeExpr(a) => self.visit_expr(a),
152+
map::NodeStmt(a) => self.visit_stmt(a),
153+
map::NodeTy(a) => self.visit_ty(a),
154+
map::NodePat(a) => self.visit_pat(a),
155+
map::NodeBlock(a) => self.visit_block(a),
156+
_ => bug!("Visitor::visit_hir_map_node() not yet impl for node `{:?}`", node)
157+
}
158+
}
159+
143160
///////////////////////////////////////////////////////////////////////////
144161
// Nested items.
145162

src/librustc/ich/impls_ty.rs

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ impl<'a, 'tcx> HashStable<StableHashingContext<'a, 'tcx>> for ty::subst::Kind<'t
3939
}
4040
}
4141

42-
impl<'a, 'tcx> HashStable<StableHashingContext<'a, 'tcx>> for ty::Region {
42+
impl<'a, 'tcx> HashStable<StableHashingContext<'a, 'tcx>> for ty::RegionKind<'tcx> {
4343
fn hash_stable<W: StableHasherResult>(&self,
4444
hcx: &mut StableHashingContext<'a, 'tcx>,
4545
hasher: &mut StableHasher<W>) {
@@ -432,17 +432,6 @@ impl_stable_hash_for!(enum ty::cast::CastKind {
432432
FnPtrAddrCast
433433
});
434434

435-
impl<'a, 'tcx> HashStable<StableHashingContext<'a, 'tcx>> for ::middle::region::CodeExtent
436-
{
437-
fn hash_stable<W: StableHasherResult>(&self,
438-
hcx: &mut StableHashingContext<'a, 'tcx>,
439-
hasher: &mut StableHasher<W>) {
440-
hcx.with_node_id_hashing_mode(NodeIdHashingMode::HashDefPath, |hcx| {
441-
hcx.tcx().region_maps.code_extent_data(*self).hash_stable(hcx, hasher);
442-
});
443-
}
444-
}
445-
446435
impl<'a, 'tcx> HashStable<StableHashingContext<'a, 'tcx>> for ::middle::region::CodeExtentData
447436
{
448437
fn hash_stable<W: StableHasherResult>(&self,
@@ -477,7 +466,7 @@ impl_stable_hash_for!(struct ty::adjustment::CoerceUnsizedInfo {
477466
custom_kind
478467
});
479468

480-
impl_stable_hash_for!(struct ty::FreeRegion {
469+
impl_stable_hash_for!(struct ty::FreeRegion<'tcx> {
481470
scope,
482471
bound_region
483472
});

0 commit comments

Comments
 (0)