Skip to content

Ambiguity, differing outlives constraints with types equal modulo normalization #57

Closed
rust-lang/rust
#114829
@compiler-errors

Description

@compiler-errors
fn main() {
    let _: &dyn Iterator<Item=i32> = &vec![1].into_iter();
}

When coercing &'?0 <Vec<{integer}> as IntoIterator>::IntoIter into &'?1 dyn Iterator<Item=i32>, we end up with two responses.

The first has a type-outlives constraint like <Vec<{integer}> as IntoIterator>::IntoIter: &'?1, and the second has one like std::vec::IntoIter<{integer}>: &'?1. These are identical except for their types being normalized, but that causes us to flounder.

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