]> git.lizzy.rs Git - rust.git/commit
Display better snippet for invalid char literal
authorGreg Chapple <gregchapple1@gmail.com>
Thu, 7 Jan 2016 16:12:28 +0000 (16:12 +0000)
committerGreg Chapple <gregchapple1@gmail.com>
Thu, 14 Jan 2016 17:34:42 +0000 (17:34 +0000)
commitacc9428c6a99d199f35032ec7f794385e4c9fd24
treeea9da6f39079fa1f203a7ada38a6da79a6d7ada1
parentd3c83fef245f1cb2e523c8913b8968c98faec1f4
Display better snippet for invalid char literal

Given this code:

    fn main() {
        let _ = 'abcd';
    }

The compiler would give a message like:

    error: character literal may only contain one codepoint: ';
    let _ = 'abcd';
                 ^~

With this change, the message now displays:

    error: character literal may only contain one codepoint: 'abcd'
    let _ = 'abcd'
            ^~~~~~

Fixes #30033
src/libsyntax/parse/lexer/mod.rs
src/test/parse-fail/lex-bad-char-literals-1.rs [new file with mode: 0644]
src/test/parse-fail/lex-bad-char-literals-2.rs [new file with mode: 0644]
src/test/parse-fail/lex-bad-char-literals-3.rs [new file with mode: 0644]
src/test/parse-fail/lex-bad-char-literals-4.rs [new file with mode: 0644]
src/test/parse-fail/lex-bad-char-literals-5.rs [new file with mode: 0644]
src/test/parse-fail/lex-bad-char-literals.rs [deleted file]