Skip to content

Commit

Permalink
Add compile-pass test about Self: Sized bounds on the trait
Browse files Browse the repository at this point in the history
Currently, the `impl` block we generate for those traits is a bit
stupid as it contains `T: Trait + ?Sized` (where `Trait: Sized`), but
it compiles fine. So I don't see a reason to make our code more
complicated just to avoid this strangeness.
  • Loading branch information
LukasKalbertodt committed Jul 19, 2019
1 parent cf6c9cc commit 90f17b6
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions tests/compile-pass/trait_obj_self_sized.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
use auto_impl::auto_impl;


#[auto_impl(Box)]
trait Foo: Sized {
fn foo(&self);
}

#[auto_impl(Box)]
trait Bar where Self: Sized {
fn foo(&self);
}

#[auto_impl(Box)]
trait Baz: Sized where Self: Sized {
fn foo(&self);
}

0 comments on commit 90f17b6

Please sign in to comment.