]> git.lizzy.rs Git - rust.git/blobdiff - src/libcollectionstest/str.rs
Changed `std::pattern::Pattern` impl on `&'a &'a str` to `&'a &'b str`
[rust.git] / src / libcollectionstest / str.rs
index 25457043a9df45dd5a5274ae83e9c184b351a240..b84b37dbf752cdb8467804368b67e90d8dcab552 100644 (file)
@@ -1508,6 +1508,19 @@ fn $name() {
     with str::rsplitn;
 }
 
+#[test]
+fn different_str_pattern_forwarding_lifetimes() {
+    use std::str::pattern::Pattern;
+
+    fn foo<'a, P>(p: P) where for<'b> &'b P: Pattern<'a> {
+        for _ in 0..3 {
+            "asdf".find(&p);
+        }
+    }
+
+    foo::<&str>("x");
+}
+
 mod bench {
     use test::{Bencher, black_box};