diff options
| author | Graydon Hoare <[email protected]> | 2010-07-23 13:52:46 -0700 |
|---|---|---|
| committer | Graydon Hoare <[email protected]> | 2010-07-23 13:52:46 -0700 |
| commit | 8bd8413906ab2e22a152bac8cb53f0884b63f111 (patch) | |
| tree | 2238b6ae7f6c9c7737190f74e5eb17accd73e320 /src/test | |
| parent | Stop using project_lval_ty_from_slot for lval_ty; cover residual un-caught ca... (diff) | |
| download | rust-8bd8413906ab2e22a152bac8cb53f0884b63f111.tar.xz rust-8bd8413906ab2e22a152bac8cb53f0884b63f111.zip | |
Add test for writing-through-uninit bug (reported on IRC by jrmuizel), plus fix in typestate system.
Diffstat (limited to 'src/test')
| -rw-r--r-- | src/test/compile-fail/writing-through-uninit-vec.rs | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/test/compile-fail/writing-through-uninit-vec.rs b/src/test/compile-fail/writing-through-uninit-vec.rs new file mode 100644 index 00000000..55edbf87 --- /dev/null +++ b/src/test/compile-fail/writing-through-uninit-vec.rs @@ -0,0 +1,10 @@ +// error-pattern: Unsatisfied precondition constraint + +fn test() { + let vec[int] w; + w.(5) = 0; +} + +fn main() { + test(); +}
\ No newline at end of file |