]> git.lizzy.rs Git - rust.git/commitdiff
Rollup merge of #35989 - 0xmohit:pr/error-code-E0453, r=jonathandturner
authorJonathan Turner <jonathandturner@users.noreply.github.com>
Sat, 27 Aug 2016 19:43:31 +0000 (12:43 -0700)
committerGitHub <noreply@github.com>
Sat, 27 Aug 2016 19:43:31 +0000 (12:43 -0700)
Update E0453 to new error format

Fixes #35929.
Part of #35233.

r? @jonathandturner

1  2 
src/librustc/lint/context.rs

index 29bcc1257fd3182c78f0bfdde13aa25444c7f2b3,9c06f0cca15666203a026c64a32393555c87a7de..0bab919a9ae3e4e384d219581321d41f4a522032
@@@ -601,16 -601,17 +601,17 @@@ pub trait LintContext: Sized 
              for (lint_id, level, span) in v {
                  let (now, now_source) = self.lints().get_level_source(lint_id);
                  if now == Forbid && level != Forbid {
 -                    let lint_name = lint_id.as_str();
 +                    let lint_name = lint_id.to_string();
                      let mut diag_builder = struct_span_err!(self.sess(), span, E0453,
                                                              "{}({}) overruled by outer forbid({})",
                                                              level.as_str(), lint_name,
                                                              lint_name);
+                     diag_builder.span_label(span, &format!("overruled by previous forbid"));
                      match now_source {
                          LintSource::Default => &mut diag_builder,
                          LintSource::Node(forbid_source_span) => {
-                             diag_builder.span_note(forbid_source_span,
-                                                    "`forbid` lint level set here")
+                             diag_builder.span_label(forbid_source_span,
+                                                     &format!("`forbid` level set here"))
                          },
                          LintSource::CommandLine => {
                              diag_builder.note("`forbid` lint level was set on command line")
@@@ -1216,7 -1217,7 +1217,7 @@@ pub fn check_crate<'a, 'tcx>(tcx: TyCtx
          for &(lint, span, ref msg) in v {
              span_bug!(span,
                        "unprocessed lint {} at {}: {}",
 -                      lint.as_str(), tcx.map.node_to_string(*id), *msg)
 +                      lint.to_string(), tcx.map.node_to_string(*id), *msg)
          }
      }
  
@@@ -1252,7 -1253,7 +1253,7 @@@ pub fn check_ast_crate(sess: &Session, 
      // in the iteration code.
      for (_, v) in sess.lints.borrow().iter() {
          for &(lint, span, ref msg) in v {
 -            span_bug!(span, "unprocessed lint {}: {}", lint.as_str(), *msg)
 +            span_bug!(span, "unprocessed lint {}: {}", lint.to_string(), *msg)
          }
      }
  }