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

Trait inheritance isn't considered in trait bounds checking #13155

Closed
alexcrichton opened this issue Mar 26, 2014 · 4 comments
Closed

Trait inheritance isn't considered in trait bounds checking #13155

alexcrichton opened this issue Mar 26, 2014 · 4 comments
Labels
A-typesystem Area: The type system

Comments

@alexcrichton
Copy link
Member

trait A: Send {}

fn is_send<T: Send>(){}

fn main() {
    is_send::<~A:>();
}
$ rustc foo.rs
foo.rs:6:5: 6:19 error: instantiating a type parameter with an incompatible type `~A<no-bounds>`, which does not fulfill `Send`                                             
foo.rs:6     is_send::<~A:>();                                                        
             ^~~~~~~~~~~~~~                                                           
error: aborting due to previous error                                                 

I would expect this code to compile because any instance of trait A must already ascribe to Send. This caused some excessive verbosity in #13050.

cc @nikomatsakis
cc @pnkfelix

@nikomatsakis
Copy link
Contributor

This no doubt relates to how type contents handles superbounds and so on. I'd be inclined not to try and fix this until opt-in builtin traits are done.

@reem
Copy link
Contributor

reem commented Sep 17, 2014

cc me

This is a pretty hairy issue, ergonomics wise.

@nikomatsakis
Copy link
Contributor

This is going to be fixed soon, I suspect, as I am reworking all of this mechanism at the moment as part of opt-in-builtin-kinds and trait reform.

@alexcrichton
Copy link
Member Author

This was fixed quite some time ago.

JohnTitor pushed a commit to JohnTitor/rust that referenced this issue Sep 6, 2022
…chievink

fix: Lower float literals with underscores

Fixes rust-lang#13155 (the problem was the `PI` is defined with `_f64` suffix). `PI` is still truncated, though, because `f64` cannot represent the value with full precision.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-typesystem Area: The type system
Projects
None yet
Development

No branches or pull requests

3 participants