Skip to content

Commit bec2679

Browse files
committed
rustdoc-json: Add test for #[optimize(..)]
Follow up to https://www.github.com/rust-lang/rust/pull/138291
1 parent 42245d3 commit bec2679

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

tests/rustdoc-json/attrs/optimize.rs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#![feature(optimize_attribute)]
2+
3+
//@ is "$.index[?(@.name=='speed')].attrs" '["#[attr = Optimize(Speed)]"]'
4+
#[optimize(speed)]
5+
pub fn speed() {}
6+
7+
//@ is "$.index[?(@.name=='size')].attrs" '["#[attr = Optimize(Size)]"]'
8+
#[optimize(size)]
9+
pub fn size() {}
10+
11+
//@ is "$.index[?(@.name=='none')].attrs" '["#[attr = Optimize(DoNotOptimize)]"]'
12+
#[optimize(none)]
13+
pub fn none() {}

0 commit comments

Comments
 (0)