提交 4d871a25 编写于 作者: C Camille GILLOT

Do not introduce bindings for types and consts in HRTB.

上级 7fe2c4b0
......@@ -1981,7 +1981,12 @@ fn with_generic_param_rib<'c, F>(
continue;
}
};
let res = Res::Def(def_kind, def_id.to_def_id());
let res = match kind {
ItemRibKind(..) | AssocItemRibKind => Res::Def(def_kind, def_id.to_def_id()),
NormalRibKind => Res::Err,
_ => bug!("Unexpected rib kind {:?}", kind),
};
self.r.record_partial_res(param.id, PartialRes::new(res));
rib.bindings.insert(ident, res);
}
......
fn a() where for<T> T: Copy {}
//~^ ERROR only lifetime parameters can be used in this context
fn b() where for<const C: usize> [(); C]: Copy {}
//~^ ERROR only lifetime parameters can be used in this context
fn main() {}
error: only lifetime parameters can be used in this context
--> $DIR/hrtb-wrong-kind.rs:1:18
|
LL | fn a() where for<T> T: Copy {}
| ^
error: only lifetime parameters can be used in this context
--> $DIR/hrtb-wrong-kind.rs:4:24
|
LL | fn b() where for<const C: usize> [(); C]: Copy {}
| ^
error: aborting due to 2 previous errors
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册