We just need to call expand_free_alias_tys on the self type in the relevant place in rustc_hir_analysis::coherence::orphan.
#![feature(lazy_type_alias)]
struct Local;
type Alias = Local;
unsafe impl Sync for Alias {} //~ ERROR cross-crate traits with a default impl, like `Sync`, can only be implemented for a struct/enum type, not `Alias`
#![feature(lazy_type_alias, auto_traits)]
auto trait Marker {}
struct Local;
type Alias = Local;
impl Marker for Alias {} //~ ERROR traits with a default impl, like `Marker`, cannot be implemented for type alias `Alias`
We just need to call
expand_free_alias_tyson the self type in the relevant place inrustc_hir_analysis::coherence::orphan.