-
Notifications
You must be signed in to change notification settings - Fork 13.2k
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
Add a span to CompilerBuiltinsCannotCall
#137505
Conversation
r? @SparrowLii rustbot has assigned @SparrowLii. Use |
Some changes occurred in compiler/rustc_codegen_cranelift cc @bjorn3 |
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
r=me after fixing this commit (pls just amend it, don't push another one) and CI is green
Hang on - sometimes this is giving a bad error where it points at two trait functions in
I'm not exactly sure what the code in this area is doing, but based on the results it looks like maybe:
@compiler-errors any idea if the span in compiler-builtins is readily available here? (not the biggest deal since it's an internal error, but I haven't been very successful hunting these errors) |
Currently, this error emit a diagnostic with no context like: error: `compiler_builtins` cannot call functions through upstream monomorphizations; encountered invalid call from `<math::libm::support::hex_float::Hexf<i32> as core::fmt::LowerHex>::fmt` to `core::fmt::num::<impl core::fmt::LowerHex for i32>::fmt` With this change, it at least usually points to the problematic function: error: `compiler_builtins` cannot call functions through upstream monomorphizations; encountered invalid call from `<math::libm::support::hex_float::Hexf<i32> as core::fmt::LowerHex>::fmt` to `core::fmt::num::<impl core::fmt::LowerHex for i32>::fmt` --> src/../libm/src/math/support/hex_float.rs:270:5 | 270 | fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
c3e139f
to
7a2db88
Compare
@bors r=compiler-errors rollup |
Rollup of 10 pull requests Successful merges: - rust-lang#136610 (Allow `IndexSlice` to be indexed by ranges.) - rust-lang#136991 ([rustdoc] Add new setting to wrap source code lines when too long) - rust-lang#137061 (Unstable `gen_future` Feature Tracking ) - rust-lang#137393 (Stabilize `unbounded_shifts`) - rust-lang#137482 (Windows: use existing wrappers in `File::open_native`) - rust-lang#137484 (Fix documentation for unstable sort on slice) - rust-lang#137491 (Tighten `str-to-string-128690.rs``CHECK{,-NOT}`s to make it less likely to incorrectly fail with symbol name mangling) - rust-lang#137495 (Added into_value function to ControlFlow<T, T>) - rust-lang#137501 (Move `impl` blocks out of `rustc_middle/src/mir/syntax.rs`) - rust-lang#137505 (Add a span to `CompilerBuiltinsCannotCall`) r? `@ghost` `@rustbot` modify labels: rollup
Rollup merge of rust-lang#137505 - tgross35:builtins-cannot-call-error, r=compiler-errors Add a span to `CompilerBuiltinsCannotCall` Currently, this error emit a diagnostic with no context like: error: `compiler_builtins` cannot call functions through upstream monomorphizations; encountered invalid call from `<math::libm::support::hex_float::Hexf<i32> as core::fmt::LowerHex>::fmt` to `core::fmt::num::<impl core::fmt::LowerHex for i32>::fmt` With this change, it at least usually points to the problematic function: error: `compiler_builtins` cannot call functions through upstream monomorphizations; encountered invalid call from `<math::libm::support::hex_float::Hexf<i32> as core::fmt::LowerHex>::fmt` to `core::fmt::num::<impl core::fmt::LowerHex for i32>::fmt` --> src/../libm/src/math/support/hex_float.rs:270:5 | 270 | fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
…r, r=compiler-errors Add a span to `CompilerBuiltinsCannotCall` Currently, this error emit a diagnostic with no context like: error: `compiler_builtins` cannot call functions through upstream monomorphizations; encountered invalid call from `<math::libm::support::hex_float::Hexf<i32> as core::fmt::LowerHex>::fmt` to `core::fmt::num::<impl core::fmt::LowerHex for i32>::fmt` With this change, it at least usually points to the problematic function: error: `compiler_builtins` cannot call functions through upstream monomorphizations; encountered invalid call from `<math::libm::support::hex_float::Hexf<i32> as core::fmt::LowerHex>::fmt` to `core::fmt::num::<impl core::fmt::LowerHex for i32>::fmt` --> src/../libm/src/math/support/hex_float.rs:270:5 | 270 | fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
Currently, this error emit a diagnostic with no context like:
With this change, it at least usually points to the problematic function: