Remove generic lifetime parameter of trait `Pattern` · model-checking/verify-rust-std@d76c965
@@ -1497,10 +1497,7 @@ impl String {
14971497 /// ```
14981498 #[cfg(not(no_global_oom_handling))]
14991499#[unstable(feature = "string_remove_matches", reason = "new API", issue = "72826")]
1500-pub fn remove_matches<'a, P>(&'a mut self, pat: P)
1501-where
1502-P: for<'x> Pattern<'x>,
1503-{
1500+pub fn remove_matches<P: Pattern>(&mut self, pat: P) {
15041501use core::str::pattern::Searcher;
1505150215061503let rejections = {
@@ -2288,35 +2285,41 @@ impl<'a> Extend<Cow<'a, str>> for String {
22882285 reason = "API not fully fleshed out and ready to be stabilized",
22892286 issue = "27721"
22902287)]
2291-impl<'a, 'b> Pattern<'a> for &'b String {
2292-type Searcher = <&'b str as Pattern<'a>>::Searcher;
2288+impl<'b> Pattern for &'b String {
2289+type Searcher<'a> = <&'b str as Pattern>::Searcher<'a>;
229322902294-fn into_searcher(self, haystack: &'a str) -> <&'b str as Pattern<'a>>::Searcher {
2291+fn into_searcher(self, haystack: &str) -> <&'b str as Pattern>::Searcher<'_> {
22952292self[..].into_searcher(haystack)
22962293}
2297229422982295#[inline]
2299-fn is_contained_in(self, haystack: &'a str) -> bool {
2296+fn is_contained_in(self, haystack: &str) -> bool {
23002297self[..].is_contained_in(haystack)
23012298}
2302229923032300#[inline]
2304-fn is_prefix_of(self, haystack: &'a str) -> bool {
2301+fn is_prefix_of(self, haystack: &str) -> bool {
23052302self[..].is_prefix_of(haystack)
23062303}
2307230423082305#[inline]
2309-fn strip_prefix_of(self, haystack: &'a str) -> Option<&'a str> {
2306+fn strip_prefix_of(self, haystack: &str) -> Option<&str> {
23102307self[..].strip_prefix_of(haystack)
23112308}
2312230923132310#[inline]
2314-fn is_suffix_of(self, haystack: &'a str) -> bool {
2311+fn is_suffix_of<'a>(self, haystack: &'a str) -> bool
2312+where
2313+Self::Searcher<'a>: core::str::pattern::ReverseSearcher<'a>,
2314+{
23152315self[..].is_suffix_of(haystack)
23162316}
2317231723182318#[inline]
2319-fn strip_suffix_of(self, haystack: &'a str) -> Option<&'a str> {
2319+fn strip_suffix_of<'a>(self, haystack: &'a str) -> Option<&str>
2320+where
2321+Self::Searcher<'a>: core::str::pattern::ReverseSearcher<'a>,
2322+{
23202323self[..].strip_suffix_of(haystack)
23212324}
23222325}