Skip to content

Some ty::sty values are being inferred as ast::ty_ #2316

Closed
@bleibig

Description

@bleibig

Consider this program:

use rustc;
import rustc::middle::ty;
fn main() {
    let _t: ty::sty = ty::ty_nil;
}

It fails to compile with this error:

infer_err.rs:4:22: 4:32 error: mismatched types: expected `rustc::middle::ty::sty` but found `rustsyntax::ast::ty_` (enum rustc::middle::ty::sty vs enum rustsyntax::ast::ty_)
infer_err.rs:4     let _t: ty::sty = ty::ty_nil;
                                     ^~~~~~~~~~

This happens for other ty::sty variants such as ty::ty_nil and ty::ty_bool, but not for ty::ty_type and possibly some others. It's also worth noting that this might only happen outside the rustc crate, as I could not reproduce this error by doing similar things inside rustc.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions