Skip to content

RFC: Keeping a stack of expressions in trans #681

@steveklabnik

Description

@steveklabnik

Issue by cmr
Friday Mar 28, 2014 at 05:12 GMT

For earlier discussion, see rust-lang/rust#13175

This issue was labelled with: B-RFC in the Rust repository


For rust-lang/rust#13146, adding the lint is easy, but getting a span to a useful place is very difficult. I propose we keep a stack of expressions being translated by pushing the ast::Expr to a task-local stack in expr::trans and expr::trans_into. Then trans_intrinsic could look up that stack for an expression with a useful span, and could even print out everything (including type params) that led to the substitution failure. I think this will be helpful if #8 gets merged, too.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions