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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 3 additions & 3 deletions
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 3 additions & 3 deletions
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

Lines changed: 2 additions & 2 deletions
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

Lines changed: 17 additions & 19 deletions
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[..]);

0 commit comments

Comments
 (0)