Skip to content

Commit 8e0141b

Browse files
committed
Stabilize unrestricted_attribute_tokens
1 parent f1586ba commit 8e0141b

16 files changed

+63
-112
lines changed

src/libsyntax/feature_gate.rs

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -440,9 +440,6 @@ declare_features! (
440440
// Added for testing E0705; perma-unstable.
441441
(active, test_2018_feature, "1.31.0", Some(0), Some(Edition::Edition2018)),
442442

443-
// support for arbitrary delimited token streams in non-macro attributes
444-
(active, unrestricted_attribute_tokens, "1.30.0", Some(55208), None),
445-
446443
// Allows `use x::y;` to resolve through `self::x`, not just `::x`.
447444
(active, uniform_paths, "1.30.0", Some(53130), None),
448445

@@ -686,6 +683,8 @@ declare_features! (
686683
(accepted, repr_packed, "1.33.0", Some(33158), None),
687684
// Allows calling `const unsafe fn` inside `unsafe` blocks in `const fn` functions.
688685
(accepted, min_const_unsafe_fn, "1.33.0", Some(55607), None),
686+
// support for arbitrary delimited token streams in non-macro attributes
687+
(accepted, unrestricted_attribute_tokens, "1.33.0", Some(55208), None),
689688
);
690689

691690
// If you change this, please modify `src/doc/unstable-book` as well. You must
@@ -1558,14 +1557,7 @@ impl<'a> Visitor<'a> for PostExpansionVisitor<'a> {
15581557
}
15591558
Err(mut err) => err.emit(),
15601559
}
1561-
None => if !self.context.features.unrestricted_attribute_tokens {
1562-
// Unfortunately, `parse_meta` cannot be called speculatively
1563-
// because it can report errors by itself, so we have to call it
1564-
// only if the feature is disabled.
1565-
if let Err(mut err) = attr.parse_meta(self.context.parse_sess) {
1566-
err.help("try enabling `#![feature(unrestricted_attribute_tokens)]`").emit()
1567-
}
1568-
}
1560+
None => {}
15691561
}
15701562
}
15711563

src/test/run-pass/proc-macro/derive-b.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
// aux-build:derive-b.rs
22

3-
#![feature(unrestricted_attribute_tokens)]
4-
53
extern crate derive_b;
64

75
#[derive(Debug, PartialEq, derive_b::B, Eq, Copy, Clone)]

src/test/ui/attr-eq-token-tree.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// compile-pass
22

3-
#![feature(custom_attribute, unrestricted_attribute_tokens)]
3+
#![feature(custom_attribute)]
44

55
#[my_attr = !] // OK under feature gate
66
fn main() {}

src/test/ui/feature-gates/feature-gate-unrestricted-attribute-tokens.rs

Lines changed: 0 additions & 7 deletions
This file was deleted.

src/test/ui/feature-gates/feature-gate-unrestricted-attribute-tokens.stderr

Lines changed: 0 additions & 20 deletions
This file was deleted.

src/test/ui/macros/macro-attribute.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,2 @@
1-
#![feature(unrestricted_attribute_tokens)]
2-
31
#[doc = $not_there] //~ ERROR expected `]`, found `not_there`
42
fn main() { }

src/test/ui/macros/macro-attribute.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error: expected `]`, found `not_there`
2-
--> $DIR/macro-attribute.rs:3:10
2+
--> $DIR/macro-attribute.rs:1:10
33
|
44
LL | #[doc = $not_there] //~ ERROR expected `]`, found `not_there`
55
| ^^^^^^^^^ expected `]`

src/test/ui/marker_trait_attr/marker-attribute-with-values.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
#![feature(marker_trait_attr)]
2-
#![feature(unrestricted_attribute_tokens)]
32

43
#[marker(always)]
54
trait Marker1 {}

src/test/ui/marker_trait_attr/marker-attribute-with-values.stderr

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
error: attribute must be of the form `#[marker]`
2-
--> $DIR/marker-attribute-with-values.rs:4:1
2+
--> $DIR/marker-attribute-with-values.rs:3:1
33
|
44
LL | #[marker(always)]
55
| ^^^^^^^^^^^^^^^^^
66

77
error: attribute must be of the form `#[marker]`
8-
--> $DIR/marker-attribute-with-values.rs:8:1
8+
--> $DIR/marker-attribute-with-values.rs:7:1
99
|
1010
LL | #[marker("never")]
1111
| ^^^^^^^^^^^^^^^^^^
1212

1313
error: expected unsuffixed literal or identifier, found value
14-
--> $DIR/marker-attribute-with-values.rs:12:10
14+
--> $DIR/marker-attribute-with-values.rs:11:10
1515
|
1616
LL | #[marker(key = value)]
1717
| ^^^

src/test/ui/parser/attr-bad-meta.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
// compile-flags: -Z parse-only
22

3-
#![feature(unrestricted_attribute_tokens)]
4-
53
#[path*] //~ ERROR expected one of `(`, `::`, `=`, `[`, `]`, or `{`, found `*`
64
mod m {}

0 commit comments

Comments
 (0)