Address a few more nits
This commit is contained in:
parent
fbe66a6ef3
commit
99417d54af
2 changed files with 12 additions and 11 deletions
|
@ -110,13 +110,14 @@ fn variance_of_opaque(tcx: TyCtxt<'_>, item_def_id: LocalDefId) -> &[ty::Varianc
|
||||||
|
|
||||||
#[instrument(level = "trace", skip(self), ret)]
|
#[instrument(level = "trace", skip(self), ret)]
|
||||||
fn visit_ty(&mut self, t: Ty<'tcx>) -> ControlFlow<Self::BreakTy> {
|
fn visit_ty(&mut self, t: Ty<'tcx>) -> ControlFlow<Self::BreakTy> {
|
||||||
// FIXME(alias): merge these
|
|
||||||
match t.kind() {
|
match t.kind() {
|
||||||
ty::Alias(ty::Opaque, ty::AliasTy { def_id, substs }) => self.visit_opaque(*def_id, substs),
|
ty::Alias(_, ty::AliasTy { def_id, substs })
|
||||||
ty::Alias(ty::Projection, proj)
|
if matches!(
|
||||||
if self.tcx.def_kind(proj.def_id) == DefKind::ImplTraitPlaceholder =>
|
self.tcx.def_kind(*def_id),
|
||||||
|
DefKind::OpaqueTy | DefKind::ImplTraitPlaceholder
|
||||||
|
) =>
|
||||||
{
|
{
|
||||||
self.visit_opaque(proj.def_id, proj.substs)
|
self.visit_opaque(*def_id, substs)
|
||||||
}
|
}
|
||||||
_ => t.super_visit_with(self),
|
_ => t.super_visit_with(self),
|
||||||
}
|
}
|
||||||
|
|
|
@ -338,13 +338,14 @@ pub fn unexpected_hidden_region_diagnostic<'tcx>(
|
||||||
|
|
||||||
impl<'tcx> InferCtxt<'tcx> {
|
impl<'tcx> InferCtxt<'tcx> {
|
||||||
pub fn get_impl_future_output_ty(&self, ty: Ty<'tcx>) -> Option<Ty<'tcx>> {
|
pub fn get_impl_future_output_ty(&self, ty: Ty<'tcx>) -> Option<Ty<'tcx>> {
|
||||||
// FIXME(alias): Merge these
|
|
||||||
let (def_id, substs) = match *ty.kind() {
|
let (def_id, substs) = match *ty.kind() {
|
||||||
ty::Alias(ty::Opaque, ty::AliasTy { def_id, substs }) => (def_id, substs),
|
ty::Alias(_, ty::AliasTy { def_id, substs })
|
||||||
ty::Alias(ty::Projection, data)
|
if matches!(
|
||||||
if self.tcx.def_kind(data.def_id) == DefKind::ImplTraitPlaceholder =>
|
self.tcx.def_kind(def_id),
|
||||||
|
DefKind::OpaqueTy | DefKind::ImplTraitPlaceholder
|
||||||
|
) =>
|
||||||
{
|
{
|
||||||
(data.def_id, data.substs)
|
(def_id, substs)
|
||||||
}
|
}
|
||||||
_ => return None,
|
_ => return None,
|
||||||
};
|
};
|
||||||
|
@ -1730,7 +1731,6 @@ impl<'tcx> TypeErrCtxt<'_, 'tcx> {
|
||||||
TypeError::Sorts(values) => {
|
TypeError::Sorts(values) => {
|
||||||
let extra = expected == found;
|
let extra = expected == found;
|
||||||
let sort_string = |ty: Ty<'tcx>, path: Option<PathBuf>| {
|
let sort_string = |ty: Ty<'tcx>, path: Option<PathBuf>| {
|
||||||
// FIXME(alias): Merge these
|
|
||||||
let mut s = match (extra, ty.kind()) {
|
let mut s = match (extra, ty.kind()) {
|
||||||
(true, ty::Alias(ty::Opaque, ty::AliasTy { def_id, .. })) => {
|
(true, ty::Alias(ty::Opaque, ty::AliasTy { def_id, .. })) => {
|
||||||
let sm = self.tcx.sess.source_map();
|
let sm = self.tcx.sess.source_map();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue