Skip to content

Deref coercion &Box<[T]> -> &[T] can be translated incorrectly #30478

Closed
@petrochenkov

Description

@petrochenkov

I wasn't able to come up with a minimal example yet, but this was the reason of segfault in #30095

Here's a patch fixing that segfault on 32 bit Linux - petrochenkov@b225678
I.e. segfaults disappear when the deref coercion is not used.

Update: Segfault reproduces on https://github.com/rust-lang/rust/tree/master if impl<T> Deref for P<[T]> is modified to use coercion (fn deref(&self) -> &[T] { &self.ptr }).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions