Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

interpret: change ABI-compat test to be type-based #115699

Merged
merged 7 commits into from
Sep 12, 2023

Conversation

RalfJung
Copy link
Member

@RalfJung RalfJung commented Sep 9, 2023

This makes the test consistent across targets. Otherwise the chances are very high that ABI mismatches get accepted on x86_64 but still fail on many other targets with more complicated ABIs.

This implements (most of) the rules described in #115476.

@rustbot
Copy link
Collaborator

rustbot commented Sep 9, 2023

r? @oli-obk

(rustbot has picked a reviewer for you, use r? to override)

@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 Sep 9, 2023
@rustbot
Copy link
Collaborator

rustbot commented Sep 9, 2023

Some changes occurred to the CTFE / Miri engine

cc @rust-lang/miri

The Miri subtree was changed

cc @rust-lang/miri

Some changes occurred to the CTFE / Miri engine

cc @rust-lang/miri

@RalfJung RalfJung force-pushed the interpret-abi-compat branch 2 times, most recently from 8773102 to d45c7ec Compare September 9, 2023 11:28
@RalfJung RalfJung force-pushed the interpret-abi-compat branch from d45c7ec to e001209 Compare September 9, 2023 13:38
@RalfJung RalfJung mentioned this pull request Sep 9, 2023
10 tasks
@@ -2743,7 +2745,7 @@ impl<'tcx> Ty<'tcx> {
| ty::Tuple(..) => (tcx.types.unit, false),

ty::Str | ty::Slice(_) => (tcx.types.usize, false),
ty::Dynamic(..) => {
ty::Dynamic(_, _, DynKind::Dyn) => {
Copy link
Member Author

Choose a reason for hiding this comment

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

This looks like a pretty serious bug in ptr_metadata_ty caused by Dyn and DynStar using the same type constructor.

fn unfold_npo(&self, ty: Ty<'tcx>) -> InterpResult<'tcx, Ty<'tcx>> {
// Check if this is `Option` wrapping some type.
let inner_ty = match ty.kind() {
ty::Adt(def, args) if self.tcx.is_diagnostic_item(sym::Option, def.did()) => {
Copy link
Contributor

Choose a reason for hiding this comment

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

using a diagnostic_item for this is somewhat fishy, but since it only decides whether code is ok or not, it seems ok. We just need to avoid using these for behaviour changes.

@oli-obk
Copy link
Contributor

oli-obk commented Sep 11, 2023

@bors r+

@bors
Copy link
Contributor

bors commented Sep 11, 2023

📌 Commit e68e9d4 has been approved by oli-obk

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 Sep 11, 2023
@bors
Copy link
Contributor

bors commented Sep 12, 2023

⌛ Testing commit e68e9d4 with merge 366dab1...

@bors
Copy link
Contributor

bors commented Sep 12, 2023

☀️ Test successful - checks-actions
Approved by: oli-obk
Pushing 366dab1 to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Sep 12, 2023
@bors bors merged commit 366dab1 into rust-lang:master Sep 12, 2023
@rustbot rustbot added this to the 1.74.0 milestone Sep 12, 2023
@RalfJung RalfJung deleted the interpret-abi-compat branch September 12, 2023 05:44
@rust-timer
Copy link
Collaborator

Finished benchmarking commit (366dab1): comparison URL.

Overall result: no relevant changes - no action needed

@rustbot label: -perf-regression

Instruction count

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

Max RSS (memory usage)

Results

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

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

Cycles

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

Binary size

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

Bootstrap: 631.339s -> 631.819s (0.08%)
Artifact size: 317.84 MiB -> 317.87 MiB (0.01%)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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.

5 participants