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: unprintable span) #32090

Closed
hank-der-hafenarbeiter opened this issue Mar 7, 2016 · 3 comments
Closed

(internal compiler error: unprintable span) #32090

hank-der-hafenarbeiter opened this issue Mar 7, 2016 · 3 comments
Labels
I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️

Comments

@hank-der-hafenarbeiter
Copy link
Contributor

When running "cargo test" on this code (reproducable for me when checking out the compiler_bug branch). The compiler outputs:

 Compiling SFCodec v0.1.0 (file:///home/kevin/Projects/Rust/SFCodec)
<std macros>:5:4: 84:20 error: mismatched types:
 expected `bool`,
    found `u8`
(expected bool,
    found u8) [E0308]
(internal compiler error: unprintable span)
src/utils.rs:84:9: 84:57 note: in this expansion of assert! (defined in <std macros>)
<std macros>:5:4: 84:20 help: run `rustc --explain E0308` to see a detailed explanation
error: aborting due to previous error
Could not compile `SFCodec`.

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

This is the corresponding code snipped:

fn test_byte_and_back() {
     extern crate rand;
     use self::rand::{thread_rng, Rng};

     let mut rng = thread_rng();
     for i in 0..20 {
         let mut num:u8 = 0;
         for i in 0..8 {
             num = rng.gen();
          } 

         assert!(num, bools_to_byte(byte_to_bools(num)));             //line 84
      }
 } 

rustc --version --verbose:

 rustc 1.6.0 (c30b771ad 2016-01-19)
 binary: rustc
 commit-hash: c30b771ad9d44ab84f8c88b80c25fcfde2433126
 commit-date: 2016-01-19
 host: x86_64-unknown-linux-gnu
 release: 1.6.0
@sanxiyn sanxiyn added the I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ label Mar 7, 2016
@nagisa
Copy link
Member

nagisa commented Mar 7, 2016

Works fine in both of

rustc 1.8.0-nightly (0ef8d4260 2016-02-24)
rustc 1.9.0-nightly (d31d8a9a9 2016-03-04)

@wesleywiser
Copy link
Member

Seems like a duplicate of #28308

@Mark-Simulacrum
Copy link
Member

I get the following. This isn't an ICE, so I'm going to go ahead and close. Please reopen if there's actually something wrong here!

error[E0308]: mismatched types
  --> src/utils.rs:84:9
   |
84 |         assert!(num, bools_to_byte(byte_to_bools(num)));
   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected bool, found u8
   |
   = note: this error originates in a macro outside of the current crate

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

5 participants