|
1 | | -use rustc_feature::{AttributeTemplate, template}; |
2 | | -use rustc_hir::attrs::{AttributeKind, DeprecatedSince, Deprecation}; |
3 | | -use rustc_hir::{MethodKind, Target}; |
4 | | -use rustc_span::{Span, Symbol, sym}; |
| 1 | +use rustc_hir::attrs::{DeprecatedSince, Deprecation}; |
5 | 2 |
|
| 3 | +use super::prelude::*; |
6 | 4 | use super::util::parse_version; |
7 | | -use super::{AttributeOrder, OnDuplicate, SingleAttributeParser}; |
8 | | -use crate::context::{AcceptContext, Stage}; |
9 | | -use crate::parser::ArgParser; |
10 | | -use crate::session_diagnostics; |
11 | | -use crate::target_checking::AllowedTargets; |
12 | | -use crate::target_checking::Policy::{Allow, Error}; |
| 5 | +use crate::session_diagnostics::{ |
| 6 | + DeprecatedItemSuggestion, InvalidSince, MissingNote, MissingSince, |
| 7 | +}; |
13 | 8 |
|
14 | 9 | pub(crate) struct DeprecationParser; |
15 | 10 |
|
@@ -104,7 +99,7 @@ impl<S: Stage> SingleAttributeParser<S> for DeprecationParser { |
104 | 99 | } |
105 | 100 | Some(name @ sym::suggestion) => { |
106 | 101 | if !features.deprecated_suggestion() { |
107 | | - cx.emit_err(session_diagnostics::DeprecatedItemSuggestion { |
| 102 | + cx.emit_err(DeprecatedItemSuggestion { |
108 | 103 | span: param.span(), |
109 | 104 | is_nightly: cx.sess().is_nightly_build(), |
110 | 105 | details: (), |
@@ -146,18 +141,18 @@ impl<S: Stage> SingleAttributeParser<S> for DeprecationParser { |
146 | 141 | } else if let Some(version) = parse_version(since) { |
147 | 142 | DeprecatedSince::RustcVersion(version) |
148 | 143 | } else { |
149 | | - cx.emit_err(session_diagnostics::InvalidSince { span: cx.attr_span }); |
| 144 | + cx.emit_err(InvalidSince { span: cx.attr_span }); |
150 | 145 | DeprecatedSince::Err |
151 | 146 | } |
152 | 147 | } else if is_rustc { |
153 | | - cx.emit_err(session_diagnostics::MissingSince { span: cx.attr_span }); |
| 148 | + cx.emit_err(MissingSince { span: cx.attr_span }); |
154 | 149 | DeprecatedSince::Err |
155 | 150 | } else { |
156 | 151 | DeprecatedSince::Unspecified |
157 | 152 | }; |
158 | 153 |
|
159 | 154 | if is_rustc && note.is_none() { |
160 | | - cx.emit_err(session_diagnostics::MissingNote { span: cx.attr_span }); |
| 155 | + cx.emit_err(MissingNote { span: cx.attr_span }); |
161 | 156 | return None; |
162 | 157 | } |
163 | 158 |
|
|
0 commit comments