-
Notifications
You must be signed in to change notification settings - Fork 13k
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
Make trait lifetime parameters early bound in static fn type. #10506
Make trait lifetime parameters early bound in static fn type. #10506
Conversation
// A',B',C', // Then type params from trait | ||
// D':Trait<'a,'b,'c,A',B',C'>, // Then this sucker | ||
// E',F',G' // Then type params from `foo()`, offset by 1 | ||
// >(...) -> D' {} |
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.
same comments as on #10556 about using a different syntax for the primed type-vars. But I assume you will fix that eventually, it need not hold up this patch...
I am eagerly awaiting this patch! Unfortunately, it looks like traits with lifetime parameters do not work across crate boundaries. After applying this patch, I tried compiling the following two crates:
The result:
|
Aha! This patch appears to fix that problem: I'd submit a pull request now, but I'd want to include a test case and try it locally, and "make check" is currently broken for me. :/ |
Update: I got |
@dwrensha great! I've been meaning to look into your example to try and figure out what the problem was :) |
Before applying this patch, the included testcase fails with: ``` src/test/run-pass/xcrate-trait-lifetime-param.rs:20:10: 20:28 error: wrong number of lifetime parameters: expected 0 but found 1 src/test/run-pass/xcrate-trait-lifetime-param.rs:20 impl <'a> other::FromBuf<'a> for Reader<'a> { ^~~~~~~~~~~~~~~~~~ ``` There's another example in my comments to #10506.
…flip1995 Add `tests_outside_test_module` lint Adds `tests_outside_test_module` from rust-lang#10506. This PR **doesn't** close the issue, just resolves task 1. changelog: [`tests_outside_test_module`]: The lint has been added
Add `items_after_test_module` lint Resolves task *3* of rust-lang#10506, alongside *1* resolved at rust-lang#10543 in an effort to help standarize a little bit more testing modules. --- changelog:[`items_after_test_module`]: Added the lint.
Make trait lifetime parameters early bound in static fn type. Reasoning for this change is (hopefully) explained well enough in the comment, so I'll not duplicate it here. Fixes #10391.
r? @pnkfelix