This repository was archived by the owner on May 28, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 4 files changed +18
-3
lines changed Expand file tree Collapse file tree 4 files changed +18
-3
lines changed Original file line number Diff line number Diff line change @@ -1740,7 +1740,7 @@ impl Type {
17401740 fn inner_def_id ( & self , cache : Option < & Cache > ) -> Option < DefId > {
17411741 let t: PrimitiveType = match * self {
17421742 Type :: Path { ref path } => return Some ( path. def_id ( ) ) ,
1743- DynTrait ( ref bounds, _) => return Some ( bounds[ 0 ] . trait_ . def_id ( ) ) ,
1743+ DynTrait ( ref bounds, _) => return bounds. get ( 0 ) . map ( |b| b . trait_ . def_id ( ) ) ,
17441744 Primitive ( p) => return cache. and_then ( |c| c. primitive_locations . get ( & p) . cloned ( ) ) ,
17451745 BorrowedRef { type_ : box Generic ( ..) , .. } => PrimitiveType :: Reference ,
17461746 BorrowedRef { ref type_, .. } => return type_. inner_def_id ( cache) ,
Original file line number Diff line number Diff line change @@ -322,8 +322,7 @@ fn get_index_type_id(clean_type: &clean::Type) -> Option<RenderTypeId> {
322322 match * clean_type {
323323 clean:: Type :: Path { ref path, .. } => Some ( RenderTypeId :: DefId ( path. def_id ( ) ) ) ,
324324 clean:: DynTrait ( ref bounds, _) => {
325- let path = & bounds[ 0 ] . trait_ ;
326- Some ( RenderTypeId :: DefId ( path. def_id ( ) ) )
325+ bounds. get ( 0 ) . map ( |b| RenderTypeId :: DefId ( b. trait_ . def_id ( ) ) )
327326 }
328327 clean:: Primitive ( p) => Some ( RenderTypeId :: Primitive ( p) ) ,
329328 clean:: BorrowedRef { ref type_, .. } | clean:: RawPointer ( _, ref type_) => {
Original file line number Diff line number Diff line change 1+ // compile-flags: --document-private-items
2+ // edition:2021
3+
4+ fn use_avx ( ) -> dyn {
5+ //~^ ERROR at least one trait is required for an object type
6+ !( ident_error )
7+ }
Original file line number Diff line number Diff line change 1+ error[E0224]: at least one trait is required for an object type
2+ --> $DIR/issue-106213.rs:4:17
3+ |
4+ LL | fn use_avx() -> dyn {
5+ | ^^^
6+
7+ error: aborting due to previous error
8+
9+ For more information about this error, try `rustc --explain E0224`.
You can’t perform that action at this time.
0 commit comments