Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign upCompiler unnecessary panicked due to a mistake in where clause #40294
Comments
Bendrien
changed the title
Unnecessary panick due to where clause
Compiler unnecessary panicked due to mistake in where clause
Mar 6, 2017
Bendrien
changed the title
Compiler unnecessary panicked due to mistake in where clause
Compiler unnecessary panicked due to a mistake in where clause
Mar 6, 2017
TimNN
added
I-ICE
regression-from-stable-to-nightly
T-compiler
labels
Mar 6, 2017
This comment has been minimized.
This comment has been minimized.
|
Backtrace from playground:
|
brson
added
the
I-nominated
label
Mar 9, 2017
This comment has been minimized.
This comment has been minimized.
|
See #39361 (comment) for how to fix in the compiler (if anyone wants to pick this up). |
This comment has been minimized.
This comment has been minimized.
|
triage: P-high |
rust-highfive
added
P-high
and removed
I-nominated
labels
Mar 9, 2017
nikomatsakis
added
E-easy
E-mentor
labels
Mar 9, 2017
This comment has been minimized.
This comment has been minimized.
|
Good chance to make a simple, high-impact fix. =) The problem is that this line of code assumes that The right thing to do would be to
OK, not totally trivial, but I don't have time for more in-depth notes just yet. =) |
This comment has been minimized.
This comment has been minimized.
|
@nikomatsakis I don't think we need to handle anything other than |
This comment has been minimized.
This comment has been minimized.
|
Never mind, the easy fix is to do something like this: let opt_expr = match self.tcx.hir.find(cause.body_id) {
rustc::hir::map::NodeExpr(e) => Some(e),
_ => None,
}then down below where we do |
This comment has been minimized.
This comment has been minimized.
|
@eddyb great minds think alike... |
Bendrien commentedMar 6, 2017
•
edited
The compiler unexpectedly panicked where a nice error should be produced.
I tried this code:
I simply forgot to change the third entry in the where clause to
B.Meta
rustc --version --verbose:rustc 1.17.0-nightly (24a70eb 2017-02-09)
binary: rustc
commit-hash: 24a70eb
commit-date: 2017-02-09
host: x86_64-pc-windows-gnu
release: 1.17.0-nightly
LLVM version: 3.9
Backtrace:
thread 'rustc' panicked at 'Box', C:\bot\slave\nightly-dist-rustc-win-gnu-64\build\src\librustc_errors\lib.rs:417
stack backtrace:
0: 0x659e854a - strncmp
1: 0x659f2fa7 - strncmp
2: 0x659f2b21 - strncmp
3: 0x659f352e - strncmp
4: 0x66242f9a - strncmp
5: 0x6625b044 - strncmp
6: 0x6f387f5e - strncmp
7: 0x6f387cb5 - strncmp
8: 0x6f3874fc - strncmp
9: 0x6f29c278 - strncmp
10: 0x6f39578b - strncmp
11: 0x6f38af55 - strncmp
12: 0x6f389971 - strncmp
13: 0x70cab10f - strncmp
14: 0x70bea5d6 - strncmp
15: 0x70c6d966 - strncmp
16: 0x70c8097a - strncmp
17: 0x70c97768 - strncmp
18: 0x70cfd984 - strncmp
19: 0x69c60b83 - strncmp
20: 0x69bbc0ab - strncmp
21: 0x69c4ace4 - strncmp
22: 0x69c343a9 - strncmp
23: 0x69c7f2b9 - strncmp
24: 0x69b8af05 - strncmp
25: 0x659f6938 - strncmp
26: 0x69ba83b4 - strncmp
27: 0x659f0d52 - strncmp
28: 0x7ffff6398363 - strncmp