Skip to content

error: each predicate in a where clause must have at least one bound in it #1

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

Closed
emk opened this issue Sep 22, 2014 · 3 comments
Closed

Comments

@emk
Copy link

emk commented Sep 22, 2014

Good morning! One of my Rust builds failed last night with an error in rust-replace-map, and I thought you might like to know:

src/lib.rs:18:7: 18:11 error: each predicate in a `where` clause must have at least one bound in it
src/lib.rs:18 where F: |: T| -> T {
                    ^~~~
src/lib.rs:18:10: 18:11 error: expected `{`, found `|`
src/lib.rs:18 where F: |: T| -> T {
                       ^

I'm not quite sure how where clauses work yet. I need to go look that up. :-)

@emk
Copy link
Author

emk commented Sep 22, 2014

See rust-lang/rust#17454 for one failed attempt to fix this:

pub fn replace_map<'a, T, F>(src: &mut T, prod: F)
where F: FnOnce(T) -> T {

@reem
Copy link
Owner

reem commented Sep 22, 2014

Ah, that's because of a change to unboxed closure syntax. It's because |: T| -> T is not a trait anymore.

Why does the above fail?

@reem
Copy link
Owner

reem commented Sep 23, 2014

Fixed in latest master.

@reem reem closed this as completed Sep 23, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants