Skip to content

Commit d6c158d

Browse files
committed
address nit from niko's review.
1 parent f51176d commit d6c158d

File tree

1 file changed

+1
-40
lines changed

1 file changed

+1
-40
lines changed

src/librustc_typeck/check/dropck.rs

+1-40
Original file line numberDiff line numberDiff line change
@@ -170,43 +170,6 @@ fn iterate_over_potentially_unsafe_regions_in_type<'a, 'tcx>(
170170
result
171171
});
172172

173-
let has_type_param_of_interest = dtor_generics.types.iter().any(|t| {
174-
let &ty::ParamBounds {
175-
ref region_bounds, builtin_bounds, ref trait_bounds,
176-
ref projection_bounds,
177-
} = &t.bounds;
178-
179-
// Belt-and-suspenders: The current set of builtin
180-
// bounds {Send, Sized, Copy, Sync} do not introduce
181-
// any new capability to access borrowed data hidden
182-
// behind a type parameter.
183-
//
184-
// In case new builtin bounds get added that do not
185-
// satisfy that property, ensure `builtin_bounds \
186-
// {Send,Sized,Copy,Sync}` is empty.
187-
188-
let mut builtin_bounds = builtin_bounds;
189-
builtin_bounds.remove(&ty::BoundSend);
190-
builtin_bounds.remove(&ty::BoundSized);
191-
builtin_bounds.remove(&ty::BoundCopy);
192-
builtin_bounds.remove(&ty::BoundSync);
193-
194-
let has_bounds =
195-
!region_bounds.is_empty() ||
196-
!builtin_bounds.is_empty() ||
197-
!trait_bounds.is_empty() ||
198-
!projection_bounds.is_empty();
199-
200-
if has_bounds {
201-
debug!("typ: {} has interesting dtor due to \
202-
bounds on param {}",
203-
typ.repr(rcx.tcx()), t.name);
204-
}
205-
206-
has_bounds
207-
208-
});
209-
210173
// In `impl<'a> Drop ...`, we automatically assume
211174
// `'a` is meaningful and thus represents a bound
212175
// through which we could reach borrowed data.
@@ -220,15 +183,13 @@ fn iterate_over_potentially_unsafe_regions_in_type<'a, 'tcx>(
220183

221184
has_dtor_of_interest =
222185
has_region_param_of_interest ||
223-
has_type_param_of_interest ||
224186
has_pred_of_interest;
225187

226188
if has_dtor_of_interest {
227189
debug!("typ: {} has interesting dtor, due to \
228-
region params: {} type params: {} or pred: {}",
190+
region params: {} or pred: {}",
229191
typ.repr(rcx.tcx()),
230192
has_region_param_of_interest,
231-
has_type_param_of_interest,
232193
has_pred_of_interest);
233194
} else {
234195
debug!("typ: {} has dtor, but it is uninteresting",

0 commit comments

Comments
 (0)