検索
Results of 1 - 10 of about 12 for println (0.019 sec.)
- チェックされるメモリ 12576
- はじめに 1. 安全と危険のご紹介 1.1. 安全と危険の相互作用 1.2. Unsafe と連携する 2. データレイアウ
...うとするのを静的に防ぎます。 fn main() { let x: i32; println!("{}", x); } src/main.rs:3:20: 3:21 error: use of...かもしれない変数 `x` を使用しています) src/main.rs:3 println!("{}", x); ^ これは、基本的な分岐分析に基づいていま...) { let x: i32; if true { x = 1; } else { x = 2; } println!("{}", x); } しかし、このコードはコンパイルできませ...ん。 fn main() { let x: i32; if true { x = 1; } println!("{}", x); } src/main.rs:6:17: 6:18 error: use of... - https://man.plustar.jp/rust/nomicon/checked-uninit.html - [similar]
- print.html 11408
- はじめに 1. 安全と危険のご紹介 1.1. 安全と危険の相互作用 1.2. Unsafe と連携する 2. データレイアウ
...ust ではコンパイルエラーになります) data.push(4); println!("{}", x); 単純なスコープ解析では、このバグは防げま...せんが、 // そのような str が無いのはあきらかです。 println!("{}", as_str::<'d>(&'d x)); } } } ちくしょう! この...a = vec![1, 2, 3]; let x = &data[0]; data.push(4); println!("{}", x); 'a: { let mut data: Vec<i32> = vec![1,...b は次の貸し出しに必要なだけ大きくなります。 // (`println!` を含むまで大きくなります) let x: &'b i32 = Inde... - https://man.plustar.jp/rust/nomicon/print.html - [similar]
- Drop Check 10895
- はじめに 1. 安全と危険のご紹介 1.1. 安全と危険の相互作用 1.2. Unsafe と連携する 2. データレイアウ
...<'a> Drop for Inspector<'a> { fn drop(&mut self) { println!("I was only {} days from retirement!", self.0); }...<'a> Drop for Inspector<'a> { fn drop(&mut self) { println!("Inspector(_, {}) knows when *not* to inspect.",...play> Drop for Inspector<T> { fn drop(&mut self) { println!("Inspector(_, {}) knows when *not* to inspect.",...'a> Drop for Inspector<'a> { fn drop(&mut self) { println!("Inspector(_, {}) knows when *not* to inspect.",... - https://man.plustar.jp/rust/nomicon/dropck.html - [similar]
- ライフタイム 9339
- はじめに 1. 安全と危険のご紹介 1.1. 安全と危険の相互作用 1.2. Unsafe と連携する 2. データレイアウ
...せんが、 // そのような str が無いのはあきらかです。 println!("{}", as_str::<'d>(&'d x)); } } } ちくしょう! この...a = vec![1, 2, 3]; let x = &data[0]; data.push(4); println!("{}", x); 'a: { let mut data: Vec<i32> = vec![1,...b は次の貸し出しに必要なだけ大きくなります。 // (`println!` を含むまで大きくなります) let x: &'b i32 = Inde...ープ 'c が作られます。 Vec::push(&'c mut data, 4); } println!("{}", x); } } これは、すこし分かりにくいですが面白... - https://man.plustar.jp/rust/nomicon/lifetimes.html - [similar]
- ドロップフラグ 8684
- はじめに 1. 安全と危険のご紹介 1.1. 安全と危険の相互作用 1.2. Unsafe と連携する 2. データレイアウ
...ブされたので、 x を初期化前の状態にします。 } else { println!("{}", x); drop(x) // x はムーブされたので、 x を初...// x は初期化されていないので、単に上書きします。 println!("{}", x); } // x はスコープを抜けました。 x は初期...dition = true; if condition { let x = Box::new(0); println!("{}", x); } } ドロップフラグはスタック上で追跡され... - https://man.plustar.jp/rust/nomicon/drop-flags.html - [similar]
- 高階トレイト境界 8295
- はじめに 1. 安全と危険のご紹介 1.1. 安全と危険の相互作用 1.2. Unsafe と連携する 2. データレイアウ
...{ let clo = Closure { data: (0, 1), func: do_it }; println!("{}", clo.call()); } ライフタイムの節と同じように...{ let clo = Closure { data: (0, 1), func: do_it }; println!("{}", clo.call()); } } F のトレイト境界は、一体ど... - https://man.plustar.jp/rust/nomicon/hrtb.html - [similar]
- 借用の分割 8171
- はじめに 1. 安全と危険のご紹介 1.1. 安全と危険の相互作用 1.2. Unsafe と連携する 2. データレイアウ
...b; let c = &x.c; *b += 1; let c2 = &x.c; *a += 10; println!("{} {} {} {}", a, b, c, c2); } しかし借用チェッカ...= [1, 2, 3]; let a = &mut x[0]; let b = &mut x[1]; println!("{} {}", a, b); <anon>:4:14: 4:18 error: cannot b...= &mut x[0]; <anon>:4 let b = &mut x[1]; <anon>:5 println!("{} {}", a, b); <anon>:6 } ^ error: aborting due... - https://man.plustar.jp/rust/nomicon/borrow-splitting.html - [similar]
- 競合 7906
- はじめに 1. 安全と危険のご紹介 1.1. 安全と危険の相互作用 1.2. Unsafe と連携する 2. データレイアウ
...ドの // 実行順序に依存するため、競合状態となります。 println!("{}", data[idx.load(Ordering::SeqCst)]); } #![all...nsafe` である `get_unchecked` を行なったからです。 println!("{}", data.get_unchecked(idx.load(Ordering::SeqCs... - https://man.plustar.jp/rust/nomicon/races.html - [similar]
- 所有権とライフタイム 7252
- はじめに 1. 安全と危険のご紹介 1.1. 安全と危険の相互作用 1.2. Unsafe と連携する 2. データレイアウ
...ust ではコンパイルエラーになります) data.push(4); println!("{}", x); 単純なスコープ解析では、このバグは防げま... - https://man.plustar.jp/rust/nomicon/ownership.html - [similar]
- Subtyping and Variance 7252
- はじめに 1. 安全と危険のご紹介 1.1. 安全と危険の相互作用 1.2. Unsafe と連携する 2. データレイアウ
...&mut &*string); } // Oops, printing free'd memory println!("{}", forever_str); } The signature of overwrite... - https://man.plustar.jp/rust/nomicon/subtyping.html - [similar]