I have a custom architecture with its own LLVM backend. I am currently trying to port rustc to it. However, I am currently getting this error while trying to corss-compile the libcore crate
error[E0378]: implementing the `DispatchFromDyn` trait requires multiple coercions --> /home/codetector/projects/github.com/transfer-learning/rust/src/libcore/ptr/unique.rs:151:1
|
151 | impl<T: ?Sized, U: ?Sized> DispatchFromDyn<Unique<U>> for Unique<T> where T: Unsize<U> {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: the trait `DispatchFromDyn` may only be implemented for a coercion between structures with a single field being coerced
= note: currently, 2 fields need coercions: `pointer` (`*const T` to `*const U`), `_marker` (`marker::PhantomData<T>` to `marker::PhantomData<U>`)
Can anyone provide some help about what could be causing this?
I am trying to cross compile with xargo on an empty project (basically just _start and panic handler) with no_std. It is trying to cross compile the core crate. Using the same flags I can crosscompile for other platform so I assume it’s something wrong with me not adding compiler support correctly
Yeah, so I had to add a target definition into rustc_target. But this is why I am confused as of why am I getting this error. Because with the same compiler, I can cross compile for msp430. In case it helps, I have attached my fork of rust repo that has the changes made to support this custom target. Thanks for your help again.
This is the commit where I added support for my target