Skip to content

Commit 176f8c2

Browse files
author
Alexander Regueiro
committed
Removed raw_identifiers feature gate.
1 parent b73535f commit 176f8c2

30 files changed

+42
-109
lines changed

src/librustc_lint/builtin.rs

+6-8
Original file line numberDiff line numberDiff line change
@@ -1927,14 +1927,12 @@ impl Async2018 {
19271927
);
19281928

19291929
// Don't suggest about raw identifiers if the feature isn't active
1930-
if cx.sess.features_untracked().raw_identifiers {
1931-
lint.span_suggestion_with_applicability(
1932-
span,
1933-
"you can use a raw identifier to stay compatible",
1934-
"r#async".to_string(),
1935-
Applicability::MachineApplicable,
1936-
);
1937-
}
1930+
lint.span_suggestion_with_applicability(
1931+
span,
1932+
"you can use a raw identifier to stay compatible",
1933+
"r#async".to_string(),
1934+
Applicability::MachineApplicable,
1935+
);
19381936
lint.emit()
19391937
}
19401938
}

src/libsyntax/diagnostic_list.rs

+3-2
Original file line numberDiff line numberDiff line change
@@ -382,8 +382,9 @@ Erroneous code example:
382382
383383
```ignore (limited to a warning during 2018 edition development)
384384
#![feature(rust_2018_preview)]
385-
#![feature(raw_identifiers)] // error: the feature `raw_identifiers` is
386-
// included in the Rust 2018 edition
385+
#![feature(impl_header_lifetime_elision)] // error: the feature
386+
// `impl_header_lifetime_elision` is
387+
// included in the Rust 2018 edition
387388
```
388389
389390
"##,

src/libsyntax/feature_gate.rs

+2-13
Original file line numberDiff line numberDiff line change
@@ -433,9 +433,6 @@ declare_features! (
433433
// `use path as _;` and `extern crate c as _;`
434434
(active, underscore_imports, "1.26.0", Some(48216), None),
435435

436-
// Allows keywords to be escaped for use as identifiers
437-
(active, raw_identifiers, "1.26.0", Some(48589), Some(Edition::Edition2018)),
438-
439436
// Allows macro invocations in `extern {}` blocks
440437
(active, macros_in_extern, "1.27.0", Some(49476), None),
441438

@@ -645,6 +642,8 @@ declare_features! (
645642
(accepted, repr_transparent, "1.28.0", Some(43036), None),
646643
// Defining procedural macros in `proc-macro` crates
647644
(accepted, proc_macro, "1.29.0", Some(38356), None),
645+
// Allows keywords to be escaped for use as identifiers
646+
(accepted, raw_identifiers, "1.30.0", Some(48589), None),
648647
);
649648

650649
// If you change this, please modify src/doc/unstable-book as well. You must
@@ -2015,16 +2014,6 @@ pub fn check_crate(krate: &ast::Crate,
20152014
plugin_attributes,
20162015
};
20172016

2018-
if !features.raw_identifiers {
2019-
for &span in sess.raw_identifier_spans.borrow().iter() {
2020-
if !span.allows_unstable() {
2021-
gate_feature!(&ctx, raw_identifiers, span,
2022-
"raw identifiers are experimental and subject to change"
2023-
);
2024-
}
2025-
}
2026-
}
2027-
20282017
let visitor = &mut PostExpansionVisitor { context: &ctx };
20292018
visitor.whole_crate_feature_gates(krate);
20302019
visit::walk_crate(visitor, krate);

src/test/run-pass/auxiliary/edition-kw-macro-2015.rs

-2
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@
1010

1111
// edition:2015
1212

13-
#![feature(raw_identifiers)]
14-
1513
#[macro_export]
1614
macro_rules! produces_async {
1715
() => (pub fn async() {})

src/test/run-pass/edition-keywords-2015-2015.rs

-2
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@
1111
// edition:2015
1212
// aux-build:edition-kw-macro-2015.rs
1313

14-
#![feature(raw_identifiers)]
15-
1614
#[macro_use]
1715
extern crate edition_kw_macro_2015;
1816

src/test/run-pass/edition-keywords-2015-2018.rs

-2
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@
1111
// edition:2015
1212
// aux-build:edition-kw-macro-2018.rs
1313

14-
#![feature(raw_identifiers)]
15-
1614
#[macro_use]
1715
extern crate edition_kw_macro_2018;
1816

src/test/run-pass/rfc-2151-raw-identifiers/attr.rs

-2
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
#![feature(raw_identifiers)]
12-
1311
use std::mem;
1412

1513
#[r#repr(r#C, r#packed)]

src/test/run-pass/rfc-2151-raw-identifiers/basic.rs

-2
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
#![feature(raw_identifiers)]
12-
1311
fn r#fn(r#match: u32) -> u32 {
1412
r#match
1513
}

src/test/run-pass/rfc-2151-raw-identifiers/items.rs

-2
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
#![feature(raw_identifiers)]
12-
1311
#[derive(Debug, PartialEq, Eq)]
1412
struct IntWrapper(u32);
1513

src/test/run-pass/rfc-2151-raw-identifiers/macros.rs

-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
// except according to those terms.
1010

1111
#![feature(decl_macro)]
12-
#![feature(raw_identifiers)]
1312

1413
r#macro_rules! r#struct {
1514
($r#struct:expr) => { $r#struct }

src/test/ui/E0705.rs

+3-6
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,7 @@
1111
// compile-pass
1212

1313
#![feature(rust_2018_preview)]
14-
#![feature(raw_identifiers)]
15-
//~^ WARN the feature `raw_identifiers` is included in the Rust 2018 edition
14+
#![feature(impl_header_lifetime_elision)]
15+
//~^ WARN the feature `impl_header_lifetime_elision` is included in the Rust 2018 edition
1616

17-
fn main() {
18-
let foo = 0;
19-
let bar = r#foo;
20-
}
17+
fn main() {}

src/test/ui/E0705.stderr

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
warning[E0705]: the feature `raw_identifiers` is included in the Rust 2018 edition
1+
warning[E0705]: the feature `impl_header_lifetime_elision` is included in the Rust 2018 edition
22
--> $DIR/E0705.rs:14:12
33
|
4-
LL | #![feature(raw_identifiers)]
5-
| ^^^^^^^^^^^^^^^
4+
LL | #![feature(impl_header_lifetime_elision)]
5+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
66

src/test/ui/auxiliary/edition-kw-macro-2015.rs

-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010

1111
// edition:2015
1212

13-
#![feature(raw_identifiers)]
1413
#![allow(async_idents)]
1514

1615
#[macro_export]

src/test/ui/edition-keywords-2015-2015-expansion.rs

-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
// aux-build:edition-kw-macro-2015.rs
1313
// compile-pass
1414

15-
#![feature(raw_identifiers)]
1615
#![allow(async_idents)]
1716

1817
#[macro_use]

src/test/ui/edition-keywords-2015-2015-parsing.rs

-2
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@
1111
// edition:2015
1212
// aux-build:edition-kw-macro-2015.rs
1313

14-
#![feature(raw_identifiers)]
15-
1614
#[macro_use]
1715
extern crate edition_kw_macro_2015;
1816

src/test/ui/edition-keywords-2015-2015-parsing.stderr

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
error: no rules expected the token `r#async`
2-
--> $DIR/edition-keywords-2015-2015-parsing.rs:24:31
2+
--> $DIR/edition-keywords-2015-2015-parsing.rs:22:31
33
|
44
LL | r#async = consumes_async!(r#async); //~ ERROR no rules expected the token `r#async`
55
| ^^^^^^^
66

77
error: no rules expected the token `async`
8-
--> $DIR/edition-keywords-2015-2015-parsing.rs:25:35
8+
--> $DIR/edition-keywords-2015-2015-parsing.rs:23:35
99
|
1010
LL | r#async = consumes_async_raw!(async); //~ ERROR no rules expected the token `async`
1111
| ^^^^^

src/test/ui/edition-keywords-2015-2018-expansion.rs

-2
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@
1111
// edition:2015
1212
// aux-build:edition-kw-macro-2018.rs
1313

14-
#![feature(raw_identifiers)]
15-
1614
#[macro_use]
1715
extern crate edition_kw_macro_2018;
1816

src/test/ui/edition-keywords-2015-2018-expansion.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error: expected identifier, found reserved keyword `async`
2-
--> $DIR/edition-keywords-2015-2018-expansion.rs:20:5
2+
--> $DIR/edition-keywords-2015-2018-expansion.rs:18:5
33
|
44
LL | produces_async! {} //~ ERROR expected identifier, found reserved keyword
55
| ^^^^^^^^^^^^^^^^^^ expected identifier, found reserved keyword

src/test/ui/edition-keywords-2015-2018-parsing.rs

-2
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@
1111
// edition:2015
1212
// aux-build:edition-kw-macro-2018.rs
1313

14-
#![feature(raw_identifiers)]
15-
1614
#[macro_use]
1715
extern crate edition_kw_macro_2018;
1816

src/test/ui/edition-keywords-2015-2018-parsing.stderr

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
error: no rules expected the token `r#async`
2-
--> $DIR/edition-keywords-2015-2018-parsing.rs:24:31
2+
--> $DIR/edition-keywords-2015-2018-parsing.rs:22:31
33
|
44
LL | r#async = consumes_async!(r#async); //~ ERROR no rules expected the token `r#async`
55
| ^^^^^^^
66

77
error: no rules expected the token `async`
8-
--> $DIR/edition-keywords-2015-2018-parsing.rs:25:35
8+
--> $DIR/edition-keywords-2015-2018-parsing.rs:23:35
99
|
1010
LL | r#async = consumes_async_raw!(async); //~ ERROR no rules expected the token `async`
1111
| ^^^^^

src/test/ui/feature-gate-raw-identifiers.rs

-14
This file was deleted.

src/test/ui/feature-gate-raw-identifiers.stderr

-11
This file was deleted.

src/test/ui/raw-literal-keywords.rs

-2
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@
1010

1111
// compile-flags: -Z parse-only
1212

13-
#![feature(raw_identifiers)]
14-
1513
fn test_if() {
1614
r#if true { } //~ ERROR found `true`
1715
}

src/test/ui/raw-literal-keywords.stderr

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
error: expected one of `!`, `.`, `::`, `;`, `?`, `{`, `}`, or an operator, found `true`
2-
--> $DIR/raw-literal-keywords.rs:16:10
2+
--> $DIR/raw-literal-keywords.rs:14:10
33
|
44
LL | r#if true { } //~ ERROR found `true`
55
| ^^^^ expected one of 8 possible tokens here
66

77
error: expected one of `!`, `.`, `::`, `;`, `?`, `{`, `}`, or an operator, found `Test`
8-
--> $DIR/raw-literal-keywords.rs:20:14
8+
--> $DIR/raw-literal-keywords.rs:18:14
99
|
1010
LL | r#struct Test; //~ ERROR found `Test`
1111
| ^^^^ expected one of 8 possible tokens here
1212

1313
error: expected one of `!`, `.`, `::`, `;`, `?`, `{`, `}`, or an operator, found `Test`
14-
--> $DIR/raw-literal-keywords.rs:24:13
14+
--> $DIR/raw-literal-keywords.rs:22:13
1515
|
1616
LL | r#union Test; //~ ERROR found `Test`
1717
| ^^^^ expected one of 8 possible tokens here

src/test/ui/raw-literal-self.rs

-2
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@
1010

1111
// compile-flags: -Z parse-only
1212

13-
#![feature(raw_identifiers)]
14-
1513
fn self_test(r#self: u32) {
1614
//~^ ERROR `r#self` is not currently supported.
1715
}

src/test/ui/raw-literal-self.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error: `r#self` is not currently supported.
2-
--> $DIR/raw-literal-self.rs:15:14
2+
--> $DIR/raw-literal-self.rs:13:14
33
|
44
LL | fn self_test(r#self: u32) {
55
| ^^^^^^

src/test/ui/rust-2018/async-ident-allowed.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ error: `async` is a keyword in the 2018 edition
22
--> $DIR/async-ident-allowed.rs:19:9
33
|
44
LL | let async = 3; //~ ERROR: is a keyword
5-
| ^^^^^
5+
| ^^^^^ help: you can use a raw identifier to stay compatible: `r#async`
66
|
77
note: lint level defined here
88
--> $DIR/async-ident-allowed.rs:13:9

src/test/ui/rust-2018/async-ident.fixed

-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
#![feature(raw_identifiers)]
1211
#![allow(dead_code, unused_variables, non_camel_case_types, non_upper_case_globals)]
1312
#![deny(async_idents)]
1413

src/test/ui/rust-2018/async-ident.rs

-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
#![feature(raw_identifiers)]
1211
#![allow(dead_code, unused_variables, non_camel_case_types, non_upper_case_globals)]
1312
#![deny(async_idents)]
1413

0 commit comments

Comments
 (0)