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

support type annot in constants, casts #55152

Merged

Conversation

nikomatsakis
Copy link
Contributor

@nikomatsakis nikomatsakis commented Oct 17, 2018

Fixes #54571
Fixes #54332
Fixes #55183

r? @pnkfelix

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Oct 17, 2018
@nikomatsakis nikomatsakis force-pushed the nll-issue-54571-type-annot-in-constants branch from 8920925 to bc1f493 Compare October 17, 2018 15:34
@rust-highfive
Copy link
Collaborator

The job x86_64-gnu-llvm-5.0 of your PR failed on Travis (raw log). Through arcane magic we have determined that the following fragments from the build log may contain information about the problem.

Click to expand the log.
[00:21:46]    Compiling rustc_tsan v0.0.0 (/checkout/src/librustc_tsan)
[00:21:48]    Compiling rustc_lsan v0.0.0 (/checkout/src/librustc_lsan)
[00:21:48]    Compiling rustc_msan v0.0.0 (/checkout/src/librustc_msan)
[00:21:48]    Compiling rustc_asan v0.0.0 (/checkout/src/librustc_asan)
[00:22:21] error: internal compiler error: broken MIR in DefId(0/0:544 ~ compiler_builtins[69d2]::float[0]::conv[0]::__fixsfsi[0]) (const Unevaluated(DefId(0/0:196 ~ compiler_builtins[69d2]::float[0]::Float[0]::SIGN_MASK[0]), [f32]):u32): bad constant user type TypeOf(DefId(0/0:196 ~ compiler_builtins[69d2]::float[0]::Float[0]::SIGN_MASK[0]), Canonical { variables: [], value: UserSubsts { substs: [f32], user_self_ty: None } }) vs u32: NoSolution
[00:22:21]    --> rustc/compiler_builtins_shim/../../libcompiler_builtins/src/float/conv.rs:173:24
[00:22:21]     |
[00:22:21] 173 |         let sign_bit = <$fty>::SIGN_MASK;
[00:22:21] ...
[00:22:21] ...
[00:22:21] 219 |         float_to_int!(f, f32, i32)
[00:22:21] 
[00:22:21] 
[00:22:21] error: internal compiler error: broken MIR in DefId(0/0:544 ~ compiler_builtins[69d2]::float[0]::conv[0]::__fixsfsi[0]) (const Unevaluated(DefId(0/0:197 ~ compiler_builtins[69d2]::float[0]::Float[0]::SIGNIFICAND_MASK[0]), [f32]):u32): bad constant user type TypeOf(DefId(0/0:197 ~ compiler_builtins[69d2]::float[0]::Float[0]::SIGNIFICAND_MASK[0]), Canonical { variables: [], value: UserSubsts { substs: [f32], user_self_ty: None } }) vs u32: NoSolution
[00:22:21]    --> rustc/compiler_builtins_shim/../../libcompiler_builtins/src/float/conv.rs:185:36
[00:22:21]     |
[00:22:21] 185 |         let significand = (a_abs & <$fty>::SIGNIFICAND_MASK) | <$fty>::IMPLICIT_BIT;
[00:22:21] ...
[00:22:21] ...
[00:22:21] 219 |         float_to_int!(f, f32, i32)
[00:22:21] 
[00:22:21] 
[00:22:21] error: internal compiler error: broken MIR in DefId(0/0:544 ~ compiler_builtins[69d2]::float[0]::conv[0]::__fixsfsi[0]) (const Unevaluated(DefId(0/0:198 ~ compiler_builtins[69d2]::float[0]::Float[0]::IMPLICIT_BIT[0]), [f32]):u32): bad constant user type TypeOf(DefId(0/0:198 ~ compiler_builtins[69d2]::float[0]::Float[0]::IMPLICIT_BIT[0]), Canonical { variables: [], value: UserSubsts { substs: [f32], user_self_ty: None } }) vs u32: NoSolution
[00:22:21]    --> rustc/compiler_builtins_shim/../../libcompiler_builtins/src/float/conv.rs:185:64
[00:22:21]     |
[00:22:21] 185 |         let significand = (a_abs & <$fty>::SIGNIFICAND_MASK) | <$fty>::IMPLICIT_BIT;
[00:22:21] ...
[00:22:21] ...
[00:22:21] 219 |         float_to_int!(f, f32, i32)
[00:22:21] 
[00:22:21] 
[00:22:21] error: internal compiler error: broken MIR in DefId(0/0:545 ~ compiler_builtins[69d2]::float[0]::conv[0]::__fixsfdi[0]) (const Unevaluated(DefId(0/0:196 ~ compiler_builtins[69d2]::float[0]::Float[0]::SIGN_MASK[0]), [f32]):u32): bad constant user type TypeOf(DefId(0/0:196 ~ compiler_builtins[69d2]::float[0]::Float[0]::SIGN_MASK[0]), Canonical { variables: [], value: UserSubsts { substs: [f32], user_self_ty: None } }) vs u32: NoSolution
[00:22:21]    --> rustc/compiler_builtins_shim/../../libcompiler_builtins/src/float/conv.rs:173:24
[00:22:21]     |
[00:22:21] 173 |         let sign_bit = <$fty>::SIGN_MASK;
[00:22:21] ...
[00:22:21] ...
[00:22:21] 224 |         float_to_int!(f, f32, i64)
[00:22:21] 
[00:22:21] 
[00:22:21] error: internal compiler error: broken MIR in DefId(0/0:545 ~ compiler_builtins[69d2]::float[0]::conv[0]::__fixsfdi[0]) (const Unevaluated(DefId(0/0:197 ~ compiler_builtins[69d2]::float[0]::Float[0]::SIGNIFICAND_MASK[0]), [f32]):u32): bad constant user type TypeOf(DefId(0/0:197 ~ compiler_builtins[69d2]::float[0]::Float[0]::SIGNIFICAND_MASK[0]), Canonical { variables: [], value: UserSubsts { substs: [f32], user_self_ty: None } }) vs u32: NoSolution
[00:22:21]    --> rustc/compiler_builtins_shim/../../libcompiler_builtins/src/float/conv.rs:185:36
[00:22:21]     |
[00:22:21] 185 |         let significand = (a_abs & <$fty>::SIGNIFICAND_MASK) | <$fty>::IMPLICIT_BIT;
[00:22:21] ...
[00:22:21] ...
[00:22:21] 224 |         float_to_int!(f, f32, i64)
[00:22:21] 
[00:22:21] 
[00:22:21] error: internal compiler error: broken MIR in DefId(0/0:545 ~ compiler_builtins[69d2]::float[0]::conv[0]::__fixsfdi[0]) (const Unevaluated(DefId(0/0:198 ~ compiler_builtins[69d2]::float[0]::Float[0]::IMPLICIT_BIT[0]), [f32]):u32): bad constant user type TypeOf(DefId(0/0:198 ~ compiler_builtins[69d2]::float[0]::Float[0]::IMPLICIT_BIT[0]), Canonical { variables: [], value: UserSubsts { substs: [f32], user_self_ty: None } }) vs u32: NoSolution
[00:22:21]    --> rustc/compiler_builtins_shim/../../libcompiler_builtins/src/float/conv.rs:185:64
[00:22:21]     |
[00:22:21] 185 |         let significand = (a_abs & <$fty>::SIGNIFICAND_MASK) | <$fty>::IMPLICIT_BIT;
[00:22:21] ...
[00:22:21] ...
[00:22:21] 224 |         float_to_int!(f, f32, i64)
[00:22:21] 
[00:22:21] 
[00:22:21] error: internal compiler error: broken MIR in DefId(0/0:546 ~ compiler_builtins[69d2]::float[0]::conv[0]::__fixsfti[0]) (const Unevaluated(DefId(0/0:196 ~ compiler_builtins[69d2]::float[0]::Float[0]::SIGN_MASK[0]), [f32]):u32): bad constant user type TypeOf(DefId(0/0:196 ~ compiler_builtins[69d2]::float[0]::Float[0]::SIGN_MASK[0]), Canonical { variables: [], value: UserSubsts { substs: [f32], user_self_ty: None } }) vs u32: NoSolution
[00:22:21] ...
[00:22:21] ...
[00:22:21] 229 |         float_to_int!(f, f32, i128)
[00:22:21] 
[00:22:21] 
[00:22:21] error: internal compiler error: broken MIR in DefId(0/0:546 ~ compiler_builtins[69d2]::float[0]::conv[0]::__fixsfti[0]) (const Unevaluated(DefId(0/0:198 ~ compiler_builtins[69d2]::float[0]::Float[0]::IMPLICIT_BIT[0]), [f32]):u32): bad constant user type TypeOf(DefId(0/0:198 ~ compiler_builtins[69d2]::float[0]::Float[0]::IMPLICIT_BIT[0]), Canonical { variables: [], value: UserSubsts { substs: [f32], user_self_ty: None } }) vs u32: NoSolution
[00:22:21]    --> rustc/compiler_builtins_shim/../../libcompiler_builtins/src/float/conv.rs:185:64
[00:22:21]     |
[00:22:21] 185 |         let significand = (a_abs & <$fty>::SIGNIFICAND_MASK) | <$fty>::IMPLICIT_BIT;
[00:22:21] ...
[00:22:21] ...
[00:22:21] 229 |         float_to_int!(f, f32, i128)
[00:22:21] 
[00:22:21] 
[00:22:21] error: internal compiler error: broken MIR in DefId(0/0:547 ~ compiler_builtins[69d2]::float[0]::conv[0]::__fixdfsi[0]) (const Unevaluated(DefId(0/0:196 ~ compiler_builtins[69d2]::float[0]::Float[0]::SIGN_MASK[0]), [f64]):u64): bad constant user type TypeOf(DefId(0/0:196 ~ compiler_builtins[69d2]::float[0]::Float[0]::SIGN_MASK[0]), Canonical { variables: [], value: UserSubsts { substs: [f64], user_self_ty: None } }) vs u64: NoSolution
[00:22:21]    --> rustc/compiler_builtins_shim/../../libcompiler_builtins/src/float/conv.rs:173:24
[00:22:21]     |
[00:22:21] 173 |         let sign_bit = <$fty>::SIGN_MASK;
[00:22:21] ...
[00:22:21] ...
[00:22:21] 234 |         float_to_int!(f, f64, i32)
[00:22:21] 
[00:22:21] 
[00:22:21] error: internal compiler error: broken MIR in DefId(0/0:547 ~ compiler_builtins[69d2]::float[0]::conv[0]::__fixdfsi[0]) (const Unevaluated(DefId(0/0:197 ~ compiler_builtins[69d2]::float[0]::Float[0]::SIGNIFICAND_MASK[0]), [f64]):u64): bad constant user type TypeOf(DefId(0/0:197 ~ compiler_builtins[69d2]::float[0]::Float[0]::SIGNIFICAND_MASK[0]), Canonical { variables: [], value: UserSubsts { substs: [f64], user_self_ty: None } }) vs u64: NoSolution
[00:22:21]    --> rustc/compiler_builtins_shim/../../libcompiler_builtins/src/float/conv.rs:185:36
[00:22:21]     |
[00:22:21] 185 |         let significand = (a_abs & <$fty>::SIGNIFICAND_MASK) | <$fty>::IMPLICIT_BIT;
[00:22:21] ...
[00:22:21] ...
[00:22:21] 234 |         float_to_int!(f, f64, i32)
[00:22:21] 
[00:22:21] 
[00:22:21] error: internal compiler error: broken MIR in DefId(0/0:547 ~ compiler_builtins[69d2]::float[0]::conv[0]::__fixdfsi[0]) (const Unevaluated(DefId(0/0:198 ~ compiler_builtins[69d2]::float[0]::Float[0]::IMPLICIT_BIT[0]), [f64]):u64): bad constant user type TypeOf(DefId(0/0:198 ~ compiler_builtins[69d2]::float[0]::Float[0]::IMPLICIT_BIT[0]), Canonical { variables: [], value: UserSubsts { substs: [f64], user_self_ty: None } }) vs u64: NoSolution
[00:22:21]    --> rustc/compiler_builtins_shim/../../libcompiler_builtins/src/float/conv.rs:185:64
[00:22:21]     12m239 |         float_to_int!(f, f64, i64)
[00:22:21] 
[00:22:21] 
[00:22:21] error: internal compiler error: broken MIR in DefId(0/0:548 ~ compiler_builtins[69d2]::float[0]::conv[0]::__fixdfdi[0]) (const Unevaluated(DefId(0/0:197 ~ compiler_builtins[69d2]::float[0]::Float[0]::SIGNIFICAND_MASK[0]), [f64]):u64): bad constant user type TypeOf(DefId(0/0:197 ~ compiler_builtins[69d2]::float[0]::Float[0]::SIGNIFICAND_MASK[0]), Canonical { variables: [], value: UserSubsts { substs: [f64], user_self_ty: None } }) vs u64: NoSolution
[00:22:21]    --> rustc/compiler_builtins_shim/../../libcompiler_builtins/src/float/conv.rs:185:36
[00:22:21]     |
[00:22:21] 185 |         let significand = (a_abs & <$fty>::SIGNIFICAND_MASK) | <$fty>::IMPLICIT_BIT;
[00:22:21] ...
[00:22:21] ...
[00:22:21] 239 |         float_to_int!(f, f64, i64)
[00:22:21] 
[00:22:21] 
[00:22:21] error: internal compiler errorGNIFICAND_MASK) | <$fty>::IMPLICIT_BIT;
[00:22:21] ...
[00:22:21] ...
[00:22:21] 244 |         float_to_int!(f, f64, i128)
[00:22:21] 
[00:22:21] 
[00:22:21] error: internal compiler error: broken MIR in DefId(0/0:549 ~ compiler_builtins[69d2]::float[0]::conv[0]::__fixdfti[0]) (const Unevaluated(DefId(0/0:198 ~ compiler_builtins[69d2]::float[0]::Float[0]::IMPLICIT_BIT[0]), [f64]):u64): bad constant user type TypeOf(DefId(0/0:198 ~ compiler_builtins[69d2]::float[0]::Float[0]::IMPLICIT_BIT[0]), Canonical { variables: [], value: UserSubsts { substs: [f64], user_self_ty: None } }) vs u64: NoSolution
[00:22:21]    --> rustc/compiler_builtins_shim/../../libcompiler_builtins/src/float/conv.rs:185:64
[00:22:21]     |
[00:22:21] 185 |         let significand = (a_abs & <$fty>::SIGNIFICAND_MASK) | <$fty>::IMPLICIT_BIT;
[00:22:21] ...
[00:22:21] ...
[00:22:21] 244 |         float_to_int!(f, ustc/compiler_builtins_shim/../../libcompiler_builtins/src/float/conv.rs:185:64
[00:22:21]     |
[00:22:21] 185 |         let significand = (a_abs & <$fty>::SIGNIFICAND_MASK) | <$fty>::IMPLICIT_BIT;
[00:22:21] ...
[00:22:21] ...
[00:22:21] 249 |         float_to_int!(f, f32, u32)
[00:22:21] 
[00:22:21] 
[00:22:21] error: internal compiler error: broken MIR in DefId(0/0:551 ~ compiler_builtins[69d2]::float[0]::conv[0]::__fixunssfdi[0]) (const Unevaluated(DefId(0/0:196 ~ compiler_builtins[69d2]::float[0]::Float[0]::SIGN_MASK[0]), [f32]):u32): bad constant user type TypeOf(DefId(0/0:196 ~ compiler_builtins[69d2]::float[0]::Float[0]::SIGN_MASK[0]), Canonical { variables: [], value: UserSubsts { substs: [f32], user_self_ty: None } }) vs u32: NoSolution
[00:22:21]    --> rustc/compiler_builtins_shim/../../libcompiler_builtins/src/float/conv.rs:173:24
[00:22:21]     |
[00:22:21] 173 |         let sign_bit = <$fty>::SIGN_MASK;
[00:22:21] ...
[00:22:21] ...
[00:22:21] 254 |         float_to_int!(f, f32, u64)
[00:22:21] 
[00:22:21] 
[00:22:21] error: internal compiler error: broken MIR in DefId(0/0:551 ~ compiler_builtins[69d2]::float[0]::conv[0]::__fixunssfdi[0]) (const Unevaluated(DefId(0/0:197 ~ compiler_builtins[69d2]::float[0]::Float[0]::SIGNIFICAND_MASK[0]), [f32]):u32): bad constant user type TypeOf(DefId(0/0:197 ~ compiler_builtins[69d2]::float[0]::Float[0]::SIGNIFICAND_MASK[0]), Canonical { variables: [], value: UserSubsts { substs: [f32], user_self_ty: None } }) vs u32: NoSolution
[00:22:21]    --> rustc/compiler_builtins_shim/../../libcompiler_builtins/src/float/conv.rs:185:36
[00:22:21]     |
[00:22:21] 185 |         let significand = (a_abs & <$fty>::SIGNIFICAND_MASK) | <$fty>::IMPLICIT_BIT;
[00:22:21] ...
[00:22:21] ...
[00:22:21] 254 |         float_to_int!(f, f32, u64)
[00:22:21] 
[00:22:21] 
[00:22:21] error: internal compiler error: broken MIR in DefId(0/0:551 ~ compiler_builtins[69d2]::float[0]::conv[0]::__fixunssfdi[0]) (const Unevaluated(DefId(0/0:198 ~ compiler_builtins[69d2]::float[0]::Float[0]::IMPLICIT_BIT[0]), [f32]):u32): bad constant user type TypeOf(DefId(0/0:198 ~ compiler_builtins[69d2]::float[0]::Float[0]::IMPLICIT_BIT[0]), Canonical { variables: [], value: UserSubsts { substs: [f32], user_self_ty: None } }) vs u32: NoSolution
[00:22:21]    --> rustc/compiler_builtins_shim/../../libcompiler_builtins/src/float/conv.rs:185:64
[00:22:21]     |
[00:22:21] 185 |         let significand = (a_abs & <$fty>::SIGNIFICAND_MASK) | <$fty>::IMPLICIT_BIT;
[00:22:21] ...
[00:22:21] ...
[00:22:21] 254 |         float_to_int!(f, f32, u64)
[00:22:21] 
[00:22:21] 
[00:22:21] error: internal compiler error: broken MIR in DefId(0/0:552 ~ compiler_builtins[69d2]::float[0]::conv[0]::__fixunssfti[0]) (const Unevaluated(DefId(0/0:196 ~ compiler_builtins[69d2]::float[0]::Float[0]::SIGN_MASK[0]), [f32]):u32): bad constant user type TypeOf(DefId(0/0:196 ~ compiler_builtins[69d2]::float[0]::Float[0]::SIGN_MASK[0]), Canonical { variables: [], value: UserSubsts { substs: [f32], user_self_ty: None } }) vs u32: NoSolution
[00:22:21]    --> rustc/compiler_builtins_shim/../../libcompiler_builtins/src/float/conv.rs:173:24
[00:22:21]     |
[00:22:21] 173 |         let sign_bit = <$fty>::SIGN_MASK;
[00:22:21] ...
[00:22:21] ...
[00:22:21] 259 |         float_to_int!(f, f32, u128)
[00:22:21] 
[00:22:21] 
[00:22:21] error: internal compiler error: broken MIR in DefId(0/0:552 ~ compiler_builtins[69d2]::float[0]::conv[0]::__fixunssfti[0]) (const Unevaluated(DefId(0/0:197 ~ compiler_builtins[69d2]::float[0]::Float[0]::SIGNIFICAND_MASK[0]), [f32]):u32): bad constant user type TypeOf(DefId(0/0:197 ~ compiler_builtins[69d2]::float[0]::Float[0]::SIGNIFICAND_MASK[0]), Canonical { variables: [], value: UserSubsts { substs: [f32], user_self_ty: None } }) vs u32: NoSolution
[00:22:21]    --> rustc/compiler_builtins_shim/../../libcompiler_builtins/src/float/conv.rs:185:36
[00:22:21]     |
[00:22:21] 185 |         let significand = (a_abs & <$fty>::SIGNIFICAND_MASK) | <$fty>::IMPLICIT_BIT;
[00:22:21] ...
[00:22:21] ...
[00:22:21] 259 |         float_to_int!(f, f32, u128)
[00:22:21] 
[00:22:21] 
[00:22:21] error: internal compiler error: broken MIR in DefId(0/0:552 ~ compiler_builtins[69d2]::float[0]::conv[0]::__fixunssfti[0]) (const Unevaluated(DefId(0/0:198 ~ compiler_builtins[69d2]::float[0]::Float[0]::IMPLICIT_BIT[0]), [f32]):u32): bad constant user type TypeOf(DefId(0/0:198 ~ compiler_builtins[69d2]::float[0]::Float[0]::IMPLICIT_BIT[0]), Canonical { variables: [], value: UserSubsts { substs: [f32], user_self_ty: None } }) vs u32: NoSolution
[00:22:21]    --> rustc/compiler_builtins_shim/../../libcompiler_builtins/src/float/conv.rs:185:64
[00:22:21]     |
[00:22:21] 185 |         let significand = (a_abs & <$fty>::SIGNIFICAND_MASK) | <$fty>::IMPLICIT_BIT;
[00:22:21] ...
[00:22:21] ...
[00:22:21] 259 |         float_to_int!(f, f32, u128)
[00:22:21] 
[00:22:21] 
[00:22:21] error: internal compiler error: broken MIR in DefId(0/0:553 ~ compiler_builtins[69d2]::float[0]::conv[0]::__fixunsdfsi[0]) (const Unevaluated(DefId(0/0:196 ~ compiler_builtins[69d2]::float[0]::Float[0]::SIGN_MASK[0]), [f64]):u64): bad constant user type TypeOf(DefId(0/0:196 ~ compiler_builtins[69d2]::float[0]::Float[0]::SIGN_MASK[0]), Canonical { variables: [], value: UserSubsts { substs: [f64], user_self_ty: None } }) vs u64: NoSolution
[00:22:21]    --> rustc/compiler_builtins_shim/../../libcompiler_builtins/src/float/conv.rs:173:24
[00:22:21]     |
[00:22:21] 173 |         let sign_bit = <$fty>::SIGN_MASK;
[00:22:21] ...
[00:22:21] ...
[00:22:21] 264 |         float_to_int!(f, f64, u32)
[00:22:21] 
[00:22:21] 
[00:22:21] error: internal compiler error: broken MIR in DefId(0/0:553 ~ compiler_builtins[69d2]::float[0]::conv[0]::__fixunsdfsi[0]) (const Unevaluated(DefId(0/0:197 ~ compiler_builtins[69d2]::float[0]::Float[0]::SIGNIFICAND_MASK[0]), [f64]):u64): bad constant user type TypeOf(DefId(0/0:197 ~ compiler_builtins[69d2]::float[0]::Float[0]::SIGNIFICAND_MASK[0]), Canonical { variables: [], value: UserSubsts { substs: [f64], user_self_ty: None } }) vs u64: NoSolution
[00:22:21]    --> rustc/compiler_builtins_shim/../../libcompiler_builtins/src/float/conv.rs:185:36
[00:22:21]     |
[00:22:21] 185 |         let significand = (a_abs & <$fty>::SIGNIFICAND_MASK) | <$fty>::IMPLICIT_BIT;
[00:22:21] ...
[00:22:21] ...
[00:22:21] 264 |         float_to_int!(f, f64, u32)
[00:22:21] 
[00:22:21] 
[00:22:21] error: internal compiler error: broken MIR in DefId(0/0:553 ~ compiler_builtins[69d2]::float[0]::conv[0]::__fixunsdfsi[0]) (const Unevaluated(DefId(0/0:198 ~ compiler_builtins[69d2]::float[0]::Float[0]::IMPLICIT_BIT[0]), [f64]):u64): bad constant user type TypeOf(DefId(0/0:198 ~ compiler_builtins[69d2]::float[0]::Float[0]::IMPLICIT_BIT[0]), Canonical { variables: [], value: Use        let sign_bit = <$fty>::SIGN_MASK;
[00:22:21] ...
[00:22:21] ...
[00:22:21] 269 |         float_to_int!(f, f64, u64)
[00:22:21] 
[00:22:21] 
[00:22:21] error: internal compiler error: broken MIR in DefId(0/0:554 ~ compiler_builtins[69d2]::float[0]::conv[0]::__fixunsdfdi[0]) (const Unevaluated(DefId(0/0:197 ~ compiler_builtins[69d2]::float[0]::Float[0]::SIGNIFICAND_MASK[0]), [f64]):u64): bad constant user type TypeOf(DefId(0/0:197 ~ compiler_builtins[69d2]::float[0]::Float[0]::SIGNIFICAND_MASK[0]), Canonical { variables: [], value: UserSubsts { substs: [f64], user_self_ty: None } }) vs u64: NoSolution
[00:22:21]    --> rustc/compiler_builtins_shim/../../libcompiler_builtins/src/float/conv.rs:185:36
[00:22:21]     |
[00:22:21] 185 |         let significand = (a_abs & <$fty>::SIGNIFICAND_MASK) | <$fty>::IMPLICIT_BIT;
[00:22:21] ...
[00:22:21] ...
[00:22:21] 269 |         float_to_int!(f, f64, u64)
[00:22:21] 
[00:22:21] 
[00:22:21] error: internal compiler error: broken MIR in DefId(0/0:554 ~ compiler_builtins[69d2]::float[0]::conv[0]::__fixunsdfdi[0]) (const Unevaluated(DefId(0/0:198 ~ compiler_builtins[69d2]::float[0]::Float[0]::IMPLICIT_BIT[0]), [f64]):u64): bad constant user type TypeOf(DefId(0/0:198 ~ compiler_builtins[69d2]::float[0]::Float[0]::IMPLICIT_BIT[0]), Canonical { variables: [], value: UserSubsts { substs: [f64], user_self_ty: None } }) vs u64: NoSolution
[00:22:21]    --> rustc/compiler_builtins_shim/../../libcompiler_builtins/src/float/conv.rs:185:64
[00:22:21]     |
[00:22:21] 185 |         let significand = (a_abs & <$fty>::SIGNIFICAND_MASK) | <$fty>::IMPLICIT_BIT;
[00:22:21] ...
[00:22:21] ...
[00:22:21] 269 |         float_to_int!(f, f64, u64)
[00:22:21] 
[00:22:21] 
[00:22:21] error: internal compiler error: broken MIR in DefId(0/0:555 ~ compiler_builtins[69d2]::float[0]::conv[0]::__fixunsdfti[0]) (const Unevaluated(DefId(0/0:196 ~ compiler_builtins[69d2]::float[0]::Float[0]::SIGN_MASK[0]), [f64]):u64): bad constant user type TypeOf(DefId(0/0:196 ~ compiler_builtins[69d2]::float[0]::Float[0]::SIGN_MASK[0]), Canonical { variables: [], value: UserSubsts { substs: [f64], user_self_ty: None } }) vs u64: NoSolution
[00:22:21]    --> rustc/compiler_builtins_shim/../../libcompiler_builtins/src/float/conv.rs:173:24
[00:22:21]     |
[00:22:21] 173 |         let sign_bit = <$fty>::SIGN_MASK;
[00:22:21] ...
[00:22:21] ...
[00:22:21] 274 |         float_to_int!(f, f64, u128)
[00:22:21] 
[00:22:21] 
[00:22:21] error: internal compiler error: broken MIR in DefId(0/0:555 ~ compiler_builtins[69d2]::float[0]::conv[0]::__fixunsdfti[0]) (const Unevaluated(DefId(0/0:197 ~ compiler_builtins[69d2]::float[0]::Float[0]::SIGNIFICAND_MASK[0]), [f64]):u64): bad constant user type TypeOf(DefId(0/0:197 ~ compiler_builtins[69d2]::float[0]::Float[0]::SIGNIFICAND_MASK[0]), Canonical { variables: [], value: UserSubsts { substs: [f64], user_self_ty: None } }) vs u64: NoSolution
[00:22:21]    --> rustc/compiler_builtins_shim/../../libcompiler_builtins/src/float/conv.rs:185:36
[00:22:21]     |
[00:22:21] 185 |         let significand = (a_abs & <$fty>::SIGNIFICAND_MASK) | <$fty>::IMPLICIT_BIT;
[00:22:21] ...
[00:22:21] ...
[00:22:21] 274 |         float_to_int!(f, f64, u128)
[00:22:21] 
[00:22:21] 
[00:22:21] error: internal compiler error: broken MIR in DefId(0/0:555 ~ compiler_builtins[69d2]::float[0]::conv[0]::__fixunsdfti[0]) (const Unevaluated(DefId(0/0:198 ~ compiler_builtins[69d2]::float[0]::Float[0]::IMPLICIT_BIT[0]), [f64]):u64): bad constant user type TypeOf(DefId(0/0:198 ~ compiler_builtins[69d2]::float[0]::Float[0]::IMPLICIT_BIT[0]), Canonical { variables: [], value: UserSubsts { substs: [f64], user_self_ty: None } }) vs u64: NoSolution
[00:22:21]    --> rustc/compiler_builtins_shim/../../libcompiler_builtins/src/float/conv.rs:185:64
[00:22:21]     |
[00:22:21] 185 |         let significand = (a_abs & <$fty>::SIGNIFICAND_MASK) | <$fty>::IMPLICIT_BIT;
[00:22:21] ...
[00:22:21] ...
[00:22:21] 274 |         float_to_int!(f, f64, u128)
[00:22:21] 
[00:22:21] 
[00:22:21] error: internal compiler error: broken MIR in DefId(0/0:578 ~ compiler_builtins[69d2]::float[0]::sub[0]::__subsf3[0]) (const Unevaluated(DefId(0/0:196 ~ compiler_builtins[69d2]::float[0]::Float[0]::SIGN_MASK[0]), [f32]):u32): bad constant user type TypeOf(DefId(0/0:196 ~ compiler_builtins[69d2]::float[0]::Float[0]::SIGN_MASK[0]), Canonical { variables: [], value: UserSubsts { substs: [f32], user_self_ty: None } }) vs u32: NoSolution
[00:22:21]  --> rustc/compiler_builtins_shim/../../libcompiler_builtins/src/float/sub.rs:8:47
[00:22:21]   |
[00:22:21] 8 |         __addsf3(a, f32::from_repr(b.repr() ^ f32::SIGN_MASK))
[00:22:21] 
[00:22:21] 
[00:22:21] error: internal compiler error: broken MIR in DefId(0/0:579 ~ compiler_builtins[69d2]::float[0]::sub[0]::__subdf3[0]) (const Unevaluated(DefId(0/0:196 ~ compiler_builtins[69d2]::float[0]::Float[0]::SIGN_MASK[0]), [f64]):u64): bad constant user type TypeOf(DefId(0/0:196 ~ compiler_builtins[69d2]::float[0]::Float[0]::SIGN_MASK[0]), Canonical { variables: [], value: UserSubsts { substs: [f64], user_self_ty: None } }) vs u64: NoSolution
[00:22:21]   --> rustc/compiler_builtins_shim/../../libcompiler_builtins/src/float/sub.rs:13:47
[00:22:21]    |
[00:22:21] 13 |         __adddf3(a, f64::from_repr(b.repr() ^ f64::SIGN_MASK))
[00:22:21] 
[00:22:21] 
[00:22:21] error: internal compiler error: broken MIR in DefId(0/0:595 ~ compiler_builtins[69d2]::float[0]::{{impl}}[0]::EXPONENT_MASK[0]) (const Unevaluated(DefId(0/0:196 ~ compiler_builtins[69d2]::float[0]::Float[0]::SIGN_MASK[0]), [f32]):u32): bad constant user type TypeOf(DefId(0/0:196 ~ compiler_builtins[69d2]::float[0]::Float[0]::SIGN_MASK[0]), Canonical { variables: [], value: UserSubsts { substs: [f32], user_self_ty: None } }) vs u32: NoSolution
[00:22:21]    --> rustc/compiler_builtins_shim/../../libcompiler_builtins/src/float/mod.rs:101:48
[00:22:21]     |
[00:22:21] 101 |             const EXPONENT_MASK: Self::Int = !(Self::SIGN_MASK | Self::SIGNIFICAND_MASK);
[00:22:21] ...
[00:22:21] ...
[00:22:21] 134 | float_impl!(f32, u32, i32, 32, 23);
[00:22:21]     | ----------------------------------- in this macro invocation
[00:22:21] 
[00:22:21] error: internal compiler error: broken MIR in DefId(0/0:595 ~ compiler_builtins[69d2]::float[0]::{{impl}}[0]::EXPONENT_MASK[0]) (const Unevaluated(DefId(0/0:197 ~ compiler_builtins[69d2]::float[0]::Float[0]::SIGNIFICAND_MASK[0]), [f32]):u32): bad constant user type TypeOf(DefId(0/0:197 ~ compiler_builtins[69d2]::float[0]::Float[0]::SIGNIFICAND_MASK[0]), Canonical { variables: [], value: UserSubsts { substs: [f32], user_self_ty: None } }) vs u32: NoSolution
[00:22:21]    --> rustc/compiler_builtins_shim/../../libcompiler_builtins/src/float/mod.rs:101:66
[00:22:21]     |
[00:22:21] 101 |             const EXPONENT_MASK: Self::Int = !(Self::SIGN_MASK | Self::SIGNIFICAND_MASK);
[00:22:21] ...
[00:22:21] ...
[00:22:21] 134 | float_impl!(f32, u32, i32, 32, 23);
[00:22:21]     | ----------------------------------- onstant user type TypeOf(DefId(0/0:197 ~ compiler_builtins[69d2]::float[0]::Float[0]::SIGNIFICAND_MASK[0]), Canonical { variables: [], value: UserSubsts { substs: [f64], user_self_ty: None } }) vs u64: NoSolution
[00:22:21]    --> rustc/compiler_builtins_shim/../../libcompiler_builtins/src/float/mod.rs:101:66
[00:22:21]     |
[00:22:21] 101 |             const EXPONENT_MASK: Self::Int = !(Self::SIGN_MASK | Self::SIGNIFICAND_MASK);
[00:22:21] ...
[00:22:21] ...
[00:22:21] 135 | float_impl!(f64, u64, i64, 64, 52);
[00:22:21]     | ----------------------------------- in this macro invocation
[00:22:21] 
[00:22:21] error: internal compiler error: broken MIR in DefId(0/0:599 ~ compiler_builtins[69d2]::float[0]::{{impl}}[0]::from_parts[0]) (const Unevaluated(DefId(0/0:199 ~ compiler_builtins[69d2]::float[0]::Float[0]::EXPONENT_MASK[0]), [f32]):u32): bad constant user type TypeOf(DefId(0/0:199 ~ compiler_builtins[69d2]::float[0]::Float[0]::EXPONENT_MASK[0]), Canonical { variables: [], value: UserSubsts { substs: [f32], user_self_ty: None } }) vs u32: NoSolution
[00:22:21]    --> rustc/compiler_builtins_shim/../../libcompiler_builtins/src/float/mod.rs:122:61
[00:22:21]     |
[00:22:21] 122 |                     ((exponent << Self::SIGNIFICAND_BITS) & Self::EXPONENT_MASK) |
[00:22:21] ...
[00:22:21] ...
[00:22:21] 134 | float_impl!(f32, u32, i32, 32, 23);
[00:22:21]     | ----------------------------------- in this macro invocation
[00:22:21] 
[00:22:21] error: internal compiler error: broken MIR in DefId(0/0:599 ~ compiler_builtins[69d2]::float[0]::{{impl}}[0]::from_parts[0]) (const Unevaluated(DefId(0/0:197 ~ compiler_builtins[69d2]::float[0]::Float[0]::SIGNIFICAND_MASK[0]), [f32]):u32): bad constant user type TypeOf(DefId(0/0:197 ~ compiler_builtins[69d2]::float[0]::Float[0]::SIGNIFICAND_MASK[0]), Canonical { variables: [], value: UserSubsts { substs: [f32], user_self_ty: None } }) vs u32: NoSolution
[00:22:21]    --> rustc/compiler_builtins_shim/../../libcompiler_builtins/src/float/mod.rs:123:36
[00:22:21]     |
[00:22:21] 123 |                     (significand & Self::SIGNIFICAND_MASK))
[00:22:21]     |                                    n this macro invocation
[00:22:21] 
[00:22:21] error: internal compiler error: broken MIR in DefId(0/0:615 ~ compiler_builtins[69d2]::float[0]::{{impl}}[1]::from_parts[0]) (const Unevaluated(DefId(0/0:197 ~ compiler_builtins[69d2]::float[0]::Float[0]::SIGNIFICAND_MASK[0]), [f64]):u64): bad constant user type TypeOf(DefId(0/0:197 ~ compiler_builtins[69d2]::float[0]::Float[0]::SIGNIFICAND_MASK[0]), Canonical { variables: [], value: UserSubsts { substs: [f64], user_self_ty: None } }) vs u64: NoSolution
[00:22:21]    --> rustc/compiler_builtins_shim/../../libcompiler_builtins/src/float/mod.rs:123:36
[00:22:21]     |
[00:22:21] 123 |                     (significand & Self::SIGNIFICAND_MASK))
[00:22:21] ...
[00:22:21] ...
[00:22:21] 135 | float_impl!(f64, u64, i64, 64, 52);
[00:22:21]     | ----------------------------------- in this macro invocation
[00:22:21] 
[00:22:21] thread 'main' panicked at 'no errors encountered even though `delay_span_bug` issued', librustc_errors/lib.rs:334:17
[00:22:21] 
[00:22:21] error: internal compiler error: unexpected panic
[00:22:21] 
[00:22:21] note: the compiler unexpectedly p

I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact @TimNN. (Feature Requests)

@nikomatsakis nikomatsakis force-pushed the nll-issue-54571-type-annot-in-constants branch from bc1f493 to 35e2f72 Compare October 17, 2018 19:01
@nikomatsakis nikomatsakis changed the title [WIP] support type annot in constants support type annot in constants Oct 17, 2018
@nikomatsakis
Copy link
Contributor Author

OK, works now.

@nikomatsakis
Copy link
Contributor Author

Well, famous last words. =)

@pnkfelix
Copy link
Member

@bors r+

@bors
Copy link
Contributor

bors commented Oct 17, 2018

📌 Commit 35e2f72603f25c64640bc3fd52c39f12572438ac has been approved by pnkfelix

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Oct 17, 2018
@rust-highfive
Copy link
Collaborator

The job x86_64-gnu-llvm-5.0 of your PR failed on Travis (raw log). Through arcane magic we have determined that the following fragments from the build log may contain information about the problem.

Click to expand the log.

[00:03:58] travis_fold:start:tidy
travis_time:start:tidy
tidy check
[00:03:58] tidy error: /checkout/src/librustc_mir/borrow_check/nll/type_check/mod.rs:1040: line longer than 100 chars
[00:03:59] some tidy checks failed
[00:03:59] 
[00:03:59] 
[00:03:59] command did not execute successfully: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-tools-bin/tidy" "/checkout/src" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/bin/cargo" "--no-vendor" "--quiet"
[00:03:59] 
[00:03:59] 
[00:03:59] failed to run: /checkout/obj/build/bootstrap/debug/bootstrap test src/tools/tidy
[00:03:59] Build completed unsuccessfully in 0:00:47
[00:03:59] Build completed unsuccessfully in 0:00:47
[00:03:59] make: *** [tidy] Error 1
[00:03:59] Makefile:79: recipe for target 'tidy' failed

The command "stamp sh -x -c "$RUN_SCRIPT"" exited with 2.
travis_time:start:123090be
$ date && (curl -fs --head https://google.com | grep ^Date: | sed 's/Date: //g' || true)
---
travis_time:end:2334fd00:start=1539804237265387512,finish=1539804237270303787,duration=4916275
travis_fold:end:after_failure.3
travis_fold:start:after_failure.4
travis_time:start:017cf0df
$ ln -s . checkout && for CORE in obj/cores/core.*; do EXE=$(echo $CORE | sed 's|obj/cores/core\.[0-9]*\.!checkout!\(.*\)|\1|;y|!|/|'); if [ -f "$EXE" ]; then printf travis_fold":start:crashlog\n\033[31;1m%s\033[0m\n" "$CORE"; gdb --batch -q -c "$CORE" "$EXE" -iex 'set auto-load off' -iex 'dir src/' -iex 'set sysroot .' -ex bt -ex q; echo travis_fold":"end:crashlog; fi; done || true
travis_fold:end:after_failure.4
travis_fold:start:after_failure.5
travis_time:start:04f27be2
travis_time:start:04f27be2
$ cat ./obj/build/x86_64-unknown-linux-gnu/native/asan/build/lib/asan/clang_rt.asan-dynamic-i386.vers || true
cat: ./obj/build/x86_64-unknown-linux-gnu/native/asan/build/lib/asan/clang_rt.asan-dynamic-i386.vers: No such file or directory
travis_fold:end:after_failure.5
travis_fold:start:after_failure.6
travis_time:start:12102b22
$ dmesg | grep -i kill

I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact @TimNN. (Feature Requests)

@nikomatsakis
Copy link
Contributor Author

@pnkfelix I threw some more commits in here, fixing up cast expressions (#54332)

@nikomatsakis nikomatsakis added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Oct 17, 2018
@rust-highfive

This comment has been minimized.

@nikomatsakis nikomatsakis force-pushed the nll-issue-54571-type-annot-in-constants branch from a464340 to d99fb09 Compare October 17, 2018 21:45
@nikomatsakis nikomatsakis changed the title support type annot in constants support type annot in constants, casts Oct 17, 2018
@nikomatsakis
Copy link
Contributor Author

OK so this had some fallout on diagnostics -- I think because we are proving some things multiple times? We can probably find a way to suppress the duplicates.

The constant errors I am less sure how to fix (cc @oli-obk @RalfJung). The underlying problem is that with a cast like X as usize we will now sometimes generate temporaries like:

T1 = X
AscribeUserType(T1, usize)

Perhaps the best fix would be to do this ascription less often, actually. For example, if there are no regions in type we are casting to, we don't have to preserve the user-supplied type (NLL doesn't care).

@rust-highfive

This comment has been minimized.

@nikomatsakis nikomatsakis force-pushed the nll-issue-54571-type-annot-in-constants branch from a030f36 to ba124c3 Compare October 17, 2018 23:02
@nikomatsakis
Copy link
Contributor Author

OK, I pushed a workaround and fixed some other bugs -- there is one FIXME I am still pondering, about what we prove WF for, but this PR is strictly better than the status quo and (I think) probably fine as is. The remaining potential bug (that I know of) probably exists without NLL and is really about normalization and hence more the domain of #54940.

@rust-highfive

This comment has been minimized.

@bors
Copy link
Contributor

bors commented Oct 18, 2018

☔ The latest upstream changes (presumably #55134) made this pull request unmergeable. Please resolve the merge conflicts.

@RalfJung
Copy link
Member

The constant errors I am less sure how to fix

Which errors are you referring to?

The underlying problem is that with a cast like X as usize we will now sometimes generate temporaries

What is the type of X in this example?

@nikomatsakis nikomatsakis force-pushed the nll-issue-54571-type-annot-in-constants branch from d6f967b to 9a7bb0e Compare October 19, 2018 13:34
@nikomatsakis
Copy link
Contributor Author

@bors r=pnkfelix

@bors
Copy link
Contributor

bors commented Oct 19, 2018

📌 Commit 9a7bb0e has been approved by pnkfelix

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Oct 19, 2018
@bors
Copy link
Contributor

bors commented Oct 19, 2018

⌛ Testing commit 9a7bb0e with merge b0a8a62621e2de5dcd45cace048ea63cde950c56...

@bors
Copy link
Contributor

bors commented Oct 19, 2018

💔 Test failed - status-travis

@rust-highfive
Copy link
Collaborator

The job dist-powerpc-linux of your PR failed on Travis (raw log). Through arcane magic we have determined that the following fragments from the build log may contain information about the problem.

Click to expand the log.
uploading "b0a8a62621e2de5dcd45cace048ea63cde950c56/rustfmt-nightly-powerpc-unknown-linux-gnu.tar.gz" with {:content_type=>"application/gzip", :acl=>"public-read"}
uploading "b0a8a62621e2de5dcd45cace048ea63cde950c56/rust-src-nightly.tar.gz" with {:content_type=>"application/gzip", :acl=>"public-read"}uploading "b0a8a62621e2de5dcd45cace048ea63cde950c56/rust-std-nightly-powerpc-unknown-linux-gnu.tar.gz" with {:content_type=>"application/gzip", :acl=>"public-read"}
uploading "b0a8a62621e2de5dcd45cace048ea63cde950c56/rustc-nightly-powerpc-unknown-linux-gnu.tar.xz" with {:content_type=>"application/x-xz", :acl=>"public-read"}
travis_fold:end:dpl.3
/home/travis/.rvm/gems/ruby-2.2.7/gems/aws-sdk-resources-2.11.153/lib/aws-sdk-resources/services/s3/multipart_file_uploader.rb:81:in `abort_upload': multipart upload failed: end of file reached; end of file reached; We encountered an internal error. Please try again.; end of file reached; end of file reached; end of file reached; end of file reached; end of file reached; end of file reached; end of file reached (Aws::S3::MultipartUploadError)
 from /home/travis/.rvm/gems/ruby-2.2.7/gems/aws-sdk-resources-2.11.153/lib/aws-sdk-resources/services/s3/multipart_file_uploader.rb:70:in `upload_parts'
 from /home/travis/.rvm/gems/ruby-2.2.7/gems/aws-sdk-resources-2.11.153/lib/aws-sdk-resources/services/s3/multipart_file_uploader.rb:44:in `upload'
 from /home/travis/.rvm/gems/ruby-2.2.7/gems/aws-sdk-resources-2.11.153/lib/aws-sdk-resources/services/s3/file_uploader.rb:32:in `upload'
 from /home/travis/.rvm/gems/ruby-2.2.7/gems/aws-sdk-resources-2.11.153/lib/aws-sdk-resources/services/s3/object.rb:252:in `upload_file'
 from /home/travis/.rvm/gems/ruby-2.2.7/gems/dpl-s3-1.10.3/lib/dpl/provider/s3.rb:114:in `block (2 levels) in upload_multithreaded'
failed to deploy

I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact @TimNN. (Feature Requests)

@bors bors added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Oct 19, 2018
@nikomatsakis
Copy link
Contributor Author

@bors retry

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Oct 19, 2018
@nikomatsakis
Copy link
Contributor Author

cc @rust-lang/infra — looks like a network error or something — am I supposed to catalog this in some way?

@bors
Copy link
Contributor

bors commented Oct 19, 2018

⌛ Testing commit 9a7bb0e with merge 78ff609...

bors added a commit that referenced this pull request Oct 19, 2018
…stants, r=pnkfelix

support type annot in constants, casts

Fixes #54571
Fixes #54332
Fixes #55183

r? @pnkfelix
@bors
Copy link
Contributor

bors commented Oct 19, 2018

☀️ Test successful - status-appveyor, status-travis
Approved by: pnkfelix
Pushing 78ff609 to master...

@kennytm
Copy link
Member

kennytm commented Oct 20, 2018

@nikomatsakis Yes it's a network error and we've recorded this down. There was an outage in S3 in the US-WEST-1 region around 2018-10-19 17~18 UTC causing this error. Error in deployment is basically always spurious and unfortunately something out of our control.

@nikomatsakis
Copy link
Contributor Author

@kennytm great thanks — I mostly want to know if there are steps I should be taking beyond @bors retry

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants