remove a bunch of dead parameters in fn
This commit is contained in:
parent
42752cbe09
commit
2bcbc16caf
16 changed files with 30 additions and 71 deletions
|
@ -16,7 +16,6 @@ use rustc_index::Idx;
|
|||
use rustc_middle::middle::region::*;
|
||||
use rustc_middle::ty::TyCtxt;
|
||||
use rustc_span::source_map;
|
||||
use rustc_span::Span;
|
||||
|
||||
use super::errs::{maybe_expr_static_mut, maybe_stmt_static_mut};
|
||||
|
||||
|
@ -72,11 +71,7 @@ struct RegionResolutionVisitor<'tcx> {
|
|||
}
|
||||
|
||||
/// Records the lifetime of a local variable as `cx.var_parent`
|
||||
fn record_var_lifetime(
|
||||
visitor: &mut RegionResolutionVisitor<'_>,
|
||||
var_id: hir::ItemLocalId,
|
||||
_sp: Span,
|
||||
) {
|
||||
fn record_var_lifetime(visitor: &mut RegionResolutionVisitor<'_>, var_id: hir::ItemLocalId) {
|
||||
match visitor.cx.var_parent {
|
||||
None => {
|
||||
// this can happen in extern fn declarations like
|
||||
|
@ -210,7 +205,7 @@ fn resolve_pat<'tcx>(visitor: &mut RegionResolutionVisitor<'tcx>, pat: &'tcx hir
|
|||
|
||||
// If this is a binding then record the lifetime of that binding.
|
||||
if let PatKind::Binding(..) = pat.kind {
|
||||
record_var_lifetime(visitor, pat.hir_id.local_id, pat.span);
|
||||
record_var_lifetime(visitor, pat.hir_id.local_id);
|
||||
}
|
||||
|
||||
debug!("resolve_pat - pre-increment {} pat = {:?}", visitor.expr_and_pat_count, pat);
|
||||
|
|
|
@ -425,9 +425,7 @@ fn check_predicates<'tcx>(
|
|||
|
||||
let mut res = Ok(());
|
||||
for (clause, span) in impl1_predicates {
|
||||
if !impl2_predicates
|
||||
.iter()
|
||||
.any(|pred2| trait_predicates_eq(tcx, clause.as_predicate(), *pred2, span))
|
||||
if !impl2_predicates.iter().any(|pred2| trait_predicates_eq(clause.as_predicate(), *pred2))
|
||||
{
|
||||
res = res.and(check_specialization_on(tcx, clause, span))
|
||||
}
|
||||
|
@ -459,10 +457,8 @@ fn check_predicates<'tcx>(
|
|||
///
|
||||
/// So we make that check in this function and try to raise a helpful error message.
|
||||
fn trait_predicates_eq<'tcx>(
|
||||
_tcx: TyCtxt<'tcx>,
|
||||
predicate1: ty::Predicate<'tcx>,
|
||||
predicate2: ty::Predicate<'tcx>,
|
||||
_span: Span,
|
||||
) -> bool {
|
||||
// FIXME(effects)
|
||||
predicate1 == predicate2
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue