未验证 提交 7ee4b218 编写于 作者: M Matthias Krüger 提交者: GitHub

Rollup merge of #103221 - TaKO8Ki:fix-103202, r=oli-obk

Fix `SelfVisitor::is_self_ty` ICE

Fixes #103202
......@@ -1939,11 +1939,11 @@ fn is_self_ty(&self, ty: &Ty) -> bool {
match ty.kind {
TyKind::ImplicitSelf => true,
TyKind::Path(None, _) => {
let path_res = self.r.partial_res_map[&ty.id].expect_full_res();
if let Res::SelfTyParam { .. } | Res::SelfTyAlias { .. } = path_res {
let path_res = self.r.partial_res_map[&ty.id].full_res();
if let Some(Res::SelfTyParam { .. } | Res::SelfTyAlias { .. }) = path_res {
return true;
}
Some(path_res) == self.impl_self
self.impl_self.is_some() && path_res == self.impl_self
}
_ => false,
}
......
struct S {}
impl S {
fn f(self: &S::x) {} //~ ERROR ambiguous associated type
}
fn main() {}
error[E0223]: ambiguous associated type
--> $DIR/issue-103202.rs:4:17
|
LL | fn f(self: &S::x) {}
| ^^^^ help: use fully-qualified syntax: `<S as Trait>::x`
error: aborting due to previous error
For more information about this error, try `rustc --explain E0223`.
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册