]> git.lizzy.rs Git - rust.git/blob - tests/ui/consts/refs_check_const_eq-issue-88384.rs
Rollup merge of #106963 - compiler-errors:scope-expr-dupe, r=michaelwoerister
[rust.git] / tests / ui / consts / refs_check_const_eq-issue-88384.rs
1 #![feature(fn_traits)]
2 #![feature(adt_const_params)]
3 //~^ WARNING the feature `adt_const_params` is incomplete
4
5 #[derive(PartialEq, Eq)]
6 struct CompileTimeSettings{
7     hooks: &'static[fn()],
8 }
9
10 struct Foo<const T: CompileTimeSettings>;
11 //~^ ERROR using function pointers as const generic parameters is forbidden
12
13 impl<const T: CompileTimeSettings> Foo<T> {
14     //~^ ERROR using function pointers as const generic parameters is forbidden
15     fn call_hooks(){
16     }
17 }
18
19 fn main(){
20     const SETTINGS: CompileTimeSettings = CompileTimeSettings{
21         hooks: &[],
22     };
23
24     Foo::<SETTINGS>::call_hooks();
25 }