3 // regression test for #91489
5 use std::borrow::Borrow;
8 pub struct VariantType {}
9 pub struct VariantTy {}
11 impl Borrow<VariantTy> for VariantType {
12 fn borrow(&self) -> &VariantTy {
17 impl ToOwned for VariantTy {
18 type Owned = VariantType;
19 fn to_owned(&self) -> VariantType {
25 pub fn as_str(&self) -> () {}
28 // the presence of this was causing all attempts to call `as_str` on
29 // `Cow<'_, VariantTy>, including in itself, to not find the method
33 Cow::Borrowed(&VariantTy {}).as_str();
39 Cow::Borrowed(&VariantTy {}).as_str()