Skip to content

literal out of range  #144

Description

@Dylan-DPC-zz

The current build fails with:

error: literal out of range for i16
[INFO] [stdout]  --> src/lib.rs:1603:23
[INFO] [stdout]   |
[INFO] [stdout] 6 | let mut numbers = [5, 65000];
[INFO] [stdout]   |                       ^^^^^

picked this up from a crater run

Activity

  1. BurntSushi commented on Mar 4, 2019

    @BurntSushi
    Owner

    We should definitely fix this, but this seems like a bug with Rust nightly. Overflowing integer literals shouldn't cause compilation failures on Rust 2015. It was only switched to deny in Rust 2018: https://github.com/rust-lang/rfcs/blob/master/text/2438-deny-integer-literal-overflow-lint.md

  2. Dylan-DPC-zz commented on Mar 4, 2019

    @Dylan-DPC-zz
    Author

    Thanks. Will create an issue upstream (if it doesn't exist)

  3. ehuss commented on Mar 4, 2019

    @ehuss

    overflowing_literals was switched to deny in 2015 in rust-lang/rust#55632.

  4. added a commit that references this issue on Oct 4, 2024
    c25f0f9
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions