Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add regression test for #60218 #64706

Merged
merged 1 commit into from
Oct 4, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions src/test/ui/issues/issue-60218.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
// Regression test for #60218
//
// This was reported to cause ICEs.

use std::iter::Map;

pub trait Foo {}

pub fn trigger_error<I, F>(iterable: I, functor: F)
where
for<'t> &'t I: IntoIterator,
for<'t> Map<<&'t I as IntoIterator>::IntoIter, F>: Iterator,
for<'t> <Map<<&'t I as IntoIterator>::IntoIter, F> as Iterator>::Item: Foo,
{
}

fn main() {
trigger_error(vec![], |x: &u32| x) //~ ERROR E0277
}
15 changes: 15 additions & 0 deletions src/test/ui/issues/issue-60218.stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
error[E0277]: the trait bound `for<'t> <std::iter::Map<<&'t _ as std::iter::IntoIterator>::IntoIter, _> as std::iter::Iterator>::Item: Foo` is not satisfied
--> $DIR/issue-60218.rs:18:5
|
LL | pub fn trigger_error<I, F>(iterable: I, functor: F)
| -------------
...
LL | for<'t> <Map<<&'t I as IntoIterator>::IntoIter, F> as Iterator>::Item: Foo,
| --- required by this bound in `trigger_error`
...
LL | trigger_error(vec![], |x: &u32| x)
| ^^^^^^^^^^^^^ the trait `for<'t> Foo` is not implemented for `<std::iter::Map<<&'t _ as std::iter::IntoIterator>::IntoIter, _> as std::iter::Iterator>::Item`

error: aborting due to previous error

For more information about this error, try `rustc --explain E0277`.