1 // Copyright 2017 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 // Unit test for the "user substitutions" that are annotated on each
17 fn method<U>(&self, arg: T, arg2: U) { }
20 impl<T, U> Bazoom<U> for T {
27 <_ as Bazoom<_>>::method(&a, b, &c); // OK
30 fn annot_underscore() {
34 <_ as Bazoom<_>>::method::<_>(&a, b, &c); // OK
37 fn annot_reference_any_lifetime() {
41 <_ as Bazoom<_>>::method::<&u32>(&a, b, &c); // OK
44 fn annot_reference_static_lifetime() {
48 <_ as Bazoom<_>>::method::<&'static u32>(&a, b, &c); //~ ERROR
51 fn annot_reference_named_lifetime<'a>(_d: &'a u32) {
55 <_ as Bazoom<_>>::method::<&'a u32>(&a, b, &c); //~ ERROR
58 fn annot_reference_named_lifetime_ok<'a>(c: &'a u32) {
61 <_ as Bazoom<_>>::method::<&'a u32>(&a, b, c);
64 fn annot_reference_named_lifetime_in_closure<'a>(_: &'a u32) {
69 <_ as Bazoom<_>>::method::<&'a u32>(&a, b, &c); //~ ERROR
73 fn annot_reference_named_lifetime_in_closure_ok<'a>(c: &'a u32) {
77 <_ as Bazoom<_>>::method::<&'a u32>(&a, b, c);