#![feature(lazy_type_alias)]
#![deny(missing_debug_implementations)]
pub struct Local; //~ ERROR type does not implement `Debug`; consider adding `#[derive(Debug)]` or a manu
pub type Alias = Local;
impl std::fmt::Debug for Alias {
fn fmt(&self, _: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { Ok(()) }
}
For some reason missing_debug_implementations doesn't actually query the trait solver (!) (if the fast path doesn't apply), it literally does
let has_impl = cx
.tcx
.non_blanket_impls_for_ty(
debug,
cx.tcx.type_of(item.owner_id).instantiate_identity().skip_norm_wip(),
)
.next()
.is_some();
but I don't think that function should be used for "correctness" (well, it's a lint), ideally it would only be used as a fast path (barring more specific use cases).
For comparison, lint missing_copy_implementations calls tcx.type_is_copy_modulo_regions() which has a fast path but then queries the trait solver.
A temporarily solution would be to call expand_free_alias_tys inside non_blanket_impls_for_ty and friends? I haven't thought about correctness yet, so not sure.
I don't think we should call expand_free_alias_tys in fast_reject::simplify_type; that ideal feels very iffy and it would probably trash perf.
For some reason
missing_debug_implementationsdoesn't actually query the trait solver (!) (if the fast path doesn't apply), it literally doesbut I don't think that function should be used for "correctness" (well, it's a lint), ideally it would only be used as a fast path (barring more specific use cases).
For comparison, lint
missing_copy_implementationscallstcx.type_is_copy_modulo_regions()which has a fast path but then queries the trait solver.A temporarily solution would be to call
expand_free_alias_tysinsidenon_blanket_impls_for_tyand friends? I haven't thought about correctness yet, so not sure.I don't think we should call
expand_free_alias_tysinfast_reject::simplify_type; that ideal feels very iffy and it would probably trash perf.