Internal compiler error when there is no enclosing scope. #38979

Open
vamsikal3 opened this Issue Jan 11, 2017 · 2 comments

Projects

None yet

3 participants

@vamsikal3
vamsikal3 commented Jan 11, 2017 edited

This snippet gives the following error:

const TEN : num::bigint::BigInt = match num::bigint::ToBigInt::to_bigint(&10) {
                                                       Some(x) => x,
                                                       None => panic!("Could not create bigint."),
                                                    };
vamsi@vamsi-laptop:~/learn/project_euler/257_to_384/problem_323$ cargo run
   Compiling problem_323 v0.1.0 (file:///home/vamsi/learn/project_euler/257_to_384/problem_323)
error: internal compiler error: ../src/librustc_typeck/check/dropck.rs:284: no enclosing scope found for scope: CodeExtent(10/Misc(NodeId(22)))
 --> src/main.rs:8:42
  |
8 |                                     Some(x) => x,
  |                                          ^

note: the compiler unexpectedly panicked. this is a bug.

note: we would appreciate a bug report: https://github.com/rust-lang/rust/blob/master/CONTRIBUTING.md#bug-reports

thread 'rustc' panicked at 'Box<Any>', ../src/librustc_errors/lib.rs:383
note: Run with `RUST_BACKTRACE=1` for a backtrace.

error: Could not compile `problem_323`.

To learn more, run the command again with --verbose.

@arielb1
Contributor
arielb1 commented Jan 11, 2017

minified:

const TEN : &'static usize = match &10 {
    x => x,
};

fn main() {}
@arielb1
Contributor
arielb1 commented Jan 11, 2017

cc #38520.

@sanxiyn sanxiyn added the I-ICE label Jan 11, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment