]> git.lizzy.rs Git - rust.git/blob - src/test/ui/alloc-error/alloc-error-handler-bad-signature-2.stderr
Auto merge of #97485 - bjorn3:new_archive_writer, r=wesleywiser
[rust.git] / src / test / ui / alloc-error / alloc-error-handler-bad-signature-2.stderr
1 error[E0308]: mismatched types
2   --> $DIR/alloc-error-handler-bad-signature-2.rs:10:1
3    |
4 LL |    #[alloc_error_handler]
5    |    ---------------------- in this procedural macro expansion
6 LL |    fn oom(
7    |  __^
8    | | _|
9    | ||
10 LL | ||     info: Layout,
11 LL | || ) {
12    | ||_- arguments to this function are incorrect
13 LL | |      loop {}
14 LL | |  }
15    | |__^ expected struct `Layout`, found struct `core::alloc::Layout`
16    |
17    = note: struct `core::alloc::Layout` and struct `Layout` have similar names, but are actually distinct types
18 note: struct `core::alloc::Layout` is defined in crate `core`
19   --> $SRC_DIR/core/src/alloc/layout.rs:LL:COL
20    |
21 LL | pub struct Layout {
22    | ^^^^^^^^^^^^^^^^^
23 note: struct `Layout` is defined in the current crate
24   --> $DIR/alloc-error-handler-bad-signature-2.rs:7:1
25    |
26 LL | struct Layout;
27    | ^^^^^^^^^^^^^
28 note: function defined here
29   --> $DIR/alloc-error-handler-bad-signature-2.rs:10:4
30    |
31 LL | fn oom(
32    |    ^^^
33 LL |     info: Layout,
34    |     ------------
35    = note: this error originates in the attribute macro `alloc_error_handler` (in Nightly builds, run with -Z macro-backtrace for more info)
36
37 error[E0308]: mismatched types
38   --> $DIR/alloc-error-handler-bad-signature-2.rs:10:1
39    |
40 LL |    #[alloc_error_handler]
41    |    ---------------------- in this procedural macro expansion
42 LL |    fn oom(
43    |  __^
44    | | _|
45    | ||
46 LL | ||     info: Layout,
47 LL | || ) {
48    | ||_^ expected `!`, found `()`
49 LL | |      loop {}
50 LL | |  }
51    | |__- expected `!` because of return type
52    |
53    = note:   expected type `!`
54            found unit type `()`
55    = note: this error originates in the attribute macro `alloc_error_handler` (in Nightly builds, run with -Z macro-backtrace for more info)
56
57 error: aborting due to 2 previous errors
58
59 For more information about this error, try `rustc --explain E0308`.