mirror of
https://github.com/rust-lang/rust.git
synced 2026-04-27 18:57:42 +03:00
check if ProjectionTy or ProjectionConst
fmt
This commit is contained in:
@@ -1607,6 +1607,7 @@ pub(super) fn report_projection_error(
|
||||
};
|
||||
|
||||
if let Some(lhs) = lhs.to_alias_term()
|
||||
&& let ty::AliasTermKind::ProjectionTy | ty::AliasTermKind::ProjectionConst = lhs.kind(self.tcx)
|
||||
&& let Some((better_type_err, expected_term)) =
|
||||
derive_better_type_error(lhs, rhs)
|
||||
{
|
||||
@@ -1615,6 +1616,7 @@ pub(super) fn report_projection_error(
|
||||
better_type_err,
|
||||
)
|
||||
} else if let Some(rhs) = rhs.to_alias_term()
|
||||
&& let ty::AliasTermKind::ProjectionTy | ty::AliasTermKind::ProjectionConst = rhs.kind(self.tcx)
|
||||
&& let Some((better_type_err, expected_term)) =
|
||||
derive_better_type_error(rhs, lhs)
|
||||
{
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
//@ compile-flags: -Znext-solver=globally
|
||||
#![feature(type_alias_impl_trait)]
|
||||
|
||||
type Foo = Vec<impl Send>;
|
||||
|
||||
#[define_opaque(Foo)]
|
||||
fn make_foo() -> Foo {}
|
||||
//~^ ERROR type mismatch resolving
|
||||
|
||||
fn main() {}
|
||||
@@ -0,0 +1,9 @@
|
||||
error[E0271]: type mismatch resolving `Foo == ()`
|
||||
--> $DIR/opaque-alias-relate-issue-151331.rs:7:18
|
||||
|
|
||||
LL | fn make_foo() -> Foo {}
|
||||
| ^^^ types differ
|
||||
|
||||
error: aborting due to 1 previous error
|
||||
|
||||
For more information about this error, try `rustc --explain E0271`.
|
||||
Reference in New Issue
Block a user