Auto merge of #118390 - cuviper:beta-next, r=cuviper
[beta] backports - feat: implement `DoubleEndedSearcher` for `CharArray[Ref]Searcher` #111922 - Update to LLVM 17.0.5 #117907 - clarify `fn discriminant` guarantees: only free lifetimes may get erased #118006 r? ghost
This commit is contained in:
commit
bd45872d96
3 changed files with 11 additions and 5 deletions
|
|
@ -1132,10 +1132,12 @@ impl<T> fmt::Debug for Discriminant<T> {
|
|||
///
|
||||
/// [Reference]: ../../reference/items/enumerations.html#custom-discriminant-values-for-fieldless-enumerations
|
||||
///
|
||||
/// The value of a [`Discriminant<T>`] is independent of any *lifetimes* in `T`. As such, reading
|
||||
/// or writing a `Discriminant<Foo<'a>>` as a `Discriminant<Foo<'b>>` (whether via [`transmute`] or
|
||||
/// otherwise) is always sound. Note that this is **not** true for other kinds of generic
|
||||
/// parameters; `Discriminant<Foo<A>>` and `Discriminant<Foo<B>>` might be incompatible.
|
||||
/// The value of a [`Discriminant<T>`] is independent of any *free lifetimes* in `T`. As such,
|
||||
/// reading or writing a `Discriminant<Foo<'a>>` as a `Discriminant<Foo<'b>>` (whether via
|
||||
/// [`transmute`] or otherwise) is always sound. Note that this is **not** true for other kinds
|
||||
/// of generic parameters and for higher-ranked lifetimes; `Discriminant<Foo<A>>` and
|
||||
/// `Discriminant<Foo<B>>` as well as `Discriminant<Bar<dyn for<'a> Trait<'a>>>` and
|
||||
/// `Discriminant<Bar<dyn Trait<'static>>>` may be incompatible.
|
||||
///
|
||||
/// # Examples
|
||||
///
|
||||
|
|
|
|||
|
|
@ -806,6 +806,8 @@ unsafe impl<'a, const N: usize> ReverseSearcher<'a> for CharArraySearcher<'a, N>
|
|||
searcher_methods!(reverse);
|
||||
}
|
||||
|
||||
impl<'a, const N: usize> DoubleEndedSearcher<'a> for CharArraySearcher<'a, N> {}
|
||||
|
||||
/// Searches for chars that are equal to any of the [`char`]s in the array.
|
||||
///
|
||||
/// # Examples
|
||||
|
|
@ -826,6 +828,8 @@ unsafe impl<'a, 'b, const N: usize> ReverseSearcher<'a> for CharArrayRefSearcher
|
|||
searcher_methods!(reverse);
|
||||
}
|
||||
|
||||
impl<'a, 'b, const N: usize> DoubleEndedSearcher<'a> for CharArrayRefSearcher<'a, 'b, N> {}
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Impl for &[char]
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
Subproject commit fef3d7b14ede45d051dc688aae0bb8c8b02a0566
|
||||
Subproject commit 7738295178045041669876bf32b0543ec8319a5c
|
||||
Loading…
Add table
Add a link
Reference in a new issue