Skip to content

Commit 4f3b49f

Browse files
committed
Auto merge of #84767 - scottmcm:try_trait_actual, r=lcnr
Implement the new desugaring from `try_trait_v2` ~~Currently blocked on rust-lang/rust#84782, which has a PR in rust-lang/rust#84811 Rebased atop that fix. `try_trait_v2` tracking issue: rust-lang/rust#84277 Unfortunately this is already touching a ton of things, so if you have suggestions for good ways to split it up, I'd be happy to hear them. (The combination between the use in the library, the compiler changes, the corresponding diagnostic differences, even MIR tests mean that I don't really have a great plan for it other than trying to have decently-readable commits. r? `@ghost` ~~(This probably shouldn't go in during the last week before the fork anyway.)~~ Fork happened.
2 parents c086676 + 300f628 commit 4f3b49f

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

clippy_lints/src/needless_question_mark.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ fn is_some_or_ok_call<'a>(cx: &'a LateContext<'_>, expr: &'a Expr<'_>) -> Option
147147
if let ExprKind::Call(called, args) = &inner_expr_with_q.kind;
148148
if args.len() == 1;
149149

150-
if let ExprKind::Path(QPath::LangItem(LangItem::TryIntoResult, _)) = &called.kind;
150+
if let ExprKind::Path(QPath::LangItem(LangItem::TryTraitBranch, _)) = &called.kind;
151151
then {
152152
// Extract inner expr type from match argument generated by
153153
// question mark operator

clippy_lints/src/try_err.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ impl<'tcx> LateLintPass<'tcx> for TryErr {
6464
if let ExprKind::Match(match_arg, _, MatchSource::TryDesugar) = expr.kind;
6565
if let ExprKind::Call(match_fun, try_args) = match_arg.kind;
6666
if let ExprKind::Path(ref match_fun_path) = match_fun.kind;
67-
if matches!(match_fun_path, QPath::LangItem(LangItem::TryIntoResult, _));
67+
if matches!(match_fun_path, QPath::LangItem(LangItem::TryTraitBranch, _));
6868
if let Some(try_arg) = try_args.get(0);
6969
if let ExprKind::Call(err_fun, err_args) = try_arg.kind;
7070
if let Some(err_arg) = err_args.get(0);

clippy_lints/src/unused_io_amount.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ impl<'tcx> LateLintPass<'tcx> for UnusedIoAmount {
4545
if let hir::ExprKind::Call(func, args) = res.kind {
4646
if matches!(
4747
func.kind,
48-
hir::ExprKind::Path(hir::QPath::LangItem(hir::LangItem::TryIntoResult, _))
48+
hir::ExprKind::Path(hir::QPath::LangItem(hir::LangItem::TryTraitBranch, _))
4949
) {
5050
check_map_error(cx, &args[0], expr);
5151
}

0 commit comments

Comments
 (0)