diff options
| author | Luqman Aden <me@luqman.ca> | 2014-08-25 13:37:40 -0700 |
|---|---|---|
| committer | Luqman Aden <me@luqman.ca> | 2014-08-25 13:37:40 -0700 |
| commit | 2ab4486cbb450a6d1fb6a71bdeb6372c3bcef6c2 (patch) | |
| tree | e0255281376835e8bc5db2074f2aadf4308aee83 | |
| parent | 1660c3be932ff7beff5f025a708bf3ee0ff2ebd4 (diff) | |
| download | rust-2ab4486cbb450a6d1fb6a71bdeb6372c3bcef6c2.tar.gz rust-2ab4486cbb450a6d1fb6a71bdeb6372c3bcef6c2.zip | |
Add test.
| -rw-r--r-- | src/test/auxiliary/issue-16643.rs | 27 | ||||
| -rw-r--r-- | src/test/run-pass/issue-16643.rs | 17 |
2 files changed, 44 insertions, 0 deletions
diff --git a/src/test/auxiliary/issue-16643.rs b/src/test/auxiliary/issue-16643.rs new file mode 100644 index 00000000000..b30ccb4dded --- /dev/null +++ b/src/test/auxiliary/issue-16643.rs @@ -0,0 +1,27 @@ +// Copyright 2014 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 <LICENSE-APACHE or +// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license +// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +#![crate_type = "lib"] + +pub struct TreeBuilder<H>; + +impl<H> TreeBuilder<H> { + pub fn process_token(&mut self) { + match self { + _ => for _y in *self {} + } + } +} + +impl<H> Iterator<H> for TreeBuilder<H> { + fn next(&mut self) -> Option<H> { + None + } +} diff --git a/src/test/run-pass/issue-16643.rs b/src/test/run-pass/issue-16643.rs new file mode 100644 index 00000000000..db877aaafca --- /dev/null +++ b/src/test/run-pass/issue-16643.rs @@ -0,0 +1,17 @@ +// Copyright 2014 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 <LICENSE-APACHE or +// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license +// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +// aux-build:issue-16643.rs + +extern crate i = "issue-16643"; + +pub fn main() { + i::TreeBuilder::<uint>.process_token(); +} |
