Skip to content

split try trait in twain#154715

Draft
bend-n wants to merge 5 commits intorust-lang:mainfrom
bend-n:the-try.-split-it
Draft

split try trait in twain#154715
bend-n wants to merge 5 commits intorust-lang:mainfrom
bend-n:the-try.-split-it

Conversation

@bend-n
Copy link
Copy Markdown
Contributor

@bend-n bend-n commented Apr 2, 2026

No description provided.

@rust-log-analyzer

This comment has been minimized.

@rustbot rustbot added T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-libs Relevant to the library team, which will review and decide on the PR/issue. T-rust-analyzer Relevant to the rust-analyzer team, which will review and decide on the PR/issue. labels Apr 4, 2026
@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer
Copy link
Copy Markdown
Collaborator

The job x86_64-gnu-tools failed! Check out the build log: (web) (plain enhanced) (plain)

Click to see the possible cause of the failure (guessed by this bot)

--- stdout

running 43 tests
test expressions/operator-expr.md - Operator_expressions::Assignment_expressions::Destructuring_assignments (line 2403) ... ok
test expressions/operator-expr.md - Operator_expressions::Assignment_expressions::Destructuring_assignments (line 2383) ... ok
test expressions/operator-expr.md - Operator_expressions::Arithmetic_and_logical_binary_operators (line 1259) ... ok
test expressions/operator-expr.md - Operator_expressions::Assignment_expressions::Basic_assignments (line 2365) ... ok
test expressions/operator-expr.md - Operator_expressions::Assignment_expressions::Destructuring_assignments (line 2463) ... ok
test expressions/operator-expr.md - Operator_expressions::Assignment_expressions::Destructuring_assignments (line 2508) ... ok
test expressions/operator-expr.md - Operator_expressions::Assignment_expressions::Destructuring_assignments (line 2516) ... ok
test expressions/operator-expr.md - Operator_expressions::Borrow_operators (line 436) ... ok
test expressions/operator-expr.md - Operator_expressions::Borrow_operators (line 455) ... ok
test expressions/operator-expr.md - Operator_expressions::Borrow_operators::Raw_borrow_operators (line 498) ... ok
test expressions/operator-expr.md - Operator_expressions::Borrow_operators::Raw_borrow_operators (line 513) ... ok
test expressions/operator-expr.md - Operator_expressions::Comparison_operators (line 1492) ... ok
test expressions/operator-expr.md - Operator_expressions::Comparison_operators (line 1518) ... ok
test expressions/operator-expr.md - Operator_expressions::Compound_assignment_expressions (line 2887) ... ok
test expressions/operator-expr.md - Operator_expressions::Compound_assignment_expressions (line 2855) ... ok
test expressions/operator-expr.md - Operator_expressions::Compound_assignment_expressions (line 2947) ... ok
test expressions/operator-expr.md - Operator_expressions::Compound_assignment_expressions (line 2961) ... ok
test expressions/operator-expr.md - Operator_expressions::Lazy_boolean_operators (line 1631) ... ok
test expressions/operator-expr.md - Operator_expressions::Negation_operators (line 917) ... ok
test expressions/operator-expr.md - Operator_expressions::The_dereference_operator (line 618) ... ok
test expressions/operator-expr.md - Operator_expressions::The_try_propagation_expression (line 693) ... ok
test expressions/operator-expr.md - Operator_expressions::The_try_propagation_expression (line 706) ... ok
test expressions/operator-expr.md - Operator_expressions::The_try_propagation_expression (line 720) ... ok
test expressions/operator-expr.md - Operator_expressions::Type_cast_expressions::Semantics::Numeric_cast (line 1764) ... ok
test expressions/operator-expr.md - Operator_expressions::Type_cast_expressions::Semantics::Address_to_pointer_cast (line 1955) ... ok
test expressions/operator-expr.md - Operator_expressions::Type_cast_expressions::Semantics::Enum_cast (line 1884) ... ok
test expressions/operator-expr.md - Operator_expressions::Type_cast_expressions (line 1712) ... ok
test expressions/operator-expr.md - Operator_expressions::Type_cast_expressions::Semantics::Numeric_cast (line 1830) ... ok
test expressions/operator-expr.md - Operator_expressions::Type_cast_expressions::Semantics::Numeric_cast (line 1795) ... ok
test expressions/operator-expr.md - Operator_expressions::Type_cast_expressions::Semantics::Numeric_cast (line 1777) ... ok
test expressions/operator-expr.md - Operator_expressions::Type_cast_expressions::Semantics::Numeric_cast (line 1812) ... ok
test expressions/operator-expr.md - Operator_expressions::Type_cast_expressions::Semantics::Numeric_cast (line 1856) ... ok
test expressions/operator-expr.md - Operator_expressions::Type_cast_expressions::Semantics::Numeric_cast (line 1842) ... ok
test expressions/operator-expr.md - Operator_expressions::Type_cast_expressions::Semantics::Pointer_to_pointer_cast (line 2010) ... ok
test expressions/operator-expr.md - Operator_expressions::Type_cast_expressions::Semantics::Pointer_to_pointer_cast (line 1989) ... ok
test expressions/operator-expr.md - Operator_expressions::Type_cast_expressions::Semantics::Pointer_to_pointer_cast (line 2038) ... ok
test expressions/operator-expr.md - Operator_expressions::Type_cast_expressions::Semantics::Pointer_to_pointer_cast (line 2103) ... ok
test expressions/operator-expr.md - Operator_expressions::Type_cast_expressions::Semantics::Pointer_to_pointer_cast (line 2137) ... ok
test expressions/operator-expr.md - Operator_expressions::Type_cast_expressions::Semantics::Pointer_to_pointer_cast (line 2081) ... ok
test expressions/operator-expr.md - Operator_expressions::Type_cast_expressions::Semantics::Pointer_to_pointer_cast (line 2179) ... ok
test expressions/operator-expr.md - Operator_expressions::Type_cast_expressions::Semantics::Primitive_to_integer_cast (line 1906) ... ok
test expressions/operator-expr.md - Operator_expressions::Type_cast_expressions::Semantics::Pointer_to_pointer_cast (line 2214) ... ok
test expressions/operator-expr.md - Operator_expressions::Type_cast_expressions::Semantics::_to_ (line 1921) ... ok

test result: ok. 43 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.02s


running 11 tests
---
    |       ^^^^^^^^^^^^^^
    |
help: you can add the `dyn` keyword if you want a trait object
    |
775 | match <dyn core::ops::Try>::branch(expr) {
    |       ++++               +

error: aborting due to 1 previous error

For more information about this error, try `rustc --explain E0782`.
---

--- BACKTRACE vvv
   0: <bootstrap::utils::exec::DeferredCommand>::finish_process
             at /checkout/src/bootstrap/src/utils/exec.rs:939:17
   1: <bootstrap::utils::exec::DeferredCommand>::wait_for_output::<&bootstrap::utils::exec::ExecutionContext>
             at /checkout/src/bootstrap/src/utils/exec.rs:831:21
   2: <bootstrap::utils::exec::ExecutionContext>::run
             at /checkout/src/bootstrap/src/utils/exec.rs:741:45
   3: <bootstrap::utils::exec::BootstrapCommand>::run::<&bootstrap::core::builder::Builder>
             at /checkout/src/bootstrap/src/utils/exec.rs:339:27
   4: <bootstrap::core::build_steps::test::BookTest>::run_ext_doc
             at /checkout/src/bootstrap/src/core/build_steps/test.rs:2662:57
   5: <bootstrap::core::build_steps::test::BookTest as bootstrap::core::builder::Step>::run
             at /checkout/src/bootstrap/src/core/build_steps/test.rs:2577:18
---
   8: <bootstrap::core::builder::Builder>::ensure::<bootstrap::core::build_steps::test::Reference>
             at /checkout/src/bootstrap/src/core/builder/mod.rs:1579:36
   9: <bootstrap::core::build_steps::test::Reference as bootstrap::core::builder::Step>::make_run
             at /checkout/src/bootstrap/src/core/build_steps/test.rs:2736:33
  10: <bootstrap::core::builder::StepDescription>::maybe_run
             at /checkout/src/bootstrap/src/core/builder/mod.rs:476:13
  11: bootstrap::core::builder::cli_paths::match_paths_to_steps_and_run
             at /checkout/src/bootstrap/src/core/builder/cli_paths.rs:232:18
  12: <bootstrap::core::builder::Builder>::run_step_descriptions
             at /checkout/src/bootstrap/src/core/builder/mod.rs:1122:9
  13: <bootstrap::core::builder::Builder>::execute_cli
             at /checkout/src/bootstrap/src/core/builder/mod.rs:1101:14
  14: <bootstrap::Build>::build
             at /checkout/src/bootstrap/src/lib.rs:799:25
  15: bootstrap::main
             at /checkout/src/bootstrap/src/bin/main.rs:130:11
  16: <fn() as core::ops::function::FnOnce<()>>::call_once
             at /rustc/ad726b5063362ec9897ef3d67452fc5606ee70fa/library/core/src/ops/function.rs:250:5
  17: std::sys::backtrace::__rust_begin_short_backtrace::<fn(), ()>
             at /rustc/ad726b5063362ec9897ef3d67452fc5606ee70fa/library/std/src/sys/backtrace.rs:166:18
  18: std::rt::lang_start::<()>::{closure#0}
             at /rustc/ad726b5063362ec9897ef3d67452fc5606ee70fa/library/std/src/rt.rs:206:18
  19: <&dyn core::ops::function::Fn<(), Output = i32> + core::panic::unwind_safe::RefUnwindSafe + core::marker::Sync as core::ops::function::FnOnce<()>>::call_once
             at /rustc/ad726b5063362ec9897ef3d67452fc5606ee70fa/library/core/src/ops/function.rs:287:21
  20: std::panicking::catch_unwind::do_call::<&dyn core::ops::function::Fn<(), Output = i32> + core::panic::unwind_safe::RefUnwindSafe + core::marker::Sync, i32>
             at /rustc/ad726b5063362ec9897ef3d67452fc5606ee70fa/library/std/src/panicking.rs:581:40
  21: std::panicking::catch_unwind::<i32, &dyn core::ops::function::Fn<(), Output = i32> + core::panic::unwind_safe::RefUnwindSafe + core::marker::Sync>
             at /rustc/ad726b5063362ec9897ef3d67452fc5606ee70fa/library/std/src/panicking.rs:544:19
  22: std::panic::catch_unwind::<&dyn core::ops::function::Fn<(), Output = i32> + core::panic::unwind_safe::RefUnwindSafe + core::marker::Sync, i32>
             at /rustc/ad726b5063362ec9897ef3d67452fc5606ee70fa/library/std/src/panic.rs:359:14
  23: std::rt::lang_start_internal::{closure#0}
             at /rustc/ad726b5063362ec9897ef3d67452fc5606ee70fa/library/std/src/rt.rs:175:24
  24: std::panicking::catch_unwind::do_call::<std::rt::lang_start_internal::{closure#0}, isize>
             at /rustc/ad726b5063362ec9897ef3d67452fc5606ee70fa/library/std/src/panicking.rs:581:40
---
tests/ui/size_of_in_element_count/functions.rs ... ok
tests/ui/crashes/third-party/conf_allowlisted.rs ... ok

FAILED TEST: tests/ui/manual_try_fold.rs
command: CLIPPY_CONF_DIR="tests" RUSTC_ICE="0" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/clippy-driver" "--error-format=json" "--emit=metadata" "-Aunused" "-Ainternal_features" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Dwarnings" "-Ldependency=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/release/deps" "--sysroot=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2" "--out-dir" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/ui_test/0/tests/ui" "tests/ui/manual_try_fold.rs" "--extern" "proc_macros=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/ui_test/0/tests/ui/auxiliary/libproc_macros.so" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/ui_test/0/tests/ui/auxiliary" "--extern" "futures=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/deps/libfutures-fbb2c78a4397bb08.rlib" "--extern" "futures=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/deps/libfutures-fbb2c78a4397bb08.rmeta" "--extern" "itertools=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/deps/libitertools-08cb6de3a10b25d1.rlib" "--extern" "itertools=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/deps/libitertools-08cb6de3a10b25d1.rmeta" "--extern" "libc=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/deps/liblibc-ac3195ae9071a567.rlib" "--extern" "libc=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/deps/liblibc-ac3195ae9071a567.rmeta" "--extern" "parking_lot=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/deps/libparking_lot-cb20139ff7bab978.rlib" "--extern" "parking_lot=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/deps/libparking_lot-cb20139ff7bab978.rmeta" "--extern" "quote=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/deps/libquote-d52f64f9beb2b3e9.rlib" "--extern" "quote=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/deps/libquote-d52f64f9beb2b3e9.rmeta" "--extern" "regex=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/deps/libregex-099fa7d611da1769.rlib" "--extern" "regex=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/deps/libregex-099fa7d611da1769.rmeta" "--extern" "serde=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/deps/libserde-cc2552a331d3edc6.rlib" "--extern" "serde=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/deps/libserde-cc2552a331d3edc6.rmeta" "--extern" "syn=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/deps/libsyn-6fe3ac6a29af0bce.rlib" "--extern" "syn=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/deps/libsyn-6fe3ac6a29af0bce.rmeta" "--extern" "tokio=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/deps/libtokio-115c8b7669715635.rlib" "--extern" "tokio=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/deps/libtokio-115c8b7669715635.rmeta" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/debug/deps" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/deps" "--edition" "2024"

error: actual output differed from expected
Execute `./x test src/tools/clippy --bless` to update `tests/ui/manual_try_fold.stderr` to the actual output
--- tests/ui/manual_try_fold.stderr
+++ <stderr output>
-error: usage of `Iterator::fold` on a type that implements `Try`
+error[E0404]: expected trait, found trait alias `Try`
-  --> tests/ui/manual_try_fold.rs:59:10
+  --> tests/ui/manual_try_fold.rs:20:6
    |
-LL |         .fold(Some(0i32), |sum, i| sum?.checked_add(*i))
-   |          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `try_fold` instead: `try_fold(0i32, |sum, i| ...)`
-   |
-   = note: `-D clippy::manual-try-fold` implied by `-D warnings`
-   = help: to override `-D warnings` add `#[allow(clippy::manual_try_fold)]`
+LL | impl Try for NotOption {
+   |      ^^^ not a trait
 
-error: usage of `Iterator::fold` on a type that implements `Try`
+error[E0404]: expected trait, found trait alias `Try`
-  --> tests/ui/manual_try_fold.rs:64:10
+  --> tests/ui/manual_try_fold.rs:43:6
    |
-LL |         .fold(NotOption(0i32, 0i32), |sum, i| NotOption(0i32, 0i32));
+LL | impl Try for NotOptionButWorse {
-   |          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `try_fold` instead: `try_fold(..., |sum, i| ...)`
+   |      ^^^ not a trait
 
-error: usage of `Iterator::fold` on a type that implements `Try`
-  --> tests/ui/manual_try_fold.rs:68:10
-   |
-LL |         .fold(NotOptionButWorse(0i32), |sum, i| NotOptionButWorse(0i32));
-   |          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `try_fold` instead: `try_fold(0i32, |sum, i| ...)`
+error: aborting due to 2 previous errors
 
-error: usage of `Iterator::fold` on a type that implements `Try`
-  --> tests/ui/manual_try_fold.rs:99:10
-   |
-LL |         .fold(Some(0i32), |sum, i| sum?.checked_add(*i))
-   |          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `try_fold` instead: `try_fold(0i32, |sum, i| ...)`
-
-error: aborting due to 4 previous errors
-
+For more information about this error, try `rustc --explain E0404`.

@rust-bors
Copy link
Copy Markdown
Contributor

rust-bors bot commented Apr 16, 2026

☔ The latest upstream changes (presumably #155380) made this pull request unmergeable. Please resolve the merge conflicts.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-libs Relevant to the library team, which will review and decide on the PR/issue. T-rust-analyzer Relevant to the rust-analyzer team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants