]> git.lizzy.rs Git - rust.git/blobdiff - src/librustc_session/lint.rs
Rollup merge of #67909 - varkor:obsolete-const-print, r=davidtwco
[rust.git] / src / librustc_session / lint.rs
index faa6a7a4644e06e26cd60332ef2f749cc99c4cc1..0cce7e848fd6066dafdc955254c471fc303f2bc5 100644 (file)
@@ -1,13 +1,16 @@
-use syntax_pos::{MultiSpan, Symbol, sym};
-use syntax_pos::edition::Edition;
-use rustc_data_structures::stable_hasher::{HashStable, ToStableHashKey, StableHasher};
 pub use self::Level::*;
 use crate::node_id::NodeId;
+use rustc_data_structures::stable_hasher::{HashStable, StableHasher, ToStableHashKey};
+use rustc_span::edition::Edition;
+use rustc_span::{sym, MultiSpan, Symbol};
 
 /// Setting for how to handle a lint.
 #[derive(Clone, Copy, PartialEq, PartialOrd, Eq, Ord, Debug, Hash)]
 pub enum Level {
-    Allow, Warn, Deny, Forbid,
+    Allow,
+    Warn,
+    Deny,
+    Forbid,
 }
 
 rustc_data_structures::impl_stable_hash_via_hash!(Level);
@@ -130,7 +133,7 @@ fn eq(&self, other: &LintId) -> bool {
     }
 }
 
-impl Eq for LintId { }
+impl Eq for LintId {}
 
 impl std::hash::Hash for LintId {
     fn hash<H: std::hash::Hasher>(&self, state: &mut H) {
@@ -142,9 +145,7 @@ fn hash<H: std::hash::Hasher>(&self, state: &mut H) {
 impl LintId {
     /// Gets the `LintId` for a `Lint`.
     pub fn of(lint: &'static Lint) -> LintId {
-        LintId {
-            lint,
-        }
+        LintId { lint }
     }
 
     pub fn lint_name_raw(&self) -> &'static str {
@@ -176,16 +177,16 @@ fn to_stable_hash_key(&self, _: &HCX) -> &'static str {
 /// Stores buffered lint info which can later be passed to `librustc`.
 pub struct BufferedEarlyLint {
     /// The span of code that we are linting on.
-   pub span: MultiSpan,
+    pub span: MultiSpan,
 
-   /// The lint message.
-   pub msg: String,
+    /// The lint message.
+    pub msg: String,
 
-   /// The `NodeId` of the AST node that generated the lint.
-   pub id: NodeId,
+    /// The `NodeId` of the AST node that generated the lint.
+    pub id: NodeId,
 
-   /// A lint Id that can be passed to `rustc::lint::Lint::from_parser_lint_id`.
-   pub lint_id: &'static Lint,
+    /// A lint Id that can be passed to `rustc::lint::Lint::from_parser_lint_id`.
+    pub lint_id: &'static Lint,
 }
 
 /// Declares a static item of type `&'static Lint`.