-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
Conversation
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
innner -> inner
27296dc
to
ef23cbb
Compare
Amended to address review comments. |
Ping? |
Ping^2. |
r? @nrc |
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; |
There was a problem hiding this comment.
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.
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.
ef23cbb
to
b221349
Compare
@nrc Updated test. |
@bors: r+ |
📌 Commit b221349 has been approved by |
Pretty straightforward; just need to make sure to explicitly handle the generic parameters of each ast::ForeignItemFn. Fixes #26587.
Pretty straightforward; just need to make sure to explicitly handle
the generic parameters of each ast::ForeignItemFn.
Fixes #26587.