Skip to content

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

Closed

Description

@Kimundi

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)]
                                                ^~~~~

Activity

  1. huonw commented on Aug 3, 2013

    @huonw
    Contributor

    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::....)

  2. emberian commented on Feb 17, 2014

    @emberian
    Contributor

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

  3. sfackler commented on Feb 17, 2014

    @sfackler
    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-syntaxextArea: Syntax extensions

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions