rollup merge of #17114 : nick29581/dst-type
This commit is contained in:
commit
25e08fb4fe
3 changed files with 7 additions and 2 deletions
|
@ -3931,6 +3931,7 @@ impl<'a> Resolver<'a> {
|
||||||
item.id,
|
item.id,
|
||||||
ItemRibKind),
|
ItemRibKind),
|
||||||
|this| {
|
|this| {
|
||||||
|
this.resolve_type_parameters(&generics.ty_params);
|
||||||
visit::walk_item(this, item, ());
|
visit::walk_item(this, item, ());
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -488,7 +488,9 @@ pub fn ensure_no_ty_param_bounds(ccx: &CrateCtxt,
|
||||||
generics: &ast::Generics,
|
generics: &ast::Generics,
|
||||||
thing: &'static str) {
|
thing: &'static str) {
|
||||||
for ty_param in generics.ty_params.iter() {
|
for ty_param in generics.ty_params.iter() {
|
||||||
for bound in ty_param.bounds.iter() {
|
let bounds = ty_param.bounds.iter();
|
||||||
|
let mut bounds = bounds.chain(ty_param.unbound.iter());
|
||||||
|
for bound in bounds {
|
||||||
match *bound {
|
match *bound {
|
||||||
ast::TraitTyParamBound(..) | ast::UnboxedFnTyParamBound(..) => {
|
ast::TraitTyParamBound(..) | ast::UnboxedFnTyParamBound(..) => {
|
||||||
// According to accepted RFC #XXX, we should
|
// According to accepted RFC #XXX, we should
|
||||||
|
@ -1076,9 +1078,10 @@ fn add_unsized_bound(ccx: &CrateCtxt,
|
||||||
desc: &str,
|
desc: &str,
|
||||||
span: Span) {
|
span: Span) {
|
||||||
let kind_id = ccx.tcx.lang_items.require(SizedTraitLangItem);
|
let kind_id = ccx.tcx.lang_items.require(SizedTraitLangItem);
|
||||||
|
|
||||||
match unbound {
|
match unbound {
|
||||||
&Some(ast::TraitTyParamBound(ref tpb)) => {
|
&Some(ast::TraitTyParamBound(ref tpb)) => {
|
||||||
// #FIXME(8559) currently requires the unbound to be built-in.
|
// FIXME(#8559) currently requires the unbound to be built-in.
|
||||||
let trait_def_id = ty::trait_ref_to_def_id(ccx.tcx, tpb);
|
let trait_def_id = ty::trait_ref_to_def_id(ccx.tcx, tpb);
|
||||||
match kind_id {
|
match kind_id {
|
||||||
Ok(kind_id) if trait_def_id != kind_id => {
|
Ok(kind_id) if trait_def_id != kind_id => {
|
||||||
|
|
|
@ -24,6 +24,7 @@ struct S1<Sized? X>;
|
||||||
enum E<Sized? X> {}
|
enum E<Sized? X> {}
|
||||||
impl <Sized? X> T1 for S1<X> {}
|
impl <Sized? X> T1 for S1<X> {}
|
||||||
fn f<Sized? X>() {}
|
fn f<Sized? X>() {}
|
||||||
|
type TT<Sized? T> = T;
|
||||||
|
|
||||||
pub fn main() {
|
pub fn main() {
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue