Skip to content

Commit

Permalink
Build fix attempt rust-lang#2.
Browse files Browse the repository at this point in the history
  • Loading branch information
ofeeg committed May 15, 2023
1 parent 042ff52 commit 8b29c65
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions clippy_lints/src/methods/path_join_correction.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,25 @@ use super::PATH_JOIN_CORRECTION;
pub(super) fn check<'tcx>(cx: &LateContext<'tcx>, expr: &'tcx Expr<'tcx>, join_arg: &'tcx Expr<'tcx>, span: Span) {
let ty = cx.typeck_results().expr_ty(expr);
if_chain!(
<<<<<<< HEAD
if is_type_diagnostic_item(cx, ty, Path);
let applicability = Applicability::MachineApplicable;
if let ExprKind::Lit(spanned) = &join_arg.kind;
if let LitKind::Str(symbol, _) = spanned.node;
if symbol.as_str().starts_with('/') || symbol.as_str().starts_with('\\');
=======
if is_type_diagnostic_item(cx, ty, Path);
let applicability = Applicability::MachineApplicable;
if let ExprKind::Lit(spanned) = &join_arg.kind;
if let LitKind::Str(symbol, _) = spanned.node;
if symbol.as_str().starts_with('/') || symbol.as_str().starts_with('\\');
>>>>>>> 729475bde (Build fix attempt #2.)
then {
span_lint_and_sugg(
cx,
PATH_JOIN_CORRECTION,
span.with_hi(expr.span.hi()),
<<<<<<< HEAD
r#"argument in join called on path contains a starting '/'"#,
"try removing first '/' or '\\'",
"join(\"your/path/here\")".to_owned(),
Expand Down Expand Up @@ -82,18 +91,23 @@ pub(super) fn check<'tcx>(cx: &LateContext<'tcx>, expr: &'tcx Expr<'tcx>, join_a
cx,
PATH_JOIN_CORRECTION,
span.with_hi(expr.span.hi()),
=======
>>>>>>> 729475bde (Build fix attempt #2.)
r#"argument in join called on path contains a starting '/'"#,
"try removing first '/' or '\\'",
"join(\"your/path/here\")".to_owned(),
applicability
);
}
);
<<<<<<< HEAD
<<<<<<< HEAD
}
);
>>>>>>> b87b08b12 (Fixed errors and lack of documentation in mod.rs.)
=======
}
>>>>>>> 00ee1bf71 (Added type check and test case for string slice.)
=======
>>>>>>> 729475bde (Build fix attempt #2.)
}

0 comments on commit 8b29c65

Please sign in to comment.