Rollup merge of #110545 - WaffleLapkin:generic_arg_as_x, r=cjgillot
Add `GenericArgKind::as_{type,const,region}` This allows to make code nicer in some cases
This commit is contained in:
commit
17f6763a14
8 changed files with 84 additions and 110 deletions
|
@ -166,10 +166,8 @@ declare_lint_pass!(BoxPointers => [BOX_POINTERS]);
|
|||
impl BoxPointers {
|
||||
fn check_heap_type(&self, cx: &LateContext<'_>, span: Span, ty: Ty<'_>) {
|
||||
for leaf in ty.walk() {
|
||||
if let GenericArgKind::Type(leaf_ty) = leaf.unpack() {
|
||||
if leaf_ty.is_box() {
|
||||
cx.emit_spanned_lint(BOX_POINTERS, span, BuiltinBoxPointers { ty });
|
||||
}
|
||||
if let GenericArgKind::Type(leaf_ty) = leaf.unpack() && leaf_ty.is_box() {
|
||||
cx.emit_spanned_lint(BOX_POINTERS, span, BuiltinBoxPointers { ty });
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue