Skip to content

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

Closed

Description

@ssbr
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

Activity

  1. nikomatsakis commented on May 10, 2013

    @nikomatsakis
    Contributor

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

  2. chris-morgan commented on Jul 9, 2013

    @chris-morgan
    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. 😄

  3. alexcrichton commented on Nov 11, 2013

    @alexcrichton
    Member

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

  4. nikomatsakis commented on Nov 11, 2013

    @nikomatsakis
    Contributor

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

  5. alexcrichton commented on Nov 11, 2013

    @alexcrichton
    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.

  6. nikomatsakis commented on Nov 11, 2013

    @nikomatsakis
    Contributor

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

  7. added a commit that references this issue on Dec 6, 2020
  8. added a commit that references this issue on Aug 21, 2026
  9. added a commit that references this issue on Sep 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    E-needs-testCall for participation: An issue has been fixed and does not reproduce, but no test has been added.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions