2016-03-01 15:25:15 +00:00
|
|
|
#![feature(plugin)]
|
|
|
|
#![plugin(clippy)]
|
|
|
|
|
|
|
|
#![allow(dead_code)]
|
2016-05-17 06:33:57 +00:00
|
|
|
#![deny(new_without_default, new_without_default_derive)]
|
2016-03-01 15:25:15 +00:00
|
|
|
|
|
|
|
struct Foo;
|
|
|
|
|
|
|
|
impl Foo {
|
2016-05-17 06:33:57 +00:00
|
|
|
fn new() -> Foo { Foo } //~ERROR: you should consider deriving a `Default` implementation for `Foo`
|
2016-03-01 15:25:15 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
struct Bar;
|
|
|
|
|
|
|
|
impl Bar {
|
2016-05-17 06:33:57 +00:00
|
|
|
fn new() -> Self { Bar } //~ERROR: you should consider deriving a `Default` implementation for `Bar`
|
2016-03-01 15:25:15 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
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 }
|
|
|
|
}
|
|
|
|
|
2016-03-18 18:12:32 +00:00
|
|
|
struct GenericsOk<T> {
|
2016-03-03 18:46:10 +00:00
|
|
|
bar: T,
|
|
|
|
}
|
|
|
|
|
2016-03-18 18:12:32 +00:00
|
|
|
impl<U> Default for GenericsOk<U> {
|
|
|
|
fn default() -> Self { unimplemented!(); }
|
|
|
|
}
|
|
|
|
|
|
|
|
impl<'c, V> GenericsOk<V> {
|
|
|
|
fn new() -> GenericsOk<V> { unimplemented!() }
|
|
|
|
}
|
|
|
|
|
|
|
|
struct LtOk<'a> {
|
|
|
|
foo: &'a bool,
|
|
|
|
}
|
|
|
|
|
|
|
|
impl<'b> Default for LtOk<'b> {
|
|
|
|
fn default() -> Self { unimplemented!(); }
|
|
|
|
}
|
|
|
|
|
|
|
|
impl<'c> LtOk<'c> {
|
|
|
|
fn new() -> LtOk<'c> { unimplemented!() }
|
|
|
|
}
|
|
|
|
|
|
|
|
struct LtKo<'a> {
|
|
|
|
foo: &'a bool,
|
|
|
|
}
|
|
|
|
|
|
|
|
impl<'c> LtKo<'c> {
|
|
|
|
fn new() -> LtKo<'c> { unimplemented!() } //~ERROR: you should consider adding a `Default` implementation for
|
2016-03-03 18:46:10 +00:00
|
|
|
}
|
|
|
|
|
2016-03-01 15:25:15 +00:00
|
|
|
fn main() {}
|