- 
                Notifications
    You must be signed in to change notification settings 
- Fork 13.9k
Closed
Description
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);
                               ^~~~~~~
Metadata
Metadata
Assignees
Labels
No labels