mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-11-30 16:39:26 +00:00
5777494f99
Only use it when the type alias contains an opaque type. Also does wf-checking on such type aliases.
26 lines
455 B
Rust
26 lines
455 B
Rust
#![feature(type_alias_impl_trait)]
|
|
#![warn(clippy::new_ret_no_self)]
|
|
|
|
mod issue10041 {
|
|
struct Bomb;
|
|
|
|
impl Bomb {
|
|
// Hidden <Rhs = Self> default generic parameter.
|
|
pub fn new() -> impl PartialOrd {
|
|
0i32
|
|
}
|
|
}
|
|
|
|
// TAIT with self-referencing bounds
|
|
type X = impl std::ops::Add<Output = X>;
|
|
|
|
struct Bomb2;
|
|
|
|
impl Bomb2 {
|
|
pub fn new() -> X {
|
|
0i32
|
|
}
|
|
}
|
|
}
|
|
|
|
fn main() {}
|