Skip to content

Change to Ord::clamp causes build errors by calling through upstream monomorphisations #1046

@Dan54

Description

@Dan54

Following rust-lang/rust#147754, chromium encounters the following build error:

error: `compiler_builtins` cannot call functions through upstream monomorphizations; encountered invalid call from `core::fmt::num::<impl core::fmt::Debug for i32>::fmt` to `core::fmt::num::imp::<impl core::fmt::Display for i32>::fmt`
 --> ./../../third_party/rust-toolchain/lib/rustlib/src/rust/library/core/src/fmt/num.rs:79:0
 ::: ./../../third_party/rust-toolchain/lib/rustlib/src/rust/library/core/src/fmt/num.rs:97:1
  |
  = note: in this expansion of `impl_Debug!`
 ::: ./../../third_party/rust-toolchain/lib/rustlib/src/rust/library/core/src/fmt/num.rs:592:1
  |
  = note: in this macro invocation

The clamp() function is called twice in libm/src/math/genric/scalbn.rs (at lines 99 and 106). I think the easiest fix would be to replace these calls with a locally defined clamp() that doesn't call Debug::fmt.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions