From 0aa94ff3c3419fdd58d87ad226d94ee0128f778b Mon Sep 17 00:00:00 2001 From: Luqman Aden Date: Wed, 19 Jun 2013 19:49:23 -0400 Subject: [PATCH] Add test for #5321. --- .../issue-5321-immediates-with-bare-self.rs | 25 +++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 src/test/run-pass/issue-5321-immediates-with-bare-self.rs diff --git a/src/test/run-pass/issue-5321-immediates-with-bare-self.rs b/src/test/run-pass/issue-5321-immediates-with-bare-self.rs new file mode 100644 index 0000000000000..7b809c39cb83d --- /dev/null +++ b/src/test/run-pass/issue-5321-immediates-with-bare-self.rs @@ -0,0 +1,25 @@ +// Copyright 2013 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +trait Fooable { + fn yes(self); +} + +impl Fooable for uint { + fn yes(self) { + for self.times { + println("yes"); + } + } +} + +fn main() { + 2.yes(); +}