Skip to content

Commit 7d609d8

Browse files
committed
Make tests a bit smarter
1 parent dc50017 commit 7d609d8

File tree

2 files changed

+15
-3
lines changed

2 files changed

+15
-3
lines changed

tests/pretty/delegation-inherit-attributes.pp

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
extern crate to_reuse_functions;
1515

1616
mod to_reuse {
17-
#[attr = Deprecation {deprecation: Deprecation {since: Unspecified}}]
1817
#[attr = MustUse]
1918
#[attr = Cold]
2019
fn foo(x: usize) -> usize { x }
@@ -24,10 +23,16 @@
2423
fn bar(x: usize) -> usize { x }
2524
}
2625

26+
#[attr = Deprecation {deprecation: Deprecation {since: Unspecified}}]
2727
#[attr = MustUse]
2828
#[attr = Inline(Hint)]
2929
fn foo1(arg0: _) -> _ { to_reuse::foo(self + 1) }
3030

31+
#[attr = Deprecation {deprecation: Deprecation {since: Unspecified}}]
32+
#[attr = MustUse {reason: "some reason"}]
33+
#[attr = Inline(Hint)]
34+
fn foo2(arg0: _) -> _ { to_reuse::foo(self + 1) }
35+
3136
#[attr = Inline(Hint)]
3237
fn bar(arg0: _) -> _ { to_reuse::bar(arg0) }
3338

@@ -40,7 +45,7 @@
4045
-> _ { to_reuse_functions::extern_fn_extern() }
4146
#[attr = Inline(Hint)]
4247
const fn const_fn_extern() -> _ { to_reuse_functions::const_fn_extern() }
43-
#[attr = MustUse]
48+
#[attr = MustUse {reason: "some reason"}]
4449
#[attr = Inline(Hint)]
4550
async fn async_fn_extern() -> _ { to_reuse_functions::async_fn_extern() }
4651

tests/pretty/delegation-inherit-attributes.rs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ extern crate to_reuse_functions;
1212
mod to_reuse {
1313
#[must_use]
1414
#[cold]
15-
#[deprecated]
1615
pub fn foo(x: usize) -> usize {
1716
x
1817
}
@@ -24,15 +23,23 @@ mod to_reuse {
2423
}
2524
}
2625

26+
#[deprecated]
2727
reuse to_reuse::foo as foo1 {
2828
self + 1
2929
}
3030

31+
#[deprecated]
32+
#[must_use = "some reason"]
33+
reuse to_reuse::foo as foo2 {
34+
self + 1
35+
}
36+
3137
reuse to_reuse::bar;
3238

3339
reuse to_reuse_functions::unsafe_fn_extern;
3440
reuse to_reuse_functions::extern_fn_extern;
3541
reuse to_reuse_functions::const_fn_extern;
42+
#[must_use = "some reason"]
3643
reuse to_reuse_functions::async_fn_extern;
3744

3845

0 commit comments

Comments
 (0)