-
Notifications
You must be signed in to change notification settings - Fork 13.1k
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
Fix unwrap error in overflowing int literal #136760
Fix unwrap error in overflowing int literal #136760
Conversation
Well the unwrap existed for a reason. My preferred way would be to check the negated hir id again instead of using the result of combining the negated arg and the negated hir id. |
526e328
to
ace6bb9
Compare
you mean don't use this line: let negative = negated ^ (type_limits.negated_expr_id == Some(hir_id)); I updated the change. |
I guess that works too, very nice @bors r+ rollup |
…t-crash, r=oli-obk Fix unwrap error in overflowing int literal Fixes rust-lang#136675 it's maybe `negative` only from [check_lit](https://github.com/chenyukang/rust/blob/526e3288feb68eac55013746e03fb54d6a0b9a1e/compiler/rustc_lint/src/types.rs#L546), in this scenario the fields in `TypeLimits` is none. r? `@oli-obk`
Rollup of 5 pull requests Successful merges: - rust-lang#134999 (Add cygwin target.) - rust-lang#135488 (Stabilize `vec_pop_if`) - rust-lang#136068 (crashes: more tests) - rust-lang#136694 (Update minifier version to `0.3.4`) - rust-lang#136760 (Fix unwrap error in overflowing int literal) r? `@ghost` `@rustbot` modify labels: rollup
…iaskrgr Rollup of 7 pull requests Successful merges: - rust-lang#135488 (Stabilize `vec_pop_if`) - rust-lang#136068 (crashes: more tests) - rust-lang#136694 (Update minifier version to `0.3.4`) - rust-lang#136722 (Visit all debug info in MIR Visitor) - rust-lang#136746 (Emit an error if `-Zdwarf-version=1` is requested) - rust-lang#136760 (Fix unwrap error in overflowing int literal) - rust-lang#136782 (Fix mistake in x86_64-unknown-freebsd platform description) r? `@ghost` `@rustbot` modify labels: rollup
Rollup merge of rust-lang#136760 - chenyukang:fix-overflowing-int-lint-crash, r=oli-obk Fix unwrap error in overflowing int literal Fixes rust-lang#136675 it's maybe `negative` only from [check_lit](https://github.com/chenyukang/rust/blob/526e3288feb68eac55013746e03fb54d6a0b9a1e/compiler/rustc_lint/src/types.rs#L546), in this scenario the fields in `TypeLimits` is none. r? ``@oli-obk``
Fixes #136675
it's maybe
negative
only from check_lit, in this scenario the fields inTypeLimits
is none.r? @oli-obk