Skip to content

Commit 56a9e2f

Browse files
committed
Test fixes and rebase conflicts
1 parent 26cd8ea commit 56a9e2f

File tree

18 files changed

+67
-34
lines changed

18 files changed

+67
-34
lines changed

src/libcollections/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
html_root_url = "http://doc.rust-lang.org/nightly/",
2222
html_playground_url = "http://play.rust-lang.org/")]
2323

24+
#![allow(unknown_features)]
2425
#![feature(unsafe_destructor, slicing_syntax)]
2526
#![feature(old_impl_check)]
2627
#![no_std]

src/libcollections/str.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1339,6 +1339,12 @@ pub trait StrExt: Index<FullRange, Output = str> {
13391339
fn trim_left(&self) -> &str {
13401340
UnicodeStr::trim_left(self.index(&FullRange))
13411341
}
1342+
1343+
/// Returns a string with trailing whitespace removed.
1344+
#[stable]
1345+
fn trim_right(&self) -> &str {
1346+
UnicodeStr::trim_right(self.index(&FullRange))
1347+
}
13421348
}
13431349

13441350
#[stable]

src/libcore/intrinsics.rs

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,9 @@
4242
#![experimental]
4343
#![allow(missing_docs)]
4444

45+
#[cfg(not(stage0))]
46+
use marker::Sized;
47+
4548
pub type GlueFn = extern "Rust" fn(*const i8);
4649

4750
#[lang="ty_desc"]
@@ -200,7 +203,10 @@ extern "rust-intrinsic" {
200203
/// Gets an identifier which is globally unique to the specified type. This
201204
/// function will return the same value for a type regardless of whichever
202205
/// crate it is invoked in.
206+
#[cfg(not(stage0))]
203207
pub fn type_id<T: ?Sized + 'static>() -> TypeId;
208+
#[cfg(stage0)]
209+
pub fn type_id<T: 'static>() -> TypeId;
204210

205211
/// Create a value initialized to zero.
206212
///
@@ -550,7 +556,16 @@ pub struct TypeId {
550556
}
551557

552558
impl TypeId {
553-
/// Returns the `TypeId` of the type this generic function has been instantiated with
559+
/// Returns the `TypeId` of the type this generic function has been
560+
/// instantiated with
561+
#[cfg(stage0)]
562+
pub fn of<T: 'static>() -> TypeId {
563+
unsafe { type_id::<T>() }
564+
}
565+
566+
/// Returns the `TypeId` of the type this generic function has been
567+
/// instantiated with
568+
#[cfg(not(stage0))]
554569
pub fn of<T: ?Sized + 'static>() -> TypeId {
555570
unsafe { type_id::<T>() }
556571
}

src/libcore/slice.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -733,7 +733,7 @@ macro_rules! iterator {
733733
}
734734

735735
macro_rules! make_slice {
736-
($t: ty -> $result: ty: $start: expr, $end: expr) => {{
736+
($t: ty => $result: ty: $start: expr, $end: expr) => {{
737737
let diff = $end as uint - $start as uint;
738738
let len = if mem::size_of::<T>() == 0 {
739739
diff
@@ -797,7 +797,7 @@ impl<'a, T> Iter<'a, T> {
797797
/// iterator can continue to be used while this exists.
798798
#[experimental]
799799
pub fn as_slice(&self) -> &'a [T] {
800-
make_slice!(T -> &'a [T]: self.ptr, self.end)
800+
make_slice!(T => &'a [T]: self.ptr, self.end)
801801
}
802802
}
803803

@@ -876,7 +876,7 @@ impl<'a, T> ops::Index<ops::FullRange> for IterMut<'a, T> {
876876
type Output = [T];
877877
#[inline]
878878
fn index(&self, _index: &ops::FullRange) -> &[T] {
879-
make_slice!(T -> &[T]: self.ptr, self.end)
879+
make_slice!(T => &[T]: self.ptr, self.end)
880880
}
881881
}
882882

@@ -909,7 +909,7 @@ impl<'a, T> ops::IndexMut<ops::FullRange> for IterMut<'a, T> {
909909
type Output = [T];
910910
#[inline]
911911
fn index_mut(&mut self, _index: &ops::FullRange) -> &mut [T] {
912-
make_slice!(T -> &mut [T]: self.ptr, self.end)
912+
make_slice!(T => &mut [T]: self.ptr, self.end)
913913
}
914914
}
915915

@@ -923,7 +923,7 @@ impl<'a, T> IterMut<'a, T> {
923923
/// restricted lifetimes that do not consume the iterator.
924924
#[experimental]
925925
pub fn into_slice(self) -> &'a mut [T] {
926-
make_slice!(T -> &'a mut [T]: self.ptr, self.end)
926+
make_slice!(T => &'a mut [T]: self.ptr, self.end)
927927
}
928928
}
929929

src/librustc/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
html_favicon_url = "http://www.rust-lang.org/favicon.ico",
2323
html_root_url = "http://doc.rust-lang.org/nightly/")]
2424

25+
#![allow(unknown_features)]
2526
#![feature(quote)]
2627
#![feature(slicing_syntax, unsafe_destructor)]
2728
#![feature(rustc_diagnostic_macros)]

src/librustc/middle/mem_categorization.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -486,9 +486,9 @@ impl<'t,'tcx,TYPER:Typer<'tcx>> MemCategorizationContext<'t,TYPER> {
486486
let method_call = ty::MethodCall::expr(expr.id());
487487
match self.typer.node_method_ty(method_call) {
488488
Some(method_ty) => {
489-
// If this is an index implemented by a method call, then it will
490-
// include an implicit deref of the result.
491-
let ret_ty = ty::ty_fn_ret(method_ty).unwrap();
489+
// If this is an index implemented by a method call, then it
490+
// will include an implicit deref of the result.
491+
let ret_ty = self.overloaded_method_return_ty(method_ty);
492492
self.cat_deref(expr,
493493
self.cat_rvalue_node(expr.id(),
494494
expr.span(),

src/librustc_typeck/check/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2405,7 +2405,7 @@ fn try_index_step<'a, 'tcx>(fcx: &FnCtxt<'a, 'tcx>,
24052405

24062406
// First, try built-in indexing.
24072407
match (ty::index(adjusted_ty), &index_ty.sty) {
2408-
(Some(ty), &ty::ty_uint(ast::TyU)) | (Some(ty), &ty::ty_infer(ty::IntVar(_))) => {
2408+
(Some(ty), &ty::ty_uint(ast::TyUs)) | (Some(ty), &ty::ty_infer(ty::IntVar(_))) => {
24092409
debug!("try_index_step: success, using built-in indexing");
24102410
fcx.write_adjustment(base_expr.id, base_expr.span, ty::AdjustDerefRef(adjustment));
24112411
return Some((tcx.types.uint, ty));

src/librustc_typeck/collect.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ impl<'a, 'tcx> AstConv<'tcx> for CollectCtxt<'a, 'tcx> {
171171
x => {
172172
self.tcx.sess.bug(format!("unexpected sort of node \
173173
in get_item_type_scheme(): {:?}",
174-
x)[]);
174+
x).as_slice());
175175
}
176176
}
177177
}

src/libserialize/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ Core encoding and decoding interfaces.
2525
#![allow(unknown_features)]
2626
#![feature(slicing_syntax)]
2727
#![feature(old_impl_check)]
28+
#![cfg_attr(stage0, allow(unused_attributes))]
2829

2930
// test harness access
3031
#[cfg(test)] extern crate test;

src/libserialize/serialize.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -499,7 +499,7 @@ macro_rules! peel {
499499
/// Evaluates to the number of identifiers passed to it, for example: `count_idents!(a, b, c) == 3
500500
macro_rules! count_idents {
501501
() => { 0u };
502-
($_i:ident, $($rest:ident),*) => { 1 + count_idents!($($rest),*) }
502+
($_i:ident, $($rest:ident,)*) => { 1 + count_idents!($($rest,)*) }
503503
}
504504

505505
macro_rules! tuple {
@@ -508,7 +508,7 @@ macro_rules! tuple {
508508
impl<$($name:Decodable),*> Decodable for ($($name,)*) {
509509
#[allow(non_snake_case)]
510510
fn decode<D: Decoder>(d: &mut D) -> Result<($($name,)*), D::Error> {
511-
let len: uint = count_idents!($($name),*);
511+
let len: uint = count_idents!($($name,)*);
512512
d.read_tuple(len, |d| {
513513
let mut i = 0;
514514
let ret = ($(try!(d.read_tuple_arg({ i+=1; i-1 },

0 commit comments

Comments
 (0)