Skip to content

Commit 7334518

Browse files
committed
Auto merge of #25085 - carols10cents:remove-old-tilde, r=steveklabnik
There were still some mentions of `~[T]` and `~T`, mostly in comments and debugging statements. I tried to do my best to preserve meaning, but I might have gotten some wrong-- I'm happy to fix anything :)
2 parents bef0b4b + abc0017 commit 7334518

File tree

22 files changed

+61
-67
lines changed

22 files changed

+61
-67
lines changed

src/librustc/middle/expr_use_visitor.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1125,7 +1125,7 @@ impl<'d,'t,'tcx,TYPER:mc::Typer<'tcx>> ExprUseVisitor<'d,'t,'tcx,TYPER> {
11251125
// that case we can adjust the length of the
11261126
// original vec accordingly, but we'd have to
11271127
// make trans do the right thing, and it would
1128-
// only work for `~` vectors. It seems simpler
1128+
// only work for `Box<[T]>`s. It seems simpler
11291129
// to just require that people call
11301130
// `vec.pop()` or `vec.unshift()`.
11311131
let slice_bk = ty::BorrowKind::from_mutbl(slice_mutbl);

src/librustc/middle/traits/coherence.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -323,7 +323,7 @@ fn ty_is_local_constructor<'tcx>(tcx: &ty::ctxt<'tcx>,
323323
def_id.krate == ast::LOCAL_CRATE
324324
}
325325

326-
ty::ty_uniq(_) => { // treat ~T like Box<T>
326+
ty::ty_uniq(_) => { // Box<T>
327327
let krate = tcx.lang_items.owned_box().map(|d| d.krate);
328328
krate == Some(ast::LOCAL_CRATE)
329329
}

src/librustc/middle/traits/select.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -2441,10 +2441,10 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
24412441
/// `match_impl()`. For example, if `impl_def_id` is declared
24422442
/// as:
24432443
///
2444-
/// impl<T:Copy> Foo for ~T { ... }
2444+
/// impl<T:Copy> Foo for Box<T> { ... }
24452445
///
2446-
/// and `obligation_self_ty` is `int`, we'd back an `Err(_)`
2447-
/// result. But if `obligation_self_ty` were `~int`, we'd get
2446+
/// and `obligation_self_ty` is `int`, we'd get back an `Err(_)`
2447+
/// result. But if `obligation_self_ty` were `Box<int>`, we'd get
24482448
/// back `Ok(T=int)`.
24492449
fn match_inherent_impl(&mut self,
24502450
impl_def_id: ast::DefId,

src/librustc/util/ppaux.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -637,7 +637,7 @@ impl<'tcx, T:Repr<'tcx>> Repr<'tcx> for OwnedSlice<T> {
637637
}
638638
}
639639

640-
// This is necessary to handle types like Option<~[T]>, for which
640+
// This is necessary to handle types like Option<Vec<T>>, for which
641641
// autoderef cannot convert the &[T] handler
642642
impl<'tcx, T:Repr<'tcx>> Repr<'tcx> for Vec<T> {
643643
fn repr(&self, tcx: &ctxt<'tcx>) -> String {

src/librustc_borrowck/borrowck/check_loans.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -732,7 +732,7 @@ impl<'a, 'tcx> CheckLoanCtxt<'a, 'tcx> {
732732
/// let p: Point;
733733
/// p.x = 22; // ok, even though `p` is uninitialized
734734
///
735-
/// let p: ~Point;
735+
/// let p: Box<Point>;
736736
/// (*p).x = 22; // not ok, p is uninitialized, can't deref
737737
/// ```
738738
fn check_if_assigned_path_is_moved(&self,

src/librustc_privacy/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1314,7 +1314,7 @@ impl<'a, 'tcx, 'v> Visitor<'v> for VisiblePrivateTypesVisitor<'a, 'tcx> {
13141314
// `impl [... for] Private` is never visible.
13151315
let self_contains_private;
13161316
// impl [... for] Public<...>, but not `impl [... for]
1317-
// ~[Public]` or `(Public,)` etc.
1317+
// Vec<Public>` or `(Public,)` etc.
13181318
let self_is_public_path;
13191319

13201320
// check the properties of the Self type:

src/librustc_trans/back/link.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,7 @@ pub fn mangle<PI: Iterator<Item=PathElem>>(path: PI,
289289
// when using unix's linker. Perhaps one day when we just use a linker from LLVM
290290
// we won't need to do this name mangling. The problem with name mangling is
291291
// that it seriously limits the available characters. For example we can't
292-
// have things like &T or ~[T] in symbol names when one would theoretically
292+
// have things like &T in symbol names when one would theoretically
293293
// want them for things like impls of traits on that type.
294294
//
295295
// To be able to work on all platforms and get *some* reasonable output, we

src/librustc_trans/save/span_utils.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -230,8 +230,8 @@ impl<'a> SpanUtils<'a> {
230230
// Reparse span and return an owned vector of sub spans of the first limit
231231
// identifier tokens in the given nesting level.
232232
// example with Foo<Bar<T,V>, Bar<T,V>>
233-
// Nesting = 0: all idents outside of brackets: ~[Foo]
234-
// Nesting = 1: idents within one level of brackets: ~[Bar, Bar]
233+
// Nesting = 0: all idents outside of brackets: Vec<Foo>
234+
// Nesting = 1: idents within one level of brackets: Vec<Bar, Bar>
235235
pub fn spans_with_brackets(&self, span: Span, nesting: isize, limit: isize) -> Vec<Span> {
236236
let mut result: Vec<Span> = vec!();
237237

@@ -352,7 +352,7 @@ impl<'a> SpanUtils<'a> {
352352
return vec!();
353353
}
354354
// Type params are nested within one level of brackets:
355-
// i.e. we want ~[A, B] from Foo<A, B<T,U>>
355+
// i.e. we want Vec<A, B> from Foo<A, B<T,U>>
356356
self.spans_with_brackets(span, 1, number)
357357
}
358358

src/librustc_trans/trans/attributes.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ pub fn from_fn_type<'a, 'tcx>(ccx: &CrateContext<'a, 'tcx>, fn_type: ty::Ty<'tcx
196196
// The `noalias` attribute on the return value is useful to a
197197
// function ptr caller.
198198
match ret_ty.sty {
199-
// `~` pointer return values never alias because ownership
199+
// `Box` pointer return values never alias because ownership
200200
// is transferred
201201
ty::ty_uniq(it) if common::type_is_sized(ccx.tcx(), it) => {
202202
attrs.ret(llvm::Attribute::NoAlias);
@@ -239,7 +239,7 @@ pub fn from_fn_type<'a, 'tcx>(ccx: &CrateContext<'a, 'tcx>, fn_type: ty::Ty<'tcx
239239
attrs.arg(idx, llvm::Attribute::ZExt);
240240
}
241241

242-
// `~` pointer parameters never alias because ownership is transferred
242+
// `Box` pointer parameters never alias because ownership is transferred
243243
ty::ty_uniq(inner) => {
244244
let llsz = machine::llsize_of_real(ccx, type_of::type_of(ccx, inner));
245245

src/librustc_trans/trans/debuginfo/metadata.rs

+17-19
Original file line numberDiff line numberDiff line change
@@ -142,26 +142,24 @@ impl<'tcx> TypeMap<'tcx> {
142142
fn get_unique_type_id_of_type<'a>(&mut self, cx: &CrateContext<'a, 'tcx>,
143143
type_: Ty<'tcx>) -> UniqueTypeId {
144144

145-
// basic type -> {:name of the type:}
146-
// tuple -> {tuple_(:param-uid:)*}
147-
// struct -> {struct_:svh: / :node-id:_<(:param-uid:),*> }
148-
// enum -> {enum_:svh: / :node-id:_<(:param-uid:),*> }
149-
// enum variant -> {variant_:variant-name:_:enum-uid:}
150-
// reference (&) -> {& :pointee-uid:}
151-
// mut reference (&mut) -> {&mut :pointee-uid:}
152-
// ptr (*) -> {* :pointee-uid:}
153-
// mut ptr (*mut) -> {*mut :pointee-uid:}
154-
// unique ptr (~) -> {~ :pointee-uid:}
155-
// @-ptr (@) -> {@ :pointee-uid:}
156-
// sized vec ([T; x]) -> {[:size:] :element-uid:}
157-
// unsized vec ([T]) -> {[] :element-uid:}
158-
// trait (T) -> {trait_:svh: / :node-id:_<(:param-uid:),*> }
159-
// closure -> {<unsafe_> <once_> :store-sigil: |(:param-uid:),* <,_...>| -> \
145+
// basic type -> {:name of the type:}
146+
// tuple -> {tuple_(:param-uid:)*}
147+
// struct -> {struct_:svh: / :node-id:_<(:param-uid:),*> }
148+
// enum -> {enum_:svh: / :node-id:_<(:param-uid:),*> }
149+
// enum variant -> {variant_:variant-name:_:enum-uid:}
150+
// reference (&) -> {& :pointee-uid:}
151+
// mut reference (&mut) -> {&mut :pointee-uid:}
152+
// ptr (*) -> {* :pointee-uid:}
153+
// mut ptr (*mut) -> {*mut :pointee-uid:}
154+
// unique ptr (box) -> {box :pointee-uid:}
155+
// @-ptr (@) -> {@ :pointee-uid:}
156+
// sized vec ([T; x]) -> {[:size:] :element-uid:}
157+
// unsized vec ([T]) -> {[] :element-uid:}
158+
// trait (T) -> {trait_:svh: / :node-id:_<(:param-uid:),*> }
159+
// closure -> {<unsafe_> <once_> :store-sigil: |(:param-uid:),* <,_...>| -> \
160160
// :return-type-uid: : (:bounds:)*}
161-
// function -> {<unsafe_> <abi_> fn( (:param-uid:)* <,_...> ) -> \
161+
// function -> {<unsafe_> <abi_> fn( (:param-uid:)* <,_...> ) -> \
162162
// :return-type-uid:}
163-
// unique vec box (~[]) -> {HEAP_VEC_BOX<:pointee-uid:>}
164-
// gc box -> {GC_BOX<:pointee-uid:>}
165163

166164
match self.type_to_unique_id.get(&type_).cloned() {
167165
Some(unique_type_id) => return unique_type_id,
@@ -202,7 +200,7 @@ impl<'tcx> TypeMap<'tcx> {
202200
}
203201
},
204202
ty::ty_uniq(inner_type) => {
205-
unique_type_id.push('~');
203+
unique_type_id.push_str("box ");
206204
let inner_type_id = self.get_unique_type_id_of_type(cx, inner_type);
207205
let inner_type_id = self.get_unique_type_id_as_string(inner_type_id);
208206
unique_type_id.push_str(&inner_type_id[..]);

src/librustc_typeck/check/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -2458,7 +2458,7 @@ fn check_expr_with_lvalue_pref<'a,'tcx>(fcx: &FnCtxt<'a,'tcx>, expr: &'tcx ast::
24582458
}
24592459

24602460
// determine the `self` type, using fresh variables for all variables
2461-
// declared on the impl declaration e.g., `impl<A,B> for ~[(A,B)]`
2461+
// declared on the impl declaration e.g., `impl<A,B> for Vec<(A,B)>`
24622462
// would return ($0, $1) where $0 and $1 are freshly instantiated type
24632463
// variables.
24642464
pub fn impl_self_ty<'a, 'tcx>(fcx: &FnCtxt<'a, 'tcx>,

src/librustc_typeck/variance.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -178,8 +178,8 @@
178178
//! further that for whatever reason I specifically supply the value of
179179
//! `String` for the type parameter `T`:
180180
//!
181-
//! let mut vector = ~["string", ...];
182-
//! convertAll::<int, String>(v);
181+
//! let mut vector = vec!["string", ...];
182+
//! convertAll::<int, String>(vector);
183183
//!
184184
//! Is this legal? To put another way, can we apply the `impl` for
185185
//! `Object` to the type `String`? The answer is yes, but to see why

src/librustdoc/clean/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -897,7 +897,7 @@ impl<'tcx> Clean<Type> for ty::ProjectionTy<'tcx> {
897897
}
898898
}
899899

900-
// maybe use a Generic enum and use ~[Generic]?
900+
// maybe use a Generic enum and use Vec<Generic>?
901901
#[derive(Clone, RustcEncodable, RustcDecodable, PartialEq, Debug)]
902902
pub struct Generics {
903903
pub lifetimes: Vec<Lifetime>,

src/libsyntax/ext/deriving/generic/mod.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -896,8 +896,8 @@ impl<'a> MethodDef<'a> {
896896
nonself_args: &[P<Expr>])
897897
-> P<Expr> {
898898

899-
let mut raw_fields = Vec::new(); // ~[[fields of self],
900-
// [fields of next Self arg], [etc]]
899+
let mut raw_fields = Vec::new(); // Vec<[fields of self],
900+
// [fields of next Self arg], [etc]>
901901
let mut patterns = Vec::new();
902902
for i in 0..self_args.len() {
903903
let struct_path= cx.path(DUMMY_SP, vec!( type_ident ));

src/libsyntax/ext/expand.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1692,7 +1692,7 @@ mod tests {
16921692
// induced by visit. Each of these arrays contains a list of indexes,
16931693
// interpreted as the varrefs in the varref traversal that this binding
16941694
// should match. So, for instance, in a program with two bindings and
1695-
// three varrefs, the array ~[~[1,2],~[0]] would indicate that the first
1695+
// three varrefs, the array [[1, 2], [0]] would indicate that the first
16961696
// binding should match the second two varrefs, and the second binding
16971697
// should match the first varref.
16981698
//

src/libsyntax/print/pp.rs

+9-9
Original file line numberDiff line numberDiff line change
@@ -312,7 +312,7 @@ impl<'a> Printer<'a> {
312312
self.token[self.right] = t;
313313
}
314314
pub fn pretty_print(&mut self, token: Token) -> io::Result<()> {
315-
debug!("pp ~[{},{}]", self.left, self.right);
315+
debug!("pp Vec<{},{}>", self.left, self.right);
316316
match token {
317317
Token::Eof => {
318318
if !self.scan_stack_empty {
@@ -329,7 +329,7 @@ impl<'a> Printer<'a> {
329329
self.left = 0;
330330
self.right = 0;
331331
} else { self.advance_right(); }
332-
debug!("pp Begin({})/buffer ~[{},{}]",
332+
debug!("pp Begin({})/buffer Vec<{},{}>",
333333
b.offset, self.left, self.right);
334334
self.token[self.right] = token;
335335
self.size[self.right] = -self.right_total;
@@ -339,10 +339,10 @@ impl<'a> Printer<'a> {
339339
}
340340
Token::End => {
341341
if self.scan_stack_empty {
342-
debug!("pp End/print ~[{},{}]", self.left, self.right);
342+
debug!("pp End/print Vec<{},{}>", self.left, self.right);
343343
self.print(token, 0)
344344
} else {
345-
debug!("pp End/buffer ~[{},{}]", self.left, self.right);
345+
debug!("pp End/buffer Vec<{},{}>", self.left, self.right);
346346
self.advance_right();
347347
self.token[self.right] = token;
348348
self.size[self.right] = -1;
@@ -358,7 +358,7 @@ impl<'a> Printer<'a> {
358358
self.left = 0;
359359
self.right = 0;
360360
} else { self.advance_right(); }
361-
debug!("pp Break({})/buffer ~[{},{}]",
361+
debug!("pp Break({})/buffer Vec<{},{}>",
362362
b.offset, self.left, self.right);
363363
self.check_stack(0);
364364
let right = self.right;
@@ -370,11 +370,11 @@ impl<'a> Printer<'a> {
370370
}
371371
Token::String(s, len) => {
372372
if self.scan_stack_empty {
373-
debug!("pp String('{}')/print ~[{},{}]",
373+
debug!("pp String('{}')/print Vec<{},{}>",
374374
s, self.left, self.right);
375375
self.print(Token::String(s, len), len)
376376
} else {
377-
debug!("pp String('{}')/buffer ~[{},{}]",
377+
debug!("pp String('{}')/buffer Vec<{},{}>",
378378
s, self.left, self.right);
379379
self.advance_right();
380380
self.token[self.right] = Token::String(s, len);
@@ -386,7 +386,7 @@ impl<'a> Printer<'a> {
386386
}
387387
}
388388
pub fn check_stream(&mut self) -> io::Result<()> {
389-
debug!("check_stream ~[{}, {}] with left_total={}, right_total={}",
389+
debug!("check_stream Vec<{}, {}> with left_total={}, right_total={}",
390390
self.left, self.right, self.left_total, self.right_total);
391391
if self.right_total - self.left_total > self.space {
392392
debug!("scan window is {}, longer than space on line ({})",
@@ -446,7 +446,7 @@ impl<'a> Printer<'a> {
446446
assert!((self.right != self.left));
447447
}
448448
pub fn advance_left(&mut self) -> io::Result<()> {
449-
debug!("advance_left ~[{},{}], sizeof({})={}", self.left, self.right,
449+
debug!("advance_left Vec<{},{}>, sizeof({})={}", self.left, self.right,
450450
self.left, self.size[self.left]);
451451

452452
let mut left_size = self.size[self.left];

src/libtest/lib.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -259,8 +259,8 @@ pub fn test_main(args: &[String], tests: Vec<TestDescAndFn> ) {
259259
// This will panic (intentionally) when fed any dynamic tests, because
260260
// it is copying the static values out into a dynamic vector and cannot
261261
// copy dynamic values. It is doing this because from this point on
262-
// a ~[TestDescAndFn] is used in order to effect ownership-transfer
263-
// semantics into parallel test runners, which in turn requires a ~[]
262+
// a Vec<TestDescAndFn> is used in order to effect ownership-transfer
263+
// semantics into parallel test runners, which in turn requires a Vec<>
264264
// rather than a &[].
265265
pub fn test_main_static(args: env::Args, tests: &[TestDescAndFn]) {
266266
let args = args.collect::<Vec<_>>();

src/test/compile-fail/kindck-copy.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ fn test<'a,T,U:Copy>(_: &'a isize) {
3737
assert_copy::<&'static mut isize>(); //~ ERROR `core::marker::Copy` is not implemented
3838
assert_copy::<&'a mut isize>(); //~ ERROR `core::marker::Copy` is not implemented
3939

40-
// ~ pointers are not ok
40+
// owned pointers are not ok
4141
assert_copy::<Box<isize>>(); //~ ERROR `core::marker::Copy` is not implemented
4242
assert_copy::<String>(); //~ ERROR `core::marker::Copy` is not implemented
4343
assert_copy::<Vec<isize> >(); //~ ERROR `core::marker::Copy` is not implemented

src/test/debuginfo/issue11600.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
// ignore-test
1414

1515
fn main() {
16-
let args : ~[String] = ::std::os::args();
16+
let args : Vec<String> = ::std::os::args();
1717
::std::io::println(args[0]);
1818
}
1919

@@ -25,6 +25,6 @@ fn main() {
2525
// compile-flags:-g
2626
// gdb-command:list
2727
// gdb-check:1[...]fn main() {
28-
// gdb-check:2[...]let args : ~[String] = ::std::os::args();
28+
// gdb-check:2[...]let args : Vec<String> = ::std::os::args();
2929
// gdb-check:3[...]::std::io::println(args[0]);
3030
// gdb-check:4[...]}

src/test/run-pass/const-bound.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ struct F { field: isize }
2020
pub fn main() {
2121
/*foo(1);
2222
foo("hi".to_string());
23-
foo(~[1, 2, 3]);
23+
foo(vec![1, 2, 3]);
2424
foo(F{field: 42});
2525
foo((1, 2));
2626
foo(@1);*/

src/test/run-pass/issue-3556.rs

-4
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,6 @@ fn check_strs(actual: &str, expected: &str) -> bool
3232

3333
pub fn main()
3434
{
35-
// assert!(check_strs(fmt!("%?", Text(@"foo".to_string())), "Text(@~\"foo\")"));
36-
// assert!(check_strs(fmt!("%?", ETag(@~["foo".to_string()], @"bar".to_string())),
37-
// "ETag(@~[ ~\"foo\" ], @~\"bar\")"));
38-
3935
let t = Token::Text("foo".to_string());
4036
let u = Token::Section(vec!["alpha".to_string()],
4137
true,

0 commit comments

Comments
 (0)