diff options
| author | Eli Friedman <eli.friedman@gmail.com> | 2015-06-13 13:15:03 -0700 |
|---|---|---|
| committer | Eduard Burtescu <edy.burt@gmail.com> | 2016-03-09 16:45:28 +0200 |
| commit | b423a0f9ef488ca4cd9ff620a44566bb441eb21f (patch) | |
| tree | ae43c17551512f743c1de53035a7f523b32aa6fa /src/test/compile-fail | |
| parent | 4b868411afee1208cfb18f7440df991b9f94265f (diff) | |
| download | rust-b423a0f9ef488ca4cd9ff620a44566bb441eb21f.tar.gz rust-b423a0f9ef488ca4cd9ff620a44566bb441eb21f.zip | |
Split TyBareFn into TyFnDef and TyFnPtr.
There's a lot of stuff wrong with the representation of these types: TyFnDef doesn't actually uniquely identify a function, TyFnPtr is used to represent method calls, TyFnDef in the sub-expression of a cast isn't correctly reified, and probably some other stuff I haven't discovered yet. Splitting them seems like the right first step, though.
Diffstat (limited to 'src/test/compile-fail')
| -rw-r--r-- | src/test/compile-fail/invalid-intrinsic.rs | 16 | ||||
| -rw-r--r-- | src/test/compile-fail/variadic-ffi-3.rs | 2 |
2 files changed, 17 insertions, 1 deletions
diff --git a/src/test/compile-fail/invalid-intrinsic.rs b/src/test/compile-fail/invalid-intrinsic.rs new file mode 100644 index 00000000000..2aa2546cb9f --- /dev/null +++ b/src/test/compile-fail/invalid-intrinsic.rs @@ -0,0 +1,16 @@ +// Copyright 2015 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 <LICENSE-APACHE or +// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license +// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +#![feature(intrinsics)] +extern "rust-intrinsic" { + pub static breakpoint : unsafe extern "rust-intrinsic" fn(); + //~^ ERROR intrinsic has wrong type +} +fn main() { unsafe { breakpoint(); } } \ No newline at end of file diff --git a/src/test/compile-fail/variadic-ffi-3.rs b/src/test/compile-fail/variadic-ffi-3.rs index 94055450bc6..1d5ebdbae3e 100644 --- a/src/test/compile-fail/variadic-ffi-3.rs +++ b/src/test/compile-fail/variadic-ffi-3.rs @@ -22,7 +22,7 @@ fn main() { let x: unsafe extern "C" fn(f: isize, x: u8) = foo; //~^ ERROR: mismatched types //~| expected `unsafe extern "C" fn(isize, u8)` - //~| found `unsafe extern "C" fn(isize, u8, ...)` + //~| found `unsafe extern "C" fn(isize, u8, ...) {foo}` //~| expected non-variadic fn //~| found variadic function |
