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

Resolve lifetime parameters for foreign functions. #26588

Merged
merged 1 commit into from Jul 23, 2015

Conversation

eefriedman
Copy link
Contributor

Pretty straightforward; just need to make sure to explicitly handle
the generic parameters of each ast::ForeignItemFn.

Fixes #26587.

@rust-highfive
Copy link
Collaborator

r? @Aatch

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

@@ -151,6 +151,29 @@ impl<'a, 'v> Visitor<'v> for LifetimeContext<'a> {
replace(&mut self.labels_in_fn, saved);
}

fn visit_foreign_item(&mut self, item: &ast::ForeignItem) {
// Items save/restore the set of labels. This way innner items
Copy link
Contributor

Choose a reason for hiding this comment

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

innner -> inner

@eefriedman
Copy link
Contributor Author

Amended to address review comments.

@eefriedman
Copy link
Contributor Author

Ping?

@eefriedman
Copy link
Contributor Author

Ping^2.

@brson
Copy link
Contributor

brson commented Jul 23, 2015

r? @nrc

@rust-highfive rust-highfive assigned nrc and unassigned Aatch Jul 23, 2015
extern {
pub fn life<'a>(x:&'a i32);
pub fn life2<'b>(x:&'a i32, y:&'b i32); //~ ERROR use of undeclared lifetime name `'a`
pub fn life3<'a>(x:&'a i32, y:&i32) -> &'a i32;
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 add lines to this test which test for bad lifetimes deeply nested in an argument type and in the return type please?

Also add a comment to the top of the test stating what is being tested.

@nrc
Copy link
Member

nrc commented Jul 23, 2015

Couple of minor things in the test, otherwise r=me

Pretty straightforward; just need to make sure to explicitly handle
the generic parameters of each ast::ForeignItemFn.

Fixes rust-lang#26587.
@eefriedman
Copy link
Contributor Author

@nrc Updated test.

@nrc
Copy link
Member

nrc commented Jul 23, 2015

@bors: r+

@bors
Copy link
Contributor

bors commented Jul 23, 2015

📌 Commit b221349 has been approved by nrc

@bors
Copy link
Contributor

bors commented Jul 23, 2015

⌛ Testing commit b221349 with merge d6a6178...

bors added a commit that referenced this pull request Jul 23, 2015
Pretty straightforward; just need to make sure to explicitly handle
the generic parameters of each ast::ForeignItemFn.

Fixes #26587.
@bors bors merged commit b221349 into rust-lang:master Jul 23, 2015
@brson brson added the relnotes Marks issues that should be documented in the release notes of the next release. label Jul 27, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
relnotes Marks issues that should be documented in the release notes of the next release.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants