From 8cfa4fe6b2268385480dc4a88ce3e6fdb06a3596 Mon Sep 17 00:00:00 2001 From: est31 Date: Sat, 5 Aug 2023 04:54:23 +0200 Subject: Add #[rustc_never_returns_null_ptr] And look for it in the useless_ptr_null_checks lint --- compiler/rustc_passes/src/check_attr.rs | 3 +++ 1 file changed, 3 insertions(+) (limited to 'compiler/rustc_passes/src') diff --git a/compiler/rustc_passes/src/check_attr.rs b/compiler/rustc_passes/src/check_attr.rs index cbb030958c6..bec12ca185e 100644 --- a/compiler/rustc_passes/src/check_attr.rs +++ b/compiler/rustc_passes/src/check_attr.rs @@ -139,6 +139,9 @@ impl CheckAttrVisitor<'_> { self.check_rustc_std_internal_symbol(&attr, span, target) } sym::naked => self.check_naked(hir_id, attr, span, target), + sym::rustc_never_returns_null_ptr => { + self.check_applied_to_fn_or_method(hir_id, attr, span, target) + } sym::rustc_legacy_const_generics => { self.check_rustc_legacy_const_generics(hir_id, &attr, span, target, item) } -- cgit 1.4.1-3-g733a5