Skip to content

Commit ff8f84c

Browse files
Bless more tests
1 parent d989156 commit ff8f84c

File tree

4 files changed

+11
-15
lines changed

4 files changed

+11
-15
lines changed

src/test/codegen/avr/avr-func-addrspace.rs

+5-11
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ pub trait Sized { }
1919
pub trait Copy { }
2020
#[lang = "receiver"]
2121
pub trait Receiver { }
22+
#[lang = "tuple_trait"]
23+
pub trait Tuple { }
2224

2325
pub struct Result<T, E> { _a: T, _b: E }
2426

@@ -29,32 +31,24 @@ impl Copy for &usize {}
2931
pub unsafe fn drop_in_place<T: ?Sized>(_: *mut T) {}
3032

3133
#[lang = "fn_once"]
32-
pub trait FnOnce<Args> {
34+
pub trait FnOnce<Args: Tuple> {
3335
#[lang = "fn_once_output"]
3436
type Output;
3537

3638
extern "rust-call" fn call_once(self, args: Args) -> Self::Output;
3739
}
3840

3941
#[lang = "fn_mut"]
40-
pub trait FnMut<Args> : FnOnce<Args> {
42+
pub trait FnMut<Args: Tuple> : FnOnce<Args> {
4143
extern "rust-call" fn call_mut(&mut self, args: Args) -> Self::Output;
4244
}
4345

4446
#[lang = "fn"]
45-
pub trait Fn<Args>: FnOnce<Args> {
47+
pub trait Fn<Args: Tuple>: FnOnce<Args> {
4648
/// Performs the call operation.
4749
extern "rust-call" fn call(&self, args: Args) -> Self::Output;
4850
}
4951

50-
impl<'a, A, R> FnOnce<A> for &'a fn(A) -> R {
51-
type Output = R;
52-
53-
extern "rust-call" fn call_once(self, args: A) -> R {
54-
(*self)(args)
55-
}
56-
}
57-
5852
pub static mut STORAGE_FOO: fn(&usize, &mut u32) -> Result<(), ()> = arbitrary_black_box;
5953
pub static mut STORAGE_BAR: u32 = 12;
6054

src/test/incremental/hashes/extern_mods.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ extern "C" {
128128
// Change calling convention ---------------------------------------------------
129129
#[cfg(any(cfail1,cfail4))]
130130
extern "C" {
131-
pub fn change_calling_convention(c: i32);
131+
pub fn change_calling_convention(c: (i32,));
132132
}
133133

134134
#[cfg(not(any(cfail1,cfail4)))]
@@ -137,7 +137,7 @@ extern "C" {
137137
#[rustc_clean(cfg = "cfail5", except = "hir_owner,hir_owner_nodes")]
138138
#[rustc_clean(cfg = "cfail6")]
139139
extern "rust-call" {
140-
pub fn change_calling_convention(c: i32);
140+
pub fn change_calling_convention(c: (i32,));
141141
}
142142

143143
// Make function public --------------------------------------------------------

src/test/run-pass-valgrind/unsized-locals/by-value-trait-objects-rust-call.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
#![feature(unsized_locals)]
22
#![feature(unboxed_closures)]
3+
#![feature(tuple_trait)]
34

4-
pub trait FnOnce<Args> {
5+
pub trait FnOnce<Args: std::marker::Tuple> {
56
type Output;
67
extern "rust-call" fn call_once(self, args: Args) -> Self::Output;
78
}

src/test/run-pass-valgrind/unsized-locals/by-value-trait-objects-rust-call2.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
#![feature(unsized_locals)]
22
#![feature(unboxed_closures)]
3+
#![feature(tuple_trait)]
34

4-
pub trait FnOnce<Args> {
5+
pub trait FnOnce<Args: std::marker::Tuple> {
56
type Output;
67
extern "rust-call" fn call_once(self, args: Args) -> Self::Output;
78
}

0 commit comments

Comments
 (0)