Skip to content

Commit fe348cd

Browse files
committed
Auto merge of rust-lang#140797 - matthiaskrgr:rollup-3km95qh, r=matthiaskrgr
Rollup of 5 pull requests Successful merges: - rust-lang#140736 (trait selection: check `&` before suggest remove deref) - rust-lang#140755 ([win][arm64] Disable various DebugInfo tests that don't work on Arm64 Windows) - rust-lang#140756 ([arm64] Pointer auth test should link with C static library statically) - rust-lang#140758 ([win][arm64] Disable MSVC Linker 'Arm Hazard' warning) - rust-lang#140759 ([win][arm64] Disable std::fs tests that require symlinks) r? `@ghost` `@rustbot` modify labels: rollup
2 parents e964cca + 7fc43e5 commit fe348cd

File tree

10 files changed

+80
-2
lines changed

10 files changed

+80
-2
lines changed

compiler/rustc_target/src/spec/targets/aarch64_pc_windows_msvc.rs

+6-1
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,15 @@
1-
use crate::spec::{Target, TargetMetadata, base};
1+
use crate::spec::{LinkerFlavor, Lld, Target, TargetMetadata, base};
22

33
pub(crate) fn target() -> Target {
44
let mut base = base::windows_msvc::opts();
55
base.max_atomic_width = Some(128);
66
base.features = "+v8a,+neon,+fp-armv8".into();
77

8+
// MSVC emits a warning about code that may trip "Cortex-A53 MPCore processor bug #843419" (see
9+
// https://developer.arm.com/documentation/epm048406/latest) which is sometimes emitted by LLVM.
10+
// Since Arm64 Windows 10+ isn't supported on that processor, it's safe to disable the warning.
11+
base.add_pre_link_args(LinkerFlavor::Msvc(Lld::No), &["/arm64hazardfree"]);
12+
813
Target {
914
llvm_target: "aarch64-pc-windows-msvc".into(),
1015
metadata: TargetMetadata {

compiler/rustc_trait_selection/src/error_reporting/traits/suggestions.rs

+6
Original file line numberDiff line numberDiff line change
@@ -1516,6 +1516,12 @@ impl<'a, 'tcx> TypeErrCtxt<'a, 'tcx> {
15161516
} else {
15171517
expr.span.with_hi(expr.span.lo() + BytePos(1))
15181518
};
1519+
1520+
match self.tcx.sess.source_map().span_to_snippet(span) {
1521+
Ok(snippet) if snippet.starts_with("&") => {}
1522+
_ => break 'outer,
1523+
}
1524+
15191525
suggestions.push((span, String::new()));
15201526

15211527
let ty::Ref(_, inner_ty, _) = suggested_ty.kind() else {

library/std/src/fs/tests.rs

+16
Original file line numberDiff line numberDiff line change
@@ -730,6 +730,10 @@ fn recursive_mkdir_empty() {
730730
}
731731

732732
#[test]
733+
#[cfg_attr(
734+
all(windows, target_arch = "aarch64"),
735+
ignore = "SymLinks not enabled on Arm64 Windows runners https://github.com/actions/partner-runner-images/issues/94"
736+
)]
733737
fn recursive_rmdir() {
734738
let tmpdir = tmpdir();
735739
let d1 = tmpdir.join("d1");
@@ -749,6 +753,10 @@ fn recursive_rmdir() {
749753
}
750754

751755
#[test]
756+
#[cfg_attr(
757+
all(windows, target_arch = "aarch64"),
758+
ignore = "SymLinks not enabled on Arm64 Windows runners https://github.com/actions/partner-runner-images/issues/94"
759+
)]
752760
fn recursive_rmdir_of_symlink() {
753761
// test we do not recursively delete a symlink but only dirs.
754762
let tmpdir = tmpdir();
@@ -1533,6 +1541,10 @@ fn file_open_not_found() {
15331541
}
15341542

15351543
#[test]
1544+
#[cfg_attr(
1545+
all(windows, target_arch = "aarch64"),
1546+
ignore = "SymLinks not enabled on Arm64 Windows runners https://github.com/actions/partner-runner-images/issues/94"
1547+
)]
15361548
fn create_dir_all_with_junctions() {
15371549
let tmpdir = tmpdir();
15381550
let target = tmpdir.join("target");
@@ -2011,6 +2023,10 @@ fn test_rename_symlink() {
20112023

20122024
#[test]
20132025
#[cfg(windows)]
2026+
#[cfg_attr(
2027+
all(windows, target_arch = "aarch64"),
2028+
ignore = "SymLinks not enabled on Arm64 Windows runners https://github.com/actions/partner-runner-images/issues/94"
2029+
)]
20142030
fn test_rename_junction() {
20152031
let tmpdir = tmpdir();
20162032
let original = tmpdir.join("original");

src/tools/compiletest/src/directive-list.rs

+1
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ const KNOWN_DIRECTIVE_NAMES: &[&str] = &[
3535
"ignore-32bit",
3636
"ignore-64bit",
3737
"ignore-aarch64",
38+
"ignore-aarch64-pc-windows-msvc",
3839
"ignore-aarch64-unknown-linux-gnu",
3940
"ignore-aix",
4041
"ignore-android",

tests/debuginfo/step-into-match.rs

+4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
//@ compile-flags: -g
22
//@ ignore-android: FIXME(#10381)
33

4+
// On Arm64 Windows, stepping at the end of a function on goes to the callsite, not the instruction
5+
// after it.
6+
//@ ignore-aarch64-pc-windows-msvc: Stepping out of functions behaves differently.
7+
48
// === GDB TESTS ==============================================================
59

610
// gdb-command: r

tests/debuginfo/type-names.rs

+2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
//@ ignore-lldb
22

3+
//@ ignore-aarch64-pc-windows-msvc: Arm64 Windows cdb doesn't support JavaScript extensions.
4+
35
// GDB changed the way that it formatted Foreign types
46
//@ min-gdb-version: 9.2
57

tests/run-make/pointer-auth-link-with-c/test.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#[link(name = "test")]
1+
#[link(name = "test", kind = "static")]
22
extern "C" {
33
fn foo() -> i32;
44
}

tests/ui/runtime/backtrace-debuginfo.rs

+4
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,13 @@ macro_rules! dump_and_die {
4242
// there, even on i686-pc-windows-msvc. We do the best we can in
4343
// rust-lang/rust to test it as well, but sometimes we just gotta keep
4444
// landing PRs.
45+
//
46+
// aarch64-msvc is broken as its backtraces are truncated.
47+
// See https://github.com/rust-lang/rust/issues/140489
4548
if cfg!(any(target_os = "android",
4649
all(target_os = "linux", target_arch = "arm"),
4750
all(target_env = "msvc", target_arch = "x86"),
51+
all(target_env = "msvc", target_arch = "aarch64"),
4852
target_os = "freebsd",
4953
target_os = "dragonfly",
5054
target_os = "openbsd")) {
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
trait Trait {}
2+
3+
struct Chars;
4+
impl Trait for Chars {}
5+
6+
struct FlatMap<T>(T);
7+
impl<T: Trait> std::fmt::Debug for FlatMap<T> {
8+
fn fmt(&self, _: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
9+
unimplemented!()
10+
}
11+
}
12+
13+
fn lol() {
14+
format_args!("{:?}", FlatMap(&Chars));
15+
//~^ ERROR the trait bound `&Chars: Trait` is not satisfied [E0277]
16+
}
17+
18+
fn main() {}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
error[E0277]: the trait bound `&Chars: Trait` is not satisfied
2+
--> $DIR/suggest-remove-deref-issue-140166.rs:14:26
3+
|
4+
LL | format_args!("{:?}", FlatMap(&Chars));
5+
| ---- ^^^^^^^^^^^^^^^ the trait `Trait` is not implemented for `&Chars`
6+
| |
7+
| required by a bound introduced by this call
8+
|
9+
= help: the trait `Trait` is implemented for `Chars`
10+
note: required for `FlatMap<&Chars>` to implement `Debug`
11+
--> $DIR/suggest-remove-deref-issue-140166.rs:7:16
12+
|
13+
LL | impl<T: Trait> std::fmt::Debug for FlatMap<T> {
14+
| ----- ^^^^^^^^^^^^^^^ ^^^^^^^^^^
15+
| |
16+
| unsatisfied trait bound introduced here
17+
note: required by a bound in `core::fmt::rt::Argument::<'_>::new_debug`
18+
--> $SRC_DIR/core/src/fmt/rt.rs:LL:COL
19+
20+
error: aborting due to 1 previous error
21+
22+
For more information about this error, try `rustc --explain E0277`.

0 commit comments

Comments
 (0)