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

rp.is_none ICE when using 'self lifetime name inappropriately(?) #6396

Closed
ssbr opened this issue May 10, 2013 · 6 comments
Closed

rp.is_none ICE when using 'self lifetime name inappropriately(?) #6396

ssbr opened this issue May 10, 2013 · 6 comments
Labels
E-needs-test Call for participation: An issue has been fixed and does not reproduce, but no test has been added.

Comments

@ssbr
Copy link

ssbr commented May 10, 2013

use core::str;

fn foo<'self>(s: &'self str) -> str::StrCharIterator<'self> {s.char_iter()}

This works fine (but doesn't do much) if we s/'self/'x/g. As-is, on my system, I get this result from compiling:

$ RUST_LOG=rustc=1,::rt::backtrace rustc --lib ice_debug/ice1.rs
rust: task failed at 'assertion failed: rp.is_none()', /home/devin/local_programming/rust/src/librustc/middle/typeck/collect.rs:1070
/usr/local/bin/../lib/librustrt.so(_ZN9rust_task13begin_failureEPKcS1_m+0x4b)[0x7fc622995ccb]
/usr/local/bin/../lib/librustrt.so(+0x2c869)[0x7fc6229a6869]
/usr/local/bin/../lib/librustrt.so(upcall_fail+0x1a0)[0x7fc622997c80]
/usr/local/bin/../lib/libcore-c3ca5d77d81b46c1-0.7-pre.so(_ZN3sys13begin_unwind_16_615cb041c655a976_07preE+0x63)[0x7fc6262fb963]
/usr/local/bin/../lib/libcore-c3ca5d77d81b46c1-0.7-pre.so(+0x1298f2)[0x7fc6262fb8f2]
/usr/local/bin/../lib/libcore-c3ca5d77d81b46c1-0.7-pre.so(_ZN3sys14__extensions__9meth_89249fail_with17_ac9eb45dc42bd6906_07preE+0x6b)[0x7fc62623a8eb]
/usr/local/bin/../lib/librustc-c84825241471686d-0.7-pre.so(_ZN6middle6typeck7collect10ty_of_item17_d137c315966677236_07preE+0x2841)[0x7fc624bcbe91]
/usr/local/bin/../lib/librustc-c84825241471686d-0.7-pre.so(_ZN6middle6typeck7collect7convert16_1a2bf85beff75cb6_07preE+0x545)[0x7fc624bc6cf5]
/usr/local/bin/../lib/librustc-c84825241471686d-0.7-pre.so(+0x6bc6db)[0x7fc624bc66db]
/usr/local/bin/../lib/libsyntax-84efebcb12c867a2-0.7-pre.so(+0xfdfd7)[0x7fc625565fd7]
/usr/local/bin/../lib/libsyntax-84efebcb12c867a2-0.7-pre.so(+0xf5b42)[0x7fc62555db42]
/usr/local/bin/../lib/libsyntax-84efebcb12c867a2-0.7-pre.so(+0x76629)[0x7fc6254de629]
/usr/local/bin/../lib/libsyntax-84efebcb12c867a2-0.7-pre.so(+0xfd5cc)[0x7fc6255655cc]
/usr/local/bin/../lib/librustc-c84825241471686d-0.7-pre.so(+0x2e08e1)[0x7fc6247ea8e1]
/usr/local/bin/../lib/librustc-c84825241471686d-0.7-pre.so(_ZN6middle6typeck7collect18collect_item_types17_74ef7a78d270e44c6_07preE+0x4a5)[0x7fc624bc3dd5]
/usr/local/bin/../lib/librustc-c84825241471686d-0.7-pre.so(+0x7149a2)[0x7fc624c1e9a2]
/usr/local/bin/../lib/librustc-c84825241471686d-0.7-pre.so(+0x7147f9)[0x7fc624c1e7f9]
/usr/local/bin/../lib/librustc-c84825241471686d-0.7-pre.so(_ZN6middle6typeck11check_crate17_c84fb58afee883786_07preE+0x1d0)[0x7fc624c1bdc0]
/usr/local/bin/../lib/librustc-c84825241471686d-0.7-pre.so(_ZN6driver6driver12compile_rest17_819c62971b10988b6_07preE+0x1555)[0x7fc624f36705]
/usr/local/bin/../lib/librustc-c84825241471686d-0.7-pre.so(_ZN6driver6driver12compile_upto15_bb4dc350e2dbf46_07preE+0x192)[0x7fc624f3c962]
/usr/local/bin/../lib/librustc-c84825241471686d-0.7-pre.so(_ZN6driver6driver13compile_input17_fa1f24ad298485546_07preE+0x107)[0x7fc624f3cde7]
/usr/local/bin/../lib/librustc-c84825241471686d-0.7-pre.so(_ZN12run_compiler17_91176f6b8a4d83ae6_07preE+0x2aec)[0x7fc624f69fbc]
/usr/local/bin/../lib/librustc-c84825241471686d-0.7-pre.so(+0xa7242e)[0x7fc624f7c42e]
/usr/local/bin/../lib/librustc-c84825241471686d-0.7-pre.so(+0xa6febc)[0x7fc624f79ebc]
/usr/local/bin/../lib/librustc-c84825241471686d-0.7-pre.so(+0xa69e0c)[0x7fc624f73e0c]
/usr/local/bin/../lib/librustc-c84825241471686d-0.7-pre.so(+0xa72708)[0x7fc624f7c708]
/usr/local/bin/../lib/libcore-c3ca5d77d81b46c1-0.7-pre.so(+0xf1f5d)[0x7fc6262c3f5d]
/usr/local/bin/../lib/libcore-c3ca5d77d81b46c1-0.7-pre.so(+0x16f338)[0x7fc626341338]
/usr/local/bin/../lib/librustrt.so(_Z18task_start_wrapperP10spawn_args+0x24)[0x7fc622996674]
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', /home/devin/local_programming/rust/src/librustc/rustc.rc:355
/usr/local/bin/../lib/librustrt.so(_ZN9rust_task13begin_failureEPKcS1_m+0x4b)[0x7fc622995ccb]
/usr/local/bin/../lib/librustrt.so(+0x2c869)[0x7fc6229a6869]
/usr/local/bin/../lib/librustrt.so(upcall_fail+0x1a0)[0x7fc622997c80]
/usr/local/bin/../lib/libcore-c3ca5d77d81b46c1-0.7-pre.so(_ZN3sys13begin_unwind_16_615cb041c655a976_07preE+0x63)[0x7fc6262fb963]
/usr/local/bin/../lib/libcore-c3ca5d77d81b46c1-0.7-pre.so(+0x129a12)[0x7fc6262fba12]
/usr/local/bin/../lib/libcore-c3ca5d77d81b46c1-0.7-pre.so(+0xc8514)[0x7fc62629a514]
/usr/local/bin/../lib/librustc-c84825241471686d-0.7-pre.so(_ZN7monitor17_7c89c43af55f627f6_07preE+0x2385)[0x7fc624f6d545]
/usr/local/bin/../lib/librustc-c84825241471686d-0.7-pre.so(+0xa72708)[0x7fc624f7c708]
/usr/local/bin/../lib/librustc-c84825241471686d-0.7-pre.so(_ZN4main15_c4de63b748e03d6_07preE+0x69)[0x7fc624f7c369]
rustc(_rust_main+0x2e)[0x400c8e]
/usr/local/bin/../lib/librustrt.so(_Z18task_start_wrapperP10spawn_args+0x24)[0x7fc622996674]
rust: domain main @0x125c410 root task failed
@nikomatsakis
Copy link
Contributor

This is due to the incomplete implementation of #4846. Hoping to patch that up Real Soon Now.

@chris-morgan
Copy link
Member

I just ran into this issue, turning an X::new(arg) definition into X(arg) and leaving 'self in at that point. So I guess it hasn't been Real Soon Yet. 😄

@alexcrichton
Copy link
Member

Closed by #10153, relevant tests already appear to be checked in.

@nikomatsakis
Copy link
Contributor

@alexcrichton are the tests enabled? I didn't check them in, at least.

@alexcrichton
Copy link
Member

Hm, I assumed that this just was all folded into not treating the 'self lifetime specially, but I certainly defer to your judgement over mine, reopening and flagging as needstest.

@alexcrichton alexcrichton reopened this Nov 11, 2013
@nikomatsakis
Copy link
Contributor

I don't think a specific test is needed, there are tests for invalid lifetime names in the named lifetime resolver.

flip1995 pushed a commit to flip1995/rust that referenced this issue Dec 6, 2020
Rustup?

Basically a rustup from an unknown source. I added a regression test (and slightly changed the lint), so this'll need a review.

changelog: Fix bug in [`items_after_statements`] wher it triggered, if items were separated by trailing semicolons.
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.
Projects
None yet
Development

No branches or pull requests

4 participants