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

internal compiler error: no ref #12252

Closed
dangets opened this issue Feb 13, 2014 · 1 comment
Closed

internal compiler error: no ref #12252

dangets opened this issue Feb 13, 2014 · 1 comment
Labels
I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️

Comments

@dangets
Copy link

dangets commented Feb 13, 2014

May be similar to #11450, but maybe not. Running on Arch Linux, pulled rust master today.

use std::num::sqrt;

struct Vec2 {
    x: f32,
    y: f32,
}

impl Vec2 {
    fn new(x: f32, y: f32) -> Vec2 {
        Vec2 {x: x, y: y}
    }

    fn normalized(&self) -> Vec2 {
        self / self.length()
    }

    fn length(&self) -> f32 {
        sqrt(self.length_squared())
    }

    fn length_squared(&self) -> f32 {
        self.x * self.x +
        self.y * self.y
    }
}

impl Div<f32, Vec2> for Vec2 {
    fn div(&self, scalar: f32) -> Vec2 {
        let inverse = 1.0f32 / scalar;
        Vec2 {
            x: self.x * inverse,
            y: self.y * inverse,
        }
    }
}

#[cfg(test)]
mod tests {
    use super::Vec2;

    #[test]
    fn test_length() {
        let v = Vec2::new(3, 4);
        let len = v.length();
        assert!(len > 0.49 && len < 0.51);
    }
}
[127] dg@dg-devbox> rustc vector-min.rs --test
vector-min.rs:14:16: 14:29 error: internal compiler error: no ref
This message reflects a bug in the Rust compiler. 
We would appreciate a bug report: http://static.rust-lang.org/doc/master/complement-bugreport.html
vector-min.rs:14         self / self.length()
dg@dg-devbox> rustc -v
rustc 0.10-pre (cfb87f1 2014-02-13 10:32:18 -0800)
host: x86_64-unknown-linux-gnu
@huonw huonw added the I-ICE label Feb 13, 2014
@luqmana
Copy link
Member

luqmana commented Mar 1, 2014

This is essentially a dupe of #11450.

@luqmana luqmana closed this as completed Mar 1, 2014
bors added a commit to rust-lang-ci/rust that referenced this issue Jul 25, 2022
internal: Make VSCode config more GUI edit friendly
flip1995 pushed a commit to flip1995/rust that referenced this issue Feb 26, 2024
[`case_sensitive_file_extension_comparisons`]: Don't trigger on digits-only extensions

If we find a file extension check with only digits (`.123`), do not trigger `case_sensitive_file_extension_comparisons`.

Fixes rust-lang#12252

---

*Please write a short comment explaining your change (or "none" for internal only changes)*

changelog: [`case_sensitive_file_extension_comparisons`]: Don't trigger on digits-only extensions
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️
Projects
None yet
Development

No branches or pull requests

3 participants