Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
scottmcm opened this issue May 15, 2017 · 2 comments
Closed

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

scottmcm opened this issue May 15, 2017 · 2 comments

Comments

@scottmcm
Copy link
Member

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.)

@est31
Copy link
Member

est31 commented May 15, 2017

Interestingly, this reproduces on stable, but not on beta or nightly. Here both is an error.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants