Skip to content

fn foo<T:?>() {} compiles despite the weird trait bound #42004

Closed
@scottmcm

Description

@scottmcm

Both of the following compile fine https://is.gd/k1iXTl:

fn foo<T:?>() {}

use std::error::Error;
fn bar<E>() -> Result<(),E>
    where E : Error + ?
{
    Ok(())
}

I would have expected that a lonely ? (without a trait name) in a bound was an error.

(Thanks @tomaka on IRC for the simpler repro.)

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