Skip to content

Commit eca445e

Browse files
committed
Auto merge of #162510 - Zalathar:rollup-0hi6WtW, r=Zalathar
Rollup of 6 pull requests Successful merges: - #162482 (Make `run-make` testsuite work with other codegen backend than LLVM) - #161587 (Avoid invalid suggestion in case of macro expansion without inferrable generic type) - #162363 (Use correct `dir_path` when parsing module from path) - #162408 (add crashtests [7/N]) - #162502 (triagebot: Subscribe me to amdgpu changes) - #162505 (Revert "fuchsia: Add safestack as a supported sanitizer for x86_64 fuchsia")
2 parents 1edd55d + b2e166a commit eca445e

106 files changed

Lines changed: 416 additions & 13 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

compiler/rustc_expand/src/expand.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1382,7 +1382,11 @@ impl InvocationCollectorNode for Box<ast::Item> {
13821382
// This lets `parse_external_mod` catch cycles if it's self-referential.
13831383
let file_path = match inline {
13841384
Inline::Yes => None,
1385-
Inline::No { .. } => mod_file_path_from_attr(ecx.sess, &node.attrs, &dir_path),
1385+
Inline::No { .. } => mod_file_path_from_attr(
1386+
ecx.sess,
1387+
&node.attrs,
1388+
&ecx.current_expansion.module.dir_path,
1389+
),
13861390
};
13871391
(file_path, dir_path, dir_ownership)
13881392
}

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

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,7 @@ pub(crate) fn target() -> Target {
99
base.features = "+cmpxchg16b,+lahfsahf,+popcnt,+sse3,+sse4.1,+sse4.2,+ssse3".into();
1010
base.max_atomic_width = Some(128);
1111
base.stack_probes = StackProbeType::Inline;
12-
base.supported_sanitizers =
13-
SanitizerSet::ADDRESS | SanitizerSet::CFI | SanitizerSet::LEAK | SanitizerSet::SAFESTACK;
14-
base.default_sanitizers = SanitizerSet::SAFESTACK;
12+
base.supported_sanitizers = SanitizerSet::ADDRESS | SanitizerSet::CFI | SanitizerSet::LEAK;
1513
base.supports_xray = true;
1614

1715
Target {

compiler/rustc_trait_selection/src/error_reporting/infer/need_type_info.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -519,11 +519,13 @@ impl<'a, 'tcx> TypeErrCtxt<'a, 'tcx> {
519519
};
520520

521521
let mut local_visitor = FindInferSourceVisitor::new(self, typeck_results, term, ty);
522+
let mut body_from_expansion = false;
522523
if let Some(body) =
523524
self.tcx.hir_maybe_body_owned_by(self.tcx.typeck_root_def_id_local(body_def_id))
524525
{
525526
let expr = body.value;
526527
local_visitor.visit_expr(expr);
528+
body_from_expansion = body.value.span.from_expansion();
527529
}
528530

529531
let Some(InferSource { span, kind }) = local_visitor.infer_source else {
@@ -566,6 +568,7 @@ impl<'a, 'tcx> TypeErrCtxt<'a, 'tcx> {
566568
term,
567569
&arg_data,
568570
typeck_results,
571+
body_from_expansion,
569572
span,
570573
);
571574

@@ -705,6 +708,7 @@ impl<'tcx> InferSourceKind<'tcx> {
705708
term: Term<'tcx>,
706709
arg_data: &'local InferenceDiagnosticsData,
707710
typeck_results: &TypeckResults<'tcx>,
711+
body_from_expansion: bool,
708712
span: Span,
709713
) -> Option<SourceKindSubdiag<'local>>
710714
where
@@ -799,7 +803,7 @@ impl<'tcx> InferSourceKind<'tcx> {
799803
p.into_buffer()
800804
};
801805

802-
let suggestion = if have_turbofish {
806+
let suggestion = if have_turbofish || body_from_expansion {
803807
None
804808
} else if generic_args.len() == 1 && used_fallback {
805809
match param.kind {

src/tools/compiletest/src/runtest/run_make.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,11 @@ impl TestCx<'_> {
203203
// through a specific CI runner).
204204
.env("LLVM_COMPONENTS", &self.config.llvm_components);
205205

206+
if let Some(codegen_backend) = &self.config.override_codegen_backend {
207+
// In case it's a different codegen backend than LLVM.
208+
cmd.env("RUSTC_CODEGEN_BACKEND", codegen_backend.as_str());
209+
}
210+
206211
// The `run-make-cargo` and `build-std` suites need an in-tree `cargo`, `run-make` does not.
207212
if matches!(self.config.suite, TestSuite::RunMakeCargo | TestSuite::BuildStd) {
208213
cmd.env(

src/tools/run-make-support/src/external_deps/rustc.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,9 @@ pub fn rustc_path() -> String {
7676
fn setup_common() -> Command {
7777
let mut cmd = Command::new(rustc_path());
7878
set_host_compiler_dylib_path(&mut cmd);
79+
if let Ok(codegen_backend) = std::env::var("RUSTC_CODEGEN_BACKEND") {
80+
cmd.arg(format!("-Zcodegen-backend={codegen_backend}"));
81+
}
7982
cmd
8083
}
8184

tests/assembly-llvm/stack-protector/stack-protector-target-support.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -177,15 +177,13 @@
177177
//@ compile-flags: -C opt-level=2
178178

179179
#![crate_type = "lib"]
180-
#![feature(no_core, lang_items, sanitize)]
180+
#![feature(no_core, lang_items)]
181181
#![crate_type = "lib"]
182182
#![no_core]
183183

184184
extern crate minicore;
185185
use minicore::*;
186186

187-
// We only do this because we can't disable default sanitizers via compile-flags.
188-
#[sanitize(safestack = "off")]
189187
#[no_mangle]
190188
pub fn foo() {
191189
// CHECK: foo{{:|()}}

tests/crashes/140693.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
//@ known-bug: #140693
2+
#![crate_type = "sdylib"]
3+
4+
pub trait Trait {
5+
type Type;
6+
}
7+
pub struct S;
8+
9+
#[export_stable]
10+
pub extern "C" fn foo1(_x: <S as Trait>::Type) {}

tests/crashes/146210.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
//@ known-bug: #146210
2+
//@ edition: 2024
3+
//@ compile-flags: -Zvalidate-mir --crate-type lib
4+
use core::pin::Pin;
5+
6+
fn bar<T>(non_send: T) -> Pin<Box<dyn Future<Output = ()> + Send>> {
7+
Box::pin(async {
8+
non_send;
9+
})
10+
}

tests/crashes/146353.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
//@ known-bug: #146353
2+
const BIG_CHAIN: u8 = ();
3+
trait NeverSend = !Send;
4+
fn main() {}

tests/crashes/149015.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
//@ known-bug: #149015
2+
trait Trait1 {
3+
type Assoc;
4+
}
5+
6+
trait Trait2 {}
7+
8+
impl Trait1 for <dyn Trait2 as Trait1>::Assoc {
9+
type Assoc = ();
10+
}

0 commit comments

Comments
 (0)