Skip to content

Commit 19a1d2b

Browse files
committed
Auto merge of rust-lang#127121 - GuillaumeGomez:rollup-xjjjckn, r=GuillaumeGomez
Rollup of 7 pull requests Successful merges: - rust-lang#126805 (Migrate `pdb-alt-path`, `mismatching-target-triples` and `mingw-export-call-convention` `run-make` tests to rmake) - rust-lang#126995 (Migrate `pretty-print-with-dep-file`, `pretty-print-to-file` and `libtest-padding` `run-make` tests to rmake) - rust-lang#127041 (Migrate `run-make/override-aliased-flags` to `rmake.rs`) - rust-lang#127072 (docs: say "includes" instead of "does include") - rust-lang#127073 (Remove unnecessary SeqCst in `impl fmt::Pointer for AtomicPtr`) - rust-lang#127112 (Bootstrap: Don't get output if `lldb --version` errors) - rust-lang#127116 (Migrate `run-make/return-non-c-like-enum` to `rmake.rs`) Failed merges: - rust-lang#127050 (Make mtime of reproducible tarballs dependent on git commit) r? `@ghost` `@rustbot` modify labels: rollup
2 parents f845335 + 69f355a commit 19a1d2b

File tree

20 files changed

+203
-124
lines changed

20 files changed

+203
-124
lines changed

library/core/src/sync/atomic.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -3766,7 +3766,7 @@ impl<T> fmt::Debug for AtomicPtr<T> {
37663766
#[stable(feature = "atomic_pointer", since = "1.24.0")]
37673767
impl<T> fmt::Pointer for AtomicPtr<T> {
37683768
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
3769-
fmt::Pointer::fmt(&self.load(Ordering::SeqCst), f)
3769+
fmt::Pointer::fmt(&self.load(Ordering::Relaxed), f)
37703770
}
37713771
}
37723772

library/core/src/time.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -842,7 +842,7 @@ impl Duration {
842842

843843
/// Returns the number of seconds contained by this `Duration` as `f64`.
844844
///
845-
/// The returned value does include the fractional (nanosecond) part of the duration.
845+
/// The returned value includes the fractional (nanosecond) part of the duration.
846846
///
847847
/// # Examples
848848
/// ```
@@ -861,7 +861,7 @@ impl Duration {
861861

862862
/// Returns the number of seconds contained by this `Duration` as `f32`.
863863
///
864-
/// The returned value does include the fractional (nanosecond) part of the duration.
864+
/// The returned value includes the fractional (nanosecond) part of the duration.
865865
///
866866
/// # Examples
867867
/// ```
@@ -880,7 +880,7 @@ impl Duration {
880880

881881
/// Returns the number of milliseconds contained by this `Duration` as `f64`.
882882
///
883-
/// The returned value does include the fractional (nanosecond) part of the duration.
883+
/// The returned value includes the fractional (nanosecond) part of the duration.
884884
///
885885
/// # Examples
886886
/// ```
@@ -901,7 +901,7 @@ impl Duration {
901901

902902
/// Returns the number of milliseconds contained by this `Duration` as `f32`.
903903
///
904-
/// The returned value does include the fractional (nanosecond) part of the duration.
904+
/// The returned value includes the fractional (nanosecond) part of the duration.
905905
///
906906
/// # Examples
907907
/// ```

src/bootstrap/src/core/build_steps/test.rs

+14-12
Original file line numberDiff line numberDiff line change
@@ -1817,23 +1817,25 @@ NOTE: if you're sure you want to do this, please open an issue as to why. In the
18171817
cmd.arg("--gdb").arg(gdb);
18181818
}
18191819

1820-
let run = |cmd: &mut Command| {
1821-
cmd.output().map(|output| {
1822-
String::from_utf8_lossy(&output.stdout)
1823-
.lines()
1824-
.next()
1825-
.unwrap_or_else(|| panic!("{:?} failed {:?}", cmd, output))
1826-
.to_string()
1827-
})
1828-
};
1829-
18301820
let lldb_exe = builder.config.lldb.clone().unwrap_or_else(|| PathBuf::from("lldb"));
18311821
let lldb_version = Command::new(&lldb_exe)
18321822
.arg("--version")
18331823
.output()
1834-
.map(|output| String::from_utf8_lossy(&output.stdout).to_string())
1835-
.ok();
1824+
.map(|output| {
1825+
(String::from_utf8_lossy(&output.stdout).to_string(), output.status.success())
1826+
})
1827+
.ok()
1828+
.and_then(|(output, success)| if success { Some(output) } else { None });
18361829
if let Some(ref vers) = lldb_version {
1830+
let run = |cmd: &mut Command| {
1831+
cmd.output().map(|output| {
1832+
String::from_utf8_lossy(&output.stdout)
1833+
.lines()
1834+
.next()
1835+
.unwrap_or_else(|| panic!("{:?} failed {:?}", cmd, output))
1836+
.to_string()
1837+
})
1838+
};
18371839
cmd.arg("--lldb-version").arg(vers);
18381840
let lldb_python_dir = run(Command::new(&lldb_exe).arg("-P")).ok();
18391841
if let Some(ref dir) = lldb_python_dir {

src/tools/tidy/src/allowed_run_make_makefiles.txt

-8
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,6 @@ run-make/jobserver-error/Makefile
8282
run-make/libs-through-symlinks/Makefile
8383
run-make/libtest-json/Makefile
8484
run-make/libtest-junit/Makefile
85-
run-make/libtest-padding/Makefile
8685
run-make/libtest-thread-limit/Makefile
8786
run-make/link-cfg/Makefile
8887
run-make/link-framework/Makefile
@@ -100,8 +99,6 @@ run-make/macos-fat-archive/Makefile
10099
run-make/manual-link/Makefile
101100
run-make/metadata-dep-info/Makefile
102101
run-make/min-global-align/Makefile
103-
run-make/mingw-export-call-convention/Makefile
104-
run-make/mismatching-target-triples/Makefile
105102
run-make/missing-crate-dependency/Makefile
106103
run-make/mixing-libs/Makefile
107104
run-make/msvc-opt-minsize/Makefile
@@ -114,22 +111,18 @@ run-make/obey-crate-type-flag/Makefile
114111
run-make/optimization-remarks-dir-pgo/Makefile
115112
run-make/optimization-remarks-dir/Makefile
116113
run-make/output-type-permutations/Makefile
117-
run-make/override-aliased-flags/Makefile
118114
run-make/panic-abort-eh_frame/Makefile
119115
run-make/pass-linker-flags-flavor/Makefile
120116
run-make/pass-linker-flags-from-dep/Makefile
121117
run-make/pass-linker-flags/Makefile
122118
run-make/pass-non-c-like-enum-to-c/Makefile
123-
run-make/pdb-alt-path/Makefile
124119
run-make/pdb-buildinfo-cl-cmd/Makefile
125120
run-make/pgo-gen-lto/Makefile
126121
run-make/pgo-gen-no-imp-symbols/Makefile
127122
run-make/pgo-gen/Makefile
128123
run-make/pgo-indirect-call-promotion/Makefile
129124
run-make/pgo-use/Makefile
130125
run-make/pointer-auth-link-with-c/Makefile
131-
run-make/pretty-print-to-file/Makefile
132-
run-make/pretty-print-with-dep-file/Makefile
133126
run-make/print-calling-conventions/Makefile
134127
run-make/print-target-list/Makefile
135128
run-make/profile/Makefile
@@ -147,7 +140,6 @@ run-make/remap-path-prefix/Makefile
147140
run-make/reproducible-build-2/Makefile
148141
run-make/reproducible-build/Makefile
149142
run-make/return-non-c-like-enum-from-c/Makefile
150-
run-make/return-non-c-like-enum/Makefile
151143
run-make/rlib-chain/Makefile
152144
run-make/rlib-format-packed-bundled-libs-2/Makefile
153145
run-make/rlib-format-packed-bundled-libs-3/Makefile

tests/run-make/libtest-padding/Makefile

-14
This file was deleted.
+46
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
// Benchmarks, when ran as tests, would cause strange indentations
2+
// to appear in the output. This was because padding formatting was
3+
// applied before the conversion from bench to test, and not afterwards.
4+
// Now that this bug has been fixed in #118548, this test checks that it
5+
// does not make a resurgence by comparing the output of --bench with an
6+
// example stdout file.
7+
// See https://github.com/rust-lang/rust/issues/104092
8+
9+
//@ ignore-cross-compile
10+
// Reason: the compiled code is ran
11+
//@ needs-unwind
12+
// Reason: #[bench] requires -Z panic-abort-tests
13+
14+
use run_make_support::{diff, run_with_args, rustc};
15+
16+
fn main() {
17+
rustc().arg("--test").input("tests.rs").run();
18+
let out = run_with_args("tests", &["--test-threads=1"]).stdout_utf8();
19+
diff()
20+
.expected_file("test.stdout")
21+
.actual_text("actual-test-stdout", out)
22+
.normalize(
23+
// Replace all instances of (arbitrary numbers)
24+
// [1.2345 ns/iter (+/- 0.1234)]
25+
// with
26+
// [?? ns/iter (+/- ??)]
27+
r#"(\d+(?:[.,]\d+)*)\s*ns/iter\s*\(\+/-\s*(\d+(?:[.,]\d+)*)\)"#,
28+
"?? ns/iter (+/- ??)",
29+
)
30+
// Replace all instances of (arbitrary numbers)
31+
// finished in 8.0000 s
32+
// with
33+
// finished in ??
34+
.normalize(r#"finished\s+in\s+(\d+(?:\.\d+)*)"#, "finished in ??")
35+
.run();
36+
let out = run_with_args("tests", &["--test-threads=1", "--bench"]).stdout_utf8();
37+
diff()
38+
.expected_file("bench.stdout")
39+
.actual_text("actual-bench-stdout", out)
40+
.normalize(
41+
r#"(\d+(?:[.,]\d+)*)\s*ns/iter\s*\(\+/-\s*(\d+(?:[.,]\d+)*)\)"#,
42+
"?? ns/iter (+/- ??)",
43+
)
44+
.normalize(r#"finished\s+in\s+(\d+(?:\.\d+)*)"#, "finished in ??")
45+
.run();
46+
}

tests/run-make/mingw-export-call-convention/Makefile

-9
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
// On windows-gnu, symbol exporting used to fail to export names
2+
// with no_mangle. #72049 brought this feature up to par with msvc,
3+
// and this test checks that the symbol "bar" is successfully exported.
4+
// See https://github.com/rust-lang/rust/issues/50176
5+
6+
//@ only-x86_64-pc-windows-gnu
7+
8+
use run_make_support::{llvm_readobj, rustc};
9+
10+
fn main() {
11+
rustc().input("foo.rs").run();
12+
llvm_readobj().arg("--all").input("libfoo.dll.a").run().assert_stdout_contains("bar");
13+
}

tests/run-make/mismatching-target-triples/Makefile

-11
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
// In this test, foo links against 32-bit architecture, and then, bar, which depends
2+
// on foo, links against 64-bit architecture, causing a metadata mismatch due to the
3+
// differences in target architectures. This used to cause an internal compiler error,
4+
// now replaced by a clearer normal error message. This test checks that this aforementioned
5+
// error message is used.
6+
// See https://github.com/rust-lang/rust/issues/10814
7+
8+
use run_make_support::rustc;
9+
10+
fn main() {
11+
rustc().input("foo.rs").target("i686-unknown-linux-gnu").run();
12+
rustc().input("bar.rs").target("x86_64-unknown-linux-gnu").run_fail().assert_stderr_contains(
13+
r#"couldn't find crate `foo` with expected target triple x86_64-unknown-linux-gnu"#,
14+
);
15+
}

tests/run-make/override-aliased-flags/Makefile

-23
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
//@ ignore-cross-compile
2+
3+
use run_make_support::rustc;
4+
5+
// FIXME: it would be good to check that it's actually the rightmost flags
6+
// that are used when multiple flags are specified, but I can't think of a
7+
// reliable way to check this.
8+
fn main() {
9+
// Test that `-O` and `-C opt-level` can be specified multiple times.
10+
// The rightmost flag will be used over any previous flags.
11+
rustc().arg("-O").arg("-O").input("main.rs").run();
12+
rustc().arg("-O").arg("-C").arg("opt-level=0").input("main.rs").run();
13+
rustc().arg("-C").arg("opt-level=0").arg("-O").input("main.rs").run();
14+
rustc().arg("-C").arg("opt-level=0").arg("-C").arg("opt-level=2").input("main.rs").run();
15+
rustc().arg("-C").arg("opt-level=2").arg("-C").arg("opt-level=0").input("main.rs").run();
16+
17+
// Test that `-g` and `-C debuginfo` can be specified multiple times.
18+
// The rightmost flag will be used over any previous flags.
19+
rustc().arg("-g").arg("-g").input("main.rs").run();
20+
rustc().arg("-g").arg("-C").arg("debuginfo=0").input("main.rs").run();
21+
rustc().arg("-C").arg("debuginfo=0").arg("-g").input("main.rs").run();
22+
rustc().arg("-C").arg("debuginfo=0").arg("-C").arg("debuginfo=2").input("main.rs").run();
23+
rustc().arg("-C").arg("debuginfo=2").arg("-C").arg("debuginfo=0").input("main.rs").run();
24+
}

tests/run-make/pdb-alt-path/Makefile

-20
This file was deleted.

tests/run-make/pdb-alt-path/rmake.rs

+39
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
// The information inside a .exe file contains a string of the PDB file name.
2+
// This could be a security concern if the full path was exposed, as it could
3+
// reveal information about the filesystem where the bin was first compiled.
4+
// This should only be overridden by `-Clink-arg=/PDBALTPATH:...` - this test
5+
// checks that no full file paths are exposed and that the override flag is respected.
6+
// See https://github.com/rust-lang/rust/pull/121297
7+
8+
//@ only-x86_64-pc-windows-msvc
9+
10+
use run_make_support::{bin_name, invalid_utf8_contains, invalid_utf8_not_contains, run, rustc};
11+
12+
fn main() {
13+
// Test that we don't have the full path to the PDB file in the binary
14+
rustc()
15+
.input("main.rs")
16+
.arg("-g")
17+
.crate_name("my_crate_name")
18+
.crate_type("bin")
19+
.arg("-Cforce-frame-pointers")
20+
.run();
21+
invalid_utf8_contains(&bin_name("my_crate_name"), "my_crate_name.pdb");
22+
invalid_utf8_not_contains(&bin_name("my_crate_name"), r#"\my_crate_name.pdb"#);
23+
// Test that backtraces still can find debuginfo by checking that they contain symbol names and
24+
// source locations.
25+
let out = run(&bin_name("my_crate_name"));
26+
out.assert_stdout_contains("my_crate_name::fn_in_backtrace");
27+
out.assert_stdout_contains("main.rs:15");
28+
// Test that explicitly passed `-Clink-arg=/PDBALTPATH:...` is respected
29+
rustc()
30+
.input("main.rs")
31+
.arg("-g")
32+
.crate_name("my_crate_name")
33+
.crate_type("bin")
34+
.link_arg("/PDBALTPATH:abcdefg.pdb")
35+
.arg("-Cforce-frame-pointers")
36+
.run();
37+
invalid_utf8_contains(&bin_name("my_crate_name"), "abcdefg.pdb");
38+
invalid_utf8_not_contains(&bin_name("my_crate_name"), "my_crate_name.pdb");
39+
}

tests/run-make/pretty-print-to-file/Makefile

-5
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
// The "pretty-printer" of rustc translates source code into other formats,
2+
// which is useful for debugging. This test checks the "normal" version of
3+
// -Zunpretty, which should format the poorly formatted input.rs into a one-line
4+
// function identical to the one in input.pp.
5+
// See https://github.com/rust-lang/rust/commit/da25539c1ab295ec40261109557dd4526923928c
6+
7+
use run_make_support::{diff, rustc};
8+
9+
fn main() {
10+
rustc().output("input.out").arg("-Zunpretty=normal").input("input.rs").run();
11+
diff().expected_file("input.out").actual_file("input.pp").run();
12+
}

tests/run-make/pretty-print-with-dep-file/Makefile

-9
This file was deleted.

0 commit comments

Comments
 (0)