Skip to content

ICE: Cannot relate bound region #11446

New issue

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

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

Already on GitHub? # to your account

Closed
Kimundi opened this issue Jan 10, 2014 · 1 comment
Closed

ICE: Cannot relate bound region #11446

Kimundi opened this issue Jan 10, 2014 · 1 comment

Comments

@Kimundi
Copy link
Member

Kimundi commented Jan 10, 2014

Code:

trait Matchable<'a> {
    fn new_matcher(s: Self, st: &'a str) -> Matcher<'a, Self>;
}

struct Matcher<'a, T>(T, &'a str);

struct A;
impl<'a> Matchable<'a> for A {
    fn new_matcher(s: A, st: &'a str) -> Matcher<'a, A> {
        Matcher(s, st)
    }
}

fn main() {
    fn generic<'a, T: Matchable<'a>>(t: T, s: &'a str) {

    }
    let s = "abc";
    generic(A, s);
}
generic_str_matching.rs:19:5: 19:12 error: internal compiler error: Cannot relate bound region: ReInfer(1) <= ReLateBound(69, BrNamed(syntax::ast::DefId{crate: 0u32, node: 84u32}, a))
This message reflects a bug in the Rust compiler. 
We would appreciate a bug report: https://github.com/mozilla/rust/wiki/HOWTO-submit-a-Rust-bug-report
generic_str_matching.rs:19     generic(A, s);
                               ^~~~~~~
@huonw
Copy link
Member

huonw commented Jan 10, 2014

Closing as a dupe of #5121.

@huonw huonw closed this as completed Jan 10, 2014
flip1995 pushed a commit to flip1995/rust that referenced this issue Sep 12, 2023
flip1995 pushed a commit to flip1995/rust that referenced this issue Sep 12, 2023
…tion, r=Manishearth

Add suggestions for std_instead_of_core

```
changelog: [`std_instead_of_core`]: add suggestions
```

Fixes rust-lang#11446
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants