diff --git a/tests/ui/use_self.fixed b/tests/ui/use_self.fixed index f8b97d8d4917..1f4d9a14eb2f 100644 --- a/tests/ui/use_self.fixed +++ b/tests/ui/use_self.fixed @@ -341,12 +341,26 @@ mod issue2843 { trait Foo { type Bar; } - + impl Foo for usize { type Bar = u8; } - + impl Foo for Option { type Bar = Option; } -} \ No newline at end of file +} + +mod issue3859 { + pub struct Foo; + pub struct Bar([usize; 3]); + + impl Foo { + pub const BAR: usize = 3; + + pub fn foo() { + const _X: usize = Foo::BAR; + // const _Y: usize = Self::BAR; + } + } +} diff --git a/tests/ui/use_self.rs b/tests/ui/use_self.rs index 863963a8cef3..11194583335d 100644 --- a/tests/ui/use_self.rs +++ b/tests/ui/use_self.rs @@ -341,12 +341,26 @@ mod issue2843 { trait Foo { type Bar; } - + impl Foo for usize { type Bar = u8; } - + impl Foo for Option { type Bar = Option; } -} \ No newline at end of file +} + +mod issue3859 { + pub struct Foo; + pub struct Bar([usize; 3]); + + impl Foo { + pub const BAR: usize = 3; + + pub fn foo() { + const _X: usize = Foo::BAR; + // const _Y: usize = Self::BAR; + } + } +}