|
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*
|
@@ -318,12 +322,22 @@ trait Trait3<T> {
|
318 | 322 | panic!()
|
319 | 323 | }
|
320 | 324 | }
|
| 325 | +trait TraitNoGenericsButWithAssocType { |
| 326 | + type Output; |
| 327 | + fn foo(&self) -> Self::Output; |
| 328 | +} |
321 | 329 |
|
322 | 330 | impl Trait1 for isize {}
|
323 | 331 | impl<T1, T2> Trait2<T1, T2> for isize {}
|
324 | 332 | impl<T> Trait3<T> for isize {
|
325 | 333 | type AssocType = isize;
|
326 | 334 | }
|
| 335 | +impl TraitNoGenericsButWithAssocType for isize { |
| 336 | + type Output = isize; |
| 337 | + fn foo(&self) -> Self::Output { |
| 338 | + *self |
| 339 | + } |
| 340 | +} |
327 | 341 |
|
328 | 342 | fn rust_fn(_: Option<isize>, _: Option<&mod1::Struct2>) {}
|
329 | 343 | extern "C" fn extern_c_fn(_: isize) {}
|
@@ -414,6 +428,8 @@ fn main() {
|
414 | 428 | let mut_ref_trait = (&mut mut_int1) as &mut dyn Trait1;
|
415 | 429 | let no_principal_trait = Box::new(0_isize) as Box<(dyn Send + Sync)>;
|
416 | 430 | let has_associated_type_trait = &0_isize as &(dyn Trait3<u32, AssocType = isize> + Send);
|
| 431 | + let has_associated_type_but_no_generics_trait = |
| 432 | + &0_isize as &dyn TraitNoGenericsButWithAssocType<Output = isize>; |
417 | 433 |
|
418 | 434 | let generic_box_trait = Box::new(0_isize) as Box<dyn Trait2<i32, mod1::Struct2>>;
|
419 | 435 | let generic_ref_trait = (&0_isize) as &dyn Trait2<Struct1, Struct1>;
|
|
0 commit comments