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

ICE: Error compiling with generic default methods #7295

Closed
Aatch opened this issue Jun 22, 2013 · 1 comment
Closed

ICE: Error compiling with generic default methods #7295

Aatch opened this issue Jun 22, 2013 · 1 comment
Labels
A-traits Area: Trait system I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️

Comments

@Aatch
Copy link
Contributor

Aatch commented Jun 22, 2013

This code:

pub trait Foo<T> {

    pub fn func1<U>(&self, t: U);

    pub fn func2<U>(&mut self, t: U) {
        self.func1(t); // Compiles if this is omitted
    }

}

Fails with the message: 'index out of bounds: the len is 1 but the index is 1', /home/james/projects/rust/compiler/src/librustc/middle/subst.rs:58

Seems to be getting mixed up with the trait parameters, if I add another type parameter to Foo, I get an index of 2, instead of 1.

@ghost ghost assigned msullivan Jun 22, 2013
@pnkfelix
Copy link
Member

Part of #2794. (just noting for tracking purposes.)

@huonw huonw mentioned this issue Jul 14, 2013
flip1995 pushed a commit to flip1995/rust that referenced this issue Sep 5, 2024
…blyxyas

Ignore underscore-prefixed args for needless_pass_by_value lint

When a user explicitly tags a param as unused (yet?), there is no need to raise another lint on it.

fixes rust-lang#7295

Note that I had to rename all `_*` params in the tests, but kept the variable name length to avoid extra changes in the expected output.

changelog: [`needless_pass_by_value`]: do not warn if the argument name starts with an `_`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-traits Area: Trait system I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️
Projects
None yet
Development

No branches or pull requests

3 participants