Skip to content

Commit d755b1e

Browse files
committed
Cleanup
1 parent 1ca5903 commit d755b1e

File tree

3 files changed

+11
-27
lines changed

3 files changed

+11
-27
lines changed

src/derive.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,12 +71,9 @@ impl LintPass for Derive {
7171

7272
impl LateLintPass for Derive {
7373
fn check_item(&mut self, cx: &LateContext, item: &Item) {
74-
75-
7674
if_let_chain! {[
7775
let ItemImpl(_, _, _, Some(ref trait_ref), _, _) = item.node
7876
], {
79-
8077
let ty = cx.tcx.lookup_item_type(cx.tcx.map.local_def_id(item.id)).ty;
8178
if item.attrs.iter().any(is_automatically_derived) {
8279
check_hash_peq(cx, item.span, trait_ref, ty);

tests/compile-fail/derive.rs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,17 @@ impl Clone for Qux {
3535
fn clone(&self) -> Self { Qux }
3636
}
3737

38+
// See #666
39+
#[derive(Copy)]
40+
struct Lt<'a> {
41+
a: &'a u8,
42+
}
43+
44+
impl<'a> Clone for Lt<'a> {
45+
//~^ ERROR you are implementing `Clone` explicitly on a `Copy` type
46+
fn clone(&self) -> Self { unimplemented!() }
47+
}
48+
3849
// Ok, `Clone` cannot be derived because of the big array
3950
#[derive(Copy)]
4051
struct BigArray {

tests/ice-666.rs

Lines changed: 0 additions & 24 deletions
This file was deleted.

0 commit comments

Comments
 (0)