-
Notifications
You must be signed in to change notification settings - Fork 14k
Closed
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsA-frontendArea: Compiler frontend (errors, parsing and HIR)Area: Compiler frontend (errors, parsing and HIR)
Description
test-error.rs:
#![no_std]
Compiling:
$> rustc --test test-error.rs
test-error.rs:1:1: 1:4 error: unresolved import `std::slice::AsSlice`. Maybe a missing `extern crate std`?
test-error.rs:1 #![no_std]
^~~
error: aborting due to previous error
This isn't very helpful. Changing the file to
#![no_std]
extern crate core;
mod std { mod slice { pub use core::slice::AsSlice; } }
instead gives the error message
test-error.rs:1:1: 1:1 error: failed to resolve. Could not find `os` in `std`.
test-error.rs:1 #![no_std]
^
test-error.rs:1:1: 1:1 error: unresolved name `std::os::args`.
test-error.rs:1 #![no_std]
^
error: aborting due to 2 previous errors
The error always refers to the first line of the file, so if you have feature gates before #![no_std], the error will refer to them.
Metadata
Metadata
Assignees
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsA-frontendArea: Compiler frontend (errors, parsing and HIR)Area: Compiler frontend (errors, parsing and HIR)