Skip to content

Commit

Permalink
Auto merge of #118390 - cuviper:beta-next, r=cuviper
Browse files Browse the repository at this point in the history
[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
  • Loading branch information
bors committed Nov 28, 2023
2 parents b66b795 + 271143a commit bd45872
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
10 changes: 6 additions & 4 deletions library/core/src/mem/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
///
Expand Down
4 changes: 4 additions & 0 deletions library/core/src/str/pattern.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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]
/////////////////////////////////////////////////////////////////////////////
Expand Down
2 changes: 1 addition & 1 deletion src/llvm-project
Submodule llvm-project updated 55 files
+5 −2 clang/include/clang/Sema/Sema.h
+4 −3 clang/lib/CodeGen/CGExprConstant.cpp
+6 −3 clang/lib/Driver/ToolChains/Solaris.cpp
+6 −0 clang/lib/Format/TokenAnnotator.cpp
+11 −0 clang/lib/Interpreter/CMakeLists.txt
+6 −0 clang/test/CodeGenCXX/const-init-cxx11.cpp
+16 −5 clang/test/Driver/solaris-ld.c
+18 −0 clang/test/Sema/PR69717.cpp
+10 −0 clang/unittests/Format/TokenAnnotatorTest.cpp
+1 −1 libcxx/include/__config
+85 −97 libcxx/include/__expected/expected.h
+8 −0 libcxx/test/std/utilities/expected/expected.expected/assign/emplace.intializer_list.pass.cpp
+7 −0 libcxx/test/std/utilities/expected/expected.expected/assign/emplace.pass.cpp
+9 −2 libcxx/test/std/utilities/expected/expected.expected/ctor/ctor.convert.copy.pass.cpp
+9 −2 libcxx/test/std/utilities/expected/expected.expected/ctor/ctor.convert.move.pass.cpp
+16 −2 libcxx/test/std/utilities/expected/expected.expected/ctor/ctor.copy.pass.cpp
+3 −2 libcxx/test/std/utilities/expected/expected.expected/ctor/ctor.default.pass.cpp
+10 −8 libcxx/test/std/utilities/expected/expected.expected/ctor/ctor.inplace.pass.cpp
+7 −2 libcxx/test/std/utilities/expected/expected.expected/ctor/ctor.inplace_init_list.pass.cpp
+18 −2 libcxx/test/std/utilities/expected/expected.expected/ctor/ctor.move.pass.cpp
+13 −8 libcxx/test/std/utilities/expected/expected.expected/ctor/ctor.u.pass.cpp
+10 −8 libcxx/test/std/utilities/expected/expected.expected/ctor/ctor.unexpect.pass.cpp
+7 −2 libcxx/test/std/utilities/expected/expected.expected/ctor/ctor.unexpect_init_list.pass.cpp
+4 −4 libcxx/test/std/utilities/expected/expected.expected/ctor/ctor.unexpected.copy.pass.cpp
+4 −4 libcxx/test/std/utilities/expected/expected.expected/ctor/ctor.unexpected.move.pass.cpp
+32 −0 libcxx/test/std/utilities/expected/expected.expected/observers/has_value.pass.cpp
+63 −1 libcxx/test/std/utilities/expected/expected.expected/swap/free.swap.pass.cpp
+63 −1 libcxx/test/std/utilities/expected/expected.expected/swap/member.swap.pass.cpp
+9 −2 libcxx/test/std/utilities/expected/expected.void/ctor/ctor.convert.copy.pass.cpp
+9 −2 libcxx/test/std/utilities/expected/expected.void/ctor/ctor.convert.move.pass.cpp
+9 −2 libcxx/test/std/utilities/expected/expected.void/ctor/ctor.copy.pass.cpp
+10 −2 libcxx/test/std/utilities/expected/expected.void/ctor/ctor.move.pass.cpp
+4 −2 libcxx/test/std/utilities/expected/expected.void/ctor/ctor.unexpect.pass.cpp
+7 −2 libcxx/test/std/utilities/expected/expected.void/ctor/ctor.unexpect_init_list.pass.cpp
+2 −2 libcxx/test/std/utilities/expected/expected.void/ctor/ctor.unexpected.copy.pass.cpp
+2 −2 libcxx/test/std/utilities/expected/expected.void/ctor/ctor.unexpected.move.pass.cpp
+12 −0 libcxx/test/std/utilities/expected/expected.void/observers/has_value.pass.cpp
+30 −2 libcxx/test/std/utilities/expected/expected.void/swap/free.swap.pass.cpp
+29 −1 libcxx/test/std/utilities/expected/expected.void/swap/member.swap.pass.cpp
+49 −0 libcxx/test/std/utilities/expected/types.h
+1 −1 llvm/CMakeLists.txt
+0 −6 llvm/lib/CodeGen/BranchFolding.cpp
+1 −0 llvm/lib/CodeGen/SelectionDAG/LegalizeTypes.h
+10 −0 llvm/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp
+8 −6 llvm/lib/Target/Mips/MipsISelLowering.cpp
+22 −8 llvm/lib/Transforms/IPO/GlobalOpt.cpp
+2 −1 llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
+12 −12 llvm/test/CodeGen/Mips/llvm-ir/ashr.ll
+13 −13 llvm/test/CodeGen/Mips/llvm-ir/lshr.ll
+13 −13 llvm/test/CodeGen/Mips/llvm-ir/shl.ll
+25 −0 llvm/test/CodeGen/PowerPC/pr70208.ll
+44 −0 llvm/test/Transforms/SLPVectorizer/X86/reduction-gather-non-scheduled-extracts.ll
+20 −20 llvm/test/Transforms/SLPVectorizer/X86/reduction-transpose.ll
+1 −1 llvm/utils/gn/secondary/llvm/version.gni
+1 −1 llvm/utils/lit/lit/__init__.py

0 comments on commit bd45872

Please sign in to comment.