about summary refs log tree commit diff
path: root/src/libsyntax/attr
diff options
context:
space:
mode:
authorOliver Scherer <github35764891676564198441@oli-obk.de>2019-01-30 17:47:36 +0100
committerOliver Scherer <github35764891676564198441@oli-obk.de>2019-01-30 17:49:04 +0100
commit4056b575e2f7d6fe88b0c72714f3bd044d1dadb6 (patch)
treec9b56185d36cd284d5dfd6393d74582eea50900e /src/libsyntax/attr
parente4a9b5c623309dd707ee8188b09e55996c6beb9b (diff)
downloadrust-4056b575e2f7d6fe88b0c72714f3bd044d1dadb6.tar.gz
rust-4056b575e2f7d6fe88b0c72714f3bd044d1dadb6.zip
Add suggestions to deprecation lints
Diffstat (limited to 'src/libsyntax/attr')
-rw-r--r--src/libsyntax/attr/builtin.rs5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/libsyntax/attr/builtin.rs b/src/libsyntax/attr/builtin.rs
index 08c7c617a7b..7fe6f4a2316 100644
--- a/src/libsyntax/attr/builtin.rs
+++ b/src/libsyntax/attr/builtin.rs
@@ -158,6 +158,8 @@ impl StabilityLevel {
 pub struct RustcDeprecation {
     pub since: Symbol,
     pub reason: Symbol,
+    /// A text snippet used to completely replace any use of the deprecated item in an expression.
+    pub suggestion: Option<Symbol>,
 }
 
 /// Check if `attrs` contains an attribute like `#![feature(feature_name)]`.
@@ -274,13 +276,14 @@ fn find_stability_generic<'a, I>(sess: &ParseSess,
                         continue 'outer
                     }
 
-                    get_meta!(since, reason);
+                    get_meta!(since, reason, suggestion);
 
                     match (since, reason) {
                         (Some(since), Some(reason)) => {
                             rustc_depr = Some(RustcDeprecation {
                                 since,
                                 reason,
+                                suggestion,
                             })
                         }
                         (None, _) => {