Fix warnings about unnecessary lifetime bounds

Rustup https://github.com/rust-lang/rust/pull/61172
This commit is contained in:
Lzu Tao
2019-06-20 01:36:23 +07:00
parent 149a988146
commit 4fa498a3eb
34 changed files with 83 additions and 87 deletions

View File

@@ -9,7 +9,7 @@ use rustc_data_structures::fx::FxHashSet;
use syntax::source_map::Span;
/// Returns a set of mutated local variable IDs, or `None` if mutations could not be determined.
pub fn mutated_variables<'a, 'tcx: 'a>(expr: &'tcx Expr, cx: &'a LateContext<'a, 'tcx>) -> Option<FxHashSet<HirId>> {
pub fn mutated_variables<'a, 'tcx>(expr: &'tcx Expr, cx: &'a LateContext<'a, 'tcx>) -> Option<FxHashSet<HirId>> {
let mut delegate = MutVarsDelegate {
used_mutably: FxHashSet::default(),
skip: false,
@@ -33,11 +33,7 @@ pub fn mutated_variables<'a, 'tcx: 'a>(expr: &'tcx Expr, cx: &'a LateContext<'a,
Some(delegate.used_mutably)
}
pub fn is_potentially_mutated<'a, 'tcx: 'a>(
variable: &'tcx Path,
expr: &'tcx Expr,
cx: &'a LateContext<'a, 'tcx>,
) -> bool {
pub fn is_potentially_mutated<'a, 'tcx>(variable: &'tcx Path, expr: &'tcx Expr, cx: &'a LateContext<'a, 'tcx>) -> bool {
if let Res::Local(id) = variable.res {
mutated_variables(expr, cx).map_or(true, |mutated| mutated.contains(&id))
} else {