Auto merge of #139000 - compiler-errors:rigid-missing-item, r=lcnr
Rigidly project missing item due to guaranteed impossible sized predicate This is a somewhat involved change, but it amounts to treating missing impl items due to guaranteed impossible where clauses (dyn/str/slice sized, cc #135480) as *rigid projections* rather than projecting to an error term, since that was preventing either reporting a proper error (in an empty param env) *or* successfully type checking the code (in the presence of trivially false where clauses). Fixes https://github.com/rust-lang/rust/issues/138970 r? `@lcnr` `@oli-obk`
This commit is contained in:
@@ -1026,6 +1026,13 @@ rustc_queries! {
|
||||
separate_provide_extern
|
||||
}
|
||||
|
||||
/// Given an `impl_def_id`, return true if the self type is guaranteed to be unsized due
|
||||
/// to either being one of the built-in unsized types (str/slice/dyn) or to be a struct
|
||||
/// whose tail is one of those types.
|
||||
query impl_self_is_guaranteed_unsized(impl_def_id: DefId) -> bool {
|
||||
desc { |tcx| "computing whether `{}` has a guaranteed unsized self type", tcx.def_path_str(impl_def_id) }
|
||||
}
|
||||
|
||||
/// Maps a `DefId` of a type to a list of its inherent impls.
|
||||
/// Contains implementations of methods that are inherent to a type.
|
||||
/// Methods in these implementations don't need to be exported.
|
||||
|
||||
Reference in New Issue
Block a user