Skip to content

Commit

Permalink
Auto merge of #41728 - sirideain:inference-failure-for-loops-test, r=…
Browse files Browse the repository at this point in the history
…alexcrichton

Add test for an inference failure.

Fixes #22066
  • Loading branch information
bors committed May 3, 2017
2 parents 8305394 + 3e03b1a commit 2d4ed8e
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions src/test/run-pass/issue-22066.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
// Copyright 2017 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.

pub trait LineFormatter<'a> {
type Iter: Iterator<Item=&'a str> + 'a;
fn iter(&'a self, line: &'a str) -> Self::Iter;

fn dimensions(&'a self, line: &'a str) {
let iter: Self::Iter = self.iter(line);
<_ as IntoIterator>::into_iter(iter);
}
}

fn main() {}

0 comments on commit 2d4ed8e

Please sign in to comment.