Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
157 commits
Select commit Hold shift + click to select a range
ba59342
make conflicting_repr_hints a hard error
RalfJung Oct 31, 2026
1ea503d
Prepare for merging from rust-lang/rust
workflows-miri[bot] Nov 10, 2026
be6f854
Merge ref 'ac8310ba643a' from rust-lang/rust
workflows-miri[bot] Nov 10, 2026
5aefb50
windows SetFileInformationByHandle: use stream_len to get current fil…
RalfJung Nov 10, 2026
e142b37
Merge pull request #5607 from rust-lang/rustup-2026-11-10
RalfJung Nov 10, 2026
ab74d54
Merge pull request #5608 from RalfJung/win-SetFileInformationByHandle
RalfJung Nov 10, 2026
0df5544
Rename `this` to `ecx` in shared socket code
WhySoBad Nov 9, 2026
9c41b09
Rename `this` to `ecx` in socket address shim
WhySoBad Nov 9, 2026
a8edb52
Rename `this` to `ecx` in TCP socket shim
WhySoBad Nov 9, 2026
f34c014
Rename `this` to `ecx` in virtual socket shim
WhySoBad Nov 9, 2026
8afbd0f
Merge pull request #5606 from WhySoBad/socket-this-to-ecx
RalfJung Nov 10, 2026
adaa069
rename this -> ecx in sse41, sse42 intrinsics and time shims
programskillforverification Nov 10, 2026
4d5dd2c
Merge pull request #5610 from programskillforverification/this-to-ecx-4
RalfJung Nov 10, 2026
a8eef01
update triagebot config
RalfJung Nov 10, 2026
41c2b0c
Merge pull request #5612 from RalfJung/triagebot
RalfJung Nov 10, 2026
14e5bd7
rename this -> ecx in poll, sync, thread unix shims and unwind shims
Enfey Nov 10, 2026
0160fd6
Prepare for merging from rust-lang/rust
workflows-miri[bot] Nov 11, 2026
915c8c1
Merge ref '9c5648833e5c' from rust-lang/rust
workflows-miri[bot] Nov 11, 2026
d1c1e29
Merge pull request #5613 from Enfey/rename-this-to-ecx-shims
RalfJung Nov 11, 2026
9eb356b
bless priroda tests
RalfJung Nov 11, 2026
3e91a2c
Merge pull request #5614 from rust-lang/rustup-2026-11-11
RalfJung Nov 11, 2026
e8e856e
Add libc direct tests for unlink and symlink
mehmettoplu-rs Nov 7, 2026
6a8c605
slightly extend test
RalfJung Nov 11, 2026
28b06a6
allow more slack in macos semaphore timeout test
RalfJung Nov 11, 2026
9406beb
Merge pull request #5584 from mehmettoplu-rs/test-unlink-symlink
RalfJung Nov 11, 2026
dc58d21
Add libc direct tests for pthread_atfork and sched_yield
mehmettoplu-rs Nov 11, 2026
2e73ebb
Prepare for merging from rust-lang/rust
workflows-miri[bot] Nov 13, 2026
aea078f
Merge ref '8eb778d04094' from rust-lang/rust
workflows-miri[bot] Nov 13, 2026
94ce7d2
fix lockfile workaround when min-publish-age is set
RalfJung Nov 13, 2026
0a4afdd
bless priroda
RalfJung Nov 13, 2026
417a15d
Merge pull request #5622 from rust-lang/rustup-2026-11-13
RalfJung Nov 13, 2026
ec3d5c5
Merge pull request #5616 from mehmettoplu-rs/test-sched-yield-pthread…
RalfJung Nov 15, 2026
dd95c16
some more this -> ecx
RalfJung Nov 15, 2026
fbb781c
Merge pull request #5627 from RalfJung/ecx
RalfJung Nov 15, 2026
f394280
NULL-terminate argv and add direct tests for _NSGetArgc and _NSGetArgv
mehmettoplu-rs Nov 13, 2026
b6255ac
Extend miri_start_with_std test to check argv[argc] is null
mehmettoplu-rs Nov 15, 2026
39e3586
tweak test
RalfJung Nov 15, 2026
49bc5f3
Merge pull request #5624 from mehmettoplu-rs/argv-null-terminator
RalfJung Nov 15, 2026
7a0aab9
Use symbolic alignment checking in the allocator tests
saethlin Nov 13, 2026
0e902ad
Merge pull request #5625 from saethlin/windows-allocator-symbolic-ali…
saethlin Nov 15, 2026
52ba0a8
Add non-blocking `write` and `send` support for UDP sockets
WhySoBad Oct 19, 2026
3cdd90b
Add non-blocking `read` and `recv` support for UDP sockets, add I/O t…
WhySoBad Oct 19, 2026
5a852b5
Rename `make_listener` libc helper to `make_tcp_listener`
WhySoBad Nov 2, 2026
374819d
Fix x86 dot-product reduction order and signed zero
Kaileshwar16 Nov 10, 2026
14ef98d
Merge pull request #5609 from Kaileshwar16/issue-5599-dot-product
RalfJung Nov 16, 2026
a150369
implement unlinkat to support fs::remove_dir_all
programskillforverification Nov 11, 2026
1a1e3ce
Add libc direct test for abort
mehmettoplu-rs Nov 16, 2026
7078a59
Prepare for merging from rust-lang/rust
workflows-miri[bot] Nov 17, 2026
370e5c8
Merge ref '5df8c02afdf6' from rust-lang/rust
workflows-miri[bot] Nov 17, 2026
b39cd33
Merge pull request #5636 from rust-lang/rustup-2026-11-17
RalfJung Nov 17, 2026
0510b1f
Merge pull request #5414 from programskillforverification/unix-unlinkat
RalfJung Nov 17, 2026
37288a4
triagebot: enable merge command
RalfJung Nov 17, 2026
9607ce1
minor tweaks
RalfJung Nov 17, 2026
e3f9e04
Merge pull request #5637 from RalfJung/triagebot
RalfJung Nov 17, 2026
9fbdb74
Merge pull request #5634 from mehmettoplu-rs/test-abort
RalfJung Nov 17, 2026
67c45b2
Merge pull request #5507 from WhySoBad/udp-non-blocking-io
RalfJung Nov 17, 2026
94bcd6d
s390x: replace -Ctarget-feature=+backchain with -Cforce-frame-pointers
fneddy Sep 24, 2026
94c2406
Test GetCurrentProcessId and _NSGetEnviron directly
Kaileshwar16 Nov 10, 2026
0bc008a
track pthread_attr_t stack size and fail pthread_create for huge stacks
programskillforverification Nov 9, 2026
119733c
tweak thread_stack_size_ok
RalfJung Nov 17, 2026
fe2968c
Merge pull request #5601 from programskillforverification/pthread-att…
rustbot Nov 17, 2026
27c1921
miri: use wrapping multiplication when computing element addresses fo…
eduardosm Nov 17, 2026
d6eb2b5
Merge pull request #5639 from eduardosm/gather-failure
RalfJung Nov 17, 2026
68906fb
windows tests: print_safe should not be needed
RalfJung Nov 17, 2026
ad25332
Merge pull request #5640 from RalfJung/win-print
RalfJung Nov 17, 2026
218e753
portable-sim tests: ensure that float ops are non-deterministic
RalfJung Nov 17, 2026
3bf85fe
[Priroda] Normalize MIR local IDs in UI test output
moabo3li Nov 17, 2026
692201e
[Priroda] Stop asserting unnamed dead MIR locals in the UI output
moabo3li Nov 17, 2026
da58a61
[Priroda] Document what the locals command lists
moabo3li Nov 17, 2026
7565191
move windows tests to their own folder
RalfJung Nov 17, 2026
43a20d3
Merge pull request #5643 from RalfJung/simd-float-nondet
RalfJung Nov 17, 2026
3a842be
Merge pull request #5626 from Kaileshwar16/test/3179-direct-win-macos…
RalfJung Nov 17, 2026
dee9bd8
Prepare for merging from rust-lang/rust
RalfJung Nov 17, 2026
7c09ebf
Merge ref '59cbdee2e7b3' from rust-lang/rust
RalfJung Nov 17, 2026
afc1997
add #[optimize] attribute tests
RalfJung Nov 17, 2026
6c3be76
Merge pull request #5644 from RalfJung/opt-attr
RalfJung Nov 17, 2026
a1ce554
[Priroda] Normalize standard-library paths in UI fixtures
moabo3li Nov 17, 2026
5ffc473
Prepare for merging from rust-lang/rust
workflows-miri[bot] Nov 18, 2026
0b09fbc
Merge ref 'ac7bce927202' from rust-lang/rust
workflows-miri[bot] Nov 18, 2026
828c560
fix genmc build
RalfJung Nov 18, 2026
5bc8443
do not mix backend and rust intrinsics
RalfJung Nov 18, 2026
239c8bf
Merge pull request #5647 from rust-lang/rustup-2026-11-18
RalfJung Nov 18, 2026
ee70d48
Lower to `hir::Param`s for extern functions
JonathanBrouwer Nov 18, 2026
db1eea4
Add regression test for `NON_SNAKE_CASE` in foreign fns
JonathanBrouwer Nov 18, 2026
939ac24
Add regression test `lint-check-params.rs`
JonathanBrouwer Nov 18, 2026
dc272b3
Test SYS_accept4 directly on Linux
Kaileshwar16 Nov 18, 2026
d6c7b46
make MetaObj opaque by default
RalfJung Nov 18, 2026
1fd2f0b
Merge pull request #5650 from RalfJung/meta-opaque
RalfJung Nov 18, 2026
e9dd805
Add `r? @ghost` for Josh push PRs
Kobzol Nov 18, 2026
8ca417b
Merge pull request #5653 from Kobzol/josh-push-msg
RalfJung Nov 18, 2026
eea8bf0
Test accept4 syscall and libc accept through shared cases
Kaileshwar16 Nov 19, 2026
6dfbd68
Implement mkdirat for Dir::create_dir
mehmettoplu-rs Nov 19, 2026
f96baed
fix asin value range
RalfJung Nov 19, 2026
cbfed63
fix atan2 NAN handling
RalfJung Nov 19, 2026
bab3e77
Merge pull request #5659 from RalfJung/asin
RalfJung Nov 19, 2026
d025ca0
Add avx512 shift intrinsics
TDecking Nov 19, 2026
354004b
Merge pull request #5651 from TDecking/avx512
rustbot Nov 19, 2026
e86400c
Test append mode with seek and reads
darkraider01 Nov 16, 2026
0a2a775
dont run broken seek-based emulation of pwrite for O_APPEND files
RalfJung Nov 19, 2026
72b2f56
Add support for blocking `send` to UDP socket shim
WhySoBad Nov 10, 2026
753d084
Add support for blocking `recv` to UDP socket shim, add blocking I/O …
WhySoBad Nov 12, 2026
5b0c763
Merge pull request #5635 from darkraider01/rename-shims-ecx
rustbot Nov 19, 2026
eef56f9
shims/fs tests: also test append mode
RalfJung Nov 19, 2026
748ab15
windows: test creating without writing, and dont falsely set append flag
RalfJung Nov 19, 2026
7c89832
migrate Windows API tests to windows-sys
programskillforverification Nov 20, 2026
08fd6cc
Merge pull request #5655 from programskillforverification/migrate-win…
rustbot Nov 20, 2026
b286dd4
windows/fs: ensure bad read/write requests get rejected
RalfJung Nov 19, 2026
6c60271
libc/fs: test and fix O_CREAT on read-only open
RalfJung Nov 19, 2026
1b58c16
Merge pull request #5646 from moabo3li/priroda-local-id-normalization
oli-obk Nov 20, 2026
d7b3011
Merge pull request #5660 from RalfJung/test-append
RalfJung Nov 20, 2026
042d32c
Merge pull request #5638 from WhySoBad/udp-blocking-io
rustbot Nov 20, 2026
3e9646b
inline the parts of rustc_tools_util that we use
RalfJung Nov 20, 2026
d54e23b
rename env vars for more consistency
RalfJung Nov 20, 2026
3f47dc0
Merge pull request #5664 from RalfJung/rustc_tools_util
RalfJung Nov 20, 2026
e01e4a6
Revert some comment changes
GuillaumeGomez Nov 20, 2026
060746c
Share the implementation of mkdirat with mkdir
mehmettoplu-rs Nov 20, 2026
9457684
Reject non-default modes in mkdir and mkdirat on non-Unix hosts
mehmettoplu-rs Nov 20, 2026
4599931
Use `core::ptr` in `implicit_provenance_casts` help for `no_std` crates
bardiharborow Nov 21, 2026
fb8daf9
minor tweaks
RalfJung Nov 21, 2026
ad44765
all syscalls seem to have tests now
RalfJung Nov 21, 2026
3a25a8c
Merge pull request #5649 from Kaileshwar16/test/3179-direct-sys-accept4
rustbot Nov 21, 2026
21d97db
Stop passing `-Ztrim-paths` to cargo now that it's stable in beta
Zalathar Nov 21, 2026
951c3bd
Add `#[must_use]` to `Ip*Addr::as_octets` methods
bardiharborow Nov 21, 2026
de01d5e
Merge pull request #5658 from mehmettoplu-rs/mkdirat
rustbot Nov 21, 2026
81961a1
floats test: add missing f128 FIXMEs
RalfJung Nov 21, 2026
4f2dca0
Move `rustdoc-ui` tests in the right folder
GuillaumeGomez Nov 21, 2026
e39a46f
rustc_diagnostic_item macros added on some iter functions
voodookiidoo Nov 21, 2026
1e5a59e
add read_int helper and use it to simplify some code in time, fs, soc…
RalfJung Nov 21, 2026
e991f56
clean up remaining to_(u)int
RalfJung Nov 21, 2026
583bea8
use write_int where appropriate
RalfJung Nov 21, 2026
b833c1f
addrinfo: propagate type information through shim
RalfJung Nov 21, 2026
86cf36e
Merge pull request #5667 from RalfJung/read_int
RalfJung Nov 21, 2026
5f6ba93
Include Build IDs in VEXos executables
lewisfm Nov 21, 2026
01f36ec
Use aggregate comparison for const array/slice patterns
jakubadamw Nov 22, 2026
456b3c7
Add lint against duplicate parameter names in fns without body
annieversary Nov 22, 2026
424489c
Fix clippy lint `IGNORED_UNIT_PATTERNS`
JonathanBrouwer Nov 22, 2026
2bd564d
Add bootstrap gate to the lint doctest
JonathanBrouwer Nov 22, 2026
6108ccf
Remove `make_cmdline`
Zalathar Nov 20, 2026
13448e6
Remove `TestCx::charset`
Zalathar Nov 21, 2026
efbbb7a
Don't forcibly set RUSTC when loading test directives
Zalathar Nov 21, 2026
ee4ff22
update lockfile
RalfJung Nov 20, 2026
6e8d3ad
enable more std tests in Miri :)
RalfJung Nov 20, 2026
f73aba8
dont try mutating the original working directory
RalfJung Nov 20, 2026
3ca3d2e
Rollup merge of #166266 - RalfJung:miri, r=RalfJung
JonathanBrouwer Nov 22, 2026
56f8470
Rollup merge of #155216 - jakubadamw:issue-110870-103073, r=dianne
JonathanBrouwer Nov 22, 2026
5aa9de9
Rollup merge of #166142 - JonathanBrouwer:param4, r=kivooeo
JonathanBrouwer Nov 22, 2026
7a410c5
Rollup merge of #163315 - fneddy:s390x_framepointer, r=wesleywiser
JonathanBrouwer Nov 22, 2026
17f05f8
Rollup merge of #165238 - RalfJung:conflicting_repr_hints, r=mejrs
JonathanBrouwer Nov 22, 2026
80ffbed
Rollup merge of #165366 - annieversary:duplicate-parameter-names, r=J…
JonathanBrouwer Nov 22, 2026
47ef372
Rollup merge of #166269 - GuillaumeGomez:revert-comment-changes, r=Ra…
JonathanBrouwer Nov 22, 2026
34b275b
Rollup merge of #166287 - bardiharborow:implicit-provenance-casts-no-…
JonathanBrouwer Nov 22, 2026
bba27c6
Rollup merge of #166306 - Zalathar:trim-paths, r=Urgau
JonathanBrouwer Nov 22, 2026
e64a712
Rollup merge of #166309 - bardiharborow:ip-as-octets-must-use, r=Mark…
JonathanBrouwer Nov 22, 2026
c340dcc
Rollup merge of #166313 - GuillaumeGomez:rustdoc-ui-cleanup, r=fmease
JonathanBrouwer Nov 22, 2026
5d486cb
Rollup merge of #166315 - voodookiidoo:diag_items, r=Mark-Simulacrum
JonathanBrouwer Nov 22, 2026
c6e56a4
Rollup merge of #166331 - vexide:lewisfm/vexos-build-id, r=hanna-kruppe
JonathanBrouwer Nov 22, 2026
e719fb6
Rollup merge of #166349 - Zalathar:compiletest-misc, r=jieyouxu
JonathanBrouwer Nov 22, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
9 changes: 1 addition & 8 deletions Cargo.lock
Original file line number Diff line number Diff line change
Expand Up @@ -462,7 +462,6 @@ dependencies = [
"cargo_metadata 0.23.1",
"directories",
"rustc-build-sysroot",
"rustc_tools_util 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)",
"rustc_version",
"serde",
"serde_json",
Expand Down Expand Up @@ -667,7 +666,7 @@ dependencies = [
"itertools",
"pulldown-cmark",
"regex",
"rustc_tools_util 0.4.2",
"rustc_tools_util",
"serde",
"serde_json",
"tempfile",
Expand Down Expand Up @@ -4907,12 +4906,6 @@ dependencies = [
name = "rustc_tools_util"
version = "0.4.2"

[[package]]
name = "rustc_tools_util"
version = "0.4.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a3b75158011a63889ba12084cf1224baad7bcad50f6ee7c842f772b74aa148ed"

[[package]]
name = "rustc_trait_selection"
version = "0.0.0"
Expand Down
7 changes: 3 additions & 4 deletions compiler/rustc_ast_lowering/src/item.rs
Original file line number Diff line number Diff line change
Expand Up @@ -637,16 +637,15 @@ impl<'hir> LoweringContext<'_, 'hir> {
let (generics, (decl, fn_args)) = self.lower_generics(generics, itctx, |this| {
(
// Disallow `impl Trait` in foreign items.
// Parameters are discarded because foreign functions don't have a body
this.lower_fn_decl(
fdec,
i.id,
hir_id,
FnDeclKind::ExternFn,
None,
DiscardParams::Yes,
DiscardParams::No,
),
this.lower_fn_params_to_idents(fdec),
this.lower_fn_params(fdec),
)
});

Expand Down Expand Up @@ -1253,7 +1252,7 @@ impl<'hir> LoweringContext<'_, 'hir> {
body_id
}

fn lower_param(&mut self, param: &Param) -> hir::Param<'hir> {
pub(super) fn lower_param(&mut self, param: &Param) -> hir::Param<'hir> {
let hir_id = self.lower_node_id(param.id);
self.lower_attrs(hir_id, &param.attrs, param.span, AstTarget::Param(param));
hir::Param {
Expand Down
9 changes: 9 additions & 0 deletions compiler/rustc_ast_lowering/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1954,6 +1954,15 @@ impl<'hir> LoweringContext<'_, 'hir> {
))
}

fn lower_fn_params(&mut self, decl: &FnDecl) -> &'hir [hir::Param<'hir>] {
self.arena.alloc_from_iter(
decl.inputs
.iter()
.filter(|param| !param.is_const_param())
.map(|param| self.lower_param(param)),
)
}

/// Lowers a function declaration.
///
/// `decl`: the unlowered (AST) function declaration.
Expand Down
2 changes: 2 additions & 0 deletions compiler/rustc_attr_ir/src/lang_items.rs
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,8 @@ language_item_table! {
AlignOf, sym::mem_align_const, align_const, Target::AssocConst(AssocCtxt::Trait), GenericRequirement::Exact(0);
SizeOf, sym::mem_size_const, size_const, Target::AssocConst(AssocCtxt::Trait), GenericRequirement::Exact(0);
OffsetOf, kw::OffsetOf, offset_of, Target::Fn, GenericRequirement::Exact(1);
RawEq, sym::raw_eq, raw_eq, Target::Fn, GenericRequirement::Exact(1);
CompareBytes, sym::compare_bytes, compare_bytes, Target::Fn, GenericRequirement::Exact(0);
/// Trait injected by `#[derive(PartialEq)]`, (i.e. "Partial EQ").
StructuralPeq, sym::structural_peq, structural_peq_trait, Target::Trait, GenericRequirement::None;
Debug, sym::debug, debug_trait, Target::Trait, GenericRequirement::Exact(0);
Expand Down
47 changes: 32 additions & 15 deletions compiler/rustc_codegen_llvm/src/attributes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,11 @@ pub(crate) fn frame_pointer(sess: &Session) -> FramePointer {
if let InstrumentMcount::Mcount(_) = opts.unstable_opts.instrument_mcount {
fp.ratchet(FramePointer::Always);
}
fp.ratchet(opts.cg.force_frame_pointers);
// On s390x, `-Cforce-frame-pointers` opts in to the `backchain` LLVM function attribute
// (set in `s390x_fn_attrs`) instead of the generic `frame-pointer` attribute.
if !(sess.target.arch == Arch::S390x) {
fp.ratchet(opts.cg.force_frame_pointers);
}
fp
}

Expand Down Expand Up @@ -410,34 +414,44 @@ fn stackprotector_attr<'ll>(cx: &SimpleCx<'ll>, sess: &Session) -> Option<Attrib
Some(sspattr.create_attr(cx.llcx))
}

fn packed_stack_attr<'ll>(
/// s390x specific function attributes
/// - `-Cforce-frame-pointers` emits "backchain"
/// - "backchain" + "packed_stack" enforces "softfloat"
fn s390x_fn_attrs<'ll>(
cx: &SimpleCx<'ll>,
sess: &Session,
function_attributes: &[TargetFeature],
) -> Option<Attribute<'ll>> {
fn_target_features: &[TargetFeature],
) -> Vec<Attribute<'ll>> {
if sess.target.arch != Arch::S390x {
return None;
return vec![];
}

let mut attrs = Vec::new();

// `-Cforce-frame-pointers` enables `backchain`
let have_backchain = sess.opts.cg.force_frame_pointers != FramePointer::MayOmit;
if have_backchain {
attrs.push(llvm::CreateAttrString(cx.llcx, "backchain"));
}

// only continue if we have packed_stack
if !sess.opts.unstable_opts.packed_stack {
return None;
return attrs;
}

// The backchain and softfloat flags can be set via -Ctarget-features=...
// or via #[target_features(enable = ...)] so we have to check both possibilities
let have_backchain = sess.internal_target_features.contains(&sym::backchain)
|| function_attributes.iter().any(|feature| feature.name == sym::backchain);
let have_softfloat = sess.internal_target_features.contains(&sym::soft_float)
|| function_attributes.iter().any(|feature| feature.name == sym::soft_float);
|| fn_target_features.iter().any(|f| f.name == sym::soft_float);

// If both, backchain and packedstack, are enabled LLVM cannot generate valid function entry points
// with the default ABI. However if the softfloat flag is set LLVM will switch to the softfloat
// ABI, where this works.
if have_backchain && !have_softfloat {
sess.dcx().emit_err(PackedStackBackchainNeedsSoftfloat);
return None;
return attrs;
}

Some(llvm::CreateAttrString(cx.llcx, "packed-stack"))
attrs.push(llvm::CreateAttrString(cx.llcx, "packed-stack"));
attrs
}

pub(crate) fn target_cpu_attr<'ll>(cx: &SimpleCx<'ll>, sess: &Session) -> Attribute<'ll> {
Expand Down Expand Up @@ -666,9 +680,12 @@ pub(crate) fn llfn_attrs_from_instance<'ll, 'tcx>(
if let Some(align) = codegen_fn_attrs.alignment {
llvm::set_alignment(llfn, align);
}
if let Some(packed_stack) = packed_stack_attr(cx, sess, &codegen_fn_attrs.target_features) {
to_add.push(packed_stack);

// Apply and check s390x-specific attributes: backchain and packed-stack.
if sess.target.arch == Arch::S390x {
to_add.extend(s390x_fn_attrs(cx, sess, &codegen_fn_attrs.target_features));
}

to_add.extend(patchable_function_entry_attrs(
cx,
sess,
Expand Down
4 changes: 2 additions & 2 deletions compiler/rustc_codegen_llvm/src/diagnostics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -252,9 +252,9 @@ pub(crate) struct FixedX18InvalidArch<'a> {
}

#[derive(Diagnostic)]
#[diag("`-Zpacked-stack` is incompatible with `backchain` target feature")]
#[diag("`-Zpacked-stack` is incompatible with `-Cforce-frame-pointers` on s390x")]
#[note(
"enabling both `-Zpacked-stack` and the `backchain` target feature is incompatible with the default s390x ABI. Switch to s390x-unknown-none-softfloat if you need both attributes"
"`-Zpacked-stack` and `-Cforce-frame-pointers` is incompatible with the default s390x ABI (note that force-frame-pointers is implemented via backchain)"
)]
pub(crate) struct PackedStackBackchainNeedsSoftfloat;

Expand Down
7 changes: 1 addition & 6 deletions compiler/rustc_hir/src/hir.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4876,12 +4876,7 @@ impl ForeignItem<'_> {
#[derive(Debug, Clone, Copy, StableHash)]
pub enum ForeignItemKind<'hir> {
/// A foreign function.
///
/// All argument idents are actually always present (i.e. `Some`), but
/// `&[Option<Ident>]` is used because of code paths shared with `TraitFn`
/// and `FnPtrTy`. The sharing is due to all of these cases not allowing
/// arbitrary patterns for parameters.
Fn(FnSig<'hir>, &'hir [Option<Ident>], &'hir Generics<'hir>),
Fn(FnSig<'hir>, &'hir [Param<'hir>], &'hir Generics<'hir>),
/// A foreign static item (`static ext: u8`).
Static(&'hir Ty<'hir>, Mutability, Safety),
/// A foreign type.
Expand Down
6 changes: 3 additions & 3 deletions compiler/rustc_hir/src/intravisit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -690,11 +690,11 @@ pub fn walk_foreign_item<'v, V: Visitor<'v>>(
try_visit!(visitor.visit_ident(*ident));

match *kind {
ForeignItemKind::Fn(ref sig, param_idents, ref generics) => {
ForeignItemKind::Fn(ref sig, params, ref generics) => {
try_visit!(visitor.visit_generics(generics));
try_visit!(visitor.visit_fn_decl(sig.decl));
for ident in param_idents.iter().copied() {
visit_opt!(visitor, visit_ident, ident);
for param in params {
try_visit!(visitor.visit_param(param));
}
}
ForeignItemKind::Static(ref typ, _, _) => {
Expand Down
24 changes: 20 additions & 4 deletions compiler/rustc_hir_pretty/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -519,14 +519,15 @@ impl<'a> State<'a> {
self.maybe_print_comment(item.span.lo());
self.print_attrs(self.attrs(item.hir_id()));
match item.kind {
hir::ForeignItemKind::Fn(sig, arg_idents, generics) => {
hir::ForeignItemKind::Fn(sig, params, generics) => {
let (cb, ib) = self.head("");
self.print_fn(
sig.header,
Some(item.ident.name),
generics,
sig.decl,
arg_idents,
&[],
params,
None,
);
self.end(ib);
Expand Down Expand Up @@ -660,7 +661,15 @@ impl<'a> State<'a> {
}
hir::ItemKind::Fn { ident, sig, generics, body, .. } => {
let (cb, ib) = self.head("");
self.print_fn(sig.header, Some(ident.name), generics, sig.decl, &[], Some(body));
self.print_fn(
sig.header,
Some(ident.name),
generics,
sig.decl,
&[],
&[],
Some(body),
);
self.word(" ");
self.end(ib);
self.end(cb);
Expand Down Expand Up @@ -984,7 +993,7 @@ impl<'a> State<'a> {
arg_idents: &[Option<Ident>],
body_id: Option<hir::BodyId>,
) {
self.print_fn(m.header, Some(ident.name), generics, m.decl, arg_idents, body_id);
self.print_fn(m.header, Some(ident.name), generics, m.decl, arg_idents, &[], body_id);
}

fn print_trait_item(&mut self, ti: &hir::TraitItem<'_>) {
Expand Down Expand Up @@ -2280,7 +2289,9 @@ impl<'a> State<'a> {
name: Option<Symbol>,
generics: &hir::Generics<'_>,
decl: &hir::FnDecl<'_>,
// Will take from one of these three for the param names
arg_idents: &[Option<Ident>],
params: &[hir::Param<'_>],
body_id: Option<hir::BodyId>,
) {
self.print_fn_header_info(header);
Expand Down Expand Up @@ -2308,6 +2319,10 @@ impl<'a> State<'a> {
s.word(":");
s.space();
}
} else if let Some(param) = params.get(i) {
s.print_param(param);
s.word(":");
s.space();
} else if let Some(body_id) = body_id {
s.ann.nested(s, Nested::BodyParamPat(body_id, i));
s.word(":");
Expand Down Expand Up @@ -2618,6 +2633,7 @@ impl<'a> State<'a> {
generics,
decl,
arg_idents,
&[],
None,
);
self.end(ib);
Expand Down
15 changes: 8 additions & 7 deletions compiler/rustc_hir_typeck/src/fn_ctxt/checks.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2142,14 +2142,16 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
is_method: bool,
) -> Option<(IndexVec<ExpectedIdx, (Option<GenericIdx>, FnParam<'_>)>, &hir::Generics<'_>)>
{
let (sig, generics, body_id, params) = match self.tcx.hir_get_if_local(def_id)? {
let (sig, generics, params, idents) = match self.tcx.hir_get_if_local(def_id)? {
hir::Node::TraitItem(&hir::TraitItem {
generics,
kind: hir::TraitItemKind::Fn(sig, trait_fn),
..
}) => match trait_fn {
hir::TraitFn::Required(params) => (sig, generics, None, Some(params)),
hir::TraitFn::Provided(body) => (sig, generics, Some(body), None),
hir::TraitFn::Provided(body) => {
(sig, generics, Some(self.tcx.hir_body(body).params), None)
}
},
hir::Node::ImplItem(&hir::ImplItem {
generics,
Expand All @@ -2159,11 +2161,11 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
| hir::Node::Item(&hir::Item {
kind: hir::ItemKind::Fn { sig, generics, body, .. },
..
}) => (sig, generics, Some(body), None),
}) => (sig, generics, Some(self.tcx.hir_body(body).params), None),
hir::Node::ForeignItem(&hir::ForeignItem {
kind: hir::ForeignItemKind::Fn(sig, params, generics),
..
}) => (sig, generics, None, Some(params)),
}) => (sig, generics, Some(params), None),
_ => return None,
};

Expand All @@ -2184,10 +2186,9 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
None
}
});
let mut params_with_generics: IndexVec<ExpectedIdx, _> = match (body_id, params) {
let mut params_with_generics: IndexVec<ExpectedIdx, _> = match (params, idents) {
(Some(_), Some(_)) | (None, None) => unreachable!(),
(Some(body), None) => {
let params = self.tcx.hir_body(body).params;
(Some(params), None) => {
let params = params
.get(is_method as usize..params.len() - sig.decl.c_variadic() as usize)?;
debug_assert_eq!(params.len(), fn_inputs.len());
Expand Down
Loading
Loading