Skip to content

ty: is_trivially_not_async_drop todo! ICE on ty::UnsafeBinder #609

Description

@SebTardif

Bug

Ty::is_trivially_not_async_drop hits todo!() on ty::UnsafeBinder(_). Ty::is_async_drop always consults this fast path before is_async_drop_raw, so any query of whether an unsafe-binder type implements AsyncDrop ICEs.

Sibling trivial predicates (is_trivially_freeze, is_trivially_unpin) treat UnsafeBinder as non-trivial (false / not in the pure-true arms) rather than panicking. Without TyCtxt in this method we cannot erase binder regions, so the conservative fix is => false (not known to be !AsyncDrop).

Affected code

compiler/rustc_middle/src/ty/util.rs (is_trivially_not_async_drop)

Impact

ICE (I-crash) on the unstable unsafe_binder feature when async-drop queries reach binder types. Distinct from #525 (pointer_kind in cast.rs) and from the #567 remaining-table sites (validity, mangling, rustc_public, normalizes_to, consts).

Origin

Lines Commit Date Author
1304-1305 9a1c5eb5b385 2024-12-21 Michael Goulet

Suggested fix

Replace todo!() with false, matching the conservative handling used for other non-trivial type kinds in this match.

Related

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-type-systemType systemI-crashUnexpected panic or crashP-mediumMedium impact: affects specific usage patternsbugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions