- let mut triggered = false;
- triggered |= box_vec::check(cx, hir_ty, qpath, def_id);
- triggered |= redundant_allocation::check(cx, hir_ty, qpath, def_id);
- triggered |= rc_buffer::check(cx, hir_ty, qpath, def_id);
- triggered |= vec_box::check(cx, hir_ty, qpath, def_id, self.vec_box_size_threshold);
- triggered |= option_option::check(cx, hir_ty, qpath, def_id);
- triggered |= linked_list::check(cx, hir_ty, def_id);
- triggered |= rc_mutex::check(cx, hir_ty, qpath, def_id);
-
- if triggered {
- return;
+ if self.is_type_change_allowed(context) {
+ // All lints that are being checked in this block are guarded by
+ // the `avoid_breaking_exported_api` configuration. When adding a
+ // new lint, please also add the name to the configuration documentation
+ // in `clippy_lints::utils::conf.rs`
+
+ let mut triggered = false;
+ triggered |= box_collection::check(cx, hir_ty, qpath, def_id);
+ triggered |= redundant_allocation::check(cx, hir_ty, qpath, def_id);
+ triggered |= rc_buffer::check(cx, hir_ty, qpath, def_id);
+ triggered |= vec_box::check(cx, hir_ty, qpath, def_id, self.vec_box_size_threshold);
+ triggered |= option_option::check(cx, hir_ty, qpath, def_id);
+ triggered |= linked_list::check(cx, hir_ty, def_id);
+ triggered |= rc_mutex::check(cx, hir_ty, qpath, def_id);
+
+ if triggered {
+ return;
+ }