diff options
| author | Marvin Löbel <loebel.marvin@gmail.com> | 2016-03-01 17:53:51 +0100 |
|---|---|---|
| committer | Marvin Löbel <loebel.marvin@gmail.com> | 2016-03-01 17:53:51 +0100 |
| commit | dd67e55c10acf80dbd2c14a8eb231e265b5776a4 (patch) | |
| tree | 024b0f78b127558bd5a8ed9ee0e53b826ae71788 /src/libcollectionstest | |
| parent | 0a52494f7e259f49a3be176dc6fb151c755d6686 (diff) | |
| download | rust-dd67e55c10acf80dbd2c14a8eb231e265b5776a4.tar.gz rust-dd67e55c10acf80dbd2c14a8eb231e265b5776a4.zip | |
Changed `std::pattern::Pattern` impl on `&'a &'a str` to `&'a &'b str`
in order to allow a bit more felixibility in how to use it.
Diffstat (limited to 'src/libcollectionstest')
| -rw-r--r-- | src/libcollectionstest/str.rs | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/libcollectionstest/str.rs b/src/libcollectionstest/str.rs index 25457043a9d..b84b37dbf75 100644 --- a/src/libcollectionstest/str.rs +++ b/src/libcollectionstest/str.rs @@ -1508,6 +1508,19 @@ generate_iterator_test! { 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}; |
