提交 502d570b 编写于 作者: E Esteban Küber

Use def span for non-ascii ident feature gate error

上级 3cc68bac
...@@ -1341,7 +1341,9 @@ fn visit_attribute(&mut self, attr: &ast::Attribute) { ...@@ -1341,7 +1341,9 @@ fn visit_attribute(&mut self, attr: &ast::Attribute) {
fn visit_name(&mut self, sp: Span, name: ast::Name) { fn visit_name(&mut self, sp: Span, name: ast::Name) {
if !name.as_str().is_ascii() { if !name.as_str().is_ascii() {
gate_feature_post!(&self, non_ascii_idents, sp, gate_feature_post!(&self,
non_ascii_idents,
self.context.parse_sess.codemap().def_span(sp),
"non-ascii idents are not fully supported."); "non-ascii idents are not fully supported.");
} }
} }
......
...@@ -17,10 +17,8 @@ error: non-ascii idents are not fully supported. (see issue #28979) ...@@ -17,10 +17,8 @@ error: non-ascii idents are not fully supported. (see issue #28979)
error: non-ascii idents are not fully supported. (see issue #28979) error: non-ascii idents are not fully supported. (see issue #28979)
--> $DIR/feature-gate-non_ascii_idents.rs:15:1 --> $DIR/feature-gate-non_ascii_idents.rs:15:1
| |
15 | / mod föö { //~ ERROR non-ascii idents 15 | mod föö { //~ ERROR non-ascii idents
16 | | pub fn bar() {} | ^^^^^^^
17 | | }
| |_^
| |
= help: add #![feature(non_ascii_idents)] to the crate attributes to enable = help: add #![feature(non_ascii_idents)] to the crate attributes to enable
...@@ -65,10 +63,8 @@ error: non-ascii idents are not fully supported. (see issue #28979) ...@@ -65,10 +63,8 @@ error: non-ascii idents are not fully supported. (see issue #28979)
error: non-ascii idents are not fully supported. (see issue #28979) error: non-ascii idents are not fully supported. (see issue #28979)
--> $DIR/feature-gate-non_ascii_idents.rs:29:1 --> $DIR/feature-gate-non_ascii_idents.rs:29:1
| |
29 | / struct Föö { //~ ERROR non-ascii idents 29 | struct Föö { //~ ERROR non-ascii idents
30 | | föö: isize //~ ERROR non-ascii idents | ^^^^^^^^^^
31 | | }
| |_^
| |
= help: add #![feature(non_ascii_idents)] to the crate attributes to enable = help: add #![feature(non_ascii_idents)] to the crate attributes to enable
...@@ -83,22 +79,16 @@ error: non-ascii idents are not fully supported. (see issue #28979) ...@@ -83,22 +79,16 @@ error: non-ascii idents are not fully supported. (see issue #28979)
error: non-ascii idents are not fully supported. (see issue #28979) error: non-ascii idents are not fully supported. (see issue #28979)
--> $DIR/feature-gate-non_ascii_idents.rs:33:1 --> $DIR/feature-gate-non_ascii_idents.rs:33:1
| |
33 | / enum Bär { //~ ERROR non-ascii idents 33 | enum Bär { //~ ERROR non-ascii idents
34 | | Bäz { //~ ERROR non-ascii idents | ^^^^^^^^
35 | | qüx: isize //~ ERROR non-ascii idents
36 | | }
37 | | }
| |_^
| |
= help: add #![feature(non_ascii_idents)] to the crate attributes to enable = help: add #![feature(non_ascii_idents)] to the crate attributes to enable
error: non-ascii idents are not fully supported. (see issue #28979) error: non-ascii idents are not fully supported. (see issue #28979)
--> $DIR/feature-gate-non_ascii_idents.rs:34:5 --> $DIR/feature-gate-non_ascii_idents.rs:34:5
| |
34 | / Bäz { //~ ERROR non-ascii idents 34 | Bäz { //~ ERROR non-ascii idents
35 | | qüx: isize //~ ERROR non-ascii idents | ^^^
36 | | }
| |_____^
| |
= help: add #![feature(non_ascii_idents)] to the crate attributes to enable = help: add #![feature(non_ascii_idents)] to the crate attributes to enable
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册