// Copyright 2012 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // // Licensed under the Apache License, Version 2.0 or the MIT license // , at your // option. This file may not be copied, modified, or distributed // except according to those terms. // Test rules governing higher-order pure fns. fn take(_v: T) {} fn assign_to_pure(x: pure fn(), y: fn(), z: unsafe fn()) { take::(x); take::(y); //~ ERROR expected pure fn but found impure fn take::(z); //~ ERROR expected pure fn but found unsafe fn } fn assign_to_impure(x: pure fn(), y: fn(), z: unsafe fn()) { take::(x); take::(y); take::(z); //~ ERROR expected impure fn but found unsafe fn } fn assign_to_unsafe(x: pure fn(), y: fn(), z: unsafe fn()) { take::(x); take::(y); take::(z); } fn assign_to_pure2(x: pure fn@(), y: fn@(), z: unsafe fn@()) { take::(x); take::(y); //~ ERROR expected pure fn but found impure fn take::(z); //~ ERROR expected pure fn but found unsafe fn take::(x); //~ ERROR expected ~ closure, found @ closure take::(y); //~ ERROR expected ~ closure, found @ closure take::(z); //~ ERROR expected ~ closure, found @ closure take::(x); //~ ERROR expected ~ closure, found @ closure take::(y); //~ ERROR expected ~ closure, found @ closure take::(z); //~ ERROR expected ~ closure, found @ closure } fn main() { }