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

Trim discriminants to their final type size #49403

Merged
merged 2 commits into from
Mar 30, 2018
Merged

Conversation

oli-obk
Copy link
Contributor

@oli-obk oli-obk commented Mar 27, 2018

r? @eddyb

fixes #49181

@pietroalbini pietroalbini added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Mar 27, 2018
@eddyb
Copy link
Member

eddyb commented Mar 27, 2018

@bors r+

@bors
Copy link
Contributor

bors commented Mar 27, 2018

📌 Commit 6b3202a has been approved by eddyb

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Mar 27, 2018
@kennytm
Copy link
Member

kennytm commented Mar 27, 2018

@bors r-

[00:53:07] ---- [run-pass] run-pass/match-arm-statics.rs stdout ----
[00:53:07] 	
[00:53:07] error: compilation failed!
[00:53:07] status: exit code: 101
[00:53:07] command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/run-pass/match-arm-statics.rs" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/run-pass" "--target=x86_64-unknown-linux-gnu" "-C" "prefer-dynamic" "-o" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/run-pass/match-arm-statics.stage2-x86_64-unknown-linux-gnu" "-Crpath" "-O" "-Zmiri" "-Zunstable-options" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-g" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/run-pass/match-arm-statics.stage2-x86_64-unknown-linux-gnu.aux"
[00:53:07] stdout:
[00:53:07] ------------------------------------------
[00:53:07] 
[00:53:07] ------------------------------------------
[00:53:07] stderr:
[00:53:07] ------------------------------------------
[00:53:07] error: internal compiler error: librustc_mir/hair/pattern/mod.rs:873: discriminant 4 not found in [
[00:53:07]     Discr {
[00:53:07]         val: 0,
[00:53:07]         ty: isize
[00:53:07]     },
[00:53:07]     Discr {
[00:53:07]         val: 1,
[00:53:07]         ty: isize
[00:53:07]     },
[00:53:07]     Discr {
[00:53:07]         val: 2,
[00:53:07]         ty: isize
[00:53:07]     },
[00:53:07]     Discr {
[00:53:07]         val: 3,
[00:53:07]         ty: isize
[00:53:07]     }
[00:53:07] ]
[00:53:07] 
[00:53:07] thread 'rustc' panicked at 'Box<Any>', librustc_errors/lib.rs:543:9
[00:53:07] note: Run with `RUST_BACKTRACE=1` for a backtrace.
[00:53:07] error: aborting due to previous error
[00:53:07] 
[00:53:07] 
[00:53:07] note: the compiler unexpectedly panicked. this is a bug.
[00:53:07] 
[00:53:07] note: we would appreciate a bug report: https://github.com/rust-lang/rust/blob/master/CONTRIBUTING.md#bug-reports
[00:53:07] 
[00:53:07] note: rustc 1.26.0-dev running on x86_64-unknown-linux-gnu
[00:53:07] 
[00:53:07] note: compiler flags: -Z miri -Z unstable-options -C prefer-dynamic -C rpath
[00:53:07] 
[00:53:07] 
[00:53:07] ------------------------------------------
[00:53:07] 
[00:53:07] thread '[run-pass] run-pass/match-arm-statics.rs' panicked at 'explicit panic', tools/compiletest/src/runtest.rs:2901:9
[00:53:07] note: Run with `RUST_BACKTRACE=1` for a backtrace.
[00:53:07] 
[00:53:07] 
[00:53:07] failures:
[00:53:07]     [run-pass] run-pass/match-arm-statics.rs

@bors bors added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Mar 27, 2018
@kennytm kennytm added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Mar 27, 2018
ty::layout::Variants::NicheFilling { dataful_variant, .. } =>
dataful_variant,
ty::layout::Variants::NicheFilling { .. } => {
assert_eq!(discr_val as usize as u128, discr_val);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ping @eddyb works now

@oli-obk
Copy link
Contributor Author

oli-obk commented Mar 30, 2018

@bors r=eddyb

@bors
Copy link
Contributor

bors commented Mar 30, 2018

📌 Commit 422efd7 has been approved by eddyb

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Mar 30, 2018
@oli-obk oli-obk added the beta-nominated Nominated for backporting to the compiler in the beta channel. label Mar 30, 2018
@bors
Copy link
Contributor

bors commented Mar 30, 2018

⌛ Testing commit 422efd7 with merge 4379c86...

bors added a commit that referenced this pull request Mar 30, 2018
Trim discriminants to their final type size

r? @eddyb

fixes  #49181
@@ -851,13 +851,38 @@ impl<'a, 'tcx> PatternContext<'a, 'tcx> {
ty::TyAdt(adt_def, substs) if adt_def.is_enum() => {
match cv.val {
ConstVal::Value(val) => {
let discr = const_discr(
let discr_val = const_discr(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Didn't we discuss that what const_discr calls is wrong, and the Tagged handling below should be fixed in there too?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ugh the PR just got merged >_<

@bors
Copy link
Contributor

bors commented Mar 30, 2018

☀️ Test successful - status-appveyor, status-travis
Approved by: eddyb
Pushing 4379c86 to master...

@bors bors merged commit 422efd7 into rust-lang:master Mar 30, 2018
@oli-obk oli-obk deleted the try2 branch March 30, 2018 14:12
@kennytm kennytm removed the beta-nominated Nominated for backporting to the compiler in the beta channel. label Mar 30, 2018
@kennytm
Copy link
Member

kennytm commented Mar 30, 2018

Removing "beta-nominated" tag since we didn't have a beta yet.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

crash while compiling pango 0.1.3
5 participants