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