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

Add to resolve's public API #34655

Merged
merged 2 commits into from
Jul 7, 2016
Merged

Conversation

jseyfried
Copy link
Contributor

@jseyfried jseyfried commented Jul 5, 2016

This adds a public method with_module_lexical_scope to Resolver to allow users to resolve a path in the lexical scope of an arbitrary module.
r? @nrc

@jseyfried
Copy link
Contributor Author

rustdoc needs to resolve in an arbitrary module's lexical scope for RFC 1661.
cc @JohnHeitmann

}
}
}

None
}

pub fn resolve_ident_in_module_lexical_scope(
Copy link
Member

Choose a reason for hiding this comment

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

Could you comment to explain what 'module lexical scope' means

@jseyfried jseyfried force-pushed the improve_resolver_api branch 6 times, most recently from 2e73eec to 54698df Compare July 5, 2016 05:12
@jseyfried jseyfried force-pushed the improve_resolver_api branch from 54698df to 6e0bd44 Compare July 5, 2016 08:58
@jseyfried
Copy link
Contributor Author

@nrc After thinking about this some more, I reimplemented this PR to provide a more powerful API.

@nrc
Copy link
Member

nrc commented Jul 5, 2016

iirc, with_module_lexical_scope is dead code now, whereas before it was used in the refactoring of an existing method. If that is not possible any more, then it would be good to add some sort of test for with_module_lexical_scope to make sure it is exercised somewhere.

@nrc
Copy link
Member

nrc commented Jul 5, 2016

otherwise, this lgtm

@jseyfried
Copy link
Contributor Author

jseyfried commented Jul 5, 2016

@nrc Hmm, we don't have a testing framework for resolve now (i.e. we don't have a way to get a Resolver in a testing environment).

There is no use for this function in the resolve today. Since it's only intended for use by rustdoc for RFC 1661, so I think it would be more appropriate to test it there.

However, we don't have a way to get a Resolver in rustdoc either -- that will require refactoring phase_2_configure_and_expand to take a ResolverArenas and return a Resolver (a bit more involved). I could do that and add a test in this PR or a future one.

@nrc
Copy link
Member

nrc commented Jul 5, 2016

OK, that sounds like a lot of work. Could you file an issue for a test so we don't forget, then add a FIXME with the issue number in the code? r=me with that

@jseyfried
Copy link
Contributor Author

Sounds good, done. @bors r=nrc

@bors
Copy link
Contributor

bors commented Jul 5, 2016

📌 Commit 58dd06d has been approved by nrc

@bors
Copy link
Contributor

bors commented Jul 7, 2016

⌛ Testing commit 58dd06d with merge b4e11c2...

bors added a commit that referenced this pull request Jul 7, 2016
Add to `resolve`'s public API

This adds a public method `with_module_lexical_scope` to `Resolver` to allow users to resolve a path in the lexical scope of an arbitrary module.
r? @nrc
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.

3 participants