Add regression test for issue 142649
This commit is contained in:
parent
86f40acce3
commit
715e02ff3c
3 changed files with 22 additions and 0 deletions
8
tests/ui/deprecation/deprecated-expr-precedence.rs
Normal file
8
tests/ui/deprecation/deprecated-expr-precedence.rs
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
//@ check-fail
|
||||
//@ compile-flags: --crate-type=lib
|
||||
|
||||
// Regression test for issue 142649
|
||||
pub fn public() {
|
||||
#[deprecated] 0
|
||||
//~^ ERROR mismatched types
|
||||
}
|
||||
|
|
@ -16,3 +16,8 @@ pub struct SinceAndNote;
|
|||
|
||||
#[deprecated(note = "here's why this is deprecated", since = "1.2.3")]
|
||||
pub struct FlippedOrder;
|
||||
|
||||
pub fn f() {
|
||||
// Attribute is ignored here (with a warning), but still preserved in HIR
|
||||
#[deprecated] 0
|
||||
}
|
||||
|
|
|
|||
|
|
@ -24,3 +24,12 @@ struct SinceAndNote;
|
|||
#[attr = Deprecation {deprecation: Deprecation {since: NonStandard("1.2.3"),
|
||||
note: "here's why this is deprecated"}}]
|
||||
struct FlippedOrder;
|
||||
|
||||
fn f() {
|
||||
|
||||
// Attribute is ignored here (with a warning), but still preserved in HIR
|
||||
#[attr = Deprecation {deprecation:
|
||||
Deprecation {since:
|
||||
Unspecified}}]
|
||||
0
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue