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

Default method ICE when (unused) parameter is unnamed. #8417

Closed
pnkfelix opened this issue Aug 9, 2013 · 3 comments
Closed

Default method ICE when (unused) parameter is unnamed. #8417

pnkfelix opened this issue Aug 9, 2013 · 3 comments
Labels
I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️

Comments

@pnkfelix
Copy link
Member

pnkfelix commented Aug 9, 2013

tic.rs:

trait T {
    fn foo(hmm:int, int) -> int { hmm + 1 }
}

fn main() {
}
% rustc --version
/Users/fklock/opt/rust-dbg/bin/rustc 0.8-pre (7b2163d 2013-08-05 00:56:00 -0700)
host: x86_64-apple-darwin
% RUST_LOG=rustc=1,::rt::backtrace rustc  /tmp/tic.rs
rust: task failed at 'index out of bounds: the len is 0 but the index is 0', /Users/fklock/Dev/Mozilla/rust.git/src/librustc/middle/liveness.rs:1604
error: internal compiler error: unexpected failure
note: the compiler hit an unexpected failure path. this is a bug
note: try running with RUST_LOG=rustc=1,::rt::backtrace to get further details and report the results to github.com/mozilla/rust/issues
rust: task failed at 'explicit failure', /Users/fklock/Dev/Mozilla/rust.git/src/librustc/rustc.rs:358
rust: domain main @0x7fc112008410 root task failed
%

(an easy work-around is to put a name on the second parameter above. But it would be better to either support this, or issue a proper error message for the erroneous input.)

@pnkfelix
Copy link
Member Author

pnkfelix commented Aug 9, 2013

Part of #2794

@ghost ghost assigned pnkfelix Aug 14, 2013
@msullivan
Copy link
Contributor

This probably ought to be just disallowed. It's not allowed for regular function defs. Closely related to #8468.

@msullivan
Copy link
Contributor

I may just fix the crash, though, to close this part, and leave the decision about whether to disallow it as part of #8468.

@pnkfelix pnkfelix removed their assignment Jun 16, 2014
flip1995 pushed a commit to flip1995/rust that referenced this issue Feb 24, 2022
…, r=llogiq

Downgrade transmute_undefined_repr to nursery

Reason: rust-lang#8417. I am skeptical of this lint but maybe there is a narrower subset of types on which it is useful, so keeping it for now but moving to nursery for further development.

---

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

changelog: Remove [`transmute_undefined_repr`] from default set of enabled lints
flip1995 pushed a commit to flip1995/rust that referenced this issue Feb 24, 2022
Fix `transmute_undefined_repr` with single field `#[repr(C)]` structs

Fixes: rust-lang#8417

The description has also been made more precise.

changelog: Fix `transmute_undefined_repr` with single field `#[repr(C)]` structs
changelog: Move `transmute_undefined_repr` back to `correctness`
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

2 participants