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

vamsikal3 opened this Issue Jan 11, 2017 · 2 comments


None yet

3 participants

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/ no enclosing scope found for scope: CodeExtent(10/Misc(NodeId(22)))
 --> src/
8 |                                     Some(x) => x,
  |                                          ^

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

note: we would appreciate a bug report:

thread 'rustc' panicked at 'Box<Any>', ../src/librustc_errors/
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 commented Jan 11, 2017


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

fn main() {}
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