Implement BOXED_SLICE_INTO_ITER
This commit is contained in:
parent
1a81092531
commit
a502e7ac1d
22 changed files with 446 additions and 173 deletions
|
@ -1117,8 +1117,24 @@ fn trait_def(tcx: TyCtxt<'_>, def_id: LocalDefId) -> ty::TraitDef {
|
|||
|
||||
let is_marker = tcx.has_attr(def_id, sym::marker);
|
||||
let rustc_coinductive = tcx.has_attr(def_id, sym::rustc_coinductive);
|
||||
let skip_array_during_method_dispatch =
|
||||
tcx.has_attr(def_id, sym::rustc_skip_array_during_method_dispatch);
|
||||
|
||||
// FIXME: We could probably do way better attribute validation here.
|
||||
let mut skip_array_during_method_dispatch = false;
|
||||
let mut skip_boxed_slice_during_method_dispatch = false;
|
||||
for attr in tcx.get_attrs(def_id, sym::rustc_skip_during_method_dispatch) {
|
||||
if let Some(lst) = attr.meta_item_list() {
|
||||
for item in lst {
|
||||
if let Some(ident) = item.ident() {
|
||||
match ident.as_str() {
|
||||
"array" => skip_array_during_method_dispatch = true,
|
||||
"boxed_slice" => skip_boxed_slice_during_method_dispatch = true,
|
||||
_ => (),
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
let specialization_kind = if tcx.has_attr(def_id, sym::rustc_unsafe_specialization_marker) {
|
||||
ty::trait_def::TraitSpecializationKind::Marker
|
||||
} else if tcx.has_attr(def_id, sym::rustc_specialization_trait) {
|
||||
|
@ -1253,6 +1269,7 @@ fn trait_def(tcx: TyCtxt<'_>, def_id: LocalDefId) -> ty::TraitDef {
|
|||
is_marker,
|
||||
is_coinductive: rustc_coinductive || is_auto,
|
||||
skip_array_during_method_dispatch,
|
||||
skip_boxed_slice_during_method_dispatch,
|
||||
specialization_kind,
|
||||
must_implement_one_of,
|
||||
implement_via_object,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue