diff options
| author | est31 <MTest31@outlook.com> | 2023-08-05 04:54:23 +0200 |
|---|---|---|
| committer | est31 <MTest31@outlook.com> | 2023-08-05 05:16:44 +0200 |
| commit | 8cfa4fe6b2268385480dc4a88ce3e6fdb06a3596 (patch) | |
| tree | 802035e9fd54a8db5096a87927ac62fdb05043a3 /compiler/rustc_passes/src | |
| parent | e173a8e6634d787a1529ff6ec5dc63273425ca34 (diff) | |
| download | rust-8cfa4fe6b2268385480dc4a88ce3e6fdb06a3596.tar.gz rust-8cfa4fe6b2268385480dc4a88ce3e6fdb06a3596.zip | |
Add #[rustc_never_returns_null_ptr]
And look for it in the useless_ptr_null_checks lint
Diffstat (limited to 'compiler/rustc_passes/src')
| -rw-r--r-- | compiler/rustc_passes/src/check_attr.rs | 3 |
1 files changed, 3 insertions, 0 deletions
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) } |
