]> git.lizzy.rs Git - rust.git/blob - src/test/ui/errors/issue-99572-impl-trait-on-pointer.stderr
:arrow_up: rust-analyzer
[rust.git] / src / test / ui / errors / issue-99572-impl-trait-on-pointer.stderr
1 error[E0117]: only traits defined in the current crate can be implemented for arbitrary types
2   --> $DIR/issue-99572-impl-trait-on-pointer.rs:7:1
3    |
4 LL | impl fmt::Display for *mut LocalType {
5    | ^^^^^^^^^^^^^^^^^^^^^^--------------
6    | |                     |
7    | |                     `*mut LocalType` is not defined in the current crate because raw pointers are always foreign
8    | impl doesn't use only types from inside the current crate
9    |
10    = note: define and implement a trait or new type instead
11 help: consider introducing a new wrapper type
12    |
13 LL + struct WrapperType(*mut LocalType);
14 LL + 
15 LL ~ impl fmt::Display for WrapperType {
16    |
17
18 error[E0117]: only traits defined in the current crate can be implemented for arbitrary types
19   --> $DIR/issue-99572-impl-trait-on-pointer.rs:18:1
20    |
21 LL | impl<T> marker::Copy for *mut T {
22    | ^^^^^^^^^^^^^^^^^^^^^^^^^------
23    | |                        |
24    | |                        `*mut T` is not defined in the current crate because raw pointers are always foreign
25    | impl doesn't use only types from inside the current crate
26    |
27    = note: define and implement a trait or new type instead
28
29 error: aborting due to 2 previous errors
30
31 For more information about this error, try `rustc --explain E0117`.