Skip to content

Pass -Werror when building LLVM wrapper in CI #109712

Open

Description

@debohman

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.

Activity

  1. added
    A-LLVMArea: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues.
    on Mar 29, 2023
  2. jyn514 commented on Apr 3, 2023

    @jyn514
    Member

    Oh, I saw these recently too actually. They also exist on latest master.

  3. added
    C-cleanupCategory: PRs that clean code up or issues documenting cleanup.
    E-mediumCall for participation: Medium difficulty. Experience needed to fix: Intermediate.
    on Apr 3, 2023
  4. jyn514 commented on Apr 3, 2023

    @jyn514
    Member

    Probably we should block CI on these errors? They should at least be controlled by deny-warnings in config.toml.

  5. added
    T-bootstrapRelevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)
    on Apr 3, 2023
  6. klensy commented on May 7, 2023

    @klensy
    Contributor

    Fixed by #110523?

  7. jyn514 commented on May 7, 2023

    @jyn514
    Member

    The warning was fixed, but we should still block on warnings in CI.

  8. changed the title [-]LLVM deprecation warnings while building rustc 1.68.2 against llvm-16.0.0[/-] [+]Pass -Werror when building LLVM in CI[/+] on May 24, 2023
  9. rperier commented on Jul 11, 2025

    @rperier
    Contributor

    @rustbot claim

  10. changed the title [-]Pass -Werror when building LLVM in CI[/-] [+]Pass -Werror when building LLVM wrapper in CI[/+] on Jul 12, 2025
  11. added a commit that references this issue on Aug 7, 2025
  12. added a commit that references this issue on Aug 7, 2025
  13. 2 remaining items

  14. rperier commented on Sep 5, 2025

    @rperier
    Contributor

    Even if it is fixed by PR #143807, I propose the keep this issue opened until it is fixed without workaround for msvc. It should be fixable with llvm22, there is a FIXME (see #143807 (comment))

  15. nikic commented on Sep 5, 2025

    @nikic
    Contributor

    I don't think this should ever be enabled with MSVC. LLVM generally only guarantees warning-freedom when building with Clang, as other compilers have too many false positives. And MSVC is the absolute king of useless, false-positive compiler warnings.

  16. rperier commented on Sep 5, 2025

    @rperier
    Contributor

    If we really have too many false positives, we can keep it disabled, I agree. We have to remove the FIXME, in this case. @tgross35 what do you think ? (keep it disabled forever and do not wait llvm22).

  17. tgross35 commented on Sep 5, 2025

    @tgross35
    Member

    No objection, I didn't consider that context. Changing a FIXME to a comment to that effect seems reasonable.

  18. added a commit that references this issue on Sep 6, 2025
  19. added a commit that references this issue on Sep 7, 2025
  20. added a commit that references this issue on Nov 10, 2025
  21. added a commit that references this issue on Aug 31, 2026
  22. added a commit that references this issue on Sep 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

A-LLVMArea: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues.C-bugCategory: This is a bug.C-cleanupCategory: PRs that clean code up or issues documenting cleanup.E-mediumCall for participation: Medium difficulty. Experience needed to fix: Intermediate.T-bootstrapRelevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions