Suppress must_use for ControlFlow in rust-analyzer
This commit is contained in:
parent
380ce74401
commit
e250bd16da
10 changed files with 17 additions and 17 deletions
|
@ -145,19 +145,19 @@ impl chalk_solve::RustIrDatabase<Interner> for ChalkContext<'_> {
|
|||
let mut result = vec![];
|
||||
if fps.is_empty() {
|
||||
debug!("Unrestricted search for {:?} impls...", trait_);
|
||||
self.for_trait_impls(trait_, self_ty_fp, |impls| {
|
||||
let _ = self.for_trait_impls(trait_, self_ty_fp, |impls| {
|
||||
result.extend(impls.for_trait(trait_).map(id_to_chalk));
|
||||
ControlFlow::Continue(())
|
||||
})
|
||||
});
|
||||
} else {
|
||||
self.for_trait_impls(trait_, self_ty_fp, |impls| {
|
||||
let _ = self.for_trait_impls(trait_, self_ty_fp, |impls| {
|
||||
result.extend(
|
||||
fps.iter().flat_map(move |fp| {
|
||||
impls.for_trait_and_self_ty(trait_, *fp).map(id_to_chalk)
|
||||
}),
|
||||
);
|
||||
ControlFlow::Continue(())
|
||||
})
|
||||
});
|
||||
};
|
||||
|
||||
debug!("impls_for_trait returned {} impls", result.len());
|
||||
|
|
|
@ -116,7 +116,7 @@ pub fn dyn_compatibility_of_trait_query(
|
|||
trait_: TraitId,
|
||||
) -> Option<DynCompatibilityViolation> {
|
||||
let mut res = None;
|
||||
dyn_compatibility_of_trait_with_callback(db, trait_, &mut |osv| {
|
||||
let _ = dyn_compatibility_of_trait_with_callback(db, trait_, &mut |osv| {
|
||||
res = Some(osv);
|
||||
ControlFlow::Break(())
|
||||
});
|
||||
|
@ -597,7 +597,7 @@ fn contains_illegal_impl_trait_in_trait(
|
|||
|
||||
let ret = sig.skip_binders().ret();
|
||||
let mut visitor = OpaqueTypeCollector(FxHashSet::default());
|
||||
ret.visit_with(visitor.as_dyn(), DebruijnIndex::INNERMOST);
|
||||
let _ = ret.visit_with(visitor.as_dyn(), DebruijnIndex::INNERMOST);
|
||||
|
||||
// Since we haven't implemented RPITIT in proper way like rustc yet,
|
||||
// just check whether `ret` contains RPIT for now
|
||||
|
|
|
@ -53,7 +53,7 @@ fn check_dyn_compatibility<'a>(
|
|||
continue;
|
||||
};
|
||||
let mut osvs = FxHashSet::default();
|
||||
dyn_compatibility_with_callback(&db, trait_id, &mut |osv| {
|
||||
let _ = dyn_compatibility_with_callback(&db, trait_id, &mut |osv| {
|
||||
osvs.insert(match osv {
|
||||
DynCompatibilityViolation::SizedSelf => SizedSelf,
|
||||
DynCompatibilityViolation::SelfReferential => SelfReferential,
|
||||
|
|
|
@ -1143,7 +1143,7 @@ impl<'a> InferenceContext<'a> {
|
|||
non_assocs: FxHashMap::default(),
|
||||
};
|
||||
for ty in tait_candidates {
|
||||
ty.visit_with(collector.as_dyn(), DebruijnIndex::INNERMOST);
|
||||
let _ = ty.visit_with(collector.as_dyn(), DebruijnIndex::INNERMOST);
|
||||
}
|
||||
|
||||
// Non-assoc TAITs can be define-used everywhere as long as they are
|
||||
|
|
|
@ -1033,7 +1033,7 @@ where
|
|||
T: ?Sized + TypeVisitable<Interner>,
|
||||
{
|
||||
let mut collector = PlaceholderCollector { db, placeholders: FxHashSet::default() };
|
||||
value.visit_with(&mut collector, DebruijnIndex::INNERMOST);
|
||||
let _ = value.visit_with(&mut collector, DebruijnIndex::INNERMOST);
|
||||
collector.placeholders.into_iter().collect()
|
||||
}
|
||||
|
||||
|
|
|
@ -596,7 +596,7 @@ pub(crate) fn iterate_method_candidates<T>(
|
|||
mut callback: impl FnMut(ReceiverAdjustments, AssocItemId, bool) -> Option<T>,
|
||||
) -> Option<T> {
|
||||
let mut slot = None;
|
||||
iterate_method_candidates_dyn(
|
||||
let _ = iterate_method_candidates_dyn(
|
||||
ty,
|
||||
db,
|
||||
env,
|
||||
|
|
|
@ -260,7 +260,7 @@ fn resolve_impl_trait_item(
|
|||
// attributes here. Use path resolution directly instead.
|
||||
//
|
||||
// FIXME: resolve type aliases (which are not yielded by iterate_path_candidates)
|
||||
method_resolution::iterate_path_candidates(
|
||||
let _ = method_resolution::iterate_path_candidates(
|
||||
&canonical,
|
||||
db,
|
||||
environment,
|
||||
|
|
|
@ -2911,7 +2911,7 @@ impl Trait {
|
|||
db: &dyn HirDatabase,
|
||||
) -> Option<Vec<DynCompatibilityViolation>> {
|
||||
let mut violations = vec![];
|
||||
hir_ty::dyn_compatibility::dyn_compatibility_with_callback(db, self.id, &mut |violation| {
|
||||
let _ = hir_ty::dyn_compatibility::dyn_compatibility_with_callback(db, self.id, &mut |violation| {
|
||||
violations.push(violation);
|
||||
ControlFlow::Continue(())
|
||||
});
|
||||
|
@ -5497,7 +5497,7 @@ impl Type {
|
|||
.generic_def()
|
||||
.map_or_else(|| TraitEnvironment::empty(krate.id), |d| db.trait_environment(d));
|
||||
|
||||
method_resolution::iterate_method_candidates_dyn(
|
||||
let _ = method_resolution::iterate_method_candidates_dyn(
|
||||
&canonical,
|
||||
db,
|
||||
environment,
|
||||
|
@ -5584,7 +5584,7 @@ impl Type {
|
|||
.generic_def()
|
||||
.map_or_else(|| TraitEnvironment::empty(krate.id), |d| db.trait_environment(d));
|
||||
|
||||
method_resolution::iterate_path_candidates(
|
||||
let _ = method_resolution::iterate_path_candidates(
|
||||
&canonical,
|
||||
db,
|
||||
environment,
|
||||
|
|
|
@ -750,7 +750,7 @@ impl FunctionBody {
|
|||
ast::Stmt::Item(_) => (),
|
||||
ast::Stmt::LetStmt(stmt) => {
|
||||
if let Some(pat) = stmt.pat() {
|
||||
walk_pat(&pat, &mut |pat| {
|
||||
let _ = walk_pat(&pat, &mut |pat| {
|
||||
cb(pat);
|
||||
std::ops::ControlFlow::<(), ()>::Continue(())
|
||||
});
|
||||
|
|
|
@ -121,7 +121,7 @@ pub fn walk_patterns_in_expr(start: &ast::Expr, cb: &mut dyn FnMut(ast::Pat)) {
|
|||
match ast::Stmt::cast(node.clone()) {
|
||||
Some(ast::Stmt::LetStmt(l)) => {
|
||||
if let Some(pat) = l.pat() {
|
||||
walk_pat(&pat, &mut |pat| {
|
||||
let _ = walk_pat(&pat, &mut |pat| {
|
||||
cb(pat);
|
||||
ControlFlow::<(), ()>::Continue(())
|
||||
});
|
||||
|
@ -159,7 +159,7 @@ pub fn walk_patterns_in_expr(start: &ast::Expr, cb: &mut dyn FnMut(ast::Pat)) {
|
|||
}
|
||||
} else if let Some(pat) = ast::Pat::cast(node) {
|
||||
preorder.skip_subtree();
|
||||
walk_pat(&pat, &mut |pat| {
|
||||
let _ = walk_pat(&pat, &mut |pat| {
|
||||
cb(pat);
|
||||
ControlFlow::<(), ()>::Continue(())
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue