Skip to content

rustdoc leaks MIR ConstValue representation of cross-crate const values that have an opaque type #113863

Open
@fmease

Description

@fmease

Minimized reproducer:

producer.rs (compiled with rustc producer.rs --crate-type=lib):

#![feature(type_alias_impl_trait)]

pub const K: Opaque = 12;

pub type Opaque = impl Trait;

pub trait Trait {}
impl Trait for i32 {}

consumer.rs (documented with rustdoc consumer.rs --edition=2021 --extern=producer=libproducer.rlib):

pub use producer::*;

Rendered output in doc/consumer/constant.K.html (notice the transmute part):

pub const K: impl Trait = 12; // {transmute(0x0000000c): producer::Opaque}

@rustbot label C-bug T-rustdoc F-type_alias_impl_trait A-cross-crate-reexports

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-cross-crate-reexportsArea: Documentation that has been re-exported from a different crateC-bugCategory: This is a bug.F-type_alias_impl_trait`#[feature(type_alias_impl_trait)]`T-rustdocRelevant to the rustdoc team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions