Skip to content

Instantly share code, notes, and snippets.

@mattjperez
Created January 21, 2023 20:33
Show Gist options
  • Save mattjperez/29fa289df1281e2fb8a353d9ea669e04 to your computer and use it in GitHub Desktop.
Save mattjperez/29fa289df1281e2fb8a353d9ea669e04 to your computer and use it in GitHub Desktop.
Failed test output from #105552 if add note when !same_type_modulo_infer()
---- [ui] tests/ui/argument-suggestions/two-mismatch-notes.rs stdout ----
diff of stderr:
11 | ^
12 = note: expected fn pointer `fn(i32)`
13 found fn item `fn(u32) {f}`
+ = note: fn items are distinct from fn pointers, consider casting to a fn pointer or using type inference
14 note: expected `i32`, found `isize`
15 --> $DIR/two-mismatch-notes.rs:10:12
16 |
The actual stderr differed from the expected stderr.
Actual stderr saved to /home/mperez/projects/rustlang/build/x86_64-unknown-linux-gnu/test/ui/argument-suggestions/two-mismatch-notes/two-mismatch-notes.stderr
To update references, rerun the tests and pass the `--bless` flag
To only update this specific test, also pass `--test-args argument-suggestions/two-mismatch-notes.rs`
error: 1 errors occurred comparing output.
status: exit status: 1
command: "/home/mperez/projects/rustlang/build/x86_64-unknown-linux-gnu/stage1/bin/rustc" "/home/mperez/projects/rustlang/tests/ui/argument-suggestions/two-mismatch-notes.rs" "-Zthreads=1" "--target=x86_64-unknown-linux-gnu" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zsimulate-remapped-rust-src-base=/rustc/FAKE_PREFIX" "-Ztranslate-remapped-path-to-local-path=no" "-Zdeduplicate-diagnostics=no" "-Cstrip=debuginfo" "--emit" "metadata" "-C" "prefer-dynamic" "--out-dir" "/home/mperez/projects/rustlang/build/x86_64-unknown-linux-gnu/test/ui/argument-suggestions/two-mismatch-notes" "-A" "unused" "-Crpath" "-Cdebuginfo=0" "-Lnative=/home/mperez/projects/rustlang/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-L" "/home/mperez/projects/rustlang/build/x86_64-unknown-linux-gnu/test/ui/argument-suggestions/two-mismatch-notes/auxiliary"
stdout: none
--- stderr -------------------------------
error[E0308]: arguments to this function are incorrect
--> /home/mperez/projects/rustlang/tests/ui/argument-suggestions/two-mismatch-notes.rs:10:5
|
LL | foo(f, w); //~ ERROR arguments to this function are incorrect
| ^^^
|
note: expected `i32`, found `u32`
--> /home/mperez/projects/rustlang/tests/ui/argument-suggestions/two-mismatch-notes.rs:10:9
|
LL | foo(f, w); //~ ERROR arguments to this function are incorrect
| ^
= note: expected fn pointer `fn(i32)`
found fn item `fn(u32) {f}`
= note: fn items are distinct from fn pointers, consider casting to a fn pointer or using type inference
note: expected `i32`, found `isize`
--> /home/mperez/projects/rustlang/tests/ui/argument-suggestions/two-mismatch-notes.rs:10:12
|
LL | foo(f, w); //~ ERROR arguments to this function are incorrect
| ^
= note: expected struct `Wrapper<i32>`
found struct `Wrapper<isize>`
note: function defined here
--> /home/mperez/projects/rustlang/tests/ui/argument-suggestions/two-mismatch-notes.rs:4:4
|
LL | fn foo(_: fn(i32), _: Wrapper<i32>) {}
| ^^^ ---------- ---------------
error: aborting due to previous error
For more information about this error, try `rustc --explain E0308`.
------------------------------------------
---- [ui] tests/ui/c-variadic/variadic-ffi-1.rs stdout ----
diff of stderr:
46 |
47 = note: expected fn pointer `unsafe extern "C" fn(_, _)`
48 found fn item `unsafe extern "C" fn(_, _, ...) {foo}`
+ = note: fn items are distinct from fn pointers, consider casting to a fn pointer or using type inference
49
50 error[E0308]: mismatched types
51 --> $DIR/variadic-ffi-1.rs:26:54
57 |
58 = note: expected fn pointer `extern "C" fn(_, _, ...)`
59 found fn item `extern "C" fn(_, _) {bar}`
+ = note: fn items are distinct from fn pointers, consider casting to a fn pointer or using type inference
60
61 error[E0617]: can't pass `f32` to variadic function
62 --> $DIR/variadic-ffi-1.rs:28:19
The actual stderr differed from the expected stderr.
Actual stderr saved to /home/mperez/projects/rustlang/build/x86_64-unknown-linux-gnu/test/ui/c-variadic/variadic-ffi-1/variadic-ffi-1.stderr
To update references, rerun the tests and pass the `--bless` flag
To only update this specific test, also pass `--test-args c-variadic/variadic-ffi-1.rs`
error: 1 errors occurred comparing output.
status: exit status: 1
command: "/home/mperez/projects/rustlang/build/x86_64-unknown-linux-gnu/stage1/bin/rustc" "/home/mperez/projects/rustlang/tests/ui/c-variadic/variadic-ffi-1.rs" "-Zthreads=1" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zsimulate-remapped-rust-src-base=/rustc/FAKE_PREFIX" "-Ztranslate-remapped-path-to-local-path=no" "-Zdeduplicate-diagnostics=no" "-Cstrip=debuginfo" "--emit" "metadata" "-C" "prefer-dynamic" "--out-dir" "/home/mperez/projects/rustlang/build/x86_64-unknown-linux-gnu/test/ui/c-variadic/variadic-ffi-1" "-A" "unused" "-Crpath" "-Cdebuginfo=0" "-Lnative=/home/mperez/projects/rustlang/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-L" "/home/mperez/projects/rustlang/build/x86_64-unknown-linux-gnu/test/ui/c-variadic/variadic-ffi-1/auxiliary" "--target=i686-pc-windows-msvc" "--crate-type=rlib"
stdout: none
--- stderr -------------------------------
error[E0045]: C-variadic function must have a compatible calling convention, like `C` or `cdecl`
--> /home/mperez/projects/rustlang/tests/ui/c-variadic/variadic-ffi-1.rs:9:5
|
LL | fn printf(_: *const u8, ...);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ C-variadic function must have a compatible calling convention
error[E0060]: this function takes at least 2 arguments but 0 arguments were supplied
--> /home/mperez/projects/rustlang/tests/ui/c-variadic/variadic-ffi-1.rs:22:9
|
LL | foo(); //~ ERROR function takes at least 2 arguments but 0 arguments were supplied
| ^^^-- two arguments of type `isize` and `u8` are missing
|
note: function defined here
--> /home/mperez/projects/rustlang/tests/ui/c-variadic/variadic-ffi-1.rs:15:8
|
LL | fn foo(f: isize, x: u8, ...);
| ^^^
help: provide the arguments
|
LL | foo(/* isize */, /* u8 */); //~ ERROR function takes at least 2 arguments but 0 arguments were supplied
| ~~~~~~~~~~~~~~~~~~~~~~~
error[E0060]: this function takes at least 2 arguments but 1 argument was supplied
--> /home/mperez/projects/rustlang/tests/ui/c-variadic/variadic-ffi-1.rs:23:9
|
LL | foo(1); //~ ERROR function takes at least 2 arguments but 1 argument was supplied
| ^^^--- an argument of type `u8` is missing
|
note: function defined here
--> /home/mperez/projects/rustlang/tests/ui/c-variadic/variadic-ffi-1.rs:15:8
|
LL | fn foo(f: isize, x: u8, ...);
| ^^^
help: provide the argument
|
LL | foo(1, /* u8 */); //~ ERROR function takes at least 2 arguments but 1 argument was supplied
| ~~~~~~~~~~~~~
error[E0308]: mismatched types
--> /home/mperez/projects/rustlang/tests/ui/c-variadic/variadic-ffi-1.rs:25:56
|
LL | let x: unsafe extern "C" fn(f: isize, x: u8) = foo; //~ ERROR mismatched types
| ------------------------------------- ^^^ expected non-variadic fn, found variadic function
| |
| expected due to this
|
= note: expected fn pointer `unsafe extern "C" fn(_, _)`
found fn item `unsafe extern "C" fn(_, _, ...) {foo}`
= note: fn items are distinct from fn pointers, consider casting to a fn pointer or using type inference
error[E0308]: mismatched types
--> /home/mperez/projects/rustlang/tests/ui/c-variadic/variadic-ffi-1.rs:26:54
|
LL | let y: extern "C" fn(f: isize, x: u8, ...) = bar; //~ ERROR mismatched types
| ----------------------------------- ^^^ expected variadic fn, found non-variadic function
| |
| expected due to this
|
= note: expected fn pointer `extern "C" fn(_, _, ...)`
found fn item `extern "C" fn(_, _) {bar}`
= note: fn items are distinct from fn pointers, consider casting to a fn pointer or using type inference
error[E0617]: can't pass `f32` to variadic function
--> /home/mperez/projects/rustlang/tests/ui/c-variadic/variadic-ffi-1.rs:28:19
|
LL | foo(1, 2, 3f32); //~ ERROR can't pass
| ^^^^ help: cast the value to `c_double`: `3f32 as c_double`
error[E0617]: can't pass `bool` to variadic function
--> /home/mperez/projects/rustlang/tests/ui/c-variadic/variadic-ffi-1.rs:29:19
|
LL | foo(1, 2, true); //~ ERROR can't pass
| ^^^^ help: cast the value to `c_int`: `true as c_int`
error[E0617]: can't pass `i8` to variadic function
--> /home/mperez/projects/rustlang/tests/ui/c-variadic/variadic-ffi-1.rs:30:19
|
LL | foo(1, 2, 1i8); //~ ERROR can't pass
| ^^^ help: cast the value to `c_int`: `1i8 as c_int`
error[E0617]: can't pass `u8` to variadic function
--> /home/mperez/projects/rustlang/tests/ui/c-variadic/variadic-ffi-1.rs:31:19
|
LL | foo(1, 2, 1u8); //~ ERROR can't pass
| ^^^ help: cast the value to `c_uint`: `1u8 as c_uint`
error[E0617]: can't pass `i16` to variadic function
--> /home/mperez/projects/rustlang/tests/ui/c-variadic/variadic-ffi-1.rs:32:19
|
LL | foo(1, 2, 1i16); //~ ERROR can't pass
| ^^^^ help: cast the value to `c_int`: `1i16 as c_int`
error[E0617]: can't pass `u16` to variadic function
--> /home/mperez/projects/rustlang/tests/ui/c-variadic/variadic-ffi-1.rs:33:19
|
LL | foo(1, 2, 1u16); //~ ERROR can't pass
| ^^^^ help: cast the value to `c_uint`: `1u16 as c_uint`
error: aborting due to 11 previous errors
Some errors have detailed explanations: E0045, E0060, E0308, E0617.
For more information about an error, try `rustc --explain E0045`.
------------------------------------------
---- [ui] tests/ui/fn/fn-pointer-mismatch.rs stdout ----
diff of stderr:
46 |
47 = note: expected fn pointer `fn(u32) -> u32`
48 found reference `&fn(u32) -> u32 {foo}`
+ = note: fn items are distinct from fn pointers, consider casting to a fn pointer or using type inference
49
50 error[E0308]: mismatched types
51 --> $DIR/fn-pointer-mismatch.rs:42:30
57 |
58 = note: expected reference `&fn(u32) -> u32`
59 found fn item `fn(u32) -> u32 {foo}`
+ = note: fn items are distinct from fn pointers, consider casting to a fn pointer or using type inference
60
61 error[E0308]: mismatched types
62 --> $DIR/fn-pointer-mismatch.rs:48:30
68 |
69 = note: expected reference `&fn(u32) -> u32`
70 found reference `&fn(u32) -> u32 {foo}`
+ = note: fn items are distinct from fn pointers, consider casting to a fn pointer or using type inference
71
72 error: aborting due to 6 previous errors
73
The actual stderr differed from the expected stderr.
Actual stderr saved to /home/mperez/projects/rustlang/build/x86_64-unknown-linux-gnu/test/ui/fn/fn-pointer-mismatch/fn-pointer-mismatch.stderr
To update references, rerun the tests and pass the `--bless` flag
To only update this specific test, also pass `--test-args fn/fn-pointer-mismatch.rs`
error: 1 errors occurred comparing output.
status: exit status: 1
command: "/home/mperez/projects/rustlang/build/x86_64-unknown-linux-gnu/stage1/bin/rustc" "/home/mperez/projects/rustlang/tests/ui/fn/fn-pointer-mismatch.rs" "-Zthreads=1" "--target=x86_64-unknown-linux-gnu" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zsimulate-remapped-rust-src-base=/rustc/FAKE_PREFIX" "-Ztranslate-remapped-path-to-local-path=no" "-Zdeduplicate-diagnostics=no" "-Cstrip=debuginfo" "--emit" "metadata" "-C" "prefer-dynamic" "--out-dir" "/home/mperez/projects/rustlang/build/x86_64-unknown-linux-gnu/test/ui/fn/fn-pointer-mismatch" "-A" "unused" "-Crpath" "-Cdebuginfo=0" "-Lnative=/home/mperez/projects/rustlang/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-L" "/home/mperez/projects/rustlang/build/x86_64-unknown-linux-gnu/test/ui/fn/fn-pointer-mismatch/auxiliary"
stdout: none
--- stderr -------------------------------
error[E0308]: `if` and `else` have incompatible types
--> /home/mperez/projects/rustlang/tests/ui/fn/fn-pointer-mismatch.rs:11:43
|
LL | let g = if n % 2 == 0 { &foo } else { &bar };
| ---- ^^^^ expected fn item, found a different fn item
| |
| expected because of this
|
= note: expected reference `&fn(u32) -> u32 {foo}`
found reference `&fn(u32) -> u32 {bar}`
= note: different fn items have unique types, even if their signatures are the same
error[E0308]: mismatched types
--> /home/mperez/projects/rustlang/tests/ui/fn/fn-pointer-mismatch.rs:23:9
|
LL | let mut a = foo;
| --- expected due to this value
LL | a = bar;
| ^^^ expected fn item, found a different fn item
|
= note: expected fn item `fn(_) -> _ {foo}`
found fn item `fn(_) -> _ {bar}`
= note: different fn items have unique types, even if their signatures are the same
error[E0308]: mismatched types
--> /home/mperez/projects/rustlang/tests/ui/fn/fn-pointer-mismatch.rs:31:18
|
LL | b = Box::new(bar);
| -------- ^^^ expected fn item, found a different fn item
| |
| arguments to this function are incorrect
|
= note: expected fn item `fn(_) -> _ {foo}`
found fn item `fn(_) -> _ {bar}`
= note: different fn items have unique types, even if their signatures are the same
note: associated function defined here
--> /rustc/FAKE_PREFIX/library/alloc/src/boxed.rs:217:12
error[E0308]: mismatched types
--> /home/mperez/projects/rustlang/tests/ui/fn/fn-pointer-mismatch.rs:36:29
|
LL | let c: fn(u32) -> u32 = &foo;
| -------------- ^^^^ expected fn pointer, found reference
| |
| expected due to this
|
= note: expected fn pointer `fn(u32) -> u32`
found reference `&fn(u32) -> u32 {foo}`
= note: fn items are distinct from fn pointers, consider casting to a fn pointer or using type inference
error[E0308]: mismatched types
--> /home/mperez/projects/rustlang/tests/ui/fn/fn-pointer-mismatch.rs:42:30
|
LL | let d: &fn(u32) -> u32 = foo;
| --------------- ^^^ expected `&fn(u32) -> u32`, found fn item
| |
| expected due to this
|
= note: expected reference `&fn(u32) -> u32`
found fn item `fn(u32) -> u32 {foo}`
= note: fn items are distinct from fn pointers, consider casting to a fn pointer or using type inference
error[E0308]: mismatched types
--> /home/mperez/projects/rustlang/tests/ui/fn/fn-pointer-mismatch.rs:48:30
|
LL | let e: &fn(u32) -> u32 = &foo;
| --------------- ^^^^ expected fn pointer, found fn item
| |
| expected due to this
|
= note: expected reference `&fn(u32) -> u32`
found reference `&fn(u32) -> u32 {foo}`
= note: fn items are distinct from fn pointers, consider casting to a fn pointer or using type inference
error: aborting due to 6 previous errors
For more information about this error, try `rustc --explain E0308`.
------------------------------------------
---- [ui] tests/ui/fn/signature-error-reporting-under-verbose.rs stdout ----
diff of stderr:
8 |
9 = note: expected fn pointer `fn(i32, u32)`
10 found fn item `fn(i32, i32) {foo}`
+ = note: fn items are distinct from fn pointers, consider casting to a fn pointer or using type inference
11 note: function defined here
12 --> $DIR/signature-error-reporting-under-verbose.rs:5:4
13 |
The actual stderr differed from the expected stderr.
Actual stderr saved to /home/mperez/projects/rustlang/build/x86_64-unknown-linux-gnu/test/ui/fn/signature-error-reporting-under-verbose/signature-error-reporting-under-verbose.stderr
To update references, rerun the tests and pass the `--bless` flag
To only update this specific test, also pass `--test-args fn/signature-error-reporting-under-verbose.rs`
error: 1 errors occurred comparing output.
status: exit status: 1
command: "/home/mperez/projects/rustlang/build/x86_64-unknown-linux-gnu/stage1/bin/rustc" "/home/mperez/projects/rustlang/tests/ui/fn/signature-error-reporting-under-verbose.rs" "-Zthreads=1" "--target=x86_64-unknown-linux-gnu" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zsimulate-remapped-rust-src-base=/rustc/FAKE_PREFIX" "-Ztranslate-remapped-path-to-local-path=no" "-Zdeduplicate-diagnostics=no" "-Cstrip=debuginfo" "--emit" "metadata" "-C" "prefer-dynamic" "--out-dir" "/home/mperez/projects/rustlang/build/x86_64-unknown-linux-gnu/test/ui/fn/signature-error-reporting-under-verbose" "-A" "unused" "-Crpath" "-Cdebuginfo=0" "-Lnative=/home/mperez/projects/rustlang/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-L" "/home/mperez/projects/rustlang/build/x86_64-unknown-linux-gnu/test/ui/fn/signature-error-reporting-under-verbose/auxiliary" "-Zverbose"
stdout: none
--- stderr -------------------------------
error[E0308]: mismatched types
--> /home/mperez/projects/rustlang/tests/ui/fn/signature-error-reporting-under-verbose.rs:10:15
|
LL | needs_ptr(foo);
| --------- ^^^ expected `u32`, found `i32`
| |
| arguments to this function are incorrect
|
= note: expected fn pointer `fn(i32, u32)`
found fn item `fn(i32, i32) {foo}`
= note: fn items are distinct from fn pointers, consider casting to a fn pointer or using type inference
note: function defined here
--> /home/mperez/projects/rustlang/tests/ui/fn/signature-error-reporting-under-verbose.rs:5:4
|
LL | fn needs_ptr(_: fn(i32, u32)) {}
| ^^^^^^^^^ ---------------
error: aborting due to previous error
For more information about this error, try `rustc --explain E0308`.
------------------------------------------
---- [ui] tests/ui/issues/issue-10764.rs stdout ----
diff of stderr:
8 |
9 = note: expected fn pointer `fn()`
10 found fn item `extern "C" fn() {bar}`
+ = note: fn items are distinct from fn pointers, consider casting to a fn pointer or using type inference
11 note: function defined here
12 --> $DIR/issue-10764.rs:1:4
13 |
The actual stderr differed from the expected stderr.
Actual stderr saved to /home/mperez/projects/rustlang/build/x86_64-unknown-linux-gnu/test/ui/issues/issue-10764/issue-10764.stderr
To update references, rerun the tests and pass the `--bless` flag
To only update this specific test, also pass `--test-args issues/issue-10764.rs`
error: 1 errors occurred comparing output.
status: exit status: 1
command: "/home/mperez/projects/rustlang/build/x86_64-unknown-linux-gnu/stage1/bin/rustc" "/home/mperez/projects/rustlang/tests/ui/issues/issue-10764.rs" "-Zthreads=1" "--target=x86_64-unknown-linux-gnu" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zsimulate-remapped-rust-src-base=/rustc/FAKE_PREFIX" "-Ztranslate-remapped-path-to-local-path=no" "-Zdeduplicate-diagnostics=no" "-Cstrip=debuginfo" "--emit" "metadata" "-C" "prefer-dynamic" "--out-dir" "/home/mperez/projects/rustlang/build/x86_64-unknown-linux-gnu/test/ui/issues/issue-10764" "-A" "unused" "-Crpath" "-Cdebuginfo=0" "-Lnative=/home/mperez/projects/rustlang/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-L" "/home/mperez/projects/rustlang/build/x86_64-unknown-linux-gnu/test/ui/issues/issue-10764/auxiliary"
stdout: none
--- stderr -------------------------------
error[E0308]: mismatched types
--> /home/mperez/projects/rustlang/tests/ui/issues/issue-10764.rs:4:15
|
LL | fn main() { f(bar) }
| - ^^^ expected "Rust" fn, found "C" fn
| |
| arguments to this function are incorrect
|
= note: expected fn pointer `fn()`
found fn item `extern "C" fn() {bar}`
= note: fn items are distinct from fn pointers, consider casting to a fn pointer or using type inference
note: function defined here
--> /home/mperez/projects/rustlang/tests/ui/issues/issue-10764.rs:1:4
|
LL | fn f(_: extern "Rust" fn()) {}
| ^ ---------------------
error: aborting due to previous error
For more information about this error, try `rustc --explain E0308`.
------------------------------------------
---- [ui] tests/ui/issues/issue-24322.rs stdout ----
diff of stderr:
8 |
9 = note: expected reference `&for<'a> fn(&'a B) -> u32`
10 found reference `&for<'a> fn(&'a B) -> u32 {B::func}`
+ = note: fn items are distinct from fn pointers, consider casting to a fn pointer or using type inference
11
12 error: aborting due to previous error
13
The actual stderr differed from the expected stderr.
Actual stderr saved to /home/mperez/projects/rustlang/build/x86_64-unknown-linux-gnu/test/ui/issues/issue-24322/issue-24322.stderr
To update references, rerun the tests and pass the `--bless` flag
To only update this specific test, also pass `--test-args issues/issue-24322.rs`
error: 1 errors occurred comparing output.
status: exit status: 1
command: "/home/mperez/projects/rustlang/build/x86_64-unknown-linux-gnu/stage1/bin/rustc" "/home/mperez/projects/rustlang/tests/ui/issues/issue-24322.rs" "-Zthreads=1" "--target=x86_64-unknown-linux-gnu" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zsimulate-remapped-rust-src-base=/rustc/FAKE_PREFIX" "-Ztranslate-remapped-path-to-local-path=no" "-Zdeduplicate-diagnostics=no" "-Cstrip=debuginfo" "--emit" "metadata" "-C" "prefer-dynamic" "--out-dir" "/home/mperez/projects/rustlang/build/x86_64-unknown-linux-gnu/test/ui/issues/issue-24322" "-A" "unused" "-Crpath" "-Cdebuginfo=0" "-Lnative=/home/mperez/projects/rustlang/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-L" "/home/mperez/projects/rustlang/build/x86_64-unknown-linux-gnu/test/ui/issues/issue-24322/auxiliary"
stdout: none
--- stderr -------------------------------
error[E0308]: mismatched types
--> /home/mperez/projects/rustlang/tests/ui/issues/issue-24322.rs:8:29
|
LL | let x: &fn(&B) -> u32 = &B::func; //~ ERROR mismatched types
| -------------- ^^^^^^^^ expected fn pointer, found fn item
| |
| expected due to this
|
= note: expected reference `&for<'a> fn(&'a B) -> u32`
found reference `&for<'a> fn(&'a B) -> u32 {B::func}`
= note: fn items are distinct from fn pointers, consider casting to a fn pointer or using type inference
error: aborting due to previous error
For more information about this error, try `rustc --explain E0308`.
------------------------------------------
---- [ui] tests/ui/mismatched_types/normalize-fn-sig.rs stdout ----
diff of stderr:
8 |
9 = note: expected fn pointer `fn(&'static i32, i32)`
10 found fn item `fn(i32, &'static i32) {foo::<()>}`
+ = note: fn items are distinct from fn pointers, consider casting to a fn pointer or using type inference
11 note: function defined here
12 --> $DIR/normalize-fn-sig.rs:11:4
13 |
The actual stderr differed from the expected stderr.
Actual stderr saved to /home/mperez/projects/rustlang/build/x86_64-unknown-linux-gnu/test/ui/mismatched_types/normalize-fn-sig/normalize-fn-sig.stderr
To update references, rerun the tests and pass the `--bless` flag
To only update this specific test, also pass `--test-args mismatched_types/normalize-fn-sig.rs`
error: 1 errors occurred comparing output.
status: exit status: 1
command: "/home/mperez/projects/rustlang/build/x86_64-unknown-linux-gnu/stage1/bin/rustc" "/home/mperez/projects/rustlang/tests/ui/mismatched_types/normalize-fn-sig.rs" "-Zthreads=1" "--target=x86_64-unknown-linux-gnu" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zsimulate-remapped-rust-src-base=/rustc/FAKE_PREFIX" "-Ztranslate-remapped-path-to-local-path=no" "-Zdeduplicate-diagnostics=no" "-Cstrip=debuginfo" "--emit" "metadata" "-C" "prefer-dynamic" "--out-dir" "/home/mperez/projects/rustlang/build/x86_64-unknown-linux-gnu/test/ui/mismatched_types/normalize-fn-sig" "-A" "unused" "-Crpath" "-Cdebuginfo=0" "-Lnative=/home/mperez/projects/rustlang/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-L" "/home/mperez/projects/rustlang/build/x86_64-unknown-linux-gnu/test/ui/mismatched_types/normalize-fn-sig/auxiliary"
stdout: none
--- stderr -------------------------------
error[E0308]: mismatched types
--> /home/mperez/projects/rustlang/tests/ui/mismatched_types/normalize-fn-sig.rs:14:22
|
LL | needs_i32_ref_fn(foo::<()>);
| ---------------- ^^^^^^^^^ expected `&i32`, found `i32`
| |
| arguments to this function are incorrect
|
= note: expected fn pointer `fn(&'static i32, i32)`
found fn item `fn(i32, &'static i32) {foo::<()>}`
= note: fn items are distinct from fn pointers, consider casting to a fn pointer or using type inference
note: function defined here
--> /home/mperez/projects/rustlang/tests/ui/mismatched_types/normalize-fn-sig.rs:11:4
|
LL | fn needs_i32_ref_fn(_: fn(&'static i32, i32)) {}
| ^^^^^^^^^^^^^^^^ ------------------------
error: aborting due to previous error
For more information about this error, try `rustc --explain E0308`.
------------------------------------------
---- [ui] tests/ui/regions/region-lifetime-bounds-on-fns-where-clause.rs stdout ----
diff of stderr:
6 |
7 = note: expected fn pointer `for<'a, 'b, 'c, 'd> fn(&'a mut &'b isize, &'c mut &'d isize)`
8 found fn item `for<'a, 'b> fn(&'a mut &isize, &'b mut &isize) {a::<'_, '_>}`
+ = note: fn items are distinct from fn pointers, consider casting to a fn pointer or using type inference
9
10 error: aborting due to previous error
11
The actual stderr differed from the expected stderr.
Actual stderr saved to /home/mperez/projects/rustlang/build/x86_64-unknown-linux-gnu/test/ui/regions/region-lifetime-bounds-on-fns-where-clause/region-lifetime-bounds-on-fns-where-clause.stderr
To update references, rerun the tests and pass the `--bless` flag
To only update this specific test, also pass `--test-args regions/region-lifetime-bounds-on-fns-where-clause.rs`
error: 1 errors occurred comparing output.
status: exit status: 1
command: "/home/mperez/projects/rustlang/build/x86_64-unknown-linux-gnu/stage1/bin/rustc" "/home/mperez/projects/rustlang/tests/ui/regions/region-lifetime-bounds-on-fns-where-clause.rs" "-Zthreads=1" "--target=x86_64-unknown-linux-gnu" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zsimulate-remapped-rust-src-base=/rustc/FAKE_PREFIX" "-Ztranslate-remapped-path-to-local-path=no" "-Zdeduplicate-diagnostics=no" "-Cstrip=debuginfo" "--emit" "metadata" "-C" "prefer-dynamic" "--out-dir" "/home/mperez/projects/rustlang/build/x86_64-unknown-linux-gnu/test/ui/regions/region-lifetime-bounds-on-fns-where-clause" "-A" "unused" "-Crpath" "-Cdebuginfo=0" "-Lnative=/home/mperez/projects/rustlang/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-L" "/home/mperez/projects/rustlang/build/x86_64-unknown-linux-gnu/test/ui/regions/region-lifetime-bounds-on-fns-where-clause/auxiliary"
stdout: none
--- stderr -------------------------------
error[E0308]: mismatched types
--> /home/mperez/projects/rustlang/tests/ui/regions/region-lifetime-bounds-on-fns-where-clause.rs:20:43
|
LL | let _: fn(&mut &isize, &mut &isize) = a;
| ^ one type is more general than the other
|
= note: expected fn pointer `for<'a, 'b, 'c, 'd> fn(&'a mut &'b isize, &'c mut &'d isize)`
found fn item `for<'a, 'b> fn(&'a mut &isize, &'b mut &isize) {a::<'_, '_>}`
= note: fn items are distinct from fn pointers, consider casting to a fn pointer or using type inference
error: aborting due to previous error
For more information about this error, try `rustc --explain E0308`.
------------------------------------------
---- [ui] tests/ui/regions/region-multiple-lifetime-bounds-on-fns-where-clause.rs stdout ----
diff of stderr:
6 |
7 = note: expected fn pointer `for<'a, 'b, 'c, 'd, 'e, 'f> fn(&'a mut &'b isize, &'c mut &'d isize, &'e mut &'f isize)`
8 found fn item `for<'a, 'b, 'c> fn(&'a mut &isize, &'b mut &isize, &'c mut &isize) {a::<'_, '_, '_>}`
+ = note: fn items are distinct from fn pointers, consider casting to a fn pointer or using type inference
9
10 error: aborting due to previous error
11
The actual stderr differed from the expected stderr.
Actual stderr saved to /home/mperez/projects/rustlang/build/x86_64-unknown-linux-gnu/test/ui/regions/region-multiple-lifetime-bounds-on-fns-where-clause/region-multiple-lifetime-bounds-on-fns-where-clause.stderr
To update references, rerun the tests and pass the `--bless` flag
To only update this specific test, also pass `--test-args regions/region-multiple-lifetime-bounds-on-fns-where-clause.rs`
error: 1 errors occurred comparing output.
status: exit status: 1
command: "/home/mperez/projects/rustlang/build/x86_64-unknown-linux-gnu/stage1/bin/rustc" "/home/mperez/projects/rustlang/tests/ui/regions/region-multiple-lifetime-bounds-on-fns-where-clause.rs" "-Zthreads=1" "--target=x86_64-unknown-linux-gnu" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zsimulate-remapped-rust-src-base=/rustc/FAKE_PREFIX" "-Ztranslate-remapped-path-to-local-path=no" "-Zdeduplicate-diagnostics=no" "-Cstrip=debuginfo" "--emit" "metadata" "-C" "prefer-dynamic" "--out-dir" "/home/mperez/projects/rustlang/build/x86_64-unknown-linux-gnu/test/ui/regions/region-multiple-lifetime-bounds-on-fns-where-clause" "-A" "unused" "-Crpath" "-Cdebuginfo=0" "-Lnative=/home/mperez/projects/rustlang/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-L" "/home/mperez/projects/rustlang/build/x86_64-unknown-linux-gnu/test/ui/regions/region-multiple-lifetime-bounds-on-fns-where-clause/auxiliary"
stdout: none
--- stderr -------------------------------
error[E0308]: mismatched types
--> /home/mperez/projects/rustlang/tests/ui/regions/region-multiple-lifetime-bounds-on-fns-where-clause.rs:22:56
|
LL | let _: fn(&mut &isize, &mut &isize, &mut &isize) = a;
| ^ one type is more general than the other
|
= note: expected fn pointer `for<'a, 'b, 'c, 'd, 'e, 'f> fn(&'a mut &'b isize, &'c mut &'d isize, &'e mut &'f isize)`
found fn item `for<'a, 'b, 'c> fn(&'a mut &isize, &'b mut &isize, &'c mut &isize) {a::<'_, '_, '_>}`
= note: fn items are distinct from fn pointers, consider casting to a fn pointer or using type inference
error: aborting due to previous error
For more information about this error, try `rustc --explain E0308`.
------------------------------------------
---- [ui] tests/ui/regions/regions-fn-subtyping-return-static-fail.rs stdout ----
diff of stderr:
8 |
9 = note: expected fn pointer `for<'cx> fn(&'cx S) -> &'static S`
10 found fn item `for<'a> fn(&'a S) -> &'a S {baz}`
+ = note: fn items are distinct from fn pointers, consider casting to a fn pointer or using type inference
11 note: function defined here
12 --> $DIR/regions-fn-subtyping-return-static-fail.rs:20:4
13 |
The actual stderr differed from the expected stderr.
Actual stderr saved to /home/mperez/projects/rustlang/build/x86_64-unknown-linux-gnu/test/ui/regions/regions-fn-subtyping-return-static-fail/regions-fn-subtyping-return-static-fail.stderr
To update references, rerun the tests and pass the `--bless` flag
To only update this specific test, also pass `--test-args regions/regions-fn-subtyping-return-static-fail.rs`
error: 1 errors occurred comparing output.
status: exit status: 1
command: "/home/mperez/projects/rustlang/build/x86_64-unknown-linux-gnu/stage1/bin/rustc" "/home/mperez/projects/rustlang/tests/ui/regions/regions-fn-subtyping-return-static-fail.rs" "-Zthreads=1" "--target=x86_64-unknown-linux-gnu" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zsimulate-remapped-rust-src-base=/rustc/FAKE_PREFIX" "-Ztranslate-remapped-path-to-local-path=no" "-Zdeduplicate-diagnostics=no" "-Cstrip=debuginfo" "--emit" "metadata" "-C" "prefer-dynamic" "--out-dir" "/home/mperez/projects/rustlang/build/x86_64-unknown-linux-gnu/test/ui/regions/regions-fn-subtyping-return-static-fail" "-A" "unused" "-Crpath" "-Cdebuginfo=0" "-Lnative=/home/mperez/projects/rustlang/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-L" "/home/mperez/projects/rustlang/build/x86_64-unknown-linux-gnu/test/ui/regions/regions-fn-subtyping-return-static-fail/auxiliary"
stdout: none
--- stderr -------------------------------
error[E0308]: mismatched types
--> /home/mperez/projects/rustlang/tests/ui/regions/regions-fn-subtyping-return-static-fail.rs:48:12
|
LL | want_G(baz); //~ ERROR mismatched types
| ------ ^^^ one type is more general than the other
| |
| arguments to this function are incorrect
|
= note: expected fn pointer `for<'cx> fn(&'cx S) -> &'static S`
found fn item `for<'a> fn(&'a S) -> &'a S {baz}`
= note: fn items are distinct from fn pointers, consider casting to a fn pointer or using type inference
note: function defined here
--> /home/mperez/projects/rustlang/tests/ui/regions/regions-fn-subtyping-return-static-fail.rs:20:4
|
LL | fn want_G(f: G) {}
| ^^^^^^ ----
error: aborting due to previous error
For more information about this error, try `rustc --explain E0308`.
------------------------------------------
---- [ui] tests/ui/regions/regions-lifetime-bounds-on-fns.rs stdout ----
diff of stderr:
6 |
7 = note: expected fn pointer `for<'a, 'b, 'c, 'd> fn(&'a mut &'b isize, &'c mut &'d isize)`
8 found fn item `for<'a, 'b> fn(&'a mut &isize, &'b mut &isize) {a::<'_, '_>}`
+ = note: fn items are distinct from fn pointers, consider casting to a fn pointer or using type inference
9
10 error: aborting due to previous error
11
The actual stderr differed from the expected stderr.
Actual stderr saved to /home/mperez/projects/rustlang/build/x86_64-unknown-linux-gnu/test/ui/regions/regions-lifetime-bounds-on-fns/regions-lifetime-bounds-on-fns.stderr
To update references, rerun the tests and pass the `--bless` flag
To only update this specific test, also pass `--test-args regions/regions-lifetime-bounds-on-fns.rs`
error: 1 errors occurred comparing output.
status: exit status: 1
command: "/home/mperez/projects/rustlang/build/x86_64-unknown-linux-gnu/stage1/bin/rustc" "/home/mperez/projects/rustlang/tests/ui/regions/regions-lifetime-bounds-on-fns.rs" "-Zthreads=1" "--target=x86_64-unknown-linux-gnu" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zsimulate-remapped-rust-src-base=/rustc/FAKE_PREFIX" "-Ztranslate-remapped-path-to-local-path=no" "-Zdeduplicate-diagnostics=no" "-Cstrip=debuginfo" "--emit" "metadata" "-C" "prefer-dynamic" "--out-dir" "/home/mperez/projects/rustlang/build/x86_64-unknown-linux-gnu/test/ui/regions/regions-lifetime-bounds-on-fns" "-A" "unused" "-Crpath" "-Cdebuginfo=0" "-Lnative=/home/mperez/projects/rustlang/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-L" "/home/mperez/projects/rustlang/build/x86_64-unknown-linux-gnu/test/ui/regions/regions-lifetime-bounds-on-fns/auxiliary"
stdout: none
--- stderr -------------------------------
error[E0308]: mismatched types
--> /home/mperez/projects/rustlang/tests/ui/regions/regions-lifetime-bounds-on-fns.rs:20:43
|
LL | let _: fn(&mut &isize, &mut &isize) = a;
| ^ one type is more general than the other
|
= note: expected fn pointer `for<'a, 'b, 'c, 'd> fn(&'a mut &'b isize, &'c mut &'d isize)`
found fn item `for<'a, 'b> fn(&'a mut &isize, &'b mut &isize) {a::<'_, '_>}`
= note: fn items are distinct from fn pointers, consider casting to a fn pointer or using type inference
error: aborting due to previous error
For more information about this error, try `rustc --explain E0308`.
------------------------------------------
---- [ui] tests/ui/reify-intrinsic.rs stdout ----
diff of stderr:
8 |
9 = note: expected fn pointer `unsafe extern "rust-intrinsic" fn(isize) -> usize`
10 found fn item `unsafe extern "rust-intrinsic" fn(_) -> _ {transmute::<_, _>}`
+ = note: fn items are distinct from fn pointers, consider casting to a fn pointer or using type inference
11
12 error[E0606]: casting `unsafe extern "rust-intrinsic" fn(_) -> _ {transmute::<_, _>}` as `unsafe extern "rust-intrinsic" fn(isize) -> usize` is invalid
13 --> $DIR/reify-intrinsic.rs:11:13
The actual stderr differed from the expected stderr.
Actual stderr saved to /home/mperez/projects/rustlang/build/x86_64-unknown-linux-gnu/test/ui/reify-intrinsic/reify-intrinsic.stderr
To update references, rerun the tests and pass the `--bless` flag
To only update this specific test, also pass `--test-args reify-intrinsic.rs`
error: 1 errors occurred comparing output.
status: exit status: 1
command: "/home/mperez/projects/rustlang/build/x86_64-unknown-linux-gnu/stage1/bin/rustc" "/home/mperez/projects/rustlang/tests/ui/reify-intrinsic.rs" "-Zthreads=1" "--target=x86_64-unknown-linux-gnu" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zsimulate-remapped-rust-src-base=/rustc/FAKE_PREFIX" "-Ztranslate-remapped-path-to-local-path=no" "-Zdeduplicate-diagnostics=no" "-Cstrip=debuginfo" "--emit" "metadata" "-C" "prefer-dynamic" "--out-dir" "/home/mperez/projects/rustlang/build/x86_64-unknown-linux-gnu/test/ui/reify-intrinsic" "-A" "unused" "-Crpath" "-Cdebuginfo=0" "-Lnative=/home/mperez/projects/rustlang/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-L" "/home/mperez/projects/rustlang/build/x86_64-unknown-linux-gnu/test/ui/reify-intrinsic/auxiliary"
stdout: none
--- stderr -------------------------------
error[E0308]: cannot coerce intrinsics to function pointers
--> /home/mperez/projects/rustlang/tests/ui/reify-intrinsic.rs:6:64
|
LL | let _: unsafe extern "rust-intrinsic" fn(isize) -> usize = std::mem::transmute;
| ------------------------------------------------- ^^^^^^^^^^^^^^^^^^^ cannot coerce intrinsics to function pointers
| |
| expected due to this
|
= note: expected fn pointer `unsafe extern "rust-intrinsic" fn(isize) -> usize`
found fn item `unsafe extern "rust-intrinsic" fn(_) -> _ {transmute::<_, _>}`
= note: fn items are distinct from fn pointers, consider casting to a fn pointer or using type inference
error[E0606]: casting `unsafe extern "rust-intrinsic" fn(_) -> _ {transmute::<_, _>}` as `unsafe extern "rust-intrinsic" fn(isize) -> usize` is invalid
--> /home/mperez/projects/rustlang/tests/ui/reify-intrinsic.rs:11:13
|
LL | let _ = std::mem::transmute as unsafe extern "rust-intrinsic" fn(isize) -> usize;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error[E0308]: cannot coerce intrinsics to function pointers
--> /home/mperez/projects/rustlang/tests/ui/reify-intrinsic.rs:18:9
|
LL | std::intrinsics::unlikely,
| ^^^^^^^^^^^^^^^^^^^^^^^^^ cannot coerce intrinsics to function pointers
|
= note: expected fn item `extern "rust-intrinsic" fn(_) -> _ {likely}`
found fn item `extern "rust-intrinsic" fn(_) -> _ {unlikely}`
= note: different fn items have unique types, even if their signatures are the same
error: aborting due to 3 previous errors
Some errors have detailed explanations: E0308, E0606.
For more information about an error, try `rustc --explain E0308`.
------------------------------------------
---- [ui] tests/ui/rfcs/rfc-2396-target_feature-11/fn-ptr.rs#mir stdout ----
diff of stderr:
11 |
12 = note: expected fn pointer `fn()`
13 found fn item `fn() {foo}`
+ = note: fn items are distinct from fn pointers, consider casting to a fn pointer or using type inference
14 = note: functions with `#[target_feature]` can only be coerced to `unsafe` function pointers
15
16 error: aborting due to previous error
The actual stderr differed from the expected stderr.
Actual stderr saved to /home/mperez/projects/rustlang/build/x86_64-unknown-linux-gnu/test/ui/rfcs/rfc-2396-target_feature-11/fn-ptr.mir/fn-ptr.mir.stderr
To update references, rerun the tests and pass the `--bless` flag
To only update this specific test, also pass `--test-args rfcs/rfc-2396-target_feature-11/fn-ptr.rs`
error in revision `mir`: 1 errors occurred comparing output.
status: exit status: 1
command: "/home/mperez/projects/rustlang/build/x86_64-unknown-linux-gnu/stage1/bin/rustc" "/home/mperez/projects/rustlang/tests/ui/rfcs/rfc-2396-target_feature-11/fn-ptr.rs" "-Zthreads=1" "--target=x86_64-unknown-linux-gnu" "--cfg" "mir" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zsimulate-remapped-rust-src-base=/rustc/FAKE_PREFIX" "-Ztranslate-remapped-path-to-local-path=no" "-Zdeduplicate-diagnostics=no" "-Cstrip=debuginfo" "--emit" "metadata" "-C" "prefer-dynamic" "--out-dir" "/home/mperez/projects/rustlang/build/x86_64-unknown-linux-gnu/test/ui/rfcs/rfc-2396-target_feature-11/fn-ptr.mir" "-A" "unused" "-Crpath" "-Cdebuginfo=0" "-Lnative=/home/mperez/projects/rustlang/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-L" "/home/mperez/projects/rustlang/build/x86_64-unknown-linux-gnu/test/ui/rfcs/rfc-2396-target_feature-11/fn-ptr.mir/auxiliary"
stdout: none
--- stderr -------------------------------
error[E0308]: mismatched types
--> /home/mperez/projects/rustlang/tests/ui/rfcs/rfc-2396-target_feature-11/fn-ptr.rs:11:21
|
LL | #[target_feature(enable = "sse2")]
| ---------------------------------- `#[target_feature]` added here
...
LL | let foo: fn() = foo; //~ ERROR mismatched types
| ---- ^^^ cannot coerce functions with `#[target_feature]` to safe function pointers
| |
| expected due to this
|
= note: expected fn pointer `fn()`
found fn item `fn() {foo}`
= note: fn items are distinct from fn pointers, consider casting to a fn pointer or using type inference
= note: functions with `#[target_feature]` can only be coerced to `unsafe` function pointers
error: aborting due to previous error
For more information about this error, try `rustc --explain E0308`.
------------------------------------------
---- [ui] tests/ui/rfcs/rfc-2396-target_feature-11/fn-ptr.rs#thir stdout ----
diff of stderr:
11 |
12 = note: expected fn pointer `fn()`
13 found fn item `fn() {foo}`
+ = note: fn items are distinct from fn pointers, consider casting to a fn pointer or using type inference
14 = note: functions with `#[target_feature]` can only be coerced to `unsafe` function pointers
15
16 error: aborting due to previous error
The actual stderr differed from the expected stderr.
Actual stderr saved to /home/mperez/projects/rustlang/build/x86_64-unknown-linux-gnu/test/ui/rfcs/rfc-2396-target_feature-11/fn-ptr.thir/fn-ptr.thir.stderr
To update references, rerun the tests and pass the `--bless` flag
To only update this specific test, also pass `--test-args rfcs/rfc-2396-target_feature-11/fn-ptr.rs`
error in revision `thir`: 1 errors occurred comparing output.
status: exit status: 1
command: "/home/mperez/projects/rustlang/build/x86_64-unknown-linux-gnu/stage1/bin/rustc" "/home/mperez/projects/rustlang/tests/ui/rfcs/rfc-2396-target_feature-11/fn-ptr.rs" "-Zthreads=1" "--target=x86_64-unknown-linux-gnu" "--cfg" "thir" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zsimulate-remapped-rust-src-base=/rustc/FAKE_PREFIX" "-Ztranslate-remapped-path-to-local-path=no" "-Zdeduplicate-diagnostics=no" "-Cstrip=debuginfo" "--emit" "metadata" "-C" "prefer-dynamic" "--out-dir" "/home/mperez/projects/rustlang/build/x86_64-unknown-linux-gnu/test/ui/rfcs/rfc-2396-target_feature-11/fn-ptr.thir" "-A" "unused" "-Crpath" "-Cdebuginfo=0" "-Lnative=/home/mperez/projects/rustlang/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-L" "/home/mperez/projects/rustlang/build/x86_64-unknown-linux-gnu/test/ui/rfcs/rfc-2396-target_feature-11/fn-ptr.thir/auxiliary" "-Z" "thir-unsafeck"
stdout: none
--- stderr -------------------------------
error[E0308]: mismatched types
--> /home/mperez/projects/rustlang/tests/ui/rfcs/rfc-2396-target_feature-11/fn-ptr.rs:11:21
|
LL | #[target_feature(enable = "sse2")]
| ---------------------------------- `#[target_feature]` added here
...
LL | let foo: fn() = foo; //~ ERROR mismatched types
| ---- ^^^ cannot coerce functions with `#[target_feature]` to safe function pointers
| |
| expected due to this
|
= note: expected fn pointer `fn()`
found fn item `fn() {foo}`
= note: fn items are distinct from fn pointers, consider casting to a fn pointer or using type inference
= note: functions with `#[target_feature]` can only be coerced to `unsafe` function pointers
error: aborting due to previous error
For more information about this error, try `rustc --explain E0308`.
------------------------------------------
---- [ui] tests/ui/static/static-reference-to-fn-1.rs stdout ----
diff of stderr:
6 |
7 = note: expected reference `&fn() -> Option<isize>`
8 found reference `&fn() -> Option<isize> {foo}`
+ = note: fn items are distinct from fn pointers, consider casting to a fn pointer or using type inference
9
10 error: aborting due to previous error
11
The actual stderr differed from the expected stderr.
Actual stderr saved to /home/mperez/projects/rustlang/build/x86_64-unknown-linux-gnu/test/ui/static/static-reference-to-fn-1/static-reference-to-fn-1.stderr
To update references, rerun the tests and pass the `--bless` flag
To only update this specific test, also pass `--test-args static/static-reference-to-fn-1.rs`
error: 1 errors occurred comparing output.
status: exit status: 1
command: "/home/mperez/projects/rustlang/build/x86_64-unknown-linux-gnu/stage1/bin/rustc" "/home/mperez/projects/rustlang/tests/ui/static/static-reference-to-fn-1.rs" "-Zthreads=1" "--target=x86_64-unknown-linux-gnu" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zsimulate-remapped-rust-src-base=/rustc/FAKE_PREFIX" "-Ztranslate-remapped-path-to-local-path=no" "-Zdeduplicate-diagnostics=no" "-Cstrip=debuginfo" "--emit" "metadata" "-C" "prefer-dynamic" "--out-dir" "/home/mperez/projects/rustlang/build/x86_64-unknown-linux-gnu/test/ui/static/static-reference-to-fn-1" "-A" "unused" "-Crpath" "-Cdebuginfo=0" "-Lnative=/home/mperez/projects/rustlang/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-L" "/home/mperez/projects/rustlang/build/x86_64-unknown-linux-gnu/test/ui/static/static-reference-to-fn-1/auxiliary"
stdout: none
--- stderr -------------------------------
error[E0308]: mismatched types
--> /home/mperez/projects/rustlang/tests/ui/static/static-reference-to-fn-1.rs:17:15
|
LL | func: &foo, //~ ERROR mismatched types
| ^^^^ expected fn pointer, found fn item
|
= note: expected reference `&fn() -> Option<isize>`
found reference `&fn() -> Option<isize> {foo}`
= note: fn items are distinct from fn pointers, consider casting to a fn pointer or using type inference
error: aborting due to previous error
For more information about this error, try `rustc --explain E0308`.
------------------------------------------
failures:
[ui] tests/ui/argument-suggestions/two-mismatch-notes.rs
[ui] tests/ui/c-variadic/variadic-ffi-1.rs
[ui] tests/ui/fn/fn-pointer-mismatch.rs
[ui] tests/ui/fn/signature-error-reporting-under-verbose.rs
[ui] tests/ui/issues/issue-10764.rs
[ui] tests/ui/issues/issue-24322.rs
[ui] tests/ui/mismatched_types/normalize-fn-sig.rs
[ui] tests/ui/regions/region-lifetime-bounds-on-fns-where-clause.rs
[ui] tests/ui/regions/region-multiple-lifetime-bounds-on-fns-where-clause.rs
[ui] tests/ui/regions/regions-fn-subtyping-return-static-fail.rs
[ui] tests/ui/regions/regions-lifetime-bounds-on-fns.rs
[ui] tests/ui/reify-intrinsic.rs
[ui] tests/ui/rfcs/rfc-2396-target_feature-11/fn-ptr.rs#mir
[ui] tests/ui/rfcs/rfc-2396-target_feature-11/fn-ptr.rs#thir
[ui] tests/ui/static/static-reference-to-fn-1.rs
test result: FAILED. 14084 passed; 15 failed; 128 ignored; 0 measured; 0 filtered out; finished in 265.08s
Some tests failed in compiletest suite=ui mode=ui host=x86_64-unknown-linux-gnu target=x86_64-unknown-linux-gnu
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment