-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
Compiler unnecessary panicked due to a mistake in where clause #40294
Comments
Backtrace from playground:
|
See #39361 (comment) for how to fix in the compiler (if anyone wants to pick this up). |
triage: P-high |
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. =) |
@nikomatsakis I don't think we need to handle anything other than |
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 |
@eddyb great minds think alike... |
fix rust-lang#40294 obligation cause.body_id is not always a NodeExpr Hello! This fixes rust-lang#40294 and moves tests related to rust-lang#38812 to a much more sensible directory. Thanks to @nikomatsakis and @eddyb
fix rust-lang#40294 obligation cause.body_id is not always a NodeExpr Hello! This fixes rust-lang#40294 and moves tests related to rust-lang#38812 to a much more sensible directory. Thanks to @nikomatsakis and @eddyb
fix rust-lang#40294 obligation cause.body_id is not always a NodeExpr Hello! This fixes rust-lang#40294 and moves tests related to rust-lang#38812 to a much more sensible directory. Thanks to @nikomatsakis and @eddyb
fix rust-lang#40294 obligation cause.body_id is not always a NodeExpr Hello! This fixes rust-lang#40294 and moves tests related to rust-lang#38812 to a much more sensible directory. Thanks to @nikomatsakis and @eddyb
fix rust-lang#40294 obligation cause.body_id is not always a NodeExpr Hello! This fixes rust-lang#40294 and moves tests related to rust-lang#38812 to a much more sensible directory. Thanks to @nikomatsakis and @eddyb
fix rust-lang#40294 obligation cause.body_id is not always a NodeExpr Hello! This fixes rust-lang#40294 and moves tests related to rust-lang#38812 to a much more sensible directory. Thanks to @nikomatsakis and @eddyb
fix rust-lang#40294 obligation cause.body_id is not always a NodeExpr Hello! This fixes rust-lang#40294 and moves tests related to rust-lang#38812 to a much more sensible directory. Thanks to @nikomatsakis and @eddyb
fix rust-lang#40294 obligation cause.body_id is not always a NodeExpr Hello! This fixes rust-lang#40294 and moves tests related to rust-lang#38812 to a much more sensible directory. Thanks to @nikomatsakis and @eddyb
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
The text was updated successfully, but these errors were encountered: