Skip to content

Commit 9757e90

Browse files
committed
Auto merge of #69958 - Centril:rollup-ecgx11p, r=Centril
Rollup of 8 pull requests Successful merges: - #68746 (Make macro metavars respect (non-)hygiene) - #69189 (Erase regions in writeback) - #69402 (Extend search) - #69403 (Implement `Copy` for `IoSlice`) - #69460 (Move some `build-pass` tests to `check-pass`) - #69802 (fix more clippy findings) - #69809 (remove lifetimes that can be elided (clippy::needless_lifetimes)) - #69949 (triagebot.toml: add ping aliases) Failed merges: - #69589 (ast: `Mac`/`Macro` -> `MacCall`) r? @ghost
2 parents 54b7d21 + e1f3da1 commit 9757e90

File tree

132 files changed

+770
-552
lines changed

Some content is hidden

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

132 files changed

+770
-552
lines changed

src/liballoc/collections/linked_list.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1427,7 +1427,7 @@ impl<'a, T> CursorMut<'a, T> {
14271427
/// `CursorMut`, which means it cannot outlive the `CursorMut` and that the
14281428
/// `CursorMut` is frozen for the lifetime of the `Cursor`.
14291429
#[unstable(feature = "linked_list_cursors", issue = "58533")]
1430-
pub fn as_cursor<'cm>(&'cm self) -> Cursor<'cm, T> {
1430+
pub fn as_cursor(&self) -> Cursor<'_, T> {
14311431
Cursor { list: self.list, current: self.current, index: self.index }
14321432
}
14331433
}

src/libcore/str/pattern.rs

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -365,11 +365,7 @@ unsafe impl<'a> ReverseSearcher<'a> for CharSearcher<'a> {
365365
let haystack = self.haystack.as_bytes();
366366
loop {
367367
// get the haystack up to but not including the last character searched
368-
let bytes = if let Some(slice) = haystack.get(self.finger..self.finger_back) {
369-
slice
370-
} else {
371-
return None;
372-
};
368+
let bytes = haystack.get(self.finger..self.finger_back)?;
373369
// the last byte of the utf8 encoded needle
374370
// SAFETY: we have an invariant that `utf8_size < 5`
375371
let last_byte = unsafe { *self.utf8_encoded.get_unchecked(self.utf8_size - 1) };
@@ -575,11 +571,12 @@ macro_rules! pattern_methods {
575571

576572
#[inline]
577573
fn is_suffix_of(self, haystack: &'a str) -> bool
578-
where $t: ReverseSearcher<'a>
574+
where
575+
$t: ReverseSearcher<'a>,
579576
{
580577
($pmap)(self).is_suffix_of(haystack)
581578
}
582-
}
579+
};
583580
}
584581

585582
macro_rules! searcher_methods {
@@ -614,7 +611,7 @@ macro_rules! searcher_methods {
614611
fn next_reject_back(&mut self) -> Option<(usize, usize)> {
615612
self.0.next_reject_back()
616613
}
617-
}
614+
};
618615
}
619616

620617
/////////////////////////////////////////////////////////////////////////////

src/librustc/dep_graph/dep_node.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ macro_rules! define_dep_nodes {
179179
$(
180180
#[inline(always)]
181181
#[allow(unreachable_code, non_snake_case)]
182-
pub fn $variant<'tcx>(_tcx: TyCtxt<'tcx>, $(arg: $tuple_arg_ty)*) -> DepNode {
182+
pub fn $variant(_tcx: TyCtxt<'_>, $(arg: $tuple_arg_ty)*) -> DepNode {
183183
// tuple args
184184
$({
185185
erase!($tuple_arg_ty);

src/librustc/hir/map/collector.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -340,7 +340,7 @@ impl<'a, 'hir> Visitor<'hir> for NodeCollector<'a, 'hir> {
340340
/// deep walking so that we walk nested items in the context of
341341
/// their outer items.
342342
343-
fn nested_visit_map<'this>(&'this mut self) -> NestedVisitorMap<'this, Self::Map> {
343+
fn nested_visit_map(&mut self) -> NestedVisitorMap<'_, Self::Map> {
344344
panic!("`visit_nested_xxx` must be manually implemented in this visitor");
345345
}
346346

src/librustc/hir/map/hir_id_validator.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ impl<'a, 'hir> HirIdValidator<'a, 'hir> {
135135
impl<'a, 'hir> intravisit::Visitor<'hir> for HirIdValidator<'a, 'hir> {
136136
type Map = Map<'hir>;
137137

138-
fn nested_visit_map<'this>(&'this mut self) -> intravisit::NestedVisitorMap<'this, Self::Map> {
138+
fn nested_visit_map(&mut self) -> intravisit::NestedVisitorMap<'_, Self::Map> {
139139
intravisit::NestedVisitorMap::OnlyBodies(self.hir_map)
140140
}
141141

src/librustc/hir/map/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,7 @@ impl<'hir> Map<'hir> {
298298
}
299299

300300
pub fn def_kind(&self, hir_id: HirId) -> Option<DefKind> {
301-
let node = if let Some(node) = self.find(hir_id) { node } else { return None };
301+
let node = self.find(hir_id)?;
302302

303303
Some(match node {
304304
Node::Item(item) => match item.kind {

src/librustc/mir/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -403,7 +403,7 @@ pub enum ClearCrossCrate<T> {
403403
}
404404

405405
impl<T> ClearCrossCrate<T> {
406-
pub fn as_ref(&'a self) -> ClearCrossCrate<&'a T> {
406+
pub fn as_ref(&self) -> ClearCrossCrate<&T> {
407407
match self {
408408
ClearCrossCrate::Clear => ClearCrossCrate::Clear,
409409
ClearCrossCrate::Set(v) => ClearCrossCrate::Set(v),
@@ -2503,7 +2503,7 @@ impl UserTypeProjection {
25032503

25042504
pub(crate) fn variant(
25052505
mut self,
2506-
adt_def: &'tcx AdtDef,
2506+
adt_def: &AdtDef,
25072507
variant_index: VariantIdx,
25082508
field: Field,
25092509
) -> Self {

src/librustc/ty/context.rs

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ use crate::mir::{
2222
};
2323
use crate::traits;
2424
use crate::traits::{Clause, Clauses, Goal, GoalKind, Goals};
25-
use crate::ty::free_region_map::FreeRegionMap;
2625
use crate::ty::layout::{LayoutDetails, TargetDataLayout, VariantIdx};
2726
use crate::ty::query;
2827
use crate::ty::steal::Steal;
@@ -415,11 +414,6 @@ pub struct TypeckTables<'tcx> {
415414
/// this field will be set to `true`.
416415
pub tainted_by_errors: bool,
417416

418-
/// Stores the free-region relationships that were deduced from
419-
/// its where-clauses and parameter types. These are then
420-
/// read-again by borrowck.
421-
pub free_region_map: FreeRegionMap<'tcx>,
422-
423417
/// All the opaque types that are restricted to concrete types
424418
/// by this function.
425419
pub concrete_opaque_types: FxHashMap<DefId, ResolvedOpaqueTy<'tcx>>,
@@ -455,7 +449,6 @@ impl<'tcx> TypeckTables<'tcx> {
455449
coercion_casts: Default::default(),
456450
used_trait_imports: Lrc::new(Default::default()),
457451
tainted_by_errors: false,
458-
free_region_map: Default::default(),
459452
concrete_opaque_types: Default::default(),
460453
upvar_list: Default::default(),
461454
generator_interior_types: Default::default(),
@@ -718,7 +711,6 @@ impl<'a, 'tcx> HashStable<StableHashingContext<'a>> for TypeckTables<'tcx> {
718711

719712
ref used_trait_imports,
720713
tainted_by_errors,
721-
ref free_region_map,
722714
ref concrete_opaque_types,
723715
ref upvar_list,
724716
ref generator_interior_types,
@@ -756,7 +748,6 @@ impl<'a, 'tcx> HashStable<StableHashingContext<'a>> for TypeckTables<'tcx> {
756748
coercion_casts.hash_stable(hcx, hasher);
757749
used_trait_imports.hash_stable(hcx, hasher);
758750
tainted_by_errors.hash_stable(hcx, hasher);
759-
free_region_map.hash_stable(hcx, hasher);
760751
concrete_opaque_types.hash_stable(hcx, hasher);
761752
upvar_list.hash_stable(hcx, hasher);
762753
generator_interior_types.hash_stable(hcx, hasher);

src/librustc/ty/util.rs

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -346,12 +346,7 @@ impl<'tcx> TyCtxt<'tcx> {
346346
adt_did: DefId,
347347
validate: &mut dyn FnMut(Self, DefId) -> Result<(), ErrorReported>,
348348
) -> Option<ty::Destructor> {
349-
let drop_trait = if let Some(def_id) = self.lang_items().drop_trait() {
350-
def_id
351-
} else {
352-
return None;
353-
};
354-
349+
let drop_trait = self.lang_items().drop_trait()?;
355350
self.ensure().coherent_trait(drop_trait);
356351

357352
let mut dtor_did = None;

src/librustc_codegen_llvm/common.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -320,7 +320,7 @@ impl ConstMethods<'tcx> for CodegenCx<'ll, 'tcx> {
320320
}
321321
}
322322

323-
pub fn val_ty(v: &'ll Value) -> &'ll Type {
323+
pub fn val_ty(v: &Value) -> &Type {
324324
unsafe { llvm::LLVMTypeOf(v) }
325325
}
326326

@@ -342,6 +342,6 @@ fn hi_lo_to_u128(lo: u64, hi: u64) -> u128 {
342342
((hi as u128) << 64) | (lo as u128)
343343
}
344344

345-
fn try_as_const_integral(v: &'ll Value) -> Option<&'ll ConstantInt> {
345+
fn try_as_const_integral(v: &Value) -> Option<&ConstantInt> {
346346
unsafe { llvm::LLVMIsAConstantInt(v) }
347347
}

0 commit comments

Comments
 (0)