0
0
mirror of https://github.com/rust-lang/rust.git synced 2024-11-25 04:06:55 +01:00
rust/tests/ui/inference/str-as-char-non-lit.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

10 lines
314 B
Rust
Raw Normal View History

// 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
}