Skip to content

Commit

Permalink
Fix TypeLayoutGraph::new const bound
Browse files Browse the repository at this point in the history
  • Loading branch information
juntyr committed Oct 30, 2022
1 parent 6439713 commit 315a458
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions try-crate/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,13 @@ pub struct MyPhantomData<T> {
#[repr(transparent)]
pub struct Wrapper(f64);

// FIXME: move bound from where clause to impl bound
// https://github.com/dtolnay/syn/issues/1238
#[derive(TypeLayout)]
pub struct Bounded<T>(T)
where
T: std::fmt::Debug + ~const TypeGraphLayout;

fn main() {
println!("{:#?}", Foo1::TYPE_GRAPH);
println!("{:#?}", Foo2::TYPE_GRAPH);
Expand Down Expand Up @@ -197,6 +204,7 @@ fn main() {
println!("{:#?}", <Referencing<&'static u8>>::TYPE_GRAPH);

println!("{:#?}", <Wrapper>::TYPE_GRAPH);
println!("{:#?}", <Bounded<bool>>::TYPE_GRAPH);

non_static_ref(&0);

Expand Down

0 comments on commit 315a458

Please sign in to comment.