Skip to content

Commit dae5f05

Browse files
committed
Remove the proc keyword again
1 parent c4352ff commit dae5f05

25 files changed

+31
-451
lines changed

src/libsyntax_pos/symbol.rs

+7-13
Original file line numberDiff line numberDiff line change
@@ -386,25 +386,20 @@ declare_keywords! {
386386

387387
// Edition-specific keywords reserved for future use.
388388
(55, Async, "async") // >= 2018 Edition Only
389-
(56, Proc, "proc") // <= 2015 Edition Only
390389

391390
// Special lifetime names
392-
(57, UnderscoreLifetime, "'_")
393-
(58, StaticLifetime, "'static")
391+
(56, UnderscoreLifetime, "'_")
392+
(57, StaticLifetime, "'static")
394393

395394
// Weak keywords, have special meaning only in specific contexts.
396-
(59, Auto, "auto")
397-
(60, Catch, "catch")
398-
(61, Default, "default")
399-
(62, Dyn, "dyn")
400-
(63, Union, "union")
395+
(58, Auto, "auto")
396+
(59, Catch, "catch")
397+
(60, Default, "default")
398+
(61, Dyn, "dyn")
399+
(62, Union, "union")
401400
}
402401

403402
impl Symbol {
404-
fn is_unused_keyword_2015(self) -> bool {
405-
self == keywords::Proc.name()
406-
}
407-
408403
fn is_unused_keyword_2018(self) -> bool {
409404
self == keywords::Async.name()
410405
}
@@ -426,7 +421,6 @@ impl Ident {
426421
pub fn is_unused_keyword(self) -> bool {
427422
// Note: `span.edition()` is relatively expensive, don't call it unless necessary.
428423
self.name >= keywords::Abstract.name() && self.name <= keywords::Yield.name() ||
429-
self.name.is_unused_keyword_2015() && self.span.edition() == Edition::Edition2015 ||
430424
self.name.is_unused_keyword_2018() && self.span.edition() == Edition::Edition2018
431425
}
432426

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

-27
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212

1313
#![feature(raw_identifiers)]
1414

15-
// `async`
1615
#[macro_export]
1716
macro_rules! produces_async {
1817
() => (pub fn async() {})
@@ -37,29 +36,3 @@ macro_rules! consumes_async_raw {
3736
macro_rules! passes_ident {
3837
($i: ident) => ($i)
3938
}
40-
41-
// `proc`
42-
#[macro_export]
43-
macro_rules! produces_proc {
44-
() => (pub fn proc() {})
45-
}
46-
47-
#[macro_export]
48-
macro_rules! produces_proc_raw {
49-
() => (pub fn r#proc() {})
50-
}
51-
52-
#[macro_export]
53-
macro_rules! consumes_proc {
54-
(proc) => (1)
55-
}
56-
57-
#[macro_export]
58-
macro_rules! consumes_proc_raw {
59-
(r#proc) => (1)
60-
}
61-
62-
#[macro_export]
63-
macro_rules! passes_ident {
64-
($i: ident) => ($i)
65-
}

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

-27
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212

1313
#![feature(raw_identifiers)]
1414

15-
// `async`
1615
#[macro_export]
1716
macro_rules! produces_async {
1817
() => (pub fn async() {})
@@ -37,29 +36,3 @@ macro_rules! consumes_async_raw {
3736
macro_rules! passes_ident {
3837
($i: ident) => ($i)
3938
}
40-
41-
// `proc`
42-
#[macro_export]
43-
macro_rules! produces_proc {
44-
() => (pub fn proc() {})
45-
}
46-
47-
#[macro_export]
48-
macro_rules! produces_proc_raw {
49-
() => (pub fn r#proc() {})
50-
}
51-
52-
#[macro_export]
53-
macro_rules! consumes_proc {
54-
(proc) => (1)
55-
}
56-
57-
#[macro_export]
58-
macro_rules! consumes_proc_raw {
59-
(r#proc) => (1)
60-
}
61-
62-
#[macro_export]
63-
macro_rules! passes_ident {
64-
($i: ident) => ($i)
65-
}

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

-26
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
#[macro_use]
1717
extern crate edition_kw_macro_2015;
1818

19-
// `async`
2019
pub fn check_async() {
2120
let mut async = 1; // OK
2221
let mut r#async = 1; // OK
@@ -41,29 +40,4 @@ mod two_async {
4140
produces_async_raw! {} // OK
4241
}
4342

44-
// `proc`
45-
pub fn check_proc() {
46-
// let mut proc = 1; // ERROR, reserved
47-
let mut r#proc = 1; // OK
48-
49-
r#proc = consumes_proc!(proc); // OK
50-
// r#proc = consumes_proc!(r#proc); // ERROR, not a match
51-
// r#proc = consumes_proc_raw!(proc); // ERROR, not a match
52-
r#proc = consumes_proc_raw!(r#proc); // OK
53-
54-
// if passes_ident!(proc) == 1 {} // ERROR, reserved
55-
if passes_ident!(r#proc) == 1 {} // OK
56-
// one_proc::proc(); // ERROR, reserved
57-
// one_proc::r#proc(); // ERROR, unresolved name
58-
// two_proc::proc(); // ERROR, reserved
59-
two_proc::r#proc(); // OK
60-
}
61-
62-
mod one_proc {
63-
// produces_proc! {} // ERROR, reserved
64-
}
65-
mod two_proc {
66-
produces_proc_raw! {} // OK
67-
}
68-
6943
fn main() {}

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

-26
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
#[macro_use]
1717
extern crate edition_kw_macro_2018;
1818

19-
// `async`
2019
pub fn check_async() {
2120
let mut async = 1; // OK
2221
let mut r#async = 1; // OK
@@ -41,29 +40,4 @@ mod two_async {
4140
produces_async_raw! {} // OK
4241
}
4342

44-
// `proc`
45-
pub fn check_proc() {
46-
// let mut proc = 1; // ERROR, reserved
47-
let mut r#proc = 1; // OK
48-
49-
r#proc = consumes_proc!(proc); // OK
50-
// r#proc = consumes_proc!(r#proc); // ERROR, not a match
51-
// r#proc = consumes_proc_raw!(proc); // ERROR, not a match
52-
r#proc = consumes_proc_raw!(r#proc); // OK
53-
54-
// if passes_ident!(proc) == 1 {} // ERROR, reserved
55-
if passes_ident!(r#proc) == 1 {} // OK
56-
// one_proc::proc(); // ERROR, reserved
57-
one_proc::r#proc(); // OK
58-
// two_proc::proc(); // ERROR, reserved
59-
two_proc::r#proc(); // OK
60-
}
61-
62-
mod one_proc {
63-
produces_proc! {} // OK
64-
}
65-
mod two_proc {
66-
produces_proc_raw! {} // OK
67-
}
68-
6943
fn main() {}

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

-26
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
#[macro_use]
1717
extern crate edition_kw_macro_2015;
1818

19-
// `async`
2019
pub fn check_async() {
2120
// let mut async = 1; // ERROR, reserved
2221
let mut r#async = 1; // OK
@@ -41,29 +40,4 @@ mod two_async {
4140
produces_async_raw! {} // OK
4241
}
4342

44-
// `proc`
45-
pub fn check_proc() {
46-
let mut proc = 1; // OK
47-
let mut r#proc = 1; // OK
48-
49-
r#proc = consumes_proc!(proc); // OK
50-
// r#proc = consumes_proc!(r#proc); // ERROR, not a match
51-
// r#proc = consumes_proc_raw!(proc); // ERROR, not a match
52-
r#proc = consumes_proc_raw!(r#proc); // OK
53-
54-
if passes_ident!(proc) == 1 {} // OK
55-
if passes_ident!(r#proc) == 1 {} // OK
56-
// one_proc::proc(); // ERROR, unresolved name
57-
// one_proc::r#proc(); // ERROR, unresolved name
58-
two_proc::proc(); // OK
59-
two_proc::r#proc(); // OK
60-
}
61-
62-
mod one_proc {
63-
// produces_proc! {} // ERROR, reserved
64-
}
65-
mod two_proc {
66-
produces_proc_raw! {} // OK
67-
}
68-
6943
fn main() {}

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

-26
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
#[macro_use]
1717
extern crate edition_kw_macro_2018;
1818

19-
// `async`
2019
pub fn check_async() {
2120
// let mut async = 1; // ERROR, reserved
2221
let mut r#async = 1; // OK
@@ -41,29 +40,4 @@ mod two_async {
4140
produces_async_raw! {} // OK
4241
}
4342

44-
// `proc`
45-
pub fn check_proc() {
46-
let mut proc = 1; // OK
47-
let mut r#proc = 1; // OK
48-
49-
r#proc = consumes_proc!(proc); // OK
50-
// r#proc = consumes_proc!(r#proc); // ERROR, not a match
51-
// r#proc = consumes_proc_raw!(proc); // ERROR, not a match
52-
r#proc = consumes_proc_raw!(r#proc); // OK
53-
54-
if passes_ident!(proc) == 1 {} // OK
55-
if passes_ident!(r#proc) == 1 {} // OK
56-
one_proc::proc(); // OK
57-
one_proc::r#proc(); // OK
58-
two_proc::proc(); // OK
59-
two_proc::r#proc(); // OK
60-
}
61-
62-
mod one_proc {
63-
produces_proc! {} // OK
64-
}
65-
mod two_proc {
66-
produces_proc_raw! {} // OK
67-
}
68-
6943
fn main() {}

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

-27
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212

1313
#![feature(raw_identifiers)]
1414

15-
// `async`
1615
#[macro_export]
1716
macro_rules! produces_async {
1817
() => (pub fn async() {})
@@ -37,29 +36,3 @@ macro_rules! consumes_async_raw {
3736
macro_rules! passes_ident {
3837
($i: ident) => ($i)
3938
}
40-
41-
// `proc`
42-
#[macro_export]
43-
macro_rules! produces_proc {
44-
() => (pub fn proc() {})
45-
}
46-
47-
#[macro_export]
48-
macro_rules! produces_proc_raw {
49-
() => (pub fn r#proc() {})
50-
}
51-
52-
#[macro_export]
53-
macro_rules! consumes_proc {
54-
(proc) => (1)
55-
}
56-
57-
#[macro_export]
58-
macro_rules! consumes_proc_raw {
59-
(r#proc) => (1)
60-
}
61-
62-
#[macro_export]
63-
macro_rules! passes_ident {
64-
($i: ident) => ($i)
65-
}

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

-27
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212

1313
#![feature(raw_identifiers)]
1414

15-
// `async`
1615
#[macro_export]
1716
macro_rules! produces_async {
1817
() => (pub fn async() {})
@@ -37,29 +36,3 @@ macro_rules! consumes_async_raw {
3736
macro_rules! passes_ident {
3837
($i: ident) => ($i)
3938
}
40-
41-
// `proc`
42-
#[macro_export]
43-
macro_rules! produces_proc {
44-
() => (pub fn proc() {})
45-
}
46-
47-
#[macro_export]
48-
macro_rules! produces_proc_raw {
49-
() => (pub fn r#proc() {})
50-
}
51-
52-
#[macro_export]
53-
macro_rules! consumes_proc {
54-
(proc) => (1)
55-
}
56-
57-
#[macro_export]
58-
macro_rules! consumes_proc_raw {
59-
(r#proc) => (1)
60-
}
61-
62-
#[macro_export]
63-
macro_rules! passes_ident {
64-
($i: ident) => ($i)
65-
}

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

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

1111
// compile-flags: --edition=2015
1212
// aux-build:edition-kw-macro-2015.rs
13+
// compile-pass
1314

1415
#![feature(raw_identifiers)]
1516

1617
#[macro_use]
1718
extern crate edition_kw_macro_2015;
1819

19-
// `async`
2020
mod one_async {
2121
produces_async! {} // OK
2222
}
2323
mod two_async {
2424
produces_async_raw! {} // OK
2525
}
2626

27-
// `proc`
28-
mod one_proc {
29-
produces_proc! {} // ERROR expected identifier, found reserved keyword `proc`
30-
}
31-
mod two_proc {
32-
produces_proc_raw! {} // OK
33-
}
27+
fn main() {}

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

-10
This file was deleted.

0 commit comments

Comments
 (0)