Skip to content

Commit bf3ca59

Browse files
committed
try gating early, add non-ascii test
1 parent 78e3455 commit bf3ca59

File tree

3 files changed

+11
-1
lines changed

3 files changed

+11
-1
lines changed

compiler/rustc_ast_passes/src/feature_gate.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
use ast::token;
21
use rustc_ast as ast;
32
use rustc_ast::visit::{self, AssocCtxt, FnCtxt, FnKind, Visitor};
43
use rustc_ast::{attr, AssocConstraint, AssocConstraintKind, NodeId};

compiler/rustc_parse/src/parser/expr.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1922,6 +1922,7 @@ impl<'a> Parser<'a> {
19221922
let recovered = self.recover_after_dot();
19231923
let token = recovered.as_ref().unwrap_or(&self.token);
19241924
let span = token.span;
1925+
19251926
token::Lit::from_token(token).map(|token_lit| {
19261927
self.bump();
19271928
(token_lit, span)
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
// run-pass
2+
3+
#![feature(c_str_literals)]
4+
5+
fn main() {
6+
assert_eq!(
7+
c"\xEF\x80🦀\u{1F980}".to_bytes_with_nul(),
8+
&[0xEF, 0x80, 0xF0, 0x9F, 0xA6, 0x80, 0xF0, 0x9F, 0xA6, 0x80, 0x00],
9+
);
10+
}

0 commit comments

Comments
 (0)