2015-02-23 17:21:54 -05:00
|
|
|
// Check that we check fns appearing in constant declarations.
|
|
|
|
// Issue #22382.
|
|
|
|
|
|
|
|
const MOVE: fn(&String) -> String = {
|
|
|
|
fn broken(x: &String) -> String {
|
2019-05-05 12:02:32 +01:00
|
|
|
return *x //~ ERROR cannot move
|
2015-02-23 17:21:54 -05:00
|
|
|
}
|
|
|
|
broken
|
|
|
|
};
|
|
|
|
|
|
|
|
fn main() {
|
2024-03-13 00:02:45 +00:00
|
|
|
println!("{}", MOVE(&String::new()));
|
2015-02-23 17:21:54 -05:00
|
|
|
}
|