1
Fork 0
rust/compiler/rustc_feature/src
bors 635c4a5e61 Auto merge of #114494 - est31:extend_useless_ptr_null_checks, r=jackh726
Make useless_ptr_null_checks smarter about some std functions

This teaches the `useless_ptr_null_checks` lint that some std functions can't ever return null pointers, because they need to point to valid data, get references as input, etc.

This is achieved by introducing an `#[rustc_never_returns_null_ptr]` attribute and adding it to these std functions (gated behind bootstrap `cfg_attr`).

Later on, the attribute could maybe be used to tell LLVM that the returned pointer is never null. I don't expect much impact of that though, as the functions are pretty shallow and usually the input data is already never null.

Follow-up of PR #113657

Fixes #114442
2023-09-16 03:40:20 +00:00
..
accepted.rs fix version for abi_thiscall to 1.73.0, which was forgotten to change when stabilized 2023-09-01 19:46:09 +03:00
active.rs Rename the feature, but not the attribute, to coverage_attribute 2023-09-08 12:46:09 +01:00
builtin_attrs.rs Auto merge of #114494 - est31:extend_useless_ptr_null_checks, r=jackh726 2023-09-16 03:40:20 +00:00
lib.rs Issue numbers are enforced on active features; remove FIXME 2023-08-06 20:01:23 +02:00
removed.rs Fix the error message for #![feature(no_coverage)] 2023-09-14 13:01:54 +10:00
tests.rs tidy: Re-enable check for inline unit tests 2020-12-12 19:18:44 +03:00