try gating early, add non-ascii test
This commit is contained in:
parent
78e3455d37
commit
bf3ca5979e
@ -1,4 +1,3 @@
|
||||
use ast::token;
|
||||
use rustc_ast as ast;
|
||||
use rustc_ast::visit::{self, AssocCtxt, FnCtxt, FnKind, Visitor};
|
||||
use rustc_ast::{attr, AssocConstraint, AssocConstraintKind, NodeId};
|
||||
|
@ -1922,6 +1922,7 @@ pub(super) fn parse_opt_token_lit(&mut self) -> Option<(token::Lit, Span)> {
|
||||
let recovered = self.recover_after_dot();
|
||||
let token = recovered.as_ref().unwrap_or(&self.token);
|
||||
let span = token.span;
|
||||
|
||||
token::Lit::from_token(token).map(|token_lit| {
|
||||
self.bump();
|
||||
(token_lit, span)
|
||||
|
10
tests/ui/rfcs/rfc-3348-c-string-literals/non-ascii.rs
Normal file
10
tests/ui/rfcs/rfc-3348-c-string-literals/non-ascii.rs
Normal file
@ -0,0 +1,10 @@
|
||||
// run-pass
|
||||
|
||||
#![feature(c_str_literals)]
|
||||
|
||||
fn main() {
|
||||
assert_eq!(
|
||||
c"\xEF\x80🦀\u{1F980}".to_bytes_with_nul(),
|
||||
&[0xEF, 0x80, 0xF0, 0x9F, 0xA6, 0x80, 0xF0, 0x9F, 0xA6, 0x80, 0x00],
|
||||
);
|
||||
}
|
Loading…
Reference in New Issue
Block a user