about summary refs log tree commit diff
path: root/src/tools/clippy/tests/ui-internal/symbol_as_str.fixed
blob: 6a71b16c6049443a59eca0a494152485dd6d5591 (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
#![feature(rustc_private)]

extern crate rustc_span;

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

fn f(s: Symbol) {
    s == sym::f32;
    //~^ symbol_as_str
    s == sym::proc_dash_macro;
    //~^ symbol_as_str
    s == kw::SelfLower;
    //~^ symbol_as_str
    s == sym::msrv;
    //~^ symbol_as_str
    s == sym::Cargo_toml;
    //~^ symbol_as_str
    sym::get == s;
    //~^ symbol_as_str

    let _ = match s {
        //~^ symbol_as_str
        sym::unwrap_err => 1,
        sym::unwrap_or_default | sym::unwrap_or_else => 2,
        _ => 3,
    };
}