about summary refs log tree commit diff
path: root/src/tools/clippy/tests/ui-internal/interning_literals.rs
blob: 561fd5702a59ff2bb8279de7bfa585d4d2519b6f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#![allow(clippy::let_unit_value)]
#![feature(rustc_private)]

extern crate rustc_span;

use clippy_utils::sym;
use rustc_span::{Symbol, kw};

fn main() {
    let _ = Symbol::intern("f32");
    //~^ interning_literals

    // Correct suggestion when symbol isn't stringified constant name
    let _ = Symbol::intern("proc-macro");
    //~^ interning_literals

    // Interning a keyword
    let _ = Symbol::intern("self");
    //~^ interning_literals

    // Defined in clippy_utils
    let _ = Symbol::intern("msrv");
    //~^ interning_literals
    let _ = Symbol::intern("Cargo.toml");
    //~^ interning_literals

    // Using a different `intern` function
    let _ = intern("f32");
}

fn intern(_: &str) {}