Skip to content

ICE when trying to access shared-access-boxed vector in iface impl #2926

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

Closed
iamtakingiteasy opened this issue Jul 16, 2012 · 3 comments
Closed
Assignees
Labels
A-lifetimes Area: Lifetimes / regions I-crash Issue: The compiler crashes (SIGSEGV, SIGABRT, etc). Use I-ICE instead when the compiler panics.

Comments

@iamtakingiteasy
Copy link

For the following code:

import io::*;
import to_str::*;

impl <T : to_str copy> of to_str for @[mut T] {
    fn to_str() -> str {
        let tmp = copy self;
        tmp.map(|x| { x.to_str() }).to_str()
    }
}

fn main() {
    println((@[mut 1, 2, 3]).to_str());
}

rustc-0.3 produces an ICE:

example.rs:7:8: 7:11 error: internal compiler error: aliased ptr with a non-none lp
example.rs:7         tmp.map(|x| { x.to_str() }).to_str()
                     ^~~

This is not happens with unique boxes (~[mut 1,2,3]/for ~[mut T])

Also tested on git snapshot (rustc 0.3 (6081eb7 2012-07-15 05:41:24 -0700)) -- same thing, except i had to change str to ~str to make it not fail with error: bare 'str' is not a type

@ghost ghost assigned nikomatsakis Jul 16, 2012
@nikomatsakis
Copy link
Contributor

This is a bug in borrowck somewhere. Assigning myself.

@nikomatsakis
Copy link
Contributor

I think this is a dup of #2797

@nikomatsakis
Copy link
Contributor

verified that this is a dup.

celinval added a commit to celinval/rust-dev that referenced this issue Jun 4, 2024
Updates the Rust toolchain to `nightly-2023-12-08`. The relevant changes
are:
 * rust-lang#118324
 * rust-lang#118684

---------

Co-authored-by: Celina G. Val <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-lifetimes Area: Lifetimes / regions I-crash Issue: The compiler crashes (SIGSEGV, SIGABRT, etc). Use I-ICE instead when the compiler panics.
Projects
None yet
Development

No branches or pull requests

2 participants