rust/compiler/rustc_span/src
Yuki Okushi 07faa2e32c
Rollup merge of #87170 - xFrednet:clippy-5393-add-diagnostic-items, r=Manishearth,oli-obk
Add diagnostic items for Clippy

This adds a bunch of diagnostic items to `std`/`core`/`alloc` functions, structs and traits used in Clippy. The actual refactorings in Clippy to use these items will be done in a different PR in Clippy after the next sync.

This PR doesn't include all paths Clippy uses, I've only gone through the first 85 lines of Clippy's [`paths.rs`](ecf85f4bdc/clippy_utils/src/paths.rs) (after rust-lang/rust-clippy#7466) to get some feedback early on. I've also decided against adding diagnostic items to methods, as it would be nicer and more scalable to access them in a nicer fashion, like adding a `is_diagnostic_assoc_item(did, sym::Iterator, sym::map)` function or something similar (Suggested by `@camsteffen` [on Zulip](https://rust-lang.zulipchat.com/#narrow/stream/147480-t-compiler.2Fwg-diagnostics/topic/Diagnostic.20Item.20Naming.20Convention.3F/near/225024603))

There seems to be some different naming conventions when it comes to diagnostic items, some use UpperCamelCase (`BinaryHeap`) and some snake_case (`hashmap_type`). This PR uses UpperCamelCase for structs and traits and snake_case with the module name as a prefix for functions. Any feedback on is this welcome.

cc: rust-lang/rust-clippy#5393

r? `@Manishearth`
2021-07-18 14:21:57 +09:00
..
analyze_source_file
lev_distance Rework SESSION_GLOBALS API to prevent overwriting it 2021-07-08 16:16:28 +02:00
source_map Split span_to_string into span_to_diagnostic/embeddable_string 2021-05-11 00:04:12 +01:00
symbol Rework SESSION_GLOBALS API to prevent overwriting it 2021-07-08 16:16:28 +02:00
analyze_source_file.rs
caching_source_map_view.rs
def_id.rs Encode ExpnId using ExpnHash for incr. comp. 2021-07-17 19:41:08 +02:00
edition.rs
fatal_error.rs
hygiene.rs Simplify Expn creation. 2021-07-17 19:41:14 +02:00
lev_distance.rs
lib.rs Make the CrateNum part of the ExpnId. 2021-07-17 19:35:33 +02:00
source_map.rs Avoid byte to char position conversions in is_multiline 2021-07-01 13:30:00 +02:00
span_encoding.rs Rework SESSION_GLOBALS API to prevent overwriting it 2021-07-08 16:16:28 +02:00
symbol.rs Rollup merge of #87170 - xFrednet:clippy-5393-add-diagnostic-items, r=Manishearth,oli-obk 2021-07-18 14:21:57 +09:00
tests.rs Inline implementation of lookup_line 2021-07-08 23:30:53 +02:00