Skip to content

Commit 6c98b6a

Browse files
Fix unused_must_use warnings
1 parent 36dde9a commit 6c98b6a

File tree

6 files changed

+19
-18
lines changed

6 files changed

+19
-18
lines changed

chalk-solve/src/clauses/builtin_traits/unsize.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ fn outer_binder_parameters_used<I: Interner>(
6363
interner,
6464
parameters: HashSet::new(),
6565
};
66-
v.visit_with(&mut visitor, DebruijnIndex::INNERMOST);
66+
let _ = v.visit_with(&mut visitor, DebruijnIndex::INNERMOST);
6767
visitor.parameters
6868
}
6969

chalk-solve/src/clauses/env_elaborator.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ pub(super) fn elaborate_env_clauses<I: Interner>(
2626
environment: &Environment<I>,
2727
) {
2828
let mut this_round = vec![];
29-
in_clauses.visit_with(
29+
let _ = in_clauses.visit_with(
3030
&mut EnvElaborator::new(db, &mut this_round, environment),
3131
DebruijnIndex::INNERMOST,
3232
);

chalk-solve/src/infer/ucanonicalize.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ impl<I: Interner> InferenceTable<I> {
2525
universes.add(*universe.skip_kind());
2626
}
2727

28-
value0.value.visit_with(
28+
let _ = value0.value.visit_with(
2929
&mut UCollector {
3030
universes: &mut universes,
3131
interner,

chalk-solve/src/logging_db/id_collector.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ use std::collections::BTreeSet;
3131
/// references parent. IdCollector solves this by collecting all of the directly
3232
/// related identifiers, allowing those to be rendered as well, ensuring name
3333
/// resolution is successful.
34+
#[allow(unused_must_use)] // unused `Result`s from `Visitor`s
3435
pub fn collect_unrecorded_ids<'i, I: Interner, DB: RustIrDatabase<I>>(
3536
db: &'i DB,
3637
identifiers: &'_ BTreeSet<RecordedItemId<I>>,

chalk-solve/src/solve/truncate.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ pub fn needs_truncation<I: Interner>(
1313
value: impl Visit<I>,
1414
) -> bool {
1515
let mut visitor = TySizeVisitor::new(interner, infer);
16-
value.visit_with(&mut visitor, DebruijnIndex::INNERMOST);
16+
let _ = value.visit_with(&mut visitor, DebruijnIndex::INNERMOST);
1717

1818
visitor.max_size > max_size
1919
}
@@ -45,15 +45,15 @@ impl<'infer, 'i, I: Interner> Visitor<'i, I> for TySizeVisitor<'infer, 'i, I> {
4545

4646
fn visit_ty(&mut self, ty: &Ty<I>, outer_binder: DebruijnIndex) -> ControlFlow<()> {
4747
if let Some(normalized_ty) = self.infer.normalize_ty_shallow(self.interner, ty) {
48-
normalized_ty.visit_with(self, outer_binder);
48+
normalized_ty.visit_with(self, outer_binder)?;
4949
return ControlFlow::Ok(());
5050
}
5151

5252
self.size += 1;
5353
self.max_size = max(self.size, self.max_size);
5454

5555
self.depth += 1;
56-
ty.super_visit_with(self, outer_binder);
56+
ty.super_visit_with(self, outer_binder)?;
5757
self.depth -= 1;
5858

5959
// When we get back to the first invocation, clear the counters.
@@ -89,7 +89,7 @@ mod tests {
8989
(placeholder 1)))));
9090

9191
let mut visitor = TySizeVisitor::new(interner, &mut table);
92-
ty0.visit_with(&mut visitor, DebruijnIndex::INNERMOST);
92+
let _ = ty0.visit_with(&mut visitor, DebruijnIndex::INNERMOST);
9393
assert!(visitor.max_size == 5);
9494
}
9595

@@ -113,7 +113,7 @@ mod tests {
113113
(placeholder 1))));
114114

115115
let mut visitor = TySizeVisitor::new(interner, &mut table);
116-
vec![&ty0, &ty1].visit_with(&mut visitor, DebruijnIndex::INNERMOST);
116+
let _ = vec![&ty0, &ty1].visit_with(&mut visitor, DebruijnIndex::INNERMOST);
117117
assert!(visitor.max_size == 5);
118118
}
119119
}

chalk-solve/src/wf.rs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ impl<'i, I: Interner> InputTypeCollector<'i, I> {
6363

6464
fn types_in(interner: &'i I, value: impl Visit<I>) -> Vec<Ty<I>> {
6565
let mut collector = Self::new(interner);
66-
value.visit_with(&mut collector, DebruijnIndex::INNERMOST);
66+
let _ = value.visit_with(&mut collector, DebruijnIndex::INNERMOST);
6767
collector.types
6868
}
6969
}
@@ -104,12 +104,12 @@ impl<'i, I: Interner> Visitor<'i, I> for InputTypeCollector<'i, I> {
104104
match ty.kind(interner) {
105105
TyKind::Adt(id, substitution) => {
106106
push_ty();
107-
id.visit_with(self, outer_binder);
107+
id.visit_with(self, outer_binder)?;
108108
substitution.visit_with(self, outer_binder)
109109
}
110110
TyKind::AssociatedType(assoc_ty, substitution) => {
111111
push_ty();
112-
assoc_ty.visit_with(self, outer_binder);
112+
assoc_ty.visit_with(self, outer_binder)?;
113113
substitution.visit_with(self, outer_binder)
114114
}
115115
TyKind::Scalar(scalar) => {
@@ -122,12 +122,12 @@ impl<'i, I: Interner> Visitor<'i, I> for InputTypeCollector<'i, I> {
122122
}
123123
TyKind::Tuple(arity, substitution) => {
124124
push_ty();
125-
arity.visit_with(self, outer_binder);
125+
arity.visit_with(self, outer_binder)?;
126126
substitution.visit_with(self, outer_binder)
127127
}
128128
TyKind::OpaqueType(opaque_ty, substitution) => {
129129
push_ty();
130-
opaque_ty.visit_with(self, outer_binder);
130+
opaque_ty.visit_with(self, outer_binder)?;
131131
substitution.visit_with(self, outer_binder)
132132
}
133133
TyKind::Slice(substitution) => {
@@ -136,18 +136,18 @@ impl<'i, I: Interner> Visitor<'i, I> for InputTypeCollector<'i, I> {
136136
}
137137
TyKind::FnDef(fn_def, substitution) => {
138138
push_ty();
139-
fn_def.visit_with(self, outer_binder);
139+
fn_def.visit_with(self, outer_binder)?;
140140
substitution.visit_with(self, outer_binder)
141141
}
142142
TyKind::Ref(mutability, lifetime, ty) => {
143143
push_ty();
144-
mutability.visit_with(self, outer_binder);
145-
lifetime.visit_with(self, outer_binder);
144+
mutability.visit_with(self, outer_binder)?;
145+
lifetime.visit_with(self, outer_binder)?;
146146
ty.visit_with(self, outer_binder)
147147
}
148148
TyKind::Raw(mutability, substitution) => {
149149
push_ty();
150-
mutability.visit_with(self, outer_binder);
150+
mutability.visit_with(self, outer_binder)?;
151151
substitution.visit_with(self, outer_binder)
152152
}
153153
TyKind::Never => {
@@ -156,7 +156,7 @@ impl<'i, I: Interner> Visitor<'i, I> for InputTypeCollector<'i, I> {
156156
}
157157
TyKind::Array(ty, const_) => {
158158
push_ty();
159-
ty.visit_with(self, outer_binder);
159+
ty.visit_with(self, outer_binder)?;
160160
const_.visit_with(self, outer_binder)
161161
}
162162
TyKind::Closure(_id, substitution) => {

0 commit comments

Comments
 (0)