]> git.lizzy.rs Git - rust.git/blob - src/test/ui/alloc-error/alloc-error-handler-bad-signature-2.stderr
Rollup merge of #105642 - uberFoo:master, r=Dylan-DPC
[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 note: struct `Layout` is defined in the current crate
21   --> $DIR/alloc-error-handler-bad-signature-2.rs:7:1
22    |
23 LL | struct Layout;
24    | ^^^^^^^^^^^^^
25 note: function defined here
26   --> $DIR/alloc-error-handler-bad-signature-2.rs:10:4
27    |
28 LL | fn oom(
29    |    ^^^
30 LL |     info: Layout,
31    |     ------------
32    = note: this error originates in the attribute macro `alloc_error_handler` (in Nightly builds, run with -Z macro-backtrace for more info)
33
34 error[E0308]: mismatched types
35   --> $DIR/alloc-error-handler-bad-signature-2.rs:10:1
36    |
37 LL |    #[alloc_error_handler]
38    |    ---------------------- in this procedural macro expansion
39 LL |    fn oom(
40    |  __^
41    | | _|
42    | ||
43 LL | ||     info: Layout,
44 LL | || ) {
45    | ||_^ expected `!`, found `()`
46 LL | |      loop {}
47 LL | |  }
48    | |__- expected `!` because of return type
49    |
50    = note:   expected type `!`
51            found unit type `()`
52    = note: this error originates in the attribute macro `alloc_error_handler` (in Nightly builds, run with -Z macro-backtrace for more info)
53
54 error: aborting due to 2 previous errors
55
56 For more information about this error, try `rustc --explain E0308`.