rust/compiler/rustc_span/src
bors 8a3765582c Auto merge of #117758 - Urgau:lint_pointer_trait_comparisons, r=davidtwco
Add lint against ambiguous wide pointer comparisons

This PR is the resolution of https://github.com/rust-lang/rust/issues/106447 decided in https://github.com/rust-lang/rust/issues/117717 by T-lang.

## `ambiguous_wide_pointer_comparisons`

*warn-by-default*

The `ambiguous_wide_pointer_comparisons` lint checks comparison of `*const/*mut ?Sized` as the operands.

### Example

```rust
let ab = (A, B);
let a = &ab.0 as *const dyn T;
let b = &ab.1 as *const dyn T;

let _ = a == b;
```

### Explanation

The comparison includes metadata which may not be expected.

-------

This PR also drops `clippy::vtable_address_comparisons` which is superseded by this one.

~~One thing: is the current naming right? `invalid` seems a bit too much.~~

Fixes https://github.com/rust-lang/rust/issues/117717
2023-12-11 14:33:16 +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 remove redundant imports 2023-12-10 10:56:22 +08:00
symbol Use FxIndexSet in the symbol interner. 2023-11-03 07:19:41 +11:00
analyze_source_file.rs Initiate the inner usage of cfg_match 2023-10-19 20:18:51 -03:00
caching_source_map_view.rs Use relative positions inside a SourceFile. 2023-09-03 12:56:10 +00:00
def_id.rs Remove a comment. 2023-11-28 14:32:31 +11:00
edit_distance.rs rustc_span: Use correct edit distance start length for suggestions 2023-11-27 19:08:27 +01:00
edition.rs Remove edition umbrella features. 2023-12-10 13:03:28 -08:00
fatal_error.rs Auto merge of #117557 - Zoxc:panic-prio, r=petrochenkov 2023-11-09 00:39:02 +00:00
hygiene.rs Replace no_ord_impl with orderable. 2023-11-22 18:38:17 +11:00
lib.rs Rename HandlerInner::delay_span_bug as HandlerInner::span_delayed_bug. 2023-12-02 09:01:19 +11:00
profiling.rs Remove an unnecessary use of with_session_globals. 2023-03-31 15:34:00 +11:00
source_map.rs remove redundant imports 2023-12-10 10:56:22 +08:00
span_encoding.rs debug Span::ctxt() call detection 2023-10-16 19:50:29 -07:00
symbol.rs Auto merge of #117758 - Urgau:lint_pointer_trait_comparisons, r=davidtwco 2023-12-11 14:33:16 +00:00
tests.rs Use Freeze for SourceFile.lines 2023-09-07 13:05:05 +02:00