|
122 | 122 | // gdb-command:whatis has_associated_type_trait |
123 | 123 | // gdb-check:type = &(dyn type_names::Trait3<u32, AssocType=isize> + core::marker::Send) |
124 | 124 |
|
| 125 | +// gdb-command:whatis has_associated_type_but_no_generics_trait |
| 126 | +// gdb-check:type = &dyn type_names::TraitNoGenericsButWithAssocType<Output=isize> |
| 127 | + |
125 | 128 | // BARE FUNCTIONS |
126 | 129 | // gdb-command:whatis rust_fn |
127 | 130 | // gdb-check:type = (fn(core::option::Option<isize>, core::option::Option<&type_names::mod1::Struct2>), usize) |
|
228 | 231 | // cdb-check:struct ref_mut$<dyn$<type_names::Trait1> > mut_ref_trait = [...] |
229 | 232 | // cdb-check:struct alloc::boxed::Box<dyn$<core::marker::Send,core::marker::Sync>,alloc::alloc::Global> no_principal_trait = [...] |
230 | 233 | // cdb-check:struct ref$<dyn$<type_names::Trait3<u32,assoc$<AssocType,isize> >,core::marker::Send> > has_associated_type_trait = struct ref$<dyn$<type_names::Trait3<u32,assoc$<AssocType,isize> >,core::marker::Send> > |
| 234 | +// cdb-check:struct ref$<dyn$<type_names::TraitNoGenericsButWithAssocType<assoc$<Output,isize> > > > has_associated_type_but_no_generics_trait = struct ref$<dyn$<type_names::TraitNoGenericsButWithAssocType<assoc$<Output,isize> > > > |
231 | 235 |
|
232 | 236 | // BARE FUNCTIONS |
233 | 237 | // cdb-command:dv /t *_fn* |
@@ -317,12 +321,22 @@ trait Trait3<T> { |
317 | 321 | panic!() |
318 | 322 | } |
319 | 323 | } |
| 324 | +trait TraitNoGenericsButWithAssocType { |
| 325 | + type Output; |
| 326 | + fn foo(&self) -> Self::Output; |
| 327 | +} |
320 | 328 |
|
321 | 329 | impl Trait1 for isize {} |
322 | 330 | impl<T1, T2> Trait2<T1, T2> for isize {} |
323 | 331 | impl<T> Trait3<T> for isize { |
324 | 332 | type AssocType = isize; |
325 | 333 | } |
| 334 | +impl TraitNoGenericsButWithAssocType for isize { |
| 335 | + type Output = isize; |
| 336 | + fn foo(&self) -> Self::Output { |
| 337 | + *self |
| 338 | + } |
| 339 | +} |
326 | 340 |
|
327 | 341 | fn rust_fn(_: Option<isize>, _: Option<&mod1::Struct2>) {} |
328 | 342 | extern "C" fn extern_c_fn(_: isize) {} |
@@ -413,6 +427,8 @@ fn main() { |
413 | 427 | let mut_ref_trait = (&mut mut_int1) as &mut dyn Trait1; |
414 | 428 | let no_principal_trait = Box::new(0_isize) as Box<(dyn Send + Sync)>; |
415 | 429 | let has_associated_type_trait = &0_isize as &(dyn Trait3<u32, AssocType = isize> + Send); |
| 430 | + let has_associated_type_but_no_generics_trait = |
| 431 | + &0_isize as &dyn TraitNoGenericsButWithAssocType<Output = isize>; |
416 | 432 |
|
417 | 433 | let generic_box_trait = Box::new(0_isize) as Box<dyn Trait2<i32, mod1::Struct2>>; |
418 | 434 | let generic_ref_trait = (&0_isize) as &dyn Trait2<Struct1, Struct1>; |
|
0 commit comments