Closed
Description
This is regarding the changes made in #49380. This change works, however when the user makes some kind of mistake, especially forgetting to install the new targets (like thumbv7em-none-eabihf
), the error messages are not currently helpful.
The current error message when forgetting to install the target looks like this:
cargo build --target thumbv7em-none-eabihf --example blinky
Compiling vcell v0.1.0
Compiling bare-metal v0.1.1
Compiling aligned v0.1.1
Compiling untagged-option v0.1.1
error[E0463]: can't find crate for `compiler_builtins`
error[E0463]: can't find crate for `compiler_builtins`
error: aborting due to previous error
For more information about this error, try `rustc --explain E0463`.
error: aborting due to previous error
For more information about this error, try `rustc --explain E0463`.
error[E0463]: can't find crate for `compiler_builtins`
error: aborting due to previous error
error[E0463]: can't find crate for `compiler_builtins`
For more information about this error, try `rustc --explain E0463`.
error: aborting due to previous error
For more information about this error, try `rustc --explain E0463`.
compared to the following when you try to compile for a not-installed target:
cargo build --target i686-unknown-linux-gnu
Compiling foo v0.1.0 (file:///tmp/foo)
error[E0463]: can't find crate for `std`
|
= note: the `i686-unknown-linux-gnu` target may not be installed
error: aborting due to previous error
For more information about this error
The following #[no_std]
code shows (the first part of) a typical embedded project:
//! Blinks an LED
#![deny(unsafe_code)]
#![deny(warnings)]
#![no_std]
extern crate cortex_m;
using cargo expand
, this code expands to:
#![feature(prelude_import)]
#![no_std]
//! Blinks an LED
#![deny(unsafe_code)]
#![deny(warnings)]
#![no_std]
#[prelude_import]
use core::prelude::v1::*;
#[macro_use]
extern crate compiler_builtins;
#[macro_use]
extern crate core;
extern crate cortex_m;
The Embedded WG talked about this, and we think the error messages would be improved if the order of extern crate compiler_builtins;
and extern crate core;
were swapped.