Movatterモバイル変換


[0]ホーム

URL:


Keyboard shortcuts

Press or to navigate between chapters

PressS or/ to search in the book

Press? to show this help

PressEsc to hide this help

The Rust Reference

    Path expressions

    Syntax
    PathExpression
          PathInExpression
        |QualifiedPathInExpression

    Apath used as an expression context denotes either a local variable or an item.

    Path expressions that resolve to local or static variables areplace expressions, other paths arevalue expressions.

    Using astatic mut variable requires anunsafe block.

    #![allow(unused)]fn main() {mod globals {    pub static STATIC_VAR: i32 = 5;    pub static mut STATIC_MUT_VAR: i32 = 7;}let local_var = 3;local_var;globals::STATIC_VAR;unsafe { globals::STATIC_MUT_VAR };let some_constructor = Some::<i32>;let push_integer = Vec::<i32>::push;let slice_reverse = <[i32]>::reverse;}

    Evaluation of associated constants is handled the same way asconst blocks.


    [8]ページ先頭

    ©2009-2025 Movatter.jp