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

PhantomData<T> does not require bounds on T #459

Merged
merged 1 commit into from
Jul 22, 2016
Merged

PhantomData<T> does not require bounds on T #459

merged 1 commit into from
Jul 22, 2016

Conversation

dtolnay
Copy link
Member

@dtolnay dtolnay commented Jul 22, 2016

No description provided.

@@ -79,6 +79,13 @@ pub fn with_bound<F>(
}
impl visit::Visitor for FindTyParams {
fn visit_path(&mut self, path: &ast::Path, _id: ast::NodeId) {
if let Some(seg) = path.segments.last() {
if seg.identifier.name.as_str() == "PhantomData" {
Copy link
Member

Choose a reason for hiding this comment

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

While it's not great to implement a custom type called Phantom data, i think this should check the rest of the path, too.

Copy link
Member Author

Choose a reason for hiding this comment

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

I don't think we always get the full path here... but I will try it.

Copy link
Member

Choose a reason for hiding this comment

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

Oh..we're in the ast, i keep forgetting... Well, it's good enough :)

@oli-obk
Copy link
Member

oli-obk commented Jul 22, 2016

@homu r+

homu added a commit that referenced this pull request Jul 22, 2016
PhantomData<T> does not require bounds on T
@homu homu merged commit 3b7fa47 into master Jul 22, 2016
@dtolnay dtolnay deleted the phantom branch August 18, 2016 20:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants