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 for vec.iter() with unbounded element type #7813

Closed
huonw opened this issue Jul 16, 2013 · 5 comments · Fixed by #17199
Closed

ICE for vec.iter() with unbounded element type #7813

huonw opened this issue Jul 16, 2013 · 5 comments · Fixed by #17199
Labels
E-needs-test Call for participation: An issue has been fixed and does not reproduce, but no test has been added. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️

Comments

@huonw
Copy link
Member

huonw commented Jul 16, 2013

fn main() {
    let v = &[];
    let it = v.iter();
}
vec-ice.rs:3:13: 3:14 error: internal compiler error: borrow-vec associated with bad sty: &ty_err
vec-ice.rs:3     let it = v.iter();
                          ^

(Doesn't happen with .slice.)

@jdm
Copy link
Contributor

jdm commented Jul 16, 2013

Paging @catamorphism!

@chris-morgan
Copy link
Member

Here's a truly minimal test case:

fn main() { [].iter(); }

@nikomatsakis
Copy link
Contributor

cc me

@michaelwoerister
Copy link
Member

Variation:

fn main() { [&1].iter(); }

This gives a different error message:

error: internal compiler error: Cannot relate bound region: ReInfer(2) <= ReLateBound(161, BrNamed(syntax::ast::DefId{crate: 0u32, node: 174u32}, a))

@ghost
Copy link

ghost commented Sep 11, 2014

Fixed in #16802. Can be closed.

@huonw huonw added the E-needs-test Call for participation: An issue has been fixed and does not reproduce, but no test has been added. label Sep 11, 2014
bors added a commit that referenced this issue Sep 15, 2014
…hton

Closes #7813.
Closes #10902.
Closes #11374.
Closes #11714.
Closes #12920.
Closes #13202.
Closes #13624.
Closes #14039.
Closes #15730.
Closes #15783.
flip1995 pushed a commit to flip1995/rust that referenced this issue Nov 23, 2021
Add Clippy version to Clippy's lint list

Hey, hey, the semester is finally over, and I wanted to get back into hacking on Clippy. It has also been some time since our metadata collection monster has been feed. So, this PR adds a new attribute `clippy::version` to document which version a lint was stabilized. I considered using `git blame` but that would be very hacky and probably not accurate.

I'm also thinking that this attribute can be used to have a `clippy::nightly` lint group which is allow-by-default that delays setting the actual lint group until the defined version is reached. Just something to consider regarding rust-lang#6623 🙃

This PR only adds the version to 4 lints to keep it reviewable. I'll do a followup PR to add the version to other lints if the implementation is accepted 🙃

![image](https://user-images.githubusercontent.com/17087237/137118859-0aafdfdf-7595-4289-8ba4-33d58eb6991d.png)

Also, mobile approved xD

![image](https://user-images.githubusercontent.com/17087237/137118944-833cf7fb-a4a1-45d6-9af8-32c951822360.png)

---

r? `@flip1995`

cc: rust-lang#7172

closes: rust-lang#6492

changelog: [Clippy's lint list](https://rust-lang.github.io/rust-clippy/master/index.html) now displays the version a lint was added. 🎉

---

Example lint declaration after this update:

```rs
declare_clippy_lint! {
    /// [...]
    ///
    /// ### Example
    /// ```rust
    /// // Bad
    /// let x = 3.14;
    /// // Good
    /// let x = std::f32::consts::PI;
    /// ```
    #[clippy::version = "pre 1.29.0"]
    pub APPROX_CONSTANT,
    correctness,
    "the approximate of a known float constant (in `std::fXX::consts`)"
}
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
E-needs-test Call for participation: An issue has been fixed and does not reproduce, but no test has been added. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants