Logo
Explore Help
Register Sign In
rust-lang/rust
1
0
Fork 0
You've already forked rust
Code Issues Pull Requests Actions 1 Packages Projects Releases Wiki Activity
Files
359bfa901b9d8eddbed7b88b6716dbb77b7bfb95
rust/tests/ui/deriving/deriving-default-box.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

14 lines
224 B
Rust
Raw Normal View History

Add `// run-pass` annotations to all the tests under `ui/run-pass/`. (I may have accidentally added it to some auxilliary crates as well; my emacs-macro-based methodology was pretty crude.)
2018-08-30 14:18:55 +02:00
//@ run-pass
Add tests
2014-11-06 11:49:08 -05:00
use std::default::Default;
Use `derive` rather than `deriving` in tests
2014-12-31 17:32:49 +13:00
#[derive(Default)]
Add tests
2014-11-06 11:49:08 -05:00
struct A {
foo: Box<[bool]>,
}
pub fn main() {
let a: A = Default::default();
Switched to Box::new in many places. Many of the modifications putting in `Box::new` calls also include a pointer to Issue 22405, which tracks going back to `box <expr>` if possible in the future. (Still tried to use `Box<_>` where it sufficed; thus some tests still have `box_syntax` enabled, as they use a mix of `box` and `Box::new`.) Precursor for overloaded-`box` and placement-`in`; see Issue 22181.
2015-02-15 09:52:21 +01:00
let b: Box<[_]> = Box::<[bool; 0]>::new([]);
Add tests
2014-11-06 11:49:08 -05:00
assert_eq!(a.foo, b);
}
Reference in New Issue Copy Permalink
Powered by Gitea Version: 1.24.6 Page: 3069ms Template: 4ms
English
Bahasa Indonesia Deutsch English Español Français Gaeilge Italiano Latviešu Magyar nyelv Nederlands Polski Português de Portugal Português do Brasil Suomi Svenska Türkçe Čeština Ελληνικά Български Русский Українська فارسی മലയാളം 日本語 简体中文 繁體中文(台灣) 繁體中文(香港) 한국어
Licenses API