]> git.lizzy.rs Git - rust.git/commit
Parameterise `Parser::{recover_unclosed_char,handle_missing_lit}`.
authorNicholas Nethercote <n.nethercote@gmail.com>
Mon, 5 Dec 2022 03:39:56 +0000 (14:39 +1100)
committerNicholas Nethercote <n.nethercote@gmail.com>
Mon, 5 Dec 2022 04:04:33 +0000 (15:04 +1100)
commitd887615b4c83d856cd3e40000968c047f2ff4019
tree5bc313564dcd33003f3087167ababad74b664189
parent4ae956f600e72d62a6b17d95705148442841cef0
Parameterise `Parser::{recover_unclosed_char,handle_missing_lit}`.

These two methods both produce a `MetaItemLit`, and then some of the
call sites convert the `MetaItemLit` to a `token::Lit` with
`as_token_lit`.

This commit parameterises these two methods with a `mk_lit_char`
closure, which can be used to produce either `MetaItemLit` or
`token::Lit` directly as necessary.
compiler/rustc_parse/src/parser/expr.rs
compiler/rustc_parse/src/parser/pat.rs