Skip to content

Commit 7ec8172

Browse files
committed
Update old uses of ~ in comments and debugging statements
1 parent 796be61 commit 7ec8172

File tree

20 files changed

+35
-39
lines changed

20 files changed

+35
-39
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 `Vec`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
@@ -288,7 +288,7 @@ pub fn mangle<PI: Iterator<Item=PathElem>>(path: PI,
288288
// when using unix's linker. Perhaps one day when we just use a linker from LLVM
289289
// we won't need to do this name mangling. The problem with name mangling is
290290
// that it seriously limits the available characters. For example we can't
291-
// have things like &T or ~[T] in symbol names when one would theoretically
291+
// have things like &T or Vec<T> in symbol names when one would theoretically
292292
// want them for things like impls of traits on that type.
293293
//
294294
// 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::NoAliasAttribute);
@@ -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::ZExtAttribute);
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_typeck/check/mod.rs

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

0 commit comments

Comments
 (0)