Skip to content

RFC: Keeping a stack of expressions in trans #681

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
steveklabnik opened this issue Jan 21, 2015 · 2 comments
Closed

RFC: Keeping a stack of expressions in trans #681

steveklabnik opened this issue Jan 21, 2015 · 2 comments

Comments

@steveklabnik
Copy link
Member

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.

@Stebalien
Copy link
Contributor

@cmr is this still relevant after MIR?

@eddyb
Copy link
Member

eddyb commented Aug 19, 2016

The original problem (generic proxy of transmute) no longer exists, nor do we want to have monomorphization errors/lints, at least nothing like this.
And yeah, with MIR this would have a different design anyway (among other things, it would have to be done during the collector, not the regular trans, which is no longer recursive).

@eddyb eddyb closed this as completed Aug 19, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants