-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Handle implicit Sized
bounds
#8984
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
Comments
As far as I am aware that is the case. |
Hmm, associated types get it as well, don't they? |
They would have to for |
If nobody working on this yet, I'd like to claim it. Nice opportunity to learn Chalk! Got some intermediate results//#[test]
//fn play() {
// check_infer(
// r#"
#[lang = "sized"]
trait Sized {}
trait Foo {
fn foo() -> u8;
}
trait Trait<T: Foo + ?Sized, U: Foo> {
fn bar() {
T::foo;
}
}
//"#,
// expect_test::expect![[]],
// );
//}
|
@iDawer Are you still working on this? If not I can pick this up |
@jonas-schievink If you do, note that they did run into some problems: https://rust-lang.zulipchat.com/#narrow/stream/185405-t-compiler.2Frust-analyzer/topic/implicit.20Sized.20bounds |
I apologize for being missing without a notify. I'm back and will continue on this |
We currently don't add the implicit
Sized
bounds to type parameters, which leads to some inaccuracies in trait solving, so we need to fix this.Rough steps:
Sized
bound (is it simply all type parameters and associated types without?Sized
except traitSelf
? not sure)Sized
bounds for all type parameters that don't have?Sized
(I feel it makes more sense to add them at this step, rather than inhir_def
, but I'm not 100% sure) except for traitSelf
+ Sized
everywhere, e.g. when displaying argumentimpl Trait
typescoerce_unsize_apit
test should now work correctly; maybe add some explicit tests withSized
bounds in trait implsanalysis-stats
performance before/afterThe text was updated successfully, but these errors were encountered: