Repository: rust
Issue: Pass -Werror when building LLVM in CI
Labels: C-cleanup,A-LLVM,T-bootstrap,E-medium,C-bug

<!--
Thank you for filing a bug report! 🐛 Please provide a short summary of the bug,
along with any information you feel relevant to replicating the bug.
-->

While building rustc against an installed llvm-16.0.0, the following warnings occur, twice:

```
warning: llvm-wrapper/PassWrapper.cpp:538:7: warning: 'any_isa<const llvm::Module *>' is deprecated: Use any_cast(Any*) != nullptr instead [-Wdeprecated-declarations]
warning:   if (any_isa<const Module *>(WrappedIr))
warning:       ^~~~~~~
warning:       any_cast
warning: /usr/local/include/llvm/ADT/Any.h:130:1: note: 'any_isa<const llvm::Module *>' has been explicitly marked deprecated here
warning: LLVM_DEPRECATED("Use any_cast(Any*) != nullptr instead", "any_cast")
warning: ^
warning: /usr/local/include/llvm/Support/Compiler.h:143:50: note: expanded from macro 'LLVM_DEPRECATED'
warning: #define LLVM_DEPRECATED(MSG, FIX) __attribute__((deprecated(MSG, FIX)))
warning:                                                  ^
warning: llvm-wrapper/PassWrapper.cpp:540:7: warning: 'any_isa<const llvm::Function *>' is deprecated: Use any_cast(Any*) != nullptr instead [-Wdeprecated-declarations]
warning:   if (any_isa<const Function *>(WrappedIr))
warning:       ^~~~~~~
warning:       any_cast
warning: /usr/local/include/llvm/ADT/Any.h:130:1: note: 'any_isa<const llvm::Function *>' has been explicitly marked deprecated here
warning: LLVM_DEPRECATED("Use any_cast(Any*) != nullptr instead", "any_cast")
warning: ^
warning: /usr/local/include/llvm/Support/Compiler.h:143:50: note: expanded from macro 'LLVM_DEPRECATED'
warning: #define LLVM_DEPRECATED(MSG, FIX) __attribute__((deprecated(MSG, FIX)))
warning:                                                  ^
warning: llvm-wrapper/PassWrapper.cpp:542:7: warning: 'any_isa<const llvm::Loop *>' is deprecated: Use any_cast(Any*) != nullptr instead [-Wdeprecated-declarations]
warning:   if (any_isa<const Loop *>(WrappedIr))
warning:       ^~~~~~~
warning:       any_cast
warning: /usr/local/include/llvm/ADT/Any.h:130:1: note: 'any_isa<const llvm::Loop *>' has been explicitly marked deprecated here
warning: LLVM_DEPRECATED("Use any_cast(Any*) != nullptr instead", "any_cast")
warning: ^
warning: /usr/local/include/llvm/Support/Compiler.h:143:50: note: expanded from macro 'LLVM_DEPRECATED'
warning: #define LLVM_DEPRECATED(MSG, FIX) __attribute__((deprecated(MSG, FIX)))
warning:                                                  ^
warning: llvm-wrapper/PassWrapper.cpp:544:7: warning: 'any_isa<const llvm::LazyCallGraph::SCC *>' is deprecated: Use any_cast(Any*) != nullptr instead [-Wdeprecated-declarations]
warning:   if (any_isa<const LazyCallGraph::SCC *>(WrappedIr))
warning:       ^~~~~~~
warning:       any_cast
warning: /usr/local/include/llvm/ADT/Any.h:130:1: note: 'any_isa<const llvm::LazyCallGraph::SCC *>' has been explicitly marked deprecated here
warning: LLVM_DEPRECATED("Use any_cast(Any*) != nullptr instead", "any_cast")
warning: ^
warning: /usr/local/include/llvm/Support/Compiler.h:143:50: note: expanded from macro 'LLVM_DEPRECATED'
warning: #define LLVM_DEPRECATED(MSG, FIX) __attribute__((deprecated(MSG, FIX)))
warning:                                                  ^
warning: 4 warnings generated.
```

`rustc --version --verbose`:
```
rustc 1.68.1 (8460ca823 2023-03-20) (built from a source tarball)
binary: rustc
commit-hash: 8460ca823e8367a30dda430efda790588b8c84d3
commit-date: 2023-03-20
host: x86_64-apple-darwin
release: 1.68.1
LLVM version: 16.0.0
```

This report is to document the issue.