Skip to content
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

Don't crash on non-existent path in constant. #28686

Merged
merged 1 commit into from
Oct 2, 2015

Conversation

eefriedman
Copy link
Contributor

The behavior here isn't really ideal, but we can't really do much better
given the current state of constant evaluation.

The changes to ExprUseVisitor are to avoid a compile error; apparently
that bit of code is extremely sensitive to changes in other areas of the
compiler.

Fixes #28670, and probably a bunch of duplicates.

@rust-highfive
Copy link
Collaborator

r? @nikomatsakis

(rust_highfive has picked a reviewer for you, use r? to override)

// FIXME: There's probably a better way to make sure we don't
// panic here.
if def.depth != 0 {
signal!(e, NonConstPath);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You could extend the error enum to have a specific variant for this situation, as NonConstPath signifies a valid but not constant path imo

@bors
Copy link
Contributor

bors commented Sep 30, 2015

☔ The latest upstream changes (presumably #28702) made this pull request unmergeable. Please resolve the merge conflicts.

The behavior here isn't really ideal, but we can't really do much better
given the current state of constant evaluation.

Fixes rust-lang#28670, and probably a bunch of duplicates.
@eefriedman eefriedman force-pushed the unresolved-path-error branch from cc743f1 to 1763fcb Compare September 30, 2015 22:06
@eefriedman
Copy link
Contributor Author

Updated with a new error kind and better comments.

@nikomatsakis
Copy link
Contributor

@bors r+ rollup

@bors
Copy link
Contributor

bors commented Oct 1, 2015

📌 Commit 1763fcb has been approved by nikomatsakis

steveklabnik added a commit to steveklabnik/rust that referenced this pull request Oct 1, 2015
…=nikomatsakis

The behavior here isn't really ideal, but we can't really do much better
given the current state of constant evaluation.

The changes to ExprUseVisitor are to avoid a compile error; apparently
that bit of code is extremely sensitive to changes in other areas of the
compiler.

Fixes rust-lang#28670, and probably a bunch of duplicates.
bors added a commit that referenced this pull request Oct 2, 2015
Manishearth added a commit to Manishearth/rust that referenced this pull request Oct 2, 2015
…=nikomatsakis

The behavior here isn't really ideal, but we can't really do much better
given the current state of constant evaluation.

The changes to ExprUseVisitor are to avoid a compile error; apparently
that bit of code is extremely sensitive to changes in other areas of the
compiler.

Fixes rust-lang#28670, and probably a bunch of duplicates.
bors added a commit that referenced this pull request Oct 2, 2015
@bors bors merged commit 1763fcb into rust-lang:master Oct 2, 2015
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

Successfully merging this pull request may close these issues.

5 participants