Skip to content

Commit fbb5b90

Browse files
committed
test(build-std): make mock-std closer to real world
`test_std_on_unsupported_target` never really succeed to build those targets, due to * local rustup may not have `{aarch64,x86_64}-unknown-none` installed. * `core` and `compiler-builtins` mock crate are not `no_std` nor `no_core` * the dummy `main.rs` uses `println!` and is not `no_std`. This commit make it compile, if you have those targets installed.
1 parent 05f54fd commit fbb5b90

File tree

3 files changed

+8
-6
lines changed

3 files changed

+8
-6
lines changed
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
// intentionally blank
1+
#![no_std]

tests/testsuite/mock-std/library/core/src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#![no_std]
12
#![feature(staged_api)]
23
#![stable(since = "1.0.0", feature = "dummy")]
34

tests/testsuite/standard_lib.rs

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -395,12 +395,13 @@ fn test_std_on_unsupported_target() {
395395

396396
let p = project()
397397
.file(
398-
"src/main.rs",
398+
"src/lib.rs",
399399
r#"
400-
fn main() {
401-
println!("hello");
402-
}
403-
"#,
400+
#![no_std]
401+
pub fn foo() {
402+
assert_eq!(u8::MIN, 0);
403+
}
404+
"#,
404405
)
405406
.build();
406407

0 commit comments

Comments
 (0)