Skip to content

Region#subst ICE with certain uses of 'self #7331

Closed

Description

Stripped-down and updated version of original source:

pub trait Interner<T> {
    fn new() -> Self;
    fn get(&'self self, tag: uint) -> Option<&'self T>;
}

pub struct SimpleInterner<T: Eq + IterBytes + Hash + Clone>;

impl<T> Interner<T> for SimpleInterner<T> {
    pub fn new() -> SimpleInterner<T> { SimpleInterner }
    pub fn get(&'self self, tag: uint) -> Option<&'self T> { None }
}
% rustc --version
/Users/fklock/opt/rust-dbg/bin/rustc 0.9-pre (97cd495 2013-10-02 01:16:31 -0700)
host: x86_64-apple-darwin
% rustc --lib /tmp/s.rs
error: internal compiler error: ty::Region#subst(): Reference to self region when given substs with no self region: substs(regions=[], self_ty=Some(BUG[1u]), tps=[T])

Original bug report: https://gist.github.com/pnkfelix/6905109

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

Metadata

Assignees

No one assigned

    Labels

    A-lifetimesArea: Lifetimes / regionsA-typesystemArea: The type systemI-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions