// revisions: min // FIXME(const_generics): This test currently causes an ICE because // we don't yet correctly deal with lifetimes, reenable this test once // this is fixed. const fn foo() -> usize { std::mem::size_of::() } const fn bar() -> usize { N } const fn faz<'a>(_: &'a ()) -> usize { 13 } const fn baz<'a>(_: &'a ()) -> usize where &'a (): Sized { 13 } struct Foo; fn test<'a, 'b, T, const N: usize>() where &'b (): Sized { let _: [u8; foo::()]; //~ ERROR generic parameters may not let _: [u8; bar::()]; //~ ERROR generic parameters may not let _: [u8; faz::<'a>(&())]; //~ ERROR a non-static lifetime let _: [u8; baz::<'a>(&())]; //~ ERROR a non-static lifetime let _: [u8; faz::<'b>(&())]; //~ ERROR a non-static lifetime let _: [u8; baz::<'b>(&())]; //~ ERROR a non-static lifetime // NOTE: This can be a future compat warning instead of an error, // so we stop compilation before emitting this error in this test. let _ = [0; foo::()]; let _ = [0; bar::()]; //~ ERROR generic parameters may not let _ = [0; faz::<'a>(&())]; //~ ERROR a non-static lifetime let _ = [0; baz::<'a>(&())]; //~ ERROR a non-static lifetime let _ = [0; faz::<'b>(&())]; //~ ERROR a non-static lifetime let _ = [0; baz::<'b>(&())]; //~ ERROR a non-static lifetime let _: Foo<{ foo::() }>; //~ ERROR generic parameters may not let _: Foo<{ bar::() }>; //~ ERROR generic parameters may not let _: Foo<{ faz::<'a>(&()) }>; //~ ERROR a non-static lifetime let _: Foo<{ baz::<'a>(&()) }>; //~ ERROR a non-static lifetime let _: Foo<{ faz::<'b>(&()) }>; //~ ERROR a non-static lifetime let _: Foo<{ baz::<'b>(&()) }>; //~ ERROR a non-static lifetime let _ = Foo::<{ foo::() }>; //~ ERROR generic parameters may not let _ = Foo::<{ bar::() }>; //~ ERROR generic parameters may not let _ = Foo::<{ faz::<'a>(&()) }>; //~ ERROR a non-static lifetime let _ = Foo::<{ baz::<'a>(&()) }>; //~ ERROR a non-static lifetime let _ = Foo::<{ faz::<'b>(&()) }>; //~ ERROR a non-static lifetime let _ = Foo::<{ baz::<'b>(&()) }>; //~ ERROR a non-static lifetime } fn main() {}