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

const prop missing diagnostic with unrelated changes #101470

Closed
oli-obk opened this issue Sep 6, 2022 · 4 comments
Closed

const prop missing diagnostic with unrelated changes #101470

oli-obk opened this issue Sep 6, 2022 · 4 comments
Assignees
Labels
A-diagnostics Area: Messages for errors, warnings, and lints A-lint Area: Lints (warnings about flaws in source code) such as unused_mut. A-mir-opt Area: MIR optimizations C-bug Category: This is a bug. P-high High priority regression-from-stable-to-stable Performance or correctness regression from one stable version to another. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@oli-obk
Copy link
Contributor

oli-obk commented Sep 6, 2022

Since rustc 1.61, the following code is not giving a compile-time error:

fn main() {
    let xs = [10, 20, 30];
    println!("{}", xs[10]);

    let _n = xs.len();
}

If I uncomment the last line, the compile-time error shows up.
Is this right? I would expect the compile-time error to show up in both cases (this is what happens for rustc < 1.61).

cc @oli-obk

Originally posted by @paolieri in #48920 (comment)

@oli-obk oli-obk added C-bug Category: This is a bug. A-mir-opt Area: MIR optimizations A-diagnostics Area: Messages for errors, warnings, and lints labels Sep 6, 2022
@steffahn
Copy link
Member

steffahn commented Sep 6, 2022

@rustbot label A-lint, regression-from-stable-to-stable

For context, the “error” pre-1.61 is the deny-by-default unconditional_panic lint

error: this operation will panic at runtime
 --> <source>:3:20
  |
3 |     println!("{}", xs[10]);
  |                    ^^^^^^ index out of bounds: the length is 3 but the index is 10
  |
  = note: `#[deny(unconditional_panic)]` on by default

error: aborting due to previous error

Bisection points to regression in #94934.

@rustbot rustbot added A-lint Area: Lints (warnings about flaws in source code) such as unused_mut. regression-from-stable-to-stable Performance or correctness regression from one stable version to another. I-prioritize Issue: Indicates that prioritization has been requested for this issue. labels Sep 6, 2022
@oli-obk oli-obk self-assigned this Sep 6, 2022
@Dajamante
Copy link
Contributor

@rustbot claim

@rustbot rustbot assigned Dajamante and unassigned oli-obk Sep 6, 2022
@apiraino
Copy link
Contributor

apiraino commented Sep 8, 2022

WG-prioritization assigning priority (Zulip discussion).

@rustbot label -I-prioritize +P-high T-compiler

@rustbot rustbot added P-high High priority T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. and removed I-prioritize Issue: Indicates that prioritization has been requested for this issue. labels Sep 8, 2022
@oli-obk
Copy link
Contributor Author

oli-obk commented Sep 14, 2022

duplicate of #98444

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-diagnostics Area: Messages for errors, warnings, and lints A-lint Area: Lints (warnings about flaws in source code) such as unused_mut. A-mir-opt Area: MIR optimizations C-bug Category: This is a bug. P-high High priority regression-from-stable-to-stable Performance or correctness regression from one stable version to another. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

5 participants