rust/tests/ui/object-safety/bare-trait-dont-suggest-dyn.fixed

10 lines
235 B
Rust
Raw Normal View History

// run-rustfix
#![deny(bare_trait_objects)]
fn ord_prefer_dot(s: String) -> impl Ord {
//~^ ERROR the trait `Ord` cannot be made into an object
(s.starts_with("."), s)
}
fn main() {
let _ = ord_prefer_dot(String::new());
}