Skip to content

Compiling with -C debuginfo=2 reduces warnings unexpectedly #48900

Closed

Description

Passing -C debuginfo=2 to rustc gives fewer warnings than debuginfo={0,1}. I expected to see the same output regardless of debug symbols.

Example

 % rustc src/main.rs -C debuginfo=1
warning: this expression will panic at run-time
 --> src/main.rs:4:19
  |
4 |     let element = a[index];
  |                   ^^^^^^^^ index out of bounds: the len is 3 but the index is 10
 % rustc src/main.rs -C debuginfo=2
 % rustc src/main.rs               
warning: this expression will panic at run-time
 --> src/main.rs:4:19
  |
4 |     let element = a[index];
  |                   ^^^^^^^^ index out of bounds: the len is 3 but the index is 10

Version

% rustc --version --verbose
rustc 1.24.1 (d3ae9a9e0 2018-02-27)
binary: rustc
commit-hash: d3ae9a9e08edf12de0ed82af57ba2a56c26496ea
commit-date: 2018-02-27
host: x86_64-unknown-linux-gnu
release: 1.24.1
LLVM version: 4.0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    A-const-fnArea: const fn foo(..) {..}. Pure functions which can be applied at compile time.Area: const fn foo(..) {..}. Pure functions which can be applied at compile time.A-debuginfoArea: Debugging information in compiled programs (DWARF, PDB, etc.)Area: Debugging information in compiled programs (DWARF, PDB, etc.)A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsC-bugCategory: This is a bug.Category: This is a bug.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions