rust/compiler/rustc_span/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
..
analyze_source_file Use relative positions inside a SourceFile. 2023-09-03 12:56:10 +00:00
edit_distance Add test for precise algorithm used 2023-02-19 22:59:22 +00:00
source_map Use Freeze for SourceFile.lines 2023-09-07 13:05:05 +02:00
symbol Move the Lock into symbol::Interner 2021-09-15 18:46:45 +02:00
analyze_source_file.rs Use relative positions inside a SourceFile. 2023-09-03 12:56:10 +00:00
caching_source_map_view.rs Use relative positions inside a SourceFile. 2023-09-03 12:56:10 +00:00
def_id.rs Use {Local}ModDefId in many queries 2023-08-14 07:22:48 +00:00
edit_distance.rs Rollup merge of #114351 - ttsugriy:sort-by-words, r=fee1-dead 2023-08-04 21:31:56 +02:00
edition.rs Make it clearer that edition functions are >=, not == 2023-07-19 16:38:35 +00:00
fatal_error.rs Make fatal DiagnosticBuilder yield never 2022-03-27 22:25:32 -07:00
hygiene.rs Rollup merge of #115081 - Zoxc:expn-id-decode, r=cjgillot 2023-08-25 09:00:12 +02:00
lib.rs Auto merge of #115594 - nnethercote:span-tweaks, r=cjgillot 2023-09-09 10:56:24 +00:00
profiling.rs Remove an unnecessary use of with_session_globals. 2023-03-31 15:34:00 +11:00
source_map.rs Use Freeze for SourceFile.lines 2023-09-07 13:05:05 +02:00
span_encoding.rs Optimize Span::is_dummy. 2023-09-08 16:54:02 +10:00
symbol.rs Auto merge of #114494 - est31:extend_useless_ptr_null_checks, r=jackh726 2023-09-16 03:40:20 +00:00
tests.rs Use Freeze for SourceFile.lines 2023-09-07 13:05:05 +02:00