Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#[deriving(ToStr)] doesn't work in std #8242

Closed
Kimundi opened this issue Aug 3, 2013 · 3 comments
Closed

#[deriving(ToStr)] doesn't work in std #8242

Kimundi opened this issue Aug 3, 2013 · 3 comments
Labels
A-syntaxext Area: Syntax extensions

Comments

@Kimundi
Copy link
Member

Kimundi commented Aug 3, 2013

Maybe I'm missing some magic incantation, but adding a #[deriving(ToStr)] to a type in std (here: rt::io::IoError) seems just to leads to these errors for me:

.../rust/src/libstd/rt/io/mod.rs:332:11: 332:16 error: unresolved import: could not find `to_str` in `std`.
.../rust/src/libstd/rt/io/mod.rs:332 #[deriving(ToStr)]
                                                ^~~~~
.../rust/src/libstd/rt/io/mod.rs:332:11: 332:16 error: use of undeclared module `::std::to_str`
.../rust/src/libstd/rt/io/mod.rs:332 #[deriving(ToStr)]
                                                ^~~~~
.../rust/src/libstd/rt/io/mod.rs:332:11: 332:16 error: attempt to implement a nonexistent trait `std::to_str::ToStr`
.../rust/src/libstd/rt/io/mod.rs:332 #[deriving(ToStr)]
                                                ^~~~~
@huonw
Copy link
Member

huonw commented Aug 3, 2013

This would be solved by adding a way to specify the path to std and extra, since it's currently just taken to be ::std::..., e.g. at the top of the appropriate crate

// in std
#[deriving_path(std="")];

// in extra
#[deriving_path(extra="")];

These would be std and extra if not specified, so the behaviour doesn't change. (And this might be useful as #[syntaxext_path] since other syntax extensions also assume ::std::....)

@emberian
Copy link
Member

Visiting for triage. Is this still an issue, @huonw?

@sfackler
Copy link
Member

If this isn't already working, this is easily fixable by adding pub use to_str to std::std.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-syntaxext Area: Syntax extensions
Projects
None yet
Development

No branches or pull requests

4 participants