summaryrefslogtreecommitdiffstats
path: root/tests/ui/consts/const-eval/issue-114994-fail.rs
blob: 723504640919154b801bf5a5855f3465d91996f3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
// This checks that function pointer signatures that are referenced mutably
// but contain a &mut T parameter still fail in a constant context: see issue #114994.
//
// check-fail

const fn use_mut_const_fn(_f: &mut fn(&mut String)) { //~ ERROR mutable references are not allowed in constant functions
    ()
}

const fn use_mut_const_tuple_fn(_f: (fn(), &mut u32)) { //~ ERROR mutable references are not allowed in constant functions

}

fn main() {}