FuelLabs/sway

`forc-fmt` issue on `raw_ptr::write`.

クローズ

#7,625 opened on 2026/05/12

 (0 件のコメント) (0 件のリアクション) (0 人の担当者)Rust (5,421 件のフォーク)batch import
bugformattergood first issueteam:tooling

Repository metrics

Stars
 (61,702 個のスター)
PR merge metrics
 (平均マージ 22h 6m) (30d で 16 merged PRs)

説明

To see the bug in practice see https://github.com/FuelLabs/sway/pull/7620

pub fn write<T>(self, val: T) {
        if __size_of::<T>() == 0 {    } else if __is_reference_type::<T>() {   // <---- look here how strange it is
        asm(dst: self, src: val, count: __size_of_val(val)) {
            mcp dst src count;
        };
    } else if __size_of::<T>() == 1 {
        asm(ptr: self, val: val) {
            sb ptr val i0;
        };
    } else {
        asm(ptr: self, val: val) {
            sw ptr val i0;
        };
    }
    }

コントリビューターガイド