Skip to content

PartialOrd derving broken for slices #18738

Closed
@emberian

Description

@emberian
#[deriving(PartialEq, PartialOrd)]
pub struct Version {
    pub vender_info: &'static str
}

fn main(){}
> rustc foo.rs
foo.rs:3:9: 3:34 error: mismatched types: expected `&str`, found `&&'static str` (expected str, found &-ptr)
foo.rs:3     pub vender_info: &'static str
                 ^~~~~~~~~~~~~~~~~~~~~~~~~
note: in expansion of #[deriving]
foo.rs:1:1: 1:35 note: expansion site
error: aborting due to previous error

Removing the PartialOrd deriving fixes it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions