1 // Copyright 2015 The Rust Project Developers. See the COPYRIGHT
2 // file at the top-level directory of this distribution and at
3 // http://rust-lang.org/COPYRIGHT.
5 // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6 // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7 // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8 // option. This file may not be copied, modified, or distributed
9 // except according to those terms.
11 // Regression test for #21726: an issue arose around the rules for
12 // subtyping of projection types that resulted in an unconstrained
13 // region, yielding region inference failures.
17 fn foo<'a>(s: &'a str) {
18 let b: B<()> = B::new(s, ());
24 fn into_ref(self, &'a str) -> Self::T;
27 impl<'a> IntoRef<'a> for () {
29 fn into_ref(self, s: &'a str) -> &'a str {
34 struct B<'a, P: IntoRef<'a>>(P::T);
36 impl<'a, P: IntoRef<'a>> B<'a, P> {
37 fn new(s: &'a str, i: P) -> B<'a, P> {
41 fn get_short(&self) -> P::T {