Skip to content

Conversation

@folkertdev
Copy link
Contributor

tracking issue: #48055

This came up in #144529 (comment).

The idea is that the layout of an unsized type is unstable (following the rust layout rules), and hence stable ABIs should not use unsized types. On stable, unsized types (or generics with a ?Sized bound) are not accepted as parameters, so the errors introduced by this PR can only be observed when the unstable unsized_fn_params feature is enabled.

r? @bjorn3
cc @RalfJung

@folkertdev folkertdev added the F-unsized_fn_params `#![feature(unsized_fn_params)]` label Oct 30, 2025
@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Oct 30, 2025
Comment on lines +59 to +60
extern "C" fn c_polymorphic<T: ?Sized>(_: T) {}
//~^ ERROR this function definition uses unsized type `[u8]` which is not supported with the chosen ABI
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The mention of [u8] here is a bit unfortunate, but I think it's the best we can do.

@bjorn3
Copy link
Member

bjorn3 commented Oct 30, 2025

Would have been nice if we could also get rid of the checks for unsized params in the call conv calculation code, but alas this checks runs after the call conv calculation code, so removing those checks would probably cause issues.

@bjorn3
Copy link
Member

bjorn3 commented Nov 4, 2025

@bors try @rust-timer queue

r=me if perf is neutral

@rust-timer

This comment has been minimized.

@rust-bors

This comment has been minimized.

rust-bors bot added a commit that referenced this pull request Nov 4, 2025
error on non-rustic ABIs using unsized parameters
@rustbot rustbot added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Nov 4, 2025
@rust-bors
Copy link

rust-bors bot commented Nov 4, 2025

☀️ Try build successful (CI)
Build commit: 6c023aa (6c023aae4513f7488ee0dd128e4cd69beca8309a, parent: 90b65889799733f21ebdf59d96411aa531c5900a)

@rust-timer

This comment has been minimized.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (6c023aa): comparison URL.

Overall result: ❌ regressions - no action needed

Benchmarking this pull request means it may be perf-sensitive – we'll automatically label it not fit for rolling up. You can override this, but we strongly advise not to, due to possible changes in compiler perf.

@bors rollup=never
@rustbot label: -S-waiting-on-perf -perf-regression

Instruction count

Our most reliable metric. Used to determine the overall result above. However, even this metric can be noisy.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
0.2% [0.2%, 0.2%] 1
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) - - 0

Max RSS (memory usage)

This benchmark run did not return any relevant results for this metric.

Cycles

Results (secondary -3.6%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-3.6% [-3.6%, -3.6%] 1
All ❌✅ (primary) - - 0

Binary size

This benchmark run did not return any relevant results for this metric.

Bootstrap: 476.459s -> 473.98s (-0.52%)
Artifact size: 390.66 MiB -> 390.71 MiB (0.01%)

@rustbot rustbot removed the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Nov 5, 2025
@bjorn3
Copy link
Member

bjorn3 commented Nov 5, 2025

@bors r+

@bors
Copy link
Collaborator

bors commented Nov 5, 2025

📌 Commit 52bfde2 has been approved by bjorn3

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Nov 5, 2025
bors added a commit that referenced this pull request Nov 5, 2025
error on non-rustic ABIs using unsized parameters

tracking issue: #48055

This came up in #144529 (comment).

The idea is that the layout of an unsized type is unstable (following the rust layout rules), and hence stable ABIs should not use unsized types. On stable, unsized types (or generics with a `?Sized` bound) are not accepted as parameters, so the errors introduced by this PR can only be observed when the unstable `unsized_fn_params` feature is enabled.

r? `@bjorn3`
cc `@RalfJung`
@bors
Copy link
Collaborator

bors commented Nov 5, 2025

⌛ Testing commit 52bfde2 with merge 345a2e1...

@rust-log-analyzer

This comment has been minimized.

@bors
Copy link
Collaborator

bors commented Nov 5, 2025

💔 Test failed - checks-actions

@bors bors added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Nov 5, 2025
@rustbot
Copy link
Collaborator

rustbot commented Nov 5, 2025

This PR was rebased onto a different master commit. Here's a range-diff highlighting what actually changed.

Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers.

@bjorn3
Copy link
Member

bjorn3 commented Nov 5, 2025

@bors r+

@bors
Copy link
Collaborator

bors commented Nov 5, 2025

📌 Commit 8e44e3f has been approved by bjorn3

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Nov 5, 2025
@bors
Copy link
Collaborator

bors commented Nov 5, 2025

⌛ Testing commit 8e44e3f with merge 1ef7943...

@bors
Copy link
Collaborator

bors commented Nov 5, 2025

☀️ Test successful - checks-actions
Approved by: bjorn3
Pushing 1ef7943 to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Nov 5, 2025
@bors bors merged commit 1ef7943 into rust-lang:master Nov 5, 2025
12 checks passed
@rustbot rustbot added this to the 1.93.0 milestone Nov 5, 2025
@github-actions
Copy link
Contributor

github-actions bot commented Nov 5, 2025

What is this? This is an experimental post-merge analysis report that shows differences in test outcomes between the merged PR and its parent PR.

Comparing 53efb3d (parent) -> 1ef7943 (this PR)

Test differences

Show 14 test diffs

Stage 0

  • errors::verify_monomorphize_abi_error_unsupported_unsized_parameter_9: [missing] -> pass (J1)
  • errors::verify_monomorphize_abi_error_unsupported_vector_type_10: [missing] -> pass (J1)
  • errors::verify_monomorphize_abi_error_unsupported_vector_type_9: pass -> [missing] (J1)
  • errors::verify_monomorphize_abi_required_target_feature_10: pass -> [missing] (J1)
  • errors::verify_monomorphize_abi_required_target_feature_11: [missing] -> pass (J1)

Stage 1

  • errors::verify_monomorphize_abi_error_unsupported_unsized_parameter_9: [missing] -> pass (J0)
  • errors::verify_monomorphize_abi_error_unsupported_vector_type_10: [missing] -> pass (J0)
  • errors::verify_monomorphize_abi_error_unsupported_vector_type_9: pass -> [missing] (J0)
  • errors::verify_monomorphize_abi_required_target_feature_10: pass -> [missing] (J0)
  • errors::verify_monomorphize_abi_required_target_feature_11: [missing] -> pass (J0)
  • [ui] tests/ui/abi/non-rustic-unsized.rs: [missing] -> pass (J1)

Stage 2

  • [ui] tests/ui/abi/non-rustic-unsized.rs: [missing] -> pass (J2)

Additionally, 2 doctest diffs were found. These are ignored, as they are noisy.

Job group index

Test dashboard

Run

cargo run --manifest-path src/ci/citool/Cargo.toml -- \
    test-dashboard 1ef7943ee607160a564655b6596f83670ef95df5 --output-dir test-dashboard

And then open test-dashboard/index.html in your browser to see an overview of all executed tests.

Job duration changes

  1. dist-x86_64-illumos: 8519.4s -> 6130.9s (-28.0%)
  2. dist-x86_64-apple: 7866.2s -> 6502.1s (-17.3%)
  3. dist-i686-linux: 7648.3s -> 6355.7s (-16.9%)
  4. x86_64-gnu-llvm-20-1: 3262.9s -> 3726.1s (+14.2%)
  5. aarch64-apple: 8858.0s -> 9900.7s (+11.8%)
  6. dist-x86_64-freebsd: 5663.0s -> 5026.6s (-11.2%)
  7. dist-aarch64-apple: 6319.8s -> 7020.2s (+11.1%)
  8. x86_64-gnu-llvm-20-3: 6109.8s -> 6773.6s (+10.9%)
  9. arm-android: 6432.9s -> 5766.0s (-10.4%)
  10. x86_64-rust-for-linux: 3070.8s -> 2759.8s (-10.1%)
How to interpret the job duration changes?

Job durations can vary a lot, based on the actual runner instance
that executed the job, system noise, invalidated caches, etc. The table above is provided
mostly for t-infra members, for simpler debugging of potential CI slow-downs.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (1ef7943): comparison URL.

Overall result: ❌ regressions - no action needed

@rustbot label: -perf-regression

Instruction count

Our most reliable metric. Used to determine the overall result above. However, even this metric can be noisy.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
0.1% [0.1%, 0.1%] 2
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) - - 0

Max RSS (memory usage)

Results (primary 0.5%, secondary -2.4%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
2.2% [2.2%, 2.2%] 1
Regressions ❌
(secondary)
2.1% [0.9%, 3.3%] 3
Improvements ✅
(primary)
-1.3% [-1.3%, -1.3%] 1
Improvements ✅
(secondary)
-3.6% [-5.3%, -1.7%] 11
All ❌✅ (primary) 0.5% [-1.3%, 2.2%] 2

Cycles

Results (primary -3.5%, secondary -1.3%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
4.3% [3.0%, 6.0%] 5
Improvements ✅
(primary)
-3.5% [-3.5%, -3.5%] 1
Improvements ✅
(secondary)
-5.3% [-9.5%, -1.8%] 7
All ❌✅ (primary) -3.5% [-3.5%, -3.5%] 1

Binary size

Results (secondary -0.0%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-0.0% [-0.0%, -0.0%] 1
All ❌✅ (primary) - - 0

Bootstrap: 473.384s -> 474.243s (0.18%)
Artifact size: 390.72 MiB -> 390.98 MiB (0.07%)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

F-unsized_fn_params `#![feature(unsized_fn_params)]` merged-by-bors This PR was explicitly merged by bors. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants