Skip to content

Commit f1878ff

Browse files
committed
tests: hackily add some #[inline(never)].
1 parent c44a20f commit f1878ff

File tree

7 files changed

+17
-10
lines changed

7 files changed

+17
-10
lines changed

src/test/codegen/internalize-closures.rs

+3-1
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,13 @@
1010

1111
// compile-flags: -C no-prepopulate-passes
1212

13+
#![feature(stmt_expr_attributes)]
14+
1315
pub fn main() {
1416

1517
// We want to make sure that closures get 'internal' linkage instead of
1618
// 'weak_odr' when they are not shared between codegen units
1719
// CHECK: define internal {{.*}}_ZN20internalize_closures4main{{.*}}$u7b$$u7b$closure$u7d$$u7d$
18-
let c = |x:i32| { x + 1 };
20+
let c = #[inline(never)] |x:i32| { x + 1 };
1921
let _ = c(1);
2022
}

src/test/codegen/remap_path_prefix/aux_mod.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
// ignore-test: this is not a test
1212

13-
#[inline]
14-
pub fn some_aux_mod_function() -> i32 {
15-
1234
13+
#[inline(never)]
14+
pub fn some_aux_mod_function<T>() -> usize {
15+
::std::mem::size_of::<T>()
1616
}

src/test/codegen/remap_path_prefix/auxiliary/remap_path_prefix_aux.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
// compile-flags: -g -Zremap-path-prefix-from={{cwd}} -Zremap-path-prefix-to=/the/aux-cwd -Zremap-path-prefix-from={{src-base}}/remap_path_prefix/auxiliary -Zremap-path-prefix-to=/the/aux-src
1414

15-
#[inline]
16-
pub fn some_aux_function() -> i32 {
17-
1234
15+
#[inline(never)]
16+
pub fn some_aux_function<T>() -> usize {
17+
std::mem::size_of::<T>()
1818
}

src/test/codegen/remap_path_prefix/main.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,9 @@ include!("aux_mod.rs");
2626
pub static FILE_PATH: &'static str = file!();
2727

2828
fn main() {
29-
remap_path_prefix_aux::some_aux_function();
30-
aux_mod::some_aux_mod_function();
31-
some_aux_mod_function();
29+
remap_path_prefix_aux::some_aux_function::<()>();
30+
aux_mod::some_aux_mod_function::<()>();
31+
some_aux_mod_function::<()>();
3232
}
3333

3434
// Here we check that local debuginfo is mapped correctly.

src/test/compile-fail/issue-22638.rs

+1
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ impl C {
5757
struct D (Box<A>);
5858

5959
impl D {
60+
#[inline(never)]
6061
pub fn matches<F: Fn()>(&self, f: &F) {
6162
//~^ ERROR reached the type-length limit while instantiating `D::matches::<[closure
6263
let &D(ref a) = self;

src/test/compile-fail/type_length_limit.rs

+3
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,9 @@ link! { F, G }
3030

3131
pub struct G;
3232

33+
#[inline(never)]
34+
fn drop<T>(_: T) {}
35+
3336
fn main() {
3437
drop::<Option<A>>(None);
3538
}

src/test/debuginfo/associated-types.rs

+1
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,7 @@ fn assoc_return_value<T: TraitWithAssocType>(arg: T) -> T::Type {
125125
return arg.get_value();
126126
}
127127

128+
#[inline(never)]
128129
fn assoc_tuple<T: TraitWithAssocType>(arg: (T, T::Type)) {
129130
zzz(); // #break
130131
}

0 commit comments

Comments
 (0)