80844f993d
The first is reduced from a case in rustdoc (originally involving an ARC); the other is related. No committed version has gotten these wrong, but when I broke them it showed up only in rustdoc; there was nothing in the test suite (or the compiler!) that failed. The general issue is that the statics and trans have to agree on order of evaluation, or else you get use-after-move-out-of errors at runtime.
17 lines
613 B
Rust
17 lines
613 B
Rust
// Copyright 2013 The Rust Project Developers. See the COPYRIGHT
|
|
// file at the top-level directory of this distribution and at
|
|
// http://rust-lang.org/COPYRIGHT.
|
|
//
|
|
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
|
|
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
|
|
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
|
// option. This file may not be copied, modified, or distributed
|
|
// except according to those terms.
|
|
|
|
struct S { f0: ~str, f1: int }
|
|
|
|
pub fn main() {
|
|
let s = ~"Hello, world!";
|
|
let _s = S { f0: str::from_slice(s), ..S { f0: s, f1: 23 } };
|
|
}
|