Implement lint against Symbol::intern
on a string literal
This commit is contained in:
parent
c322cd5c5a
commit
72d2db7bf4
6 changed files with 54 additions and 2 deletions
|
@ -315,6 +315,7 @@ symbols! {
|
|||
StructuralPartialEq,
|
||||
SubdiagMessage,
|
||||
Subdiagnostic,
|
||||
SymbolIntern,
|
||||
Sync,
|
||||
SyncUnsafeCell,
|
||||
T,
|
||||
|
@ -2401,6 +2402,7 @@ impl Symbol {
|
|||
}
|
||||
|
||||
/// Maps a string to its interned representation.
|
||||
#[rustc_diagnostic_item = "SymbolIntern"]
|
||||
pub fn intern(string: &str) -> Self {
|
||||
with_session_globals(|session_globals| session_globals.symbol_interner.intern(string))
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue