use rustc_typeck::hir_ty_to_ty;
use syntax_pos::{InnerSpan, Span, DUMMY_SP};
-use crate::utils::{in_constant, in_macro_or_desugar, is_copy, span_lint_and_then};
+use crate::utils::{in_constant, is_copy, qpath_res, span_lint_and_then};
declare_clippy_lint! {
/// **What it does:** Checks for declaration of `const` items which is interior
let (lint, msg, span) = source.lint();
span_lint_and_then(cx, lint, span, msg, |db| {
- if in_macro_or_desugar(span) {
+ if span.from_expansion() {
return; // Don't give suggestions into macros.
}
match source {
}
// Make sure it is a const item.
- match cx.tables.qpath_res(qpath, expr.hir_id) {
+ match qpath_res(cx, qpath, expr.hir_id) {
Res::Def(DefKind::Const, _) | Res::Def(DefKind::AssocConst, _) => {},
_ => return,
};