Rollup merge of #77534 - Mark-Simulacrum:issue-70819-disallow-override-forbid-in-same-scope, r=petrochenkov
Disallow overriding forbid in same scope Rebased #73379. Fixes #70819.
This commit is contained in:
commit
bc600c3905
7 changed files with 150 additions and 24 deletions
|
@ -9,7 +9,7 @@ use rustc_session::lint::{builtin, Level, Lint, LintId};
|
|||
use rustc_session::{DiagnosticMessageId, Session};
|
||||
use rustc_span::hygiene::MacroKind;
|
||||
use rustc_span::source_map::{DesugaringKind, ExpnKind, MultiSpan};
|
||||
use rustc_span::{Span, Symbol};
|
||||
use rustc_span::{symbol, Span, Symbol, DUMMY_SP};
|
||||
|
||||
/// How a lint level was set.
|
||||
#[derive(Clone, Copy, PartialEq, Eq, HashStable)]
|
||||
|
@ -25,6 +25,24 @@ pub enum LintSource {
|
|||
CommandLine(Symbol),
|
||||
}
|
||||
|
||||
impl LintSource {
|
||||
pub fn name(&self) -> Symbol {
|
||||
match *self {
|
||||
LintSource::Default => symbol::kw::Default,
|
||||
LintSource::Node(name, _, _) => name,
|
||||
LintSource::CommandLine(name) => name,
|
||||
}
|
||||
}
|
||||
|
||||
pub fn span(&self) -> Span {
|
||||
match *self {
|
||||
LintSource::Default => DUMMY_SP,
|
||||
LintSource::Node(_, span, _) => span,
|
||||
LintSource::CommandLine(_) => DUMMY_SP,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pub type LevelSource = (Level, LintSource);
|
||||
|
||||
pub struct LintLevelSets {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue