Rename in_macro to in_macro_or_desugar

This commit is contained in:
Manish Goregaokar
2019-05-11 20:40:05 -07:00
parent 3710ec5996
commit 7eb8018554
45 changed files with 132 additions and 121 deletions

View File

@@ -142,7 +142,7 @@ declare_lint_pass!(StringLitAsBytes => [STRING_LIT_AS_BYTES]);
impl<'a, 'tcx> LateLintPass<'a, 'tcx> for StringLitAsBytes {
fn check_expr(&mut self, cx: &LateContext<'a, 'tcx>, e: &'tcx Expr) {
use crate::utils::{in_macro, snippet, snippet_with_applicability};
use crate::utils::{in_macro_or_desugar, snippet, snippet_with_applicability};
use syntax::ast::{LitKind, StrStyle};
if let ExprKind::MethodCall(ref path, _, ref args) = e.node {
@@ -173,7 +173,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for StringLitAsBytes {
);
} else if callsite == expanded
&& lit_content.as_str().chars().all(|c| c.is_ascii())
&& !in_macro(args[0].span)
&& !in_macro_or_desugar(args[0].span)
{
span_lint_and_sugg(
cx,