Skip to content

bounds in ty params can't seem to refer to other ty params #2611

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
catamorphism opened this issue Jun 15, 2012 · 5 comments
Closed

bounds in ty params can't seem to refer to other ty params #2611

catamorphism opened this issue Jun 15, 2012 · 5 comments
Labels
A-resolve Area: Name/path resolution done by `rustc_resolve` specifically
Milestone

Comments

@catamorphism
Copy link
Contributor

This is more-or-less taken from commented-out code in core::iter-trait:

import iter;
import iter::base_iter;

impl Q<A> for base_iter<A> {
   fn flat_map_to_vec<B:copy, IB:base_iter<B>>(op: fn(B) -> IB) -> [B] {
      iter::flat_map_to_vec(self, op)
   }
}

This fails to compile with unresolved typename: B. That's not right, since the method should get resolved in a scope that includes its own ty params. Strangely enough, the same function does compile if it's not inside an impl and takes its self arg explicitly.

@catamorphism
Copy link
Contributor Author

Adding (xfailed) test case as run-pass/issue-2611.rs

@bstrie
Copy link
Contributor

bstrie commented Jul 17, 2012

Post-0.3, the test case gives this error instead:

mismatched types: expected `core::iter::base_iter<'b>` but found `core::iter::base_iter<'a>` (type parameter vs type parameter)
2611.rs:6       iter::flat_map_to_vec(self, op)
                ^~~~~~~~~~~~~~~~~~~~~

Not sure whether or not the message is accurate, but it's certainly unhelpful.

@ghost ghost assigned catamorphism Jul 17, 2012
@catamorphism
Copy link
Contributor Author

I'll try fixing the error message.

@msullivan
Copy link
Contributor

Now it fails with a message saying they have incompatible type parameters. I think I'm going to look into this some.

@catamorphism
Copy link
Contributor Author

I'm going to take this one, since @msullivan already has plenty of stuff ;-) I'm still getting the "incompatible type parameters" message too, which seems wrong. I'll keep looking.

thestinger added a commit that referenced this issue Jun 21, 2013
The removed test for issue #2611 is well covered by the `std::iterator`
module itself.

This adds the `count` method to `IteratorUtil` to replace `EqIter`.
@catamorphism catamorphism removed their assignment Jun 16, 2014
RalfJung pushed a commit to RalfJung/rust that referenced this issue Oct 24, 2022
Update libffi-sys to 2.0.1

Prior version of libffi [could not be cross-compiled to illumos](tov/libffi-rs#59) due to host-triple complications.  This should fix rustup builds of miri for the illumos platform.
Aaron1011 pushed a commit to Aaron1011/rust that referenced this issue Jan 6, 2023
Update libffi-sys to 2.0.1

Prior version of libffi [could not be cross-compiled to illumos](tov/libffi-rs#59) due to host-triple complications.  This should fix rustup builds of miri for the illumos platform.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-resolve Area: Name/path resolution done by `rustc_resolve` specifically
Projects
None yet
Development

No branches or pull requests

3 participants