mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-11-27 07:00:55 +00:00
35 lines
545 B
Rust
Executable file
35 lines
545 B
Rust
Executable file
#![feature(plugin)]
|
|
#![plugin(clippy)]
|
|
|
|
#![allow(dead_code)]
|
|
#![deny(new_without_default)]
|
|
|
|
struct Foo;
|
|
|
|
impl Foo {
|
|
fn new() -> Foo { Foo } //~ERROR: you should consider adding a `Default` implementation for `Foo`
|
|
}
|
|
|
|
struct Bar;
|
|
|
|
impl Bar {
|
|
fn new() -> Self { Bar } //~ERROR: you should consider adding a `Default` implementation for `Bar`
|
|
}
|
|
|
|
struct Ok;
|
|
|
|
impl Ok {
|
|
fn new() -> Self { Ok }
|
|
}
|
|
|
|
impl Default for Ok {
|
|
fn default() -> Self { Ok }
|
|
}
|
|
|
|
struct Params;
|
|
|
|
impl Params {
|
|
fn new(_: u32) -> Self { Params }
|
|
}
|
|
|
|
fn main() {}
|