make coerce-lub order independent by BoxyUwU · Pull Request #147565 · rust-lang/rust (original) (raw)

test [ui] tests/ui/coercion/issue-73886.rs ... ok
test [ui] tests/ui/coercion/issue-88097.rs#current ... ok
test [ui] tests/ui/coercion/issue-88097.rs#next ... ok
test [ui] tests/ui/coercion/issue-3794.rs ... ok
test [ui] tests/ui/coercion/leak_check_fndef_lub.rs ... ok
test [ui] tests/ui/coercion/leak_check_fndef_lub_deadcode_breakage.rs ... ok
test [ui] tests/ui/coercion/leak_check_lub_fallback.rs ... FAILED
test [ui] tests/ui/coercion/leak_check_single_to_fnptr.rs#deadcode ... ok
test [ui] tests/ui/coercion/leak_check_lub_to_fnptr.rs#deadcode ... FAILED
test [ui] tests/ui/coercion/leak_check_lub_to_fnptr.rs#livecode ... FAILED
test [ui] tests/ui/coercion/lub_coercion_handles_safety.rs ... ignored, only executed when the architecture is x86_64
test [ui] tests/ui/coercion/issue-39823.rs ... ok
test [ui] tests/ui/coercion/leak_check_single_to_fnptr.rs#livecode ... ok
test [ui] tests/ui/coercion/lub_closures_before_fnptr_coercion.rs ... ok
test [ui] tests/ui/coercion/mut-trait-object-coercion-8398.rs ... ok
test [ui] tests/ui/coercion/mut-mut-wont-coerce.rs ... ok
test [ui] tests/ui/coercion/method-return-trait-object-14399.rs ... ok
test [ui] tests/ui/coercion/no_local_for_coerced_const-issue-143671.rs ... ok
test [ui] tests/ui/coercion/pin-dyn-dispatch-sound.rs ... ok
---
test [ui] tests/ui/zero-sized/zero-sized-btreemap-insert.rs ... ok

failures:

---- [ui] tests/ui/coercion/leak_check_lub_fallback.rs stdout ----

error: ui test did not emit an error
note: by default, ui tests are expected not to compile.
hint: use check-pass, build-pass, or run-pass directive to change this behavior.
status: exit status: 0
command: env -u RUSTC_LOG_COLOR RUSTC_ICE="0" RUST_BACKTRACE="short" "/checkout/obj/build/aarch64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/tests/ui/coercion/leak_check_lub_fallback.rs" "-Zthreads=1" "-Zsimulate-remapped-rust-src-base=/rustc/FAKE_PREFIX" "-Ztranslate-remapped-path-to-local-path=no" "-Z" "ignore-directory-in-diagnostics-source-blocks=/cargo" "-Z" "ignore-directory-in-diagnostics-source-blocks=/checkout/vendor" "--sysroot" "/checkout/obj/build/aarch64-unknown-linux-gnu/stage2" "--target=aarch64-unknown-linux-gnu" "--check-cfg" "cfg(test,FALSE)" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Zwrite-long-types-to-disk=no" "-Cstrip=debuginfo" "--emit" "metadata" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/aarch64-unknown-linux-gnu/test/ui/coercion/leak_check_lub_fallback" "-A" "unused" "-W" "unused_attributes" "-A" "internal_features" "-A" "unused_parens" "-A" "unused_braces" "-Crpath" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/aarch64-unknown-linux-gnu/native/rust-test-helpers"
stdout: none
stderr: none

---- [ui] tests/ui/coercion/leak_check_lub_fallback.rs stdout end ----
---- [ui] tests/ui/coercion/leak_check_lub_to_fnptr.rs#deadcode stdout ----
Saved the actual stderr to `/checkout/obj/build/aarch64-unknown-linux-gnu/test/ui/coercion/leak_check_lub_to_fnptr.deadcode/leak_check_lub_to_fnptr.deadcode.stderr`
diff of stderr:

50                  found fn item `for<'a> fn(&'static (), &'a ()) {lub_with_fnptr_leak_checking::rhs_fndef}`
51 
52 error[E0308]: `if` and `else` have incompatible types
-   --> $DIR/leak_check_lub_to_fnptr.rs:47:15
-    |
- LL |     let rhs_closure = |_: &'static (), _: &()| {};
-    |                       ------------------------ the found closure
- LL |     lub!(lhs, rhs_closure);
-    |          ---  ^^^^^^^^^^^ one type is more general than the other
-    |          |
-    |          expected because of this
-    |
-    = note: expected fn pointer `for<'a> fn(&'a (), &())`
-                  found closure `{closure@$DIR/leak_check_lub_to_fnptr.rs:46:23: 46:47}`
-    = note: closure has signature: `for<'a> fn(&'static (), &'a ())`
- 
- error[E0308]: `if` and `else` have incompatible types
67   --> $DIR/leak_check_lub_to_fnptr.rs:59:23
68    |
69 LL |     let lhs_closure = |_: &(), _: &'static (), _: &()| {};

123    = note: expected fn item `for<'a> fn(&'static (), &'static (), &'a ()) {order_dependence_fndefs::rhs_fndef}`
124               found fn item `for<'a, 'b> fn(&'a (), &'static (), &'b ()) {order_dependence_fndefs::lhs_fndef}`
125 
- error: aborting due to 9 previous errors
+ error: aborting due to 8 previous errors
127 
128 For more information about this error, try `rustc --explain E0308`.
129 


The actual stderr differed from the expected stderr
To update references, rerun the tests and pass the `--bless` flag
To only update this specific test, also pass `--test-args coercion/leak_check_lub_to_fnptr.rs`

error in revision `deadcode`: 1 errors occurred comparing output.
status: exit status: 1
command: env -u RUSTC_LOG_COLOR RUSTC_ICE="0" RUST_BACKTRACE="short" "/checkout/obj/build/aarch64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/tests/ui/coercion/leak_check_lub_to_fnptr.rs" "-Zthreads=1" "-Zsimulate-remapped-rust-src-base=/rustc/FAKE_PREFIX" "-Ztranslate-remapped-path-to-local-path=no" "-Z" "ignore-directory-in-diagnostics-source-blocks=/cargo" "-Z" "ignore-directory-in-diagnostics-source-blocks=/checkout/vendor" "--sysroot" "/checkout/obj/build/aarch64-unknown-linux-gnu/stage2" "--target=aarch64-unknown-linux-gnu" "--cfg" "deadcode" "--check-cfg" "cfg(test,FALSE,livecode,deadcode)" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Zwrite-long-types-to-disk=no" "-Cstrip=debuginfo" "--emit" "metadata" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/aarch64-unknown-linux-gnu/test/ui/coercion/leak_check_lub_to_fnptr.deadcode" "-A" "unused" "-W" "unused_attributes" "-A" "internal_features" "-A" "unused_parens" "-A" "unused_braces" "-Crpath" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/aarch64-unknown-linux-gnu/native/rust-test-helpers"
stdout: none
--- stderr -------------------------------
error[E0308]: `if` and `else` have incompatible types
##[error]  --> /checkout/tests/ui/coercion/leak_check_lub_to_fnptr.rs:21:21
   |
LL |     lub!(lhs_fnptr, rhs_fnptr);
   |          ---------  ^^^^^^^^^ one type is more general than the other
   |          |
   |          expected because of this
   |
   = note: expected fn pointer `for<'a> fn(&'a (), &())`
              found fn pointer `for<'a> fn(&(), &'a ())`

error[E0308]: `if` and `else` have incompatible types
##[error]  --> /checkout/tests/ui/coercion/leak_check_lub_to_fnptr.rs:27:21
   |
LL |     lub!(lhs_fndef, rhs_fndef);
   |          ---------  ^^^^^^^^^ one type is more general than the other
   |          |
   |          expected because of this
   |
   = note: expected fn item `for<'a> fn(&'a (), &'static ()) {lub_to_fnptr_leak_checking::lhs_fndef}`
              found fn item `for<'a> fn(&'static (), &'a ()) {lub_to_fnptr_leak_checking::rhs_fndef}`

error[E0308]: `if` and `else` have incompatible types
##[error]  --> /checkout/tests/ui/coercion/leak_check_lub_to_fnptr.rs:33:23
   |
LL |     let lhs_closure = |_: &(), _: &'static ()| {};
   |                       ------------------------ the expected closure
LL |     let rhs_closure = |_: &'static (), _: &()| {};
   |                       ------------------------ the found closure
LL |     lub!(lhs_closure, rhs_closure);
   |          -----------  ^^^^^^^^^^^ one type is more general than the other
   |          |
   |          expected because of this
   |
   = note: expected closure `{closure@/checkout/tests/ui/coercion/leak_check_lub_to_fnptr.rs:31:23: 31:47}`
              found closure `{closure@/checkout/tests/ui/coercion/leak_check_lub_to_fnptr.rs:32:23: 32:47}`
   = note: closure has signature: `for<'a> fn(&'static (), &'a ())`
   = note: no two closures, even if identical, have the same type
   = help: consider boxing your closure and/or using it as a trait object

error[E0308]: `if` and `else` have incompatible types
##[error]  --> /checkout/tests/ui/coercion/leak_check_lub_to_fnptr.rs:42:15
   |
LL |     lub!(lhs, rhs_fndef);
   |          ---  ^^^^^^^^^ one type is more general than the other
   |          |
   |          expected because of this
   |
   = note: expected fn pointer `for<'a> fn(&'a (), &())`
                 found fn item `for<'a> fn(&'static (), &'a ()) {lub_with_fnptr_leak_checking::rhs_fndef}`

error[E0308]: `if` and `else` have incompatible types
##[error]  --> /checkout/tests/ui/coercion/leak_check_lub_to_fnptr.rs:59:23
   |
LL |     let lhs_closure = |_: &(), _: &'static (), _: &()| {};
   |                       -------------------------------- the expected closure
LL |     let rhs_closure = |_: &'static (), _: &'static (), _: &()| {};
   |                       ---------------------------------------- the found closure
LL |
LL |     lub!(lhs_closure, rhs_closure);
   |          -----------  ^^^^^^^^^^^ one type is more general than the other
   |          |
   |          expected because of this
   |
   = note: expected closure `{closure@/checkout/tests/ui/coercion/leak_check_lub_to_fnptr.rs:56:23: 56:55}`
              found closure `{closure@/checkout/tests/ui/coercion/leak_check_lub_to_fnptr.rs:57:23: 57:63}`
   = note: closure has signature: `for<'a> fn(&'static (), &'static (), &'a ())`
   = note: no two closures, even if identical, have the same type
   = help: consider boxing your closure and/or using it as a trait object

error[E0308]: `if` and `else` have incompatible types
##[error]  --> /checkout/tests/ui/coercion/leak_check_lub_to_fnptr.rs:61:23
   |
LL |     let lhs_closure = |_: &(), _: &'static (), _: &()| {};
   |                       -------------------------------- the found closure
LL |     let rhs_closure = |_: &'static (), _: &'static (), _: &()| {};
   |                       ---------------------------------------- the expected closure
...
LL |     lub!(rhs_closure, lhs_closure);
   |          -----------  ^^^^^^^^^^^ one type is more general than the other
   |          |
   |          expected because of this
   |
   = note: expected closure `{closure@/checkout/tests/ui/coercion/leak_check_lub_to_fnptr.rs:57:23: 57:63}`
              found closure `{closure@/checkout/tests/ui/coercion/leak_check_lub_to_fnptr.rs:56:23: 56:55}`
   = note: closure has signature: `for<'a, 'b> fn(&'a (), &'static (), &'b ())`
   = note: no two closures, even if identical, have the same type
   = help: consider boxing your closure and/or using it as a trait object

error[E0308]: `if` and `else` have incompatible types
##[error]  --> /checkout/tests/ui/coercion/leak_check_lub_to_fnptr.rs:73:21
   |
LL |     lub!(lhs_fndef, rhs_fndef);
   |          ---------  ^^^^^^^^^ one type is more general than the other
   |          |
   |          expected because of this
   |
   = note: expected fn item `for<'a, 'b> fn(&'a (), &'static (), &'b ()) {order_dependence_fndefs::lhs_fndef}`
              found fn item `for<'a> fn(&'static (), &'static (), &'a ()) {order_dependence_fndefs::rhs_fndef}`

error[E0308]: `if` and `else` have incompatible types
##[error]  --> /checkout/tests/ui/coercion/leak_check_lub_to_fnptr.rs:75:21
   |
LL |     lub!(rhs_fndef, lhs_fndef);
   |          ---------  ^^^^^^^^^ one type is more general than the other
   |          |
   |          expected because of this
   |
   = note: expected fn item `for<'a> fn(&'static (), &'static (), &'a ()) {order_dependence_fndefs::rhs_fndef}`
              found fn item `for<'a, 'b> fn(&'a (), &'static (), &'b ()) {order_dependence_fndefs::lhs_fndef}`

error: aborting due to 8 previous errors

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

---- [ui] tests/ui/coercion/leak_check_lub_to_fnptr.rs#deadcode stdout end ----
---- [ui] tests/ui/coercion/leak_check_lub_to_fnptr.rs#livecode stdout ----
Saved the actual stderr to `/checkout/obj/build/aarch64-unknown-linux-gnu/test/ui/coercion/leak_check_lub_to_fnptr.livecode/leak_check_lub_to_fnptr.livecode.stderr`
diff of stderr:

50                  found fn item `for<'a> fn(&'static (), &'a ()) {lub_with_fnptr_leak_checking::rhs_fndef}`
51 
52 error[E0308]: `if` and `else` have incompatible types
-   --> $DIR/leak_check_lub_to_fnptr.rs:47:15
-    |
- LL |     let rhs_closure = |_: &'static (), _: &()| {};
-    |                       ------------------------ the found closure
- LL |     lub!(lhs, rhs_closure);
-    |          ---  ^^^^^^^^^^^ one type is more general than the other
-    |          |
-    |          expected because of this
-    |
-    = note: expected fn pointer `for<'a> fn(&'a (), &())`
-                  found closure `{closure@$DIR/leak_check_lub_to_fnptr.rs:46:23: 46:47}`
-    = note: closure has signature: `for<'a> fn(&'static (), &'a ())`
- 
- error[E0308]: `if` and `else` have incompatible types
67   --> $DIR/leak_check_lub_to_fnptr.rs:59:23
68    |
69 LL |     let lhs_closure = |_: &(), _: &'static (), _: &()| {};

123    = note: expected fn item `for<'a> fn(&'static (), &'static (), &'a ()) {order_dependence_fndefs::rhs_fndef}`
124               found fn item `for<'a, 'b> fn(&'a (), &'static (), &'b ()) {order_dependence_fndefs::lhs_fndef}`
125 
- error: aborting due to 9 previous errors
+ error: aborting due to 8 previous errors
127 
128 For more information about this error, try `rustc --explain E0308`.
129 


The actual stderr differed from the expected stderr
To update references, rerun the tests and pass the `--bless` flag
To only update this specific test, also pass `--test-args coercion/leak_check_lub_to_fnptr.rs`

error in revision `livecode`: 1 errors occurred comparing output.
status: exit status: 1
command: env -u RUSTC_LOG_COLOR RUSTC_ICE="0" RUST_BACKTRACE="short" "/checkout/obj/build/aarch64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/tests/ui/coercion/leak_check_lub_to_fnptr.rs" "-Zthreads=1" "-Zsimulate-remapped-rust-src-base=/rustc/FAKE_PREFIX" "-Ztranslate-remapped-path-to-local-path=no" "-Z" "ignore-directory-in-diagnostics-source-blocks=/cargo" "-Z" "ignore-directory-in-diagnostics-source-blocks=/checkout/vendor" "--sysroot" "/checkout/obj/build/aarch64-unknown-linux-gnu/stage2" "--target=aarch64-unknown-linux-gnu" "--cfg" "livecode" "--check-cfg" "cfg(test,FALSE,livecode,deadcode)" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Zwrite-long-types-to-disk=no" "-Cstrip=debuginfo" "--emit" "metadata" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/aarch64-unknown-linux-gnu/test/ui/coercion/leak_check_lub_to_fnptr.livecode" "-A" "unused" "-W" "unused_attributes" "-A" "internal_features" "-A" "unused_parens" "-A" "unused_braces" "-Crpath" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/aarch64-unknown-linux-gnu/native/rust-test-helpers"
stdout: none
--- stderr -------------------------------
error[E0308]: `if` and `else` have incompatible types
##[error]  --> /checkout/tests/ui/coercion/leak_check_lub_to_fnptr.rs:21:21
   |
LL |     lub!(lhs_fnptr, rhs_fnptr);
   |          ---------  ^^^^^^^^^ one type is more general than the other
   |          |
   |          expected because of this
   |
   = note: expected fn pointer `for<'a> fn(&'a (), &())`
              found fn pointer `for<'a> fn(&(), &'a ())`

error[E0308]: `if` and `else` have incompatible types
##[error]  --> /checkout/tests/ui/coercion/leak_check_lub_to_fnptr.rs:27:21
   |
LL |     lub!(lhs_fndef, rhs_fndef);
   |          ---------  ^^^^^^^^^ one type is more general than the other
   |          |
   |          expected because of this
   |
   = note: expected fn item `for<'a> fn(&'a (), &'static ()) {lub_to_fnptr_leak_checking::lhs_fndef}`
              found fn item `for<'a> fn(&'static (), &'a ()) {lub_to_fnptr_leak_checking::rhs_fndef}`

error[E0308]: `if` and `else` have incompatible types
##[error]  --> /checkout/tests/ui/coercion/leak_check_lub_to_fnptr.rs:33:23
   |
LL |     let lhs_closure = |_: &(), _: &'static ()| {};
   |                       ------------------------ the expected closure
LL |     let rhs_closure = |_: &'static (), _: &()| {};
   |                       ------------------------ the found closure
LL |     lub!(lhs_closure, rhs_closure);
   |          -----------  ^^^^^^^^^^^ one type is more general than the other
   |          |
   |          expected because of this
   |
   = note: expected closure `{closure@/checkout/tests/ui/coercion/leak_check_lub_to_fnptr.rs:31:23: 31:47}`
              found closure `{closure@/checkout/tests/ui/coercion/leak_check_lub_to_fnptr.rs:32:23: 32:47}`
   = note: closure has signature: `for<'a> fn(&'static (), &'a ())`
   = note: no two closures, even if identical, have the same type
   = help: consider boxing your closure and/or using it as a trait object

error[E0308]: `if` and `else` have incompatible types
##[error]  --> /checkout/tests/ui/coercion/leak_check_lub_to_fnptr.rs:42:15
   |
LL |     lub!(lhs, rhs_fndef);
   |          ---  ^^^^^^^^^ one type is more general than the other
   |          |
   |          expected because of this
   |
   = note: expected fn pointer `for<'a> fn(&'a (), &())`
                 found fn item `for<'a> fn(&'static (), &'a ()) {lub_with_fnptr_leak_checking::rhs_fndef}`

error[E0308]: `if` and `else` have incompatible types
##[error]  --> /checkout/tests/ui/coercion/leak_check_lub_to_fnptr.rs:59:23
   |
LL |     let lhs_closure = |_: &(), _: &'static (), _: &()| {};
   |                       -------------------------------- the expected closure
LL |     let rhs_closure = |_: &'static (), _: &'static (), _: &()| {};
   |                       ---------------------------------------- the found closure
LL |
LL |     lub!(lhs_closure, rhs_closure);
   |          -----------  ^^^^^^^^^^^ one type is more general than the other
   |          |
   |          expected because of this
   |
   = note: expected closure `{closure@/checkout/tests/ui/coercion/leak_check_lub_to_fnptr.rs:56:23: 56:55}`
              found closure `{closure@/checkout/tests/ui/coercion/leak_check_lub_to_fnptr.rs:57:23: 57:63}`
   = note: closure has signature: `for<'a> fn(&'static (), &'static (), &'a ())`
   = note: no two closures, even if identical, have the same type
   = help: consider boxing your closure and/or using it as a trait object

error[E0308]: `if` and `else` have incompatible types
##[error]  --> /checkout/tests/ui/coercion/leak_check_lub_to_fnptr.rs:61:23
   |
LL |     let lhs_closure = |_: &(), _: &'static (), _: &()| {};
   |                       -------------------------------- the found closure
LL |     let rhs_closure = |_: &'static (), _: &'static (), _: &()| {};
   |                       ---------------------------------------- the expected closure
...
LL |     lub!(rhs_closure, lhs_closure);
   |          -----------  ^^^^^^^^^^^ one type is more general than the other
   |          |
   |          expected because of this
   |
   = note: expected closure `{closure@/checkout/tests/ui/coercion/leak_check_lub_to_fnptr.rs:57:23: 57:63}`
              found closure `{closure@/checkout/tests/ui/coercion/leak_check_lub_to_fnptr.rs:56:23: 56:55}`
   = note: closure has signature: `for<'a, 'b> fn(&'a (), &'static (), &'b ())`
   = note: no two closures, even if identical, have the same type
   = help: consider boxing your closure and/or using it as a trait object

error[E0308]: `if` and `else` have incompatible types
##[error]  --> /checkout/tests/ui/coercion/leak_check_lub_to_fnptr.rs:73:21
   |
LL |     lub!(lhs_fndef, rhs_fndef);
   |          ---------  ^^^^^^^^^ one type is more general than the other
   |          |
   |          expected because of this
   |
   = note: expected fn item `for<'a, 'b> fn(&'a (), &'static (), &'b ()) {order_dependence_fndefs::lhs_fndef}`
              found fn item `for<'a> fn(&'static (), &'static (), &'a ()) {order_dependence_fndefs::rhs_fndef}`

error[E0308]: `if` and `else` have incompatible types
##[error]  --> /checkout/tests/ui/coercion/leak_check_lub_to_fnptr.rs:75:21
   |
LL |     lub!(rhs_fndef, lhs_fndef);
   |          ---------  ^^^^^^^^^ one type is more general than the other
   |          |
   |          expected because of this
   |
   = note: expected fn item `for<'a> fn(&'static (), &'static (), &'a ()) {order_dependence_fndefs::rhs_fndef}`
              found fn item `for<'a, 'b> fn(&'a (), &'static (), &'b ()) {order_dependence_fndefs::lhs_fndef}`

error: aborting due to 8 previous errors

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

---- [ui] tests/ui/coercion/leak_check_lub_to_fnptr.rs#livecode stdout end ----

failures:
    [ui] tests/ui/coercion/leak_check_lub_fallback.rs
    [ui] tests/ui/coercion/leak_check_lub_to_fnptr.rs#deadcode
    [ui] tests/ui/coercion/leak_check_lub_to_fnptr.rs#livecode

test result: FAILED. 19700 passed; 3 failed; 325 ignored; 0 measured; 21 filtered out; finished in 601.20s

Some tests failed in compiletest suite=ui mode=ui host=aarch64-unknown-linux-gnu target=aarch64-unknown-linux-gnu
Bootstrap failed while executing `--stage 2 test --skip compiler --skip src`