diff options
| author | Patrick Walton <pcwalton@mimiga.net> | 2014-05-05 18:56:44 -0700 |
|---|---|---|
| committer | Patrick Walton <pcwalton@mimiga.net> | 2014-05-06 23:12:54 -0700 |
| commit | 090040bf4037a094e50b03d79e4baf5cd89c912b (patch) | |
| tree | 27fa91d623889d59260d3db167abdfa8c4288849 /src/test/auxiliary | |
| parent | 24f6f26e633e50b5b59f9d0f6cca0b1e49e215d9 (diff) | |
| download | rust-090040bf4037a094e50b03d79e4baf5cd89c912b.tar.gz rust-090040bf4037a094e50b03d79e4baf5cd89c912b.zip | |
librustc: Remove `~EXPR`, `~TYPE`, and `~PAT` from the language, except
for `~str`/`~[]`. Note that `~self` still remains, since I forgot to add support for `Box<self>` before the snapshot. How to update your code: * Instead of `~EXPR`, you should write `box EXPR`. * Instead of `~TYPE`, you should write `Box<Type>`. * Instead of `~PATTERN`, you should write `box PATTERN`. [breaking-change]
Diffstat (limited to 'src/test/auxiliary')
| -rw-r--r-- | src/test/auxiliary/issue-2380.rs | 5 | ||||
| -rw-r--r-- | src/test/auxiliary/issue13507.rs | 2 | ||||
| -rw-r--r-- | src/test/auxiliary/macro_crate_outlive_expansion_phase.rs | 4 | ||||
| -rw-r--r-- | src/test/auxiliary/macro_crate_test.rs | 5 | ||||
| -rw-r--r-- | src/test/auxiliary/syntax-extension-with-dll-deps-2.rs | 5 |
5 files changed, 12 insertions, 9 deletions
diff --git a/src/test/auxiliary/issue-2380.rs b/src/test/auxiliary/issue-2380.rs index a34ec980bda..c617c1b2d03 100644 --- a/src/test/auxiliary/issue-2380.rs +++ b/src/test/auxiliary/issue-2380.rs @@ -11,10 +11,11 @@ #![crate_id="a"] #![crate_type = "lib"] + pub trait i<T> { } -pub fn f<T>() -> ~i<T> { +pub fn f<T>() -> Box<i<T>> { impl<T> i<T> for () { } - ~() as ~i<T> + box() () as Box<i<T>> } diff --git a/src/test/auxiliary/issue13507.rs b/src/test/auxiliary/issue13507.rs index be066187be5..2b4df978cc8 100644 --- a/src/test/auxiliary/issue13507.rs +++ b/src/test/auxiliary/issue13507.rs @@ -59,7 +59,7 @@ pub mod testtypes { // Skipping ty_box // Tests ty_uniq (of u8) - pub type FooUniq = ~u8; + pub type FooUniq = Box<u8>; // As with ty_str, what type should be used for ty_vec? diff --git a/src/test/auxiliary/macro_crate_outlive_expansion_phase.rs b/src/test/auxiliary/macro_crate_outlive_expansion_phase.rs index 4e933be5092..a2c7e3533d8 100644 --- a/src/test/auxiliary/macro_crate_outlive_expansion_phase.rs +++ b/src/test/auxiliary/macro_crate_outlive_expansion_phase.rs @@ -29,7 +29,7 @@ impl Drop for Foo { #[macro_registrar] pub fn registrar(_: |Name, SyntaxExtension|) { - local_data_key!(foo: ~Any:Send); - local_data::set(foo, ~Foo { foo: 10 } as ~Any:Send); + local_data_key!(foo: Box<Any:Send>); + local_data::set(foo, box Foo { foo: 10 } as Box<Any:Send>); } diff --git a/src/test/auxiliary/macro_crate_test.rs b/src/test/auxiliary/macro_crate_test.rs index 070bb6dfcb7..95f2a8c1ca1 100644 --- a/src/test/auxiliary/macro_crate_test.rs +++ b/src/test/auxiliary/macro_crate_test.rs @@ -27,7 +27,7 @@ macro_rules! unexported_macro (() => (3)) #[macro_registrar] pub fn macro_registrar(register: |Name, SyntaxExtension|) { register(token::intern("make_a_1"), - NormalTT(~BasicMacroExpander { + NormalTT(box BasicMacroExpander { expander: expand_make_a_1, span: None, }, @@ -35,7 +35,8 @@ pub fn macro_registrar(register: |Name, SyntaxExtension|) { register(token::intern("into_foo"), ItemModifier(expand_into_foo)); } -fn expand_make_a_1(cx: &mut ExtCtxt, sp: Span, tts: &[TokenTree]) -> ~MacResult { +fn expand_make_a_1(cx: &mut ExtCtxt, sp: Span, tts: &[TokenTree]) + -> Box<MacResult> { if !tts.is_empty() { cx.span_fatal(sp, "make_a_1 takes no arguments"); } diff --git a/src/test/auxiliary/syntax-extension-with-dll-deps-2.rs b/src/test/auxiliary/syntax-extension-with-dll-deps-2.rs index 8156e7f0e34..93b56a7600d 100644 --- a/src/test/auxiliary/syntax-extension-with-dll-deps-2.rs +++ b/src/test/auxiliary/syntax-extension-with-dll-deps-2.rs @@ -25,14 +25,15 @@ use syntax::parse::token; #[macro_registrar] pub fn macro_registrar(register: |Name, SyntaxExtension|) { register(token::intern("foo"), - NormalTT(~BasicMacroExpander { + NormalTT(box BasicMacroExpander { expander: expand_foo, span: None, }, None)); } -fn expand_foo(cx: &mut ExtCtxt, sp: Span, tts: &[TokenTree]) -> ~MacResult { +fn expand_foo(cx: &mut ExtCtxt, sp: Span, tts: &[TokenTree]) + -> Box<MacResult> { let answer = other::the_answer(); MacExpr::new(quote_expr!(cx, $answer)) } |
