mirror of
https://github.com/rust-lang/rust.git
synced 2024-12-01 03:03:40 +00:00
d975ae5027
- add new testcase for TypeVisitor on const-eval mutable ref check
19 lines
348 B
Rust
19 lines
348 B
Rust
// This checks that function pointer signatures containing &mut T types
|
|
// work in a constant context: see issue #114994.
|
|
//
|
|
// check-pass
|
|
|
|
const fn use_const_fn(_f: fn(&mut String)) {
|
|
()
|
|
}
|
|
|
|
const fn get_some_fn() -> fn(&mut String) {
|
|
String::clear
|
|
}
|
|
|
|
const fn some_const_fn() {
|
|
let _f: fn(&mut String) = String::clear;
|
|
}
|
|
|
|
fn main() {}
|