use crate::reexport::*;
use crate::utils::{
- in_macro_or_desugar, is_present_in_source, last_line_of_span, match_def_path, paths, snippet_opt, span_lint,
- span_lint_and_sugg, span_lint_and_then, without_block_comments,
+ is_present_in_source, last_line_of_span, match_def_path, paths, snippet_opt, span_lint, span_lint_and_sugg,
+ span_lint_and_then, without_block_comments,
};
use if_chain::if_chain;
use rustc::hir::*;
line_span,
"if you just forgot a `!`, use",
sugg,
- Applicability::MachineApplicable,
+ Applicability::MaybeIncorrect,
);
},
);
let name = meta_item.path.segments.last().unwrap().ident.name;
if let CheckLintNameResult::Tool(Err((None, _))) = lint_store.check_lint_name(
&name.as_str(),
- Some(tool_name.as_str()),
+ Some(tool_name.name),
);
then {
span_lint_and_then(
let name_lower = name.as_str().to_lowercase();
match lint_store.check_lint_name(
&name_lower,
- Some(tool_name.as_str())
+ Some(tool_name.name)
) {
// FIXME: can we suggest similar lint names here?
// https://github.com/rust-lang/rust/pull/56992
}
fn check_attrs(cx: &LateContext<'_, '_>, span: Span, name: Name, attrs: &[Attribute]) {
- if in_macro_or_desugar(span) {
+ if span.from_expansion() {
return;
}