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

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

Closed
ghost opened this issue Jan 11, 2017 · 4 comments
Closed

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

ghost opened this issue Jan 11, 2017 · 4 comments
Labels
I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️

Comments

@ghost
Copy link

ghost commented Jan 11, 2017

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
Copy link
Contributor

arielb1 commented Jan 11, 2017

minified:

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

fn main() {}

@arielb1
Copy link
Contributor

arielb1 commented Jan 11, 2017

cc #38520.

@sanxiyn sanxiyn added the I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ label Jan 11, 2017
@oli-obk
Copy link
Contributor

oli-obk commented Jan 26, 2017

dupe of #29093

@steveklabnik
Copy link
Member

closing as duplicate

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️
Projects
None yet
Development

No branches or pull requests

4 participants