Skip to content

How to sync rustc_abi with the "current" stable release #14846

@Veykril

Description

@Veykril

We now have support for calculating layouts of types which is a great thing to have, but there is a problem here. Type layouts are not stable so ideally the latest r-a we offer should work with the latest stable's type layout while the rustup releases should work with the corresponding rustc_abi crate there.

Currently we just try to do the former and the rustup releases are bound to just be out of sync with the toolchains actual layout (unless nothing changed over a version).

This is an interesting problem to have, and an important one to fix as with const eval being able to make use of this via `mem::size_of`` and friends, users will run into diagnostics due to mismatches and more. How can we solve this?

A simple somewhat working approach would be to just have current master always work with the latest stable version of the layout crate and patching upstream whenever a beta branch is done to use the upstream crate there. That will at least give us correct stable version matches, but ideally we would handle all releases (nightly as well) properly. That is somewhat tricky to do though since the crate has no stable API. Maybe we can abstract things so that we can have a feature toggle whether to use the upstream crate or the crates.io clone?

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-layoutMemory layout of typesA-rustcissues regarding the rustc codebase and rustc private cratesBroken WindowBugs / technical debt to be addressed immediatelyC-tracking-issueCategory: tracking issueE-hardS-unactionableIssue requires feedback, design decisions or is blocked on other work

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions