This repository was archived by the owner on May 28, 2025. It is now read-only.
File tree 4 files changed +18
-3
lines changed 4 files changed +18
-3
lines changed Original file line number Diff line number Diff line change @@ -1740,7 +1740,7 @@ impl Type {
1740
1740
fn inner_def_id ( & self , cache : Option < & Cache > ) -> Option < DefId > {
1741
1741
let t: PrimitiveType = match * self {
1742
1742
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 ( ) ) ,
1744
1744
Primitive ( p) => return cache. and_then ( |c| c. primitive_locations . get ( & p) . cloned ( ) ) ,
1745
1745
BorrowedRef { type_ : box Generic ( ..) , .. } => PrimitiveType :: Reference ,
1746
1746
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> {
322
322
match * clean_type {
323
323
clean:: Type :: Path { ref path, .. } => Some ( RenderTypeId :: DefId ( path. def_id ( ) ) ) ,
324
324
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 ( ) ) )
327
326
}
328
327
clean:: Primitive ( p) => Some ( RenderTypeId :: Primitive ( p) ) ,
329
328
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