未验证 提交 e4b9e72e 编写于 作者: G Guillaume Gomez 提交者: GitHub

Rollup merge of #114827 - compiler-errors:next-solver-dyn-safe-candidates, r=lcnr

Only consider object candidates for object-safe dyn types in new solver

We apparently allow this per RFC2027 💀

r? lcnr
......@@ -826,6 +826,11 @@ fn assemble_object_bound_candidates<G: GoalKind<'tcx>>(
ty::Dynamic(bounds, ..) => bounds,
};
// Do not consider built-in object impls for non-object-safe types.
if bounds.principal_def_id().is_some_and(|def_id| !tcx.check_is_object_safe(def_id)) {
return;
}
// Consider all of the auto-trait and projection bounds, which don't
// need to be recorded as a `BuiltinImplSource::Object` since they don't
// really have a vtable base...
......
// Check that we can manually implement an object-unsafe trait for its trait object.
// revisions: current next
//[next] compile-flags: -Ztrait-solver=next
// run-pass
#![feature(object_safe_for_dispatch)]
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册