rust/tests/ui/object-safety/bare-trait-dont-suggest-dyn.fixed
2024-01-04 00:46:33 +00:00

10 lines
235 B
Rust

// 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());
}