You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In #50882, adding an Alloc parameter to the Box type, that defaults to Global induces changes to UI tests that are indicative of something that seemed to need improvement in the compiler, namely that when you have a type Foo<A, B = Bar>, errors should present Foo<A> instead of Foo<A, Bar> when they can.
It turns out, the compiler does. But not consistently. The following is derived from src/test/compile-fail/terr-sorts.rs:
This all stems from the fact that in some cases, types are just printed out by formatting the Ty<'ctx> instances, while in other cases, there is manual machinery to highlight parts of the type that handle things, and that doesn't have the default-param elimination that PrintContext::parameterized has.
In #50882, adding an
Alloc
parameter to theBox
type, that defaults toGlobal
induces changes to UI tests that are indicative of something that seemed to need improvement in the compiler, namely that when you have a typeFoo<A, B = Bar>
, errors should presentFoo<A>
instead ofFoo<A, Bar>
when they can.It turns out, the compiler does. But not consistently. The following is derived from
src/test/compile-fail/terr-sorts.rs
:(Playground version)
This yields the following errors:
See how it prints
Foo<foo, Global>
instead of the (imho) desiredFoo<foo>
, butFoo<usize>
, notFoo<usize, Global>
.The text was updated successfully, but these errors were encountered: