Skip to content

type_id is not crate-independent with object associated types #35144

Open
@arielb1

Description

@arielb1

Meta

$ rustc -V
rustc 1.12.0-dev (5556554e2 2016-07-31)

STR

#![feature(core_intrinsics, rustc_private)]

#[cfg(arena_first)]
extern crate arena;
extern crate term;
#[cfg(not(arena_first))]
extern crate arena;

use std::intrinsics::type_id;

fn main() { unsafe {
    println!("same={:?} different={:?}",
        type_id::<arena::TypedArena<()>>(),
        type_id::<Iterator<Item=arena::TypedArena<()>>>()
    );
}}  

Any pair of crates, one of them with a struct, can be used instead of arena/term.

Expected Result

The Type ID of Iterator<Item=arena::TypedArena<()>> should be the same when the cfg is toggled.

Actual Result

The Type ID of Iterator<Item=arena::TypedArena<()>> differs when the cfg is toggled, but the id of arena::TypedArena<()> does not

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-trait-systemArea: Trait systemC-bugCategory: This is a bug.E-needs-testCall for participation: An issue has been fixed and does not reproduce, but no test has been added.T-compilerRelevant to the compiler 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