Skip to content

First example of non-compiling impl Trait does compile #5

@rodrimati1992

Description

@rodrimati1992

The first example of non-compiling uses of impl Trait

fn foo(x: &mut dyn Iterator<Item = impl Debug>)

fn foo(x: &mut dyn Iterator<Item = impl Debug>)

Does compile when written in full:
https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=bd81ce5a64eda9175ea1001723a12127

use std::fmt::Debug;

fn foo(x: &mut dyn Iterator<Item = impl Debug>){}

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