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

Use span_bug for unexpected field projection type #99404

Merged
merged 1 commit into from
Jul 19, 2022
Merged

Commits on Jul 18, 2022

  1. Use span_bug for unexpected field projection type

    Improves the compiler error backtrace information, as shown in rust-lang#99363,
    by using `span_bug` instead of `bug`.
    
    New output:
    
    ```
    build/aarch64-apple-darwin/stage1/bin/rustc /tmp/test.rs --edition=2021
    error: internal compiler error: compiler/rustc_middle/src/ty/closure.rs:185:25: Unexpected type Opaque(DefId(0:5 ~ test[db0f]::main::T::{opaque#0}), []) for `Field` projection
      --> /tmp/test.rs:11:27
       |
    11 |         let Foo((a, b)) = foo;
       |                           ^^^
    
    thread 'rustc' panicked at 'Box<dyn Any>', /Users/jmq/src/forked/rust/compiler/rustc_errors/src/lib.rs:1331:9
    stack backtrace:
    ```
    
    (Remainder of output truncated.)
    Jordan McQueen authored and Jordan McQueen committed Jul 18, 2022
    Configuration menu
    Copy the full SHA
    38f090b View commit details
    Browse the repository at this point in the history