Skip to content

Infinitely recursive dyn #90

@Jules-Bertholet

Description

@Jules-Bertholet

As discovered by @theemathas at rust-lang/rust#142900 (comment), the following compiles:

trait Trait: Sync {}

impl Trait for &dyn Trait {}

static X: &dyn Trait = &X;

Perhaps this is too obscure even for the quiz, but I’m sure it’s possible to make a fun question based on this trick.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions