Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make const panic!("..") work in Rust 2021. #86998

Merged
merged 9 commits into from
Jul 29, 2021

Commits on Jul 28, 2021

  1. Make const panic!("..") work in Rust 2021.

    During const eval, this replaces calls to core::panicking::panic_fmt and
    std::panicking::being_panic_fmt with a call to a new const fn:
    core::panicking::const_panic_fmt. That function uses
    fmt::Arguments::as_str() to get the str and calls panic_str with that
    instead.
    
    panic!() invocations with formatting arguments are still not accepted,
    as the creation of such a fmt::Arguments cannot be done in constant
    functions right now.
    m-ou-se committed Jul 28, 2021
    Configuration menu
    Copy the full SHA
    f827d3e View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    91d0823 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    76cf1b8 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    b64c4f9 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    b48274f View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    38bf5b0 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    4e63561 View commit details
    Browse the repository at this point in the history
  8. Improve comments about const panic handling

    Co-authored-by: Ralf Jung <post@ralfj.de>
    m-ou-se and RalfJung committed Jul 28, 2021
    Configuration menu
    Copy the full SHA
    0b8033a View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    312bf8e View commit details
    Browse the repository at this point in the history