Skip to content

Commit 1e82a9b

Browse files
committed
Use Option instead of String to make inling test pass
Contracts result in function calls that would make the inlining test spuriously fail.
1 parent f4a8289 commit 1e82a9b

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

tests/codegen-llvm/cross-crate-inlining/auxiliary/leaf.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44

55
// This function *looks* like it contains a call, but that call will be optimized out by MIR
66
// optimizations.
7-
pub fn leaf_fn() -> String {
8-
String::new()
7+
pub fn leaf_fn() -> bool {
8+
Some(0).is_some()
99
}
1010

1111
// This function contains a call, even after MIR optimizations. It is only eligible for

tests/codegen-llvm/cross-crate-inlining/leaf-inlining.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ extern crate leaf;
77

88
// Check that we inline a leaf cross-crate call
99
#[no_mangle]
10-
pub fn leaf_outer() -> String {
10+
pub fn leaf_outer() -> bool {
1111
// CHECK-NOT: call {{.*}}leaf_fn
1212
leaf::leaf_fn()
1313
}

0 commit comments

Comments
 (0)