-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
ICE using trait lifetime in a method definition #10391
Comments
I just got similar ICE with extern mod. a.rs: #[crate_type = "lib"];
pub struct Markdown<'self>(&'self str); b.rs: extern mod a;
fn main() {
a::Markdown("abcd");
} Building b.rs gives
(Yes, I was using |
Another variant:
produces:
|
Seems likely to be related, yes. I'll take a look today. Probably something funky in the handling of static methods. Possibly related to what @dwrensha was trying to address in #9841 (though maybe not -- I'm sad to say I ddn't fully understand the problem there, was too caught up in trying to finish with #10153!) |
Here's an example relevant to me:
|
So these examples are a mix of problems, but they are all related to #5121. The only one of these examples I expect to not ICE is the first one. The others don't work because of #5121. The basic problem is that you cannot have a function which has a lifetime parameter that appears in a trait bound (yet -- I want to fix this, see #5121 for details). Interestingly, the reason that we have this problem with the first example, is that static functions like
You can see here that |
@nikomatsakis: Thanks for looking into this. I started playing around with your branch to fix this and I ran into another ICE. Is there something new, or is it also caused by #5121?
Errors with:
|
On Sat, Nov 16, 2013 at 10:01:08PM -0800, Erick Tryzelaar wrote:
#5121. I will see how quickly I can prepare a fix for this. The key identifying point is:
right here (I added a comment) |
…dnet Fix test function checker in `unwrap_used`, `expect_used` After rust-lang#9686 , `unwrap` and `expect` in integration tests and raw test functions won't be allowed. fixes rust-lang#10011 fixes rust-lang#10238 fixes rust-lang#10264 --- changelog: Fix: [`expect_used`], [`unwrap_used`], [`dbg_macro`], [`print_stdout`], [`print_stderr`]: No longer lint in test functions, if the related configuration is set [rust-lang#10391](rust-lang/rust-clippy#10391) <!-- changelog_checked -->
cc @nikomatsakis. I think this is related to #10153. Here's the example code:
It errors with:
The text was updated successfully, but these errors were encountered: