Skip to content

update to rustc 1.98#612

Draft
Firestar99 wants to merge 6 commits into
mainfrom
nightly-2026-06-09
Draft

update to rustc 1.98#612
Firestar99 wants to merge 6 commits into
mainfrom
nightly-2026-06-09

Conversation

@Firestar99

Copy link
Copy Markdown
Member

Requires #610

Warning

This is an in-the-middle nightly

Notable changes:

  • This commit does a few cleanups, assuming ScalarPairs are passed by PassMode::ScalarPair exclusively. But rust-gpu readjusts the fn abi here to pass any non-slice ScalarPair as PassMode::Direct. Removing this ABI change breaks a bunch of code in all kinds of weird ways, primarily ByteAddressableBuffer intrinsics and panic!() format args decompiler complaining about function pointers and pointer casts. It's just that rust-gpu can't properly handle PassMode::ScalarPair in so many places... So we'll keep our abi adjustments and I just undo that upstream cleanup.

close #605

@Firestar99 Firestar99 requested review from LegNeato and eddyb as code owners June 9, 2026 10:53
@Firestar99 Firestar99 marked this pull request as draft June 9, 2026 10:53
@Firestar99 Firestar99 mentioned this pull request Jun 9, 2026
@Firestar99 Firestar99 changed the title Nightly 2026 06 09 update to nightly-2026-06-09 Jun 9, 2026
Base automatically changed from rustc_1_97 to main June 10, 2026 09:27
@Firestar99 Firestar99 force-pushed the nightly-2026-06-09 branch from 92c6cd5 to 442f98b Compare June 10, 2026 10:39
@Firestar99 Firestar99 changed the title update to nightly-2026-06-09 update to rustc 1.98 Jun 25, 2026
@Firestar99 Firestar99 force-pushed the nightly-2026-06-09 branch from 442f98b to 0e0dc17 Compare June 25, 2026 13:19
@Firestar99

Firestar99 commented Jun 25, 2026

Copy link
Copy Markdown
Member Author

Going from working nightly-2026-06-12 (rust-lang/rust@b30f3df) to nighty-2026-06-13 (rust-lang/rust@6540795) causes our compiletests to break due to some upstream change I can't identify.

The only two PRs that change anything in rustc_codegen_ssa in that range are:

UPDATE: We can fix the compiletests by just removing this flag:

-        "-Cdebuginfo=2",

This flag is responsible for controlling debug symbol emission, 2 means all the debug symbols and it defaults to 0 (I think) meaning none.

How the hell does turning on debug symbol emission cause fundamental compilation errors?

    fn create_function_debug_context(
        &self,
        _instance: Instance<'tcx>,
        _fn_abi: &FnAbi<'tcx, Ty<'tcx>>,
        _llfn: Self::Function,
        _mir: &mir::Body<'tcx>,
    ) -> Option<FunctionDebugContext<'tcx, Self::DIScope, Self::DILocation>> {
        // TODO: This is ignored. Do we want to implement this at some point?
        None
    }
  • Notice how it returns an Option and we always return None? With the debug symbol refactor, codegen backends can't choose to just return None and disable debug info emission. Whether to emit or not is exclusively determined by the debuginfo flag. Which is why I had to remove a bunch of todo!()s in all our dbg fn impls.
  • To correctly emit debug information, the new cg_ssa impl needs to monomorphise inlined functions, which causes them to be emitted to our codegen backend. Specifically, I see a lot of <usize>::unchecked_add calling <usize>::unchecked_add::precondition_check with a &str as an argument.
  • That &str value is a [u8] constant, which are represented as a RuntimeArray in rust-gpu's codegen and not well supported. Eventually it hits this zombification, erroring with error: unsupported unsized [u8] constant.

I beliebe the fix I made here is only a temporary fix, I suspect any debug build of sufficient complexity will fail. Don't yet know what to do about that.

@Firestar99 Firestar99 force-pushed the nightly-2026-06-09 branch 2 times, most recently from a05ddca to 7df0ab3 Compare June 25, 2026 15:27
@Firestar99 Firestar99 force-pushed the nightly-2026-06-09 branch from 7df0ab3 to f9b1b4c Compare June 25, 2026 15:33
@Firestar99 Firestar99 force-pushed the nightly-2026-06-09 branch from f9b1b4c to a6bf7bf Compare June 26, 2026 08:55
@Firestar99

Copy link
Copy Markdown
Member Author

Instead of opting out compiletests from debug info, I decided to just patch out the newest changes to debuginfo emission

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Update Rust toolchain

1 participant