Skip to content

Commit e473b04

Browse files
committed
Rewrite core-no-fp-fmt-parse in Rust
Rewrite core-no-fp-fmt-parse in Rust fix: missing import fix: tidiness check more tidy checks remove tidy line length ignore
1 parent d748046 commit e473b04

File tree

4 files changed

+28
-5
lines changed

4 files changed

+28
-5
lines changed

Diff for: src/tools/run-make-support/src/rustc.rs

+8
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
use std::env;
22
use std::path::Path;
3+
use std::path::PathBuf;
34
use std::process::{Command, Output};
45

56
use crate::{handle_failed_output, tmp_dir};
@@ -104,6 +105,13 @@ impl Rustc {
104105
self
105106
}
106107

108+
/// Generic file path provider.
109+
pub fn arg_path(&mut self, path: &[&str]) -> &mut Self {
110+
let path_buf = path.iter().collect::<PathBuf>();
111+
self.cmd.arg(path_buf.to_str().unwrap());
112+
self
113+
}
114+
107115
/// Generic command arguments provider. Use `.arg("-Zname")` over `.arg("-Z").arg("arg")`.
108116
/// This method will panic if a plain `-Z` or `-C` is passed, or if `-Z <name>` or `-C <name>`
109117
/// is passed (note the space).

Diff for: src/tools/tidy/src/allowed_run_make_makefiles.txt

-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ run-make/compiler-rt-works-on-mingw/Makefile
3131
run-make/compressed-debuginfo/Makefile
3232
run-make/const-prop-lint/Makefile
3333
run-make/const_fn_mir/Makefile
34-
run-make/core-no-fp-fmt-parse/Makefile
3534
run-make/core-no-oom-handling/Makefile
3635
run-make/crate-data-smoke/Makefile
3736
run-make/crate-hash-rustc-version/Makefile

Diff for: tests/run-make/core-no-fp-fmt-parse/Makefile

-4
This file was deleted.

Diff for: tests/run-make/core-no-fp-fmt-parse/rmake.rs

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
// This test checks that the core library of Rust can be compiled without enabling
2+
// support for formatting and parsing floating-point numbers.
3+
4+
extern crate run_make_support;
5+
6+
use run_make_support::rustc;
7+
use std::path::PathBuf;
8+
9+
fn main() {
10+
rustc()
11+
.arg("--edition")
12+
.arg("2021")
13+
.arg("-Dwarnings")
14+
.arg("--crate-type")
15+
.arg("rlib")
16+
.arg_path(&["..", "..", "..", "library", "core", "src", "lib.rs"])
17+
.arg("--cfg")
18+
.arg("no_fp_fmt_parse")
19+
.run();
20+
}

0 commit comments

Comments
 (0)