about summary refs log tree commit diff
path: root/tests/ui/inference/str-as-char-non-lit.rs
blob: d38b46630dcf198a3a9261ec132b13f93801b9c4 (plain)
1
2
3
4
5
6
7
8
9
// Don't suggest double quotes when encountering an expr of type `char` where a `&str`
// is expected if the expr is not a char literal.
// issue: rust-lang/rust#125595

fn main() {
    let _: &str = ('a'); //~ ERROR mismatched types
    let token = || 'a';
    let _: &str = token(); //~ ERROR mismatched types
}