Skip to content

Commit d588e77

Browse files
committed
fix CI in newer rust
The culprit lied in rust-lang/rust#116505 In short, with default features turned off, main was trivial enough to be marked as inline function automatically which then made the symbol weak. Since nobody was referencing it, it got stripped away. Marking main in default-features=false config as #[inline(never)] or replacing 1 + 1 in it's body with a simple println!("foo") call (to make the main function sophisticated enough not to be subject to the new automatic marking as inline) makes the test pass again.
1 parent 18d2e23 commit d588e77

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

sample/src/lib.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ impl SeedableRng for MyRngCore {
2525
}
2626

2727
#[cfg(not(feature = "superbanana"))]
28+
#[inline(never)]
2829
pub fn main() -> u32 {
2930
1 + 1
3031
}
@@ -38,6 +39,7 @@ impl Bar {
3839
}
3940

4041
#[cfg(feature = "superbanana")]
42+
#[inline(never)]
4143
pub fn main() {
4244
let mut rng = BlockRng::<MyRngCore>::seed_from_u64(0);
4345
for ix in 0..10 {

sample_rlib/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1+
#[inline(never)]
12
pub fn add(a: usize, b: usize) -> usize {
23
a + b
34
}
4-

0 commit comments

Comments
 (0)