Skip to content

Commit 5020fcf

Browse files
committed
use_self - add test case of #3859
1 parent f0dc26f commit 5020fcf

File tree

2 files changed

+34
-6
lines changed

2 files changed

+34
-6
lines changed

tests/ui/use_self.fixed

+17-3
Original file line numberDiff line numberDiff line change
@@ -341,12 +341,26 @@ mod issue2843 {
341341
trait Foo {
342342
type Bar;
343343
}
344-
344+
345345
impl Foo for usize {
346346
type Bar = u8;
347347
}
348-
348+
349349
impl<T: Foo> Foo for Option<T> {
350350
type Bar = Option<T::Bar>;
351351
}
352-
}
352+
}
353+
354+
mod issue3859 {
355+
pub struct Foo;
356+
pub struct Bar([usize; 3]);
357+
358+
impl Foo {
359+
pub const BAR: usize = 3;
360+
361+
pub fn foo() {
362+
const _X: usize = Foo::BAR;
363+
// const _Y: usize = Self::BAR;
364+
}
365+
}
366+
}

tests/ui/use_self.rs

+17-3
Original file line numberDiff line numberDiff line change
@@ -341,12 +341,26 @@ mod issue2843 {
341341
trait Foo {
342342
type Bar;
343343
}
344-
344+
345345
impl Foo for usize {
346346
type Bar = u8;
347347
}
348-
348+
349349
impl<T: Foo> Foo for Option<T> {
350350
type Bar = Option<T::Bar>;
351351
}
352-
}
352+
}
353+
354+
mod issue3859 {
355+
pub struct Foo;
356+
pub struct Bar([usize; 3]);
357+
358+
impl Foo {
359+
pub const BAR: usize = 3;
360+
361+
pub fn foo() {
362+
const _X: usize = Foo::BAR;
363+
// const _Y: usize = Self::BAR;
364+
}
365+
}
366+
}

0 commit comments

Comments
 (0)