Skip to content

[BUG] - Rust 语言无法使用 v0.9.0 的 rand #27097

@amcones-lc

Description

@amcones-lc

LeetCode Username

amcones

Problem Number, Title, and Link

  1. Two Sum https://leetcode.com/problems/two-sum/description/

Bug Category

Incorrect or missing "Related Topics"

Bug Description

Rust 语言 v0.9.0 版本 rand api 无法使用
https://rust-random.github.io/rand/rand/index.html

let mut rng = rand::rng();
println!("{}", rng.random_range(0..9));

Language Used for Code

Rust

Code used for Submit/Run operation

let mut rng = rand::rng();
println!("{}", rng.random_range(0..9));

Expected behavior

正常编译

Screenshots

No response

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions