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

ICE when compiling function w/ Iterator with lifetime constraint #12008

Closed
yuriks opened this issue Feb 3, 2014 · 2 comments
Closed

ICE when compiling function w/ Iterator with lifetime constraint #12008

yuriks opened this issue Feb 3, 2014 · 2 comments

Comments

@yuriks
Copy link
Contributor

yuriks commented Feb 3, 2014

The code:

fn f<'a, T: Iterator<&'a int>>(arg_iter: &'a mut T) {
    arg_iter.next().unwrap().clone();
}

Produces an ICE when compiled (using rustc from master at time of writing):

yuriks@reinforce ~/rust-ice % rustc --lib main.rs
main.rs:2:5: 2:30 error: internal compiler error: Cannot relate bound region: ReScope(23) <= ReLateBound(3, BrNamed(syntax::ast::DefId{crate: 0u32, node: 17u32}, a))
This message reflects a bug in the Rust compiler. 
We would appreciate a bug report: http://static.rust-lang.org/doc/master/complement-bugreport.html
main.rs:2     arg_iter.next().unwrap().clone();
              ^~~~~~~~~~~~~~~~~~~~~~~~~
101 yuriks@reinforce ~/rust-ice %
@huonw
Copy link
Member

huonw commented Feb 3, 2014

Dupe of #5121. Thanks for the report.

@huonw huonw closed this as completed Feb 3, 2014
@pnkfelix
Copy link
Member

(still reproduces, as is, on rustc 0.10-pre (caf17fe 2014-03-21).)

flip1995 pushed a commit to flip1995/rust that referenced this issue Jan 11, 2024
make [`mutex_atomic`] more type aware

fixes: rust-lang#9872

---

changelog: [`mutex_atomic`] now suggests more specific atomic types and skips mutex i128 and u128
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

3 participants