]> git.proxmox.com Git - rustc.git/blobdiff - src/test/ui/deprecation/deprecation-lint.rs
Update unsuspicious file list
[rustc.git] / src / test / ui / deprecation / deprecation-lint.rs
index 6b3e9a8ad8116dae8fb811c9150ce84183158d66..0417e952eb71d3a19571384b623ada2e6cb97472 100644 (file)
@@ -1,5 +1,4 @@
 // aux-build:deprecation-lint.rs
-// ignore-tidy-linelength
 
 #![deny(deprecated)]
 #![allow(warnings)]
@@ -14,86 +13,86 @@ mod cross_crate {
         type Foo = MethodTester;
         let foo = MethodTester;
 
-        deprecated(); //~ ERROR use of deprecated item 'deprecation_lint::deprecated'
-        foo.method_deprecated(); //~ ERROR use of deprecated item 'deprecation_lint::MethodTester::method_deprecated'
-        Foo::method_deprecated(&foo); //~ ERROR use of deprecated item 'deprecation_lint::MethodTester::method_deprecated'
-        <Foo>::method_deprecated(&foo); //~ ERROR use of deprecated item 'deprecation_lint::MethodTester::method_deprecated'
-        foo.trait_deprecated(); //~ ERROR use of deprecated item 'deprecation_lint::Trait::trait_deprecated'
-        Trait::trait_deprecated(&foo); //~ ERROR use of deprecated item 'deprecation_lint::Trait::trait_deprecated'
-        <Foo>::trait_deprecated(&foo); //~ ERROR use of deprecated item 'deprecation_lint::Trait::trait_deprecated'
-        <Foo as Trait>::trait_deprecated(&foo); //~ ERROR use of deprecated item 'deprecation_lint::Trait::trait_deprecated'
-
-        deprecated_text(); //~ ERROR use of deprecated item 'deprecation_lint::deprecated_text': text
-        foo.method_deprecated_text(); //~ ERROR use of deprecated item 'deprecation_lint::MethodTester::method_deprecated_text': text
-        Foo::method_deprecated_text(&foo); //~ ERROR use of deprecated item 'deprecation_lint::MethodTester::method_deprecated_text': text
-        <Foo>::method_deprecated_text(&foo); //~ ERROR use of deprecated item 'deprecation_lint::MethodTester::method_deprecated_text': text
-        foo.trait_deprecated_text(); //~ ERROR use of deprecated item 'deprecation_lint::Trait::trait_deprecated_text': text
-        Trait::trait_deprecated_text(&foo); //~ ERROR use of deprecated item 'deprecation_lint::Trait::trait_deprecated_text': text
-        <Foo>::trait_deprecated_text(&foo); //~ ERROR use of deprecated item 'deprecation_lint::Trait::trait_deprecated_text': text
-        <Foo as Trait>::trait_deprecated_text(&foo); //~ ERROR use of deprecated item 'deprecation_lint::Trait::trait_deprecated_text': text
-
-        let _ = DeprecatedStruct { //~ ERROR use of deprecated item 'deprecation_lint::DeprecatedStruct': text
-            i: 0 //~ ERROR use of deprecated item 'deprecation_lint::DeprecatedStruct::i': text
+        deprecated(); //~ ERROR use of deprecated function `deprecation_lint::deprecated`
+        foo.method_deprecated(); //~ ERROR use of deprecated associated function `deprecation_lint::MethodTester::method_deprecated`
+        Foo::method_deprecated(&foo); //~ ERROR use of deprecated associated function `deprecation_lint::MethodTester::method_deprecated`
+        <Foo>::method_deprecated(&foo); //~ ERROR use of deprecated associated function `deprecation_lint::MethodTester::method_deprecated`
+        foo.trait_deprecated(); //~ ERROR use of deprecated associated function `deprecation_lint::Trait::trait_deprecated`
+        Trait::trait_deprecated(&foo); //~ ERROR use of deprecated associated function `deprecation_lint::Trait::trait_deprecated`
+        <Foo>::trait_deprecated(&foo); //~ ERROR use of deprecated associated function `deprecation_lint::Trait::trait_deprecated`
+        <Foo as Trait>::trait_deprecated(&foo); //~ ERROR use of deprecated associated function `deprecation_lint::Trait::trait_deprecated`
+
+        deprecated_text(); //~ ERROR use of deprecated function `deprecation_lint::deprecated_text`: text
+        foo.method_deprecated_text(); //~ ERROR use of deprecated associated function `deprecation_lint::MethodTester::method_deprecated_text`: text
+        Foo::method_deprecated_text(&foo); //~ ERROR use of deprecated associated function `deprecation_lint::MethodTester::method_deprecated_text`: text
+        <Foo>::method_deprecated_text(&foo); //~ ERROR use of deprecated associated function `deprecation_lint::MethodTester::method_deprecated_text`: text
+        foo.trait_deprecated_text(); //~ ERROR use of deprecated associated function `deprecation_lint::Trait::trait_deprecated_text`: text
+        Trait::trait_deprecated_text(&foo); //~ ERROR use of deprecated associated function `deprecation_lint::Trait::trait_deprecated_text`: text
+        <Foo>::trait_deprecated_text(&foo); //~ ERROR use of deprecated associated function `deprecation_lint::Trait::trait_deprecated_text`: text
+        <Foo as Trait>::trait_deprecated_text(&foo); //~ ERROR use of deprecated associated function `deprecation_lint::Trait::trait_deprecated_text`: text
+
+        let _ = DeprecatedStruct { //~ ERROR use of deprecated struct `deprecation_lint::DeprecatedStruct`: text
+            i: 0 //~ ERROR use of deprecated field `deprecation_lint::DeprecatedStruct::i`: text
         };
 
-        let _ = DeprecatedUnitStruct; //~ ERROR use of deprecated item 'deprecation_lint::DeprecatedUnitStruct': text
+        let _ = DeprecatedUnitStruct; //~ ERROR use of deprecated unit struct `deprecation_lint::DeprecatedUnitStruct`: text
 
-        let _ = Enum::DeprecatedVariant; //~ ERROR use of deprecated item 'deprecation_lint::Enum::DeprecatedVariant': text
+        let _ = Enum::DeprecatedVariant; //~ ERROR use of deprecated unit variant `deprecation_lint::Enum::DeprecatedVariant`: text
 
-        let _ = DeprecatedTupleStruct (1); //~ ERROR use of deprecated item 'deprecation_lint::DeprecatedTupleStruct': text
+        let _ = DeprecatedTupleStruct (1); //~ ERROR use of deprecated tuple struct `deprecation_lint::DeprecatedTupleStruct`: text
 
-        let _ = nested::DeprecatedStruct { //~ ERROR use of deprecated item 'deprecation_lint::nested::DeprecatedStruct': text
-            i: 0 //~ ERROR use of deprecated item 'deprecation_lint::nested::DeprecatedStruct::i': text
+        let _ = nested::DeprecatedStruct { //~ ERROR use of deprecated struct `deprecation_lint::nested::DeprecatedStruct`: text
+            i: 0 //~ ERROR use of deprecated field `deprecation_lint::nested::DeprecatedStruct::i`: text
         };
 
-        let _ = nested::DeprecatedUnitStruct; //~ ERROR use of deprecated item 'deprecation_lint::nested::DeprecatedUnitStruct': text
+        let _ = nested::DeprecatedUnitStruct; //~ ERROR use of deprecated unit struct `deprecation_lint::nested::DeprecatedUnitStruct`: text
 
-        let _ = nested::Enum::DeprecatedVariant; //~ ERROR use of deprecated item 'deprecation_lint::nested::Enum::DeprecatedVariant': text
+        let _ = nested::Enum::DeprecatedVariant; //~ ERROR use of deprecated unit variant `deprecation_lint::nested::Enum::DeprecatedVariant`: text
 
-        let _ = nested::DeprecatedTupleStruct (1); //~ ERROR use of deprecated item 'deprecation_lint::nested::DeprecatedTupleStruct': text
+        let _ = nested::DeprecatedTupleStruct (1); //~ ERROR use of deprecated tuple struct `deprecation_lint::nested::DeprecatedTupleStruct`: text
 
-        // At the moment, the lint checker only checks stability in
+        // At the moment, the lint checker only checks stability
         // in the arguments of macros.
         // Eventually, we will want to lint the contents of the
         // macro in the module *defining* it. Also, stability levels
         // on macros themselves are not yet linted.
-        macro_test_arg!(deprecated_text()); //~ ERROR use of deprecated item 'deprecation_lint::deprecated_text': text
-        macro_test_arg!(macro_test_arg!(deprecated_text())); //~ ERROR use of deprecated item 'deprecation_lint::deprecated_text': text
+        macro_test_arg!(deprecated_text()); //~ ERROR use of deprecated function `deprecation_lint::deprecated_text`: text
+        macro_test_arg!(macro_test_arg!(deprecated_text())); //~ ERROR use of deprecated function `deprecation_lint::deprecated_text`: text
     }
 
     fn test_method_param<Foo: Trait>(foo: Foo) {
-        foo.trait_deprecated(); //~ ERROR use of deprecated item 'deprecation_lint::Trait::trait_deprecated'
-        Trait::trait_deprecated(&foo); //~ ERROR use of deprecated item 'deprecation_lint::Trait::trait_deprecated'
-        <Foo>::trait_deprecated(&foo); //~ ERROR use of deprecated item 'deprecation_lint::Trait::trait_deprecated'
-        <Foo as Trait>::trait_deprecated(&foo); //~ ERROR use of deprecated item 'deprecation_lint::Trait::trait_deprecated'
-        foo.trait_deprecated_text(); //~ ERROR use of deprecated item 'deprecation_lint::Trait::trait_deprecated_text': text
-        Trait::trait_deprecated_text(&foo); //~ ERROR use of deprecated item 'deprecation_lint::Trait::trait_deprecated_text': text
-        <Foo>::trait_deprecated_text(&foo); //~ ERROR use of deprecated item 'deprecation_lint::Trait::trait_deprecated_text': text
-        <Foo as Trait>::trait_deprecated_text(&foo); //~ ERROR use of deprecated item 'deprecation_lint::Trait::trait_deprecated_text': text
+        foo.trait_deprecated(); //~ ERROR use of deprecated associated function `deprecation_lint::Trait::trait_deprecated`
+        Trait::trait_deprecated(&foo); //~ ERROR use of deprecated associated function `deprecation_lint::Trait::trait_deprecated`
+        <Foo>::trait_deprecated(&foo); //~ ERROR use of deprecated associated function `deprecation_lint::Trait::trait_deprecated`
+        <Foo as Trait>::trait_deprecated(&foo); //~ ERROR use of deprecated associated function `deprecation_lint::Trait::trait_deprecated`
+        foo.trait_deprecated_text(); //~ ERROR use of deprecated associated function `deprecation_lint::Trait::trait_deprecated_text`: text
+        Trait::trait_deprecated_text(&foo); //~ ERROR use of deprecated associated function `deprecation_lint::Trait::trait_deprecated_text`: text
+        <Foo>::trait_deprecated_text(&foo); //~ ERROR use of deprecated associated function `deprecation_lint::Trait::trait_deprecated_text`: text
+        <Foo as Trait>::trait_deprecated_text(&foo); //~ ERROR use of deprecated associated function `deprecation_lint::Trait::trait_deprecated_text`: text
     }
 
     fn test_method_object(foo: &Trait) {
-        foo.trait_deprecated(); //~ ERROR use of deprecated item 'deprecation_lint::Trait::trait_deprecated'
-        foo.trait_deprecated_text(); //~ ERROR use of deprecated item 'deprecation_lint::Trait::trait_deprecated_text': text
+        foo.trait_deprecated(); //~ ERROR use of deprecated associated function `deprecation_lint::Trait::trait_deprecated`
+        foo.trait_deprecated_text(); //~ ERROR use of deprecated associated function `deprecation_lint::Trait::trait_deprecated_text`: text
     }
 
     struct S;
 
-    impl DeprecatedTrait for S {} //~ ERROR use of deprecated item 'deprecation_lint::DeprecatedTrait': text
-    trait LocalTrait : DeprecatedTrait { } //~ ERROR use of deprecated item 'deprecation_lint::DeprecatedTrait': text
+    impl DeprecatedTrait for S {} //~ ERROR use of deprecated trait `deprecation_lint::DeprecatedTrait`: text
+    trait LocalTrait : DeprecatedTrait { } //~ ERROR use of deprecated trait `deprecation_lint::DeprecatedTrait`: text
 
     pub fn foo() {
         let x = Stable {
             override2: 3,
-            //~^ ERROR use of deprecated item 'deprecation_lint::Stable::override2': text
+            //~^ ERROR use of deprecated field `deprecation_lint::Stable::override2`: text
         };
 
         let _ = x.override2;
-        //~^ ERROR use of deprecated item 'deprecation_lint::Stable::override2': text
+        //~^ ERROR use of deprecated field `deprecation_lint::Stable::override2`: text
 
         let Stable {
             override2: _
-            //~^ ERROR use of deprecated item 'deprecation_lint::Stable::override2': text
+            //~^ ERROR use of deprecated field `deprecation_lint::Stable::override2`: text
         } = x;
         // all fine
         let Stable { .. } = x;
@@ -101,56 +100,56 @@ mod cross_crate {
         let x = Stable2(1, 2, 3);
 
         let _ = x.2;
-        //~^ ERROR use of deprecated item 'deprecation_lint::Stable2::2': text
+        //~^ ERROR use of deprecated field `deprecation_lint::Stable2::2`: text
 
         let Stable2(_,
                    _,
                    _)
-            //~^ ERROR use of deprecated item 'deprecation_lint::Stable2::2': text
+            //~^ ERROR use of deprecated field `deprecation_lint::Stable2::2`: text
             = x;
         // all fine
         let Stable2(..) = x;
 
         let x = Deprecated {
-            //~^ ERROR use of deprecated item 'deprecation_lint::Deprecated': text
+            //~^ ERROR use of deprecated struct `deprecation_lint::Deprecated`: text
             inherit: 1,
-            //~^ ERROR use of deprecated item 'deprecation_lint::Deprecated::inherit': text
+            //~^ ERROR use of deprecated field `deprecation_lint::Deprecated::inherit`: text
         };
 
         let _ = x.inherit;
-        //~^ ERROR use of deprecated item 'deprecation_lint::Deprecated::inherit': text
+        //~^ ERROR use of deprecated field `deprecation_lint::Deprecated::inherit`: text
 
         let Deprecated {
-            //~^ ERROR use of deprecated item 'deprecation_lint::Deprecated': text
+            //~^ ERROR use of deprecated struct `deprecation_lint::Deprecated`: text
             inherit: _,
-            //~^ ERROR use of deprecated item 'deprecation_lint::Deprecated::inherit': text
+            //~^ ERROR use of deprecated field `deprecation_lint::Deprecated::inherit`: text
         } = x;
 
         let Deprecated
-            //~^ ERROR use of deprecated item 'deprecation_lint::Deprecated': text
+            //~^ ERROR use of deprecated struct `deprecation_lint::Deprecated`: text
             { .. } = x;
 
         let x = Deprecated2(1, 2, 3);
-        //~^ ERROR use of deprecated item 'deprecation_lint::Deprecated2': text
+        //~^ ERROR use of deprecated tuple struct `deprecation_lint::Deprecated2`: text
 
         let _ = x.0;
-        //~^ ERROR use of deprecated item 'deprecation_lint::Deprecated2::0': text
+        //~^ ERROR use of deprecated field `deprecation_lint::Deprecated2::0`: text
         let _ = x.1;
-        //~^ ERROR use of deprecated item 'deprecation_lint::Deprecated2::1': text
+        //~^ ERROR use of deprecated field `deprecation_lint::Deprecated2::1`: text
         let _ = x.2;
-        //~^ ERROR use of deprecated item 'deprecation_lint::Deprecated2::2': text
+        //~^ ERROR use of deprecated field `deprecation_lint::Deprecated2::2`: text
 
         let Deprecated2
-        //~^ ERROR use of deprecated item 'deprecation_lint::Deprecated2': text
+        //~^ ERROR use of deprecated tuple struct `deprecation_lint::Deprecated2`: text
             (_,
-             //~^ ERROR use of deprecated item 'deprecation_lint::Deprecated2::0': text
+             //~^ ERROR use of deprecated field `deprecation_lint::Deprecated2::0`: text
              _,
-             //~^ ERROR use of deprecated item 'deprecation_lint::Deprecated2::1': text
+             //~^ ERROR use of deprecated field `deprecation_lint::Deprecated2::1`: text
              _)
-             //~^ ERROR use of deprecated item 'deprecation_lint::Deprecated2::2': text
+             //~^ ERROR use of deprecated field `deprecation_lint::Deprecated2::2`: text
             = x;
         let Deprecated2
-        //~^ ERROR use of deprecated item 'deprecation_lint::Deprecated2': text
+        //~^ ERROR use of deprecated tuple struct `deprecation_lint::Deprecated2`: text
             // the patterns are all fine:
             (..) = x;
     }
@@ -160,7 +159,7 @@ mod inheritance {
     use deprecation_lint::*;
 
     fn test_inheritance() {
-        deprecated_mod::deprecated(); //~ ERROR use of deprecated item 'deprecation_lint::deprecated_mod::deprecated': text
+        deprecated_mod::deprecated(); //~ ERROR use of deprecated function `deprecation_lint::deprecated_mod::deprecated`: text
     }
 }
 
@@ -243,64 +242,66 @@ mod this_crate {
         type Foo = MethodTester;
         let foo = MethodTester;
 
-        deprecated(); //~ ERROR use of deprecated item 'this_crate::deprecated'
-        foo.method_deprecated(); //~ ERROR use of deprecated item 'this_crate::MethodTester::method_deprecated'
-        Foo::method_deprecated(&foo); //~ ERROR use of deprecated item 'this_crate::MethodTester::method_deprecated'
-        <Foo>::method_deprecated(&foo); //~ ERROR use of deprecated item 'this_crate::MethodTester::method_deprecated'
-        foo.trait_deprecated(); //~ ERROR use of deprecated item 'this_crate::Trait::trait_deprecated'
-        Trait::trait_deprecated(&foo); //~ ERROR use of deprecated item 'this_crate::Trait::trait_deprecated'
-        <Foo>::trait_deprecated(&foo); //~ ERROR use of deprecated item 'this_crate::Trait::trait_deprecated'
-        <Foo as Trait>::trait_deprecated(&foo); //~ ERROR use of deprecated item 'this_crate::Trait::trait_deprecated'
-
-        deprecated_text(); //~ ERROR use of deprecated item 'this_crate::deprecated_text': text
-        foo.method_deprecated_text(); //~ ERROR use of deprecated item 'this_crate::MethodTester::method_deprecated_text': text
-        Foo::method_deprecated_text(&foo); //~ ERROR use of deprecated item 'this_crate::MethodTester::method_deprecated_text': text
-        <Foo>::method_deprecated_text(&foo); //~ ERROR use of deprecated item 'this_crate::MethodTester::method_deprecated_text': text
-        foo.trait_deprecated_text(); //~ ERROR use of deprecated item 'this_crate::Trait::trait_deprecated_text': text
-        Trait::trait_deprecated_text(&foo); //~ ERROR use of deprecated item 'this_crate::Trait::trait_deprecated_text': text
-        <Foo>::trait_deprecated_text(&foo); //~ ERROR use of deprecated item 'this_crate::Trait::trait_deprecated_text': text
-        <Foo as Trait>::trait_deprecated_text(&foo); //~ ERROR use of deprecated item 'this_crate::Trait::trait_deprecated_text': text
-
-        deprecated_future(); // Fine; no error.
-        deprecated_future_text(); // Fine; no error.
+        deprecated(); //~ ERROR use of deprecated function `this_crate::deprecated`
+        foo.method_deprecated(); //~ ERROR use of deprecated associated function `this_crate::MethodTester::method_deprecated`
+        Foo::method_deprecated(&foo); //~ ERROR use of deprecated associated function `this_crate::MethodTester::method_deprecated`
+        <Foo>::method_deprecated(&foo); //~ ERROR use of deprecated associated function `this_crate::MethodTester::method_deprecated`
+        foo.trait_deprecated(); //~ ERROR use of deprecated associated function `this_crate::Trait::trait_deprecated`
+        Trait::trait_deprecated(&foo); //~ ERROR use of deprecated associated function `this_crate::Trait::trait_deprecated`
+        <Foo>::trait_deprecated(&foo); //~ ERROR use of deprecated associated function `this_crate::Trait::trait_deprecated`
+        <Foo as Trait>::trait_deprecated(&foo); //~ ERROR use of deprecated associated function `this_crate::Trait::trait_deprecated`
+
+        deprecated_text(); //~ ERROR use of deprecated function `this_crate::deprecated_text`: text
+        foo.method_deprecated_text(); //~ ERROR use of deprecated associated function `this_crate::MethodTester::method_deprecated_text`: text
+        Foo::method_deprecated_text(&foo); //~ ERROR use of deprecated associated function `this_crate::MethodTester::method_deprecated_text`: text
+        <Foo>::method_deprecated_text(&foo); //~ ERROR use of deprecated associated function `this_crate::MethodTester::method_deprecated_text`: text
+        foo.trait_deprecated_text(); //~ ERROR use of deprecated associated function `this_crate::Trait::trait_deprecated_text`: text
+        Trait::trait_deprecated_text(&foo); //~ ERROR use of deprecated associated function `this_crate::Trait::trait_deprecated_text`: text
+        <Foo>::trait_deprecated_text(&foo); //~ ERROR use of deprecated associated function `this_crate::Trait::trait_deprecated_text`: text
+        <Foo as Trait>::trait_deprecated_text(&foo); //~ ERROR use of deprecated associated function `this_crate::Trait::trait_deprecated_text`: text
+
+        // Future deprecations are only permitted with `#![feature(staged_api)]`
+        deprecated_future(); //~ ERROR use of deprecated function
+        deprecated_future_text(); //~ ERROR use of deprecated function
 
         let _ = DeprecatedStruct {
-            //~^ ERROR use of deprecated item 'this_crate::DeprecatedStruct': text
-            i: 0 //~ ERROR use of deprecated item 'this_crate::DeprecatedStruct::i': text
+            //~^ ERROR use of deprecated struct `this_crate::DeprecatedStruct`: text
+            i: 0 //~ ERROR use of deprecated field `this_crate::DeprecatedStruct::i`: text
         };
 
-        let _ = DeprecatedUnitStruct; //~ ERROR use of deprecated item 'this_crate::DeprecatedUnitStruct': text
+        let _ = DeprecatedUnitStruct; //~ ERROR use of deprecated unit struct `this_crate::DeprecatedUnitStruct`: text
 
-        let _ = Enum::DeprecatedVariant; //~ ERROR use of deprecated item 'this_crate::Enum::DeprecatedVariant': text
+        let _ = Enum::DeprecatedVariant; //~ ERROR use of deprecated unit variant `this_crate::Enum::DeprecatedVariant`: text
 
-        let _ = DeprecatedTupleStruct (1); //~ ERROR use of deprecated item 'this_crate::DeprecatedTupleStruct': text
+        let _ = DeprecatedTupleStruct (1); //~ ERROR use of deprecated tuple struct `this_crate::DeprecatedTupleStruct`: text
 
         let _ = nested::DeprecatedStruct {
-            //~^ ERROR use of deprecated item 'this_crate::nested::DeprecatedStruct': text
-            i: 0 //~ ERROR use of deprecated item 'this_crate::nested::DeprecatedStruct::i': text
+            //~^ ERROR use of deprecated struct `this_crate::nested::DeprecatedStruct`: text
+            i: 0 //~ ERROR use of deprecated field `this_crate::nested::DeprecatedStruct::i`: text
+            //~| ERROR field `i` of struct `this_crate::nested::DeprecatedStruct` is private
         };
 
-        let _ = nested::DeprecatedUnitStruct; //~ ERROR use of deprecated item 'this_crate::nested::DeprecatedUnitStruct': text
+        let _ = nested::DeprecatedUnitStruct; //~ ERROR use of deprecated unit struct `this_crate::nested::DeprecatedUnitStruct`: text
 
-        let _ = nested::Enum::DeprecatedVariant; //~ ERROR use of deprecated item 'this_crate::nested::Enum::DeprecatedVariant': text
+        let _ = nested::Enum::DeprecatedVariant; //~ ERROR use of deprecated unit variant `this_crate::nested::Enum::DeprecatedVariant`: text
 
-        let _ = nested::DeprecatedTupleStruct (1); //~ ERROR use of deprecated item 'this_crate::nested::DeprecatedTupleStruct': text
+        let _ = nested::DeprecatedTupleStruct (1); //~ ERROR use of deprecated tuple struct `this_crate::nested::DeprecatedTupleStruct`: text
     }
 
     fn test_method_param<Foo: Trait>(foo: Foo) {
-        foo.trait_deprecated(); //~ ERROR use of deprecated item 'this_crate::Trait::trait_deprecated'
-        Trait::trait_deprecated(&foo); //~ ERROR use of deprecated item 'this_crate::Trait::trait_deprecated'
-        <Foo>::trait_deprecated(&foo); //~ ERROR use of deprecated item 'this_crate::Trait::trait_deprecated'
-        <Foo as Trait>::trait_deprecated(&foo); //~ ERROR use of deprecated item 'this_crate::Trait::trait_deprecated'
-        foo.trait_deprecated_text(); //~ ERROR use of deprecated item 'this_crate::Trait::trait_deprecated_text': text
-        Trait::trait_deprecated_text(&foo); //~ ERROR use of deprecated item 'this_crate::Trait::trait_deprecated_text': text
-        <Foo>::trait_deprecated_text(&foo); //~ ERROR use of deprecated item 'this_crate::Trait::trait_deprecated_text': text
-        <Foo as Trait>::trait_deprecated_text(&foo); //~ ERROR use of deprecated item 'this_crate::Trait::trait_deprecated_text': text
+        foo.trait_deprecated(); //~ ERROR use of deprecated associated function `this_crate::Trait::trait_deprecated`
+        Trait::trait_deprecated(&foo); //~ ERROR use of deprecated associated function `this_crate::Trait::trait_deprecated`
+        <Foo>::trait_deprecated(&foo); //~ ERROR use of deprecated associated function `this_crate::Trait::trait_deprecated`
+        <Foo as Trait>::trait_deprecated(&foo); //~ ERROR use of deprecated associated function `this_crate::Trait::trait_deprecated`
+        foo.trait_deprecated_text(); //~ ERROR use of deprecated associated function `this_crate::Trait::trait_deprecated_text`: text
+        Trait::trait_deprecated_text(&foo); //~ ERROR use of deprecated associated function `this_crate::Trait::trait_deprecated_text`: text
+        <Foo>::trait_deprecated_text(&foo); //~ ERROR use of deprecated associated function `this_crate::Trait::trait_deprecated_text`: text
+        <Foo as Trait>::trait_deprecated_text(&foo); //~ ERROR use of deprecated associated function `this_crate::Trait::trait_deprecated_text`: text
     }
 
     fn test_method_object(foo: &Trait) {
-        foo.trait_deprecated(); //~ ERROR use of deprecated item 'this_crate::Trait::trait_deprecated'
-        foo.trait_deprecated_text(); //~ ERROR use of deprecated item 'this_crate::Trait::trait_deprecated_text': text
+        foo.trait_deprecated(); //~ ERROR use of deprecated associated function `this_crate::Trait::trait_deprecated`
+        foo.trait_deprecated_text(); //~ ERROR use of deprecated associated function `this_crate::Trait::trait_deprecated_text`: text
     }
 
     #[deprecated(since = "1.0.0", note = "text")]
@@ -313,7 +314,7 @@ mod this_crate {
         let _ = || {
             #[deprecated]
             fn bar() { }
-            bar(); //~ ERROR use of deprecated item 'this_crate::test_fn_closure_body::{{closure}}::bar'
+            bar(); //~ ERROR use of deprecated function `this_crate::test_fn_closure_body::{closure#0}::bar`
         };
     }
 
@@ -332,9 +333,9 @@ mod this_crate {
 
     struct S;
 
-    impl DeprecatedTrait for S { } //~ ERROR use of deprecated item 'this_crate::DeprecatedTrait': text
+    impl DeprecatedTrait for S { } //~ ERROR use of deprecated trait `this_crate::DeprecatedTrait`: text
 
-    trait LocalTrait : DeprecatedTrait { } //~ ERROR use of deprecated item 'this_crate::DeprecatedTrait': text
+    trait LocalTrait : DeprecatedTrait { } //~ ERROR use of deprecated trait `this_crate::DeprecatedTrait`: text
 }
 
 mod this_crate2 {
@@ -360,15 +361,15 @@ mod this_crate2 {
     pub fn foo() {
         let x = Stable {
             override2: 3,
-            //~^ ERROR use of deprecated item 'this_crate2::Stable::override2': text
+            //~^ ERROR use of deprecated field `this_crate2::Stable::override2`: text
         };
 
         let _ = x.override2;
-        //~^ ERROR use of deprecated item 'this_crate2::Stable::override2': text
+        //~^ ERROR use of deprecated field `this_crate2::Stable::override2`: text
 
         let Stable {
             override2: _
-            //~^ ERROR use of deprecated item 'this_crate2::Stable::override2': text
+            //~^ ERROR use of deprecated field `this_crate2::Stable::override2`: text
         } = x;
         // all fine
         let Stable { .. } = x;
@@ -376,60 +377,78 @@ mod this_crate2 {
         let x = Stable2(1, 2, 3);
 
         let _ = x.2;
-        //~^ ERROR use of deprecated item 'this_crate2::Stable2::2': text
+        //~^ ERROR use of deprecated field `this_crate2::Stable2::2`: text
 
         let Stable2(_,
                    _,
                    _)
-            //~^ ERROR use of deprecated item 'this_crate2::Stable2::2': text
+            //~^ ERROR use of deprecated field `this_crate2::Stable2::2`: text
             = x;
         // all fine
         let Stable2(..) = x;
 
         let x = Deprecated {
-            //~^ ERROR use of deprecated item 'this_crate2::Deprecated': text
+            //~^ ERROR use of deprecated struct `this_crate2::Deprecated`: text
             inherit: 1,
-            //~^ ERROR use of deprecated item 'this_crate2::Deprecated::inherit': text
+            //~^ ERROR use of deprecated field `this_crate2::Deprecated::inherit`: text
         };
 
         let _ = x.inherit;
-        //~^ ERROR use of deprecated item 'this_crate2::Deprecated::inherit': text
+        //~^ ERROR use of deprecated field `this_crate2::Deprecated::inherit`: text
 
         let Deprecated {
-            //~^ ERROR use of deprecated item 'this_crate2::Deprecated': text
+            //~^ ERROR use of deprecated struct `this_crate2::Deprecated`: text
             inherit: _,
-            //~^ ERROR use of deprecated item 'this_crate2::Deprecated::inherit': text
+            //~^ ERROR use of deprecated field `this_crate2::Deprecated::inherit`: text
         } = x;
 
         let Deprecated
-            //~^ ERROR use of deprecated item 'this_crate2::Deprecated': text
+            //~^ ERROR use of deprecated struct `this_crate2::Deprecated`: text
             // the patterns are all fine:
             { .. } = x;
 
         let x = Deprecated2(1, 2, 3);
-        //~^ ERROR use of deprecated item 'this_crate2::Deprecated2': text
+        //~^ ERROR use of deprecated tuple struct `this_crate2::Deprecated2`: text
 
         let _ = x.0;
-        //~^ ERROR use of deprecated item 'this_crate2::Deprecated2::0': text
+        //~^ ERROR use of deprecated field `this_crate2::Deprecated2::0`: text
         let _ = x.1;
-        //~^ ERROR use of deprecated item 'this_crate2::Deprecated2::1': text
+        //~^ ERROR use of deprecated field `this_crate2::Deprecated2::1`: text
         let _ = x.2;
-        //~^ ERROR use of deprecated item 'this_crate2::Deprecated2::2': text
+        //~^ ERROR use of deprecated field `this_crate2::Deprecated2::2`: text
 
         let Deprecated2
-        //~^ ERROR use of deprecated item 'this_crate2::Deprecated2': text
+        //~^ ERROR use of deprecated tuple struct `this_crate2::Deprecated2`: text
             (_,
-             //~^ ERROR use of deprecated item 'this_crate2::Deprecated2::0': text
+             //~^ ERROR use of deprecated field `this_crate2::Deprecated2::0`: text
              _,
-             //~^ ERROR use of deprecated item 'this_crate2::Deprecated2::1': text
+             //~^ ERROR use of deprecated field `this_crate2::Deprecated2::1`: text
              _)
-            //~^ ERROR use of deprecated item 'this_crate2::Deprecated2::2': text
+            //~^ ERROR use of deprecated field `this_crate2::Deprecated2::2`: text
             = x;
         let Deprecated2
-        //~^ ERROR use of deprecated item 'this_crate2::Deprecated2': text
+        //~^ ERROR use of deprecated tuple struct `this_crate2::Deprecated2`: text
             // the patterns are all fine:
             (..) = x;
     }
+
+    #[derive(Debug)]
+    #[deprecated(note = "Use something else instead")]
+    enum DeprecatedDebugEnum {
+        Variant1 { value: Option<String> },
+    }
+
+    #[allow(deprecated)]
+    impl DeprecatedDebugEnum {
+        fn new() -> Self {
+            DeprecatedDebugEnum::Variant1 { value: None }
+        }
+    }
+
+    #[allow(deprecated)]
+    pub fn allow_dep() {
+        let _ = DeprecatedDebugEnum::new();
+    }
 }
 
 fn main() {}