Skip to content

Use more precise span when checking type definitions #26221

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

Merged
merged 2 commits into from
Jun 12, 2015

Conversation

sanxiyn
Copy link
Member

@sanxiyn sanxiyn commented Jun 11, 2015

When checking field types of struct or enum definitions, use spans for field types instead of the entire item.

@rust-highfive
Copy link
Contributor

r? @alexcrichton

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

scope: ast::NodeId,
cache: Option<&'cx mut HashSet<Ty<'tcx>>>)
-> BoundsChecker<'cx,'tcx> {
BoundsChecker { fcx: fcx, span: span, scope: scope,
BoundsChecker { fcx: fcx, span: DUMMY_SP, scope: scope,
Copy link
Member

Choose a reason for hiding this comment

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

If this span field is never used, can it be deleted? If it is used, it seems odd to use DUMMY_SP here?

Copy link
Member Author

Choose a reason for hiding this comment

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

After the patch, it is used, but not initialized here.

@alexcrichton
Copy link
Member

r? @nikomatsakis or @pnkfelix

@arielb1
Copy link
Contributor

arielb1 commented Jun 11, 2015

@bors r+

@bors
Copy link
Collaborator

bors commented Jun 11, 2015

📌 Commit 412977d has been approved by arielb1

@bors
Copy link
Collaborator

bors commented Jun 11, 2015

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

@arielb1
Copy link
Contributor

arielb1 commented Jun 11, 2015

Needs a rebase.

@arielb1
Copy link
Contributor

arielb1 commented Jun 11, 2015

Actually, thinking about it, I would also want tests that this feature works on both structs and enums, both tuple-like and dictionary-like.

@bors
Copy link
Collaborator

bors commented Jun 12, 2015

🔒 Merge conflict

@sanxiyn
Copy link
Member Author

sanxiyn commented Jun 12, 2015

Rebased and added tests.

@alexcrichton
Copy link
Member

@bors: r=arielb1 793d9fc

bors added a commit that referenced this pull request Jun 12, 2015
When checking field types of struct or enum definitions, use spans for field types instead of the entire item.
@bors
Copy link
Collaborator

bors commented Jun 12, 2015

⌛ Testing commit 793d9fc with merge 1671b9b...

@bors bors merged commit 793d9fc into rust-lang:master Jun 12, 2015
@sanxiyn sanxiyn deleted the wf-span branch June 13, 2015 02:30
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.

6 participants