diff options
Diffstat (limited to '')
-rw-r--r-- | src/test/ui/issues/issue-5321-immediates-with-bare-self.rs | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/test/ui/issues/issue-5321-immediates-with-bare-self.rs b/src/test/ui/issues/issue-5321-immediates-with-bare-self.rs new file mode 100644 index 000000000..64aa2836a --- /dev/null +++ b/src/test/ui/issues/issue-5321-immediates-with-bare-self.rs @@ -0,0 +1,15 @@ +// run-pass + +trait Fooable { + fn yes(self); +} + +impl Fooable for usize { + fn yes(self) { + for _ in 0..self { println!("yes"); } + } +} + +pub fn main() { + 2.yes(); +} |