Skip to content

Box::from(&str) -> Box<Error> regression #30634

Closed
@diwic

Description

@diwic

The following code compiles fine on the stable channel but fails on the beta and nigthly channels:

fn test() -> Box<std::error::Error> { Box::from("test") }
fn main() { test(); }

The error message is:

error: the trait `std::error::Error` is not implemented for the type `&str`

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions