]> git.lizzy.rs Git - rust.git/blob - src/test/ui/const-generics/uninferred-consts.rs
Auto merge of #76160 - scileo:format-recovery, r=petrochenkov
[rust.git] / src / test / ui / const-generics / uninferred-consts.rs
1 // Test that we emit an error if we cannot properly infer a constant.
2 // revisions: full min
3
4 #![cfg_attr(full, feature(const_generics))]
5 #![cfg_attr(full, allow(incomplete_features))]
6 #![cfg_attr(min, feature(min_const_generics))]
7
8 // taken from https://github.com/rust-lang/rust/issues/70507#issuecomment-615268893
9 struct Foo;
10 impl Foo {
11     fn foo<const N: usize>(self) {}
12 }
13 fn main() {
14     Foo.foo();
15     //~^ ERROR type annotations needed
16 }