Lint bare traits in AstConv.
This commit is contained in:
parent
887999d163
commit
646f58a7e1
45 changed files with 366 additions and 297 deletions
|
@ -635,16 +635,6 @@ pub trait LintContext: Sized {
|
|||
}
|
||||
},
|
||||
BuiltinLintDiagnostics::Normal => (),
|
||||
BuiltinLintDiagnostics::BareTraitObject(span, is_global) => {
|
||||
let (sugg, app) = match sess.source_map().span_to_snippet(span) {
|
||||
Ok(s) if is_global => {
|
||||
(format!("dyn ({})", s), Applicability::MachineApplicable)
|
||||
}
|
||||
Ok(s) => (format!("dyn {}", s), Applicability::MachineApplicable),
|
||||
Err(_) => ("dyn <type>".to_string(), Applicability::HasPlaceholders),
|
||||
};
|
||||
db.span_suggestion(span, "use `dyn`", sugg, app);
|
||||
}
|
||||
BuiltinLintDiagnostics::AbsPathWithModule(span) => {
|
||||
let (sugg, app) = match sess.source_map().span_to_snippet(span) {
|
||||
Ok(ref s) => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue