Repository navigation
Closed
Labels
E-easyCall for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.E-needs-testCall for participation: An issue has been fixed and does not reproduce, but no test has been added.Call for participation: An issue has been fixed and does not reproduce, but no test has been added.
Description
Minimal test case:
use std::*;
fn main() {
fail!("");
}
rustc output:
<core-macros>:45:12: 45:48 error: unresolved import: could not find `sys` in `std::std`.
<core-macros>:45 ::std::sys::FailWithCause::fail_with($msg, file!(), line!())
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
<core-macros>:40:4: 50:5 note: in expansion of fail!
x.rs:3:1: 3:11 note: expansion site
<core-macros>:45:12: 45:48 error: use of undeclared module `::std::sys::FailWithCause`
<core-macros>:45 ::std::sys::FailWithCause::fail_with($msg, file!(), line!())
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
<core-macros>:40:4: 50:5 note: in expansion of fail!
x.rs:3:1: 3:11 note: expansion site
<core-macros>:45:12: 45:48 error: unresolved name `std::sys::FailWithCause::fail_with`.
<core-macros>:45 ::std::sys::FailWithCause::fail_with($msg, file!(), line!())
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
<core-macros>:40:4: 50:5 note: in expansion of fail!
x.rs:3:1: 3:11 note: expansion site
error: aborting due to 3 previous errors
Rust 0.7, Ubuntu 13.04, 64-bit.
Metadata
Metadata
Assignees
Labels
E-easyCall for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.E-needs-testCall for participation: An issue has been fixed and does not reproduce, but no test has been added.Call for participation: An issue has been fixed and does not reproduce, but no test has been added.
Activity
brson commentedon Jul 10, 2013
Funny. This is because std exports an inner module called std that shadows std.
brson commentedon Jul 10, 2013
There are probably other lurking bugs due to this.
thestinger commentedon Sep 16, 2013
This evil inner module is still around. We couls probably just special case the macro injection via an attribute like
#[module_is_std];.alexcrichton commentedon Sep 16, 2013
This could probably use a similar fix as #8242, something at the top of the file which says that the path to
libstdis.huonw commentedon Oct 20, 2013
Fixed by the privacy changes that meant that
stdmodule instdcan be private. This works:Flagging as needstest.
Merge rust-lang#8767