Skip to content

Commit 43ca9d1

Browse files
committedFeb 8, 2025·
Auto merge of rust-lang#136747 - matthiaskrgr:rollup-qfiiv4n, r=matthiaskrgr
Rollup of 6 pull requests Successful merges: - rust-lang#135696 (std: move `io` module out of `pal`, get rid of `sys_common::io`) - rust-lang#136099 (Optimize `Rc::<str>::default()` implementation) - rust-lang#136200 (Generate correct terminate block under Wasm EH) - rust-lang#136626 (create `initial_rustdoc` field in `Build`) - rust-lang#136657 (Make empty-line-after an early clippy lint) - rust-lang#136679 (ci: Use largedisk for loongarch) r? `@ghost` `@rustbot` modify labels: rollup
2 parents 73bf794 + 45771e4 commit 43ca9d1

Some content is hidden

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

64 files changed

+857
-802
lines changed
 

‎compiler/rustc_codegen_ssa/src/mir/block.rs

+23-6
Original file line numberDiff line numberDiff line change
@@ -1708,15 +1708,32 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
17081708
let mut cs_bx = Bx::build(self.cx, llbb);
17091709
let cs = cs_bx.catch_switch(None, None, &[cp_llbb]);
17101710

1711-
// The "null" here is actually a RTTI type descriptor for the
1712-
// C++ personality function, but `catch (...)` has no type so
1713-
// it's null. The 64 here is actually a bitfield which
1714-
// represents that this is a catch-all block.
17151711
bx = Bx::build(self.cx, cp_llbb);
17161712
let null =
17171713
bx.const_null(bx.type_ptr_ext(bx.cx().data_layout().instruction_address_space));
1718-
let sixty_four = bx.const_i32(64);
1719-
funclet = Some(bx.catch_pad(cs, &[null, sixty_four, null]));
1714+
1715+
// The `null` in first argument here is actually a RTTI type
1716+
// descriptor for the C++ personality function, but `catch (...)`
1717+
// has no type so it's null.
1718+
let args = if base::wants_msvc_seh(self.cx.sess()) {
1719+
// This bitmask is a single `HT_IsStdDotDot` flag, which
1720+
// represents that this is a C++-style `catch (...)` block that
1721+
// only captures programmatic exceptions, not all SEH
1722+
// exceptions. The second `null` points to a non-existent
1723+
// `alloca` instruction, which an LLVM pass would inline into
1724+
// the initial SEH frame allocation.
1725+
let adjectives = bx.const_i32(0x40);
1726+
&[null, adjectives, null] as &[_]
1727+
} else {
1728+
// Specifying more arguments than necessary usually doesn't
1729+
// hurt, but the `WasmEHPrepare` LLVM pass does not recognize
1730+
// anything other than a single `null` as a `catch (...)` block,
1731+
// leading to problems down the line during instruction
1732+
// selection.
1733+
&[null] as &[_]
1734+
};
1735+
1736+
funclet = Some(bx.catch_pad(cs, args));
17201737
} else {
17211738
llbb = Bx::append_block(self.cx, self.llfn, "terminate");
17221739
bx = Bx::build(self.cx, llbb);

‎compiler/rustc_lint/src/early.rs

+8
Original file line numberDiff line numberDiff line change
@@ -246,6 +246,14 @@ impl<'ast, 'ecx, 'tcx, T: EarlyLintPass> ast_visit::Visitor<'ast>
246246
}
247247
}
248248
ast_visit::walk_assoc_item(cx, item, ctxt);
249+
match ctxt {
250+
ast_visit::AssocCtxt::Trait => {
251+
lint_callback!(cx, check_trait_item_post, item);
252+
}
253+
ast_visit::AssocCtxt::Impl => {
254+
lint_callback!(cx, check_impl_item_post, item);
255+
}
256+
}
249257
});
250258
}
251259

0 commit comments

Comments
 (0)