diff options
| author | Alex Crichton <alex@alexcrichton.com> | 2015-01-05 19:13:38 -0800 |
|---|---|---|
| committer | Alex Crichton <alex@alexcrichton.com> | 2015-01-05 22:58:37 -0800 |
| commit | 4b359e3aeeaf97a190c5a7ecff8815b7b5734ece (patch) | |
| tree | 0502e3fcb9ceaa41d36c707e95baf0d7740fc3fd | |
| parent | ee9921aaedb26de3cac4c1c174888528f68bbd3f (diff) | |
| download | rust-4b359e3aeeaf97a190c5a7ecff8815b7b5734ece.tar.gz rust-4b359e3aeeaf97a190c5a7ecff8815b7b5734ece.zip | |
More test fixes!
42 files changed, 50 insertions, 328 deletions
diff --git a/src/libcollections/dlist.rs b/src/libcollections/dlist.rs index 14d61edca04..5e08f90ce1c 100644 --- a/src/libcollections/dlist.rs +++ b/src/libcollections/dlist.rs @@ -1066,6 +1066,7 @@ mod tests { } #[allow(deprecated)] + #[test] fn test_append() { { let mut m = DList::new(); diff --git a/src/libcore/iter.rs b/src/libcore/iter.rs index 9a2245501a8..e5753f6cc2e 100644 --- a/src/libcore/iter.rs +++ b/src/libcore/iter.rs @@ -1171,134 +1171,6 @@ impl_multiplicative! { uint, 1 } impl_multiplicative! { f32, 1.0 } impl_multiplicative! { f64, 1.0 } -<<<<<<< HEAD -======= -/// A trait for iterators over elements which can be compared to one another. -#[unstable = "recently renamed for new extension trait conventions"] -pub trait IteratorOrdExt<A> { - /// Consumes the entire iterator to return the maximum element. - /// - /// # Example - /// - /// ```rust - /// let a = [1i, 2, 3, 4, 5]; - /// assert!(a.iter().max().unwrap() == &5); - /// ``` - fn max(self) -> Option<A>; - - /// Consumes the entire iterator to return the minimum element. - /// - /// # Example - /// - /// ```rust - /// let a = [1i, 2, 3, 4, 5]; - /// assert!(a.iter().min().unwrap() == &1); - /// ``` - fn min(self) -> Option<A>; - - /// `min_max` finds the minimum and maximum elements in the iterator. - /// - /// The return type `MinMaxResult` is an enum of three variants: - /// - /// - `NoElements` if the iterator is empty. - /// - `OneElement(x)` if the iterator has exactly one element. - /// - `MinMax(x, y)` is returned otherwise, where `x <= y`. Two - /// values are equal if and only if there is more than one - /// element in the iterator and all elements are equal. - /// - /// On an iterator of length `n`, `min_max` does `1.5 * n` comparisons, - /// and so is faster than calling `min` and `max` separately which does `2 * n` comparisons. - /// - /// # Example - /// - /// ```rust - /// use std::iter::MinMaxResult::{NoElements, OneElement, MinMax}; - /// - /// let v: [int; 0] = []; - /// assert_eq!(v.iter().min_max(), NoElements); - /// - /// let v = [1i]; - /// assert!(v.iter().min_max() == OneElement(&1)); - /// - /// let v = [1i, 2, 3, 4, 5]; - /// assert!(v.iter().min_max() == MinMax(&1, &5)); - /// - /// let v = [1i, 2, 3, 4, 5, 6]; - /// assert!(v.iter().min_max() == MinMax(&1, &6)); - /// - /// let v = [1i, 1, 1, 1]; - /// assert!(v.iter().min_max() == MinMax(&1, &1)); - /// ``` - fn min_max(self) -> MinMaxResult<A>; -} - -#[unstable = "trait is unstable"] -impl<T, I> IteratorOrdExt<T> for I where I: Iterator<Item=T>, T: Ord { - #[inline] - fn max(self) -> Option<T> { - self.fold(None, |max, x| { - match max { - None => Some(x), - Some(y) => Some(cmp::max(x, y)) - } - }) - } - - #[inline] - fn min(self) -> Option<T> { - self.fold(None, |min, x| { - match min { - None => Some(x), - Some(y) => Some(cmp::min(x, y)) - } - }) - } - - fn min_max(mut self) -> MinMaxResult<T> { - let (mut min, mut max) = match self.next() { - None => return NoElements, - Some(x) => { - match self.next() { - None => return OneElement(x), - Some(y) => if x < y {(x, y)} else {(y,x)} - } - } - }; - - loop { - // `first` and `second` are the two next elements we want to look at. - // We first compare `first` and `second` (#1). The smaller one is then compared to - // current minimum (#2). The larger one is compared to current maximum (#3). This - // way we do 3 comparisons for 2 elements. - let first = match self.next() { - None => break, - Some(x) => x - }; - let second = match self.next() { - None => { - if first < min { - min = first; - } else if first > max { - max = first; - } - break; - } - Some(x) => x - }; - if first < second { - if first < min {min = first;} - if max < second {max = second;} - } else { - if second < min {min = second;} - if max < first {max = first;} - } - } - - MinMax(min, max) - } -} - ->>>>>>> parent of f031671... Remove i suffix in docs /// `MinMaxResult` is an enum returned by `min_max`. See `IteratorOrdExt::min_max` for more detail. #[derive(Clone, PartialEq, Show)] #[unstable = "unclear whether such a fine-grained result is widely useful"] @@ -1386,35 +1258,6 @@ impl<T, D, I> ExactSizeIterator for Cloned<I> where I: ExactSizeIterator + Iterator<Item=D>, {} -<<<<<<< HEAD -======= -#[unstable = "recently renamed for extension trait conventions"] -/// An extension trait for cloneable iterators. -pub trait CloneIteratorExt { - /// Repeats an iterator endlessly - /// - /// # Example - /// - /// ```rust - /// use std::iter::{CloneIteratorExt, count}; - /// - /// let a = count(1i,1i).take(1); - /// let mut cy = a.cycle(); - /// assert_eq!(cy.next(), Some(1)); - /// assert_eq!(cy.next(), Some(1)); - /// ``` - #[stable] - fn cycle(self) -> Cycle<Self>; -} - -impl<I> CloneIteratorExt for I where I: Iterator + Clone { - #[inline] - fn cycle(self) -> Cycle<I> { - Cycle{orig: self.clone(), iter: self} - } -} - ->>>>>>> parent of f031671... Remove i suffix in docs /// An iterator that repeats endlessly #[derive(Clone, Copy)] #[must_use = "iterator adaptors are lazy and do nothing unless consumed"] diff --git a/src/libcoretest/iter.rs b/src/libcoretest/iter.rs index 2aa2a229f90..73db72d0313 100644 --- a/src/libcoretest/iter.rs +++ b/src/libcoretest/iter.rs @@ -769,7 +769,7 @@ fn test_range_step_inclusive() { #[test] fn test_reverse() { let mut ys = [1i, 2, 3, 4, 5]; - ys.iter_mut().reverse_(); + ys.iter_mut().reverse_in_place(); assert!(ys == [5, 4, 3, 2, 1]); } diff --git a/src/libgraphviz/lib.rs b/src/libgraphviz/lib.rs index e3bcf70e8c8..64cc490f4b1 100644 --- a/src/libgraphviz/lib.rs +++ b/src/libgraphviz/lib.rs @@ -587,7 +587,7 @@ pub fn render_opts<'a, N:Clone+'a, E:Clone+'a, G:Labeller<'a,N,E>+GraphWalk<'a,N mod tests { use self::NodeLabels::*; use super::{Id, Labeller, Nodes, Edges, GraphWalk, render}; - use super::LabelText::{mod, LabelStr, EscStr}; + use super::LabelText::{self, LabelStr, EscStr}; use std::io::IoResult; use std::borrow::IntoCow; use std::iter::repeat; diff --git a/src/librand/chacha.rs b/src/librand/chacha.rs index ce055a84d3f..815fc0e7ec7 100644 --- a/src/librand/chacha.rs +++ b/src/librand/chacha.rs @@ -27,7 +27,7 @@ const CHACHA_ROUNDS: uint = 20; // Cryptographically secure from 8 upwards as of /// /// [1]: D. J. Bernstein, [*ChaCha, a variant of /// Salsa20*](http://cr.yp.to/chacha.html) -#[deriving(Copy, Clone)] +#[derive(Copy, Clone)] pub struct ChaChaRng { buffer: [u32; STATE_WORDS], // Internal buffer of output state: [u32; STATE_WORDS], // Initial state @@ -284,7 +284,7 @@ mod test { #[test] fn test_rng_clone() { - let seed : &[_] = &[0u32, ..8]; + let seed : &[_] = &[0u32; 8]; let mut rng: ChaChaRng = SeedableRng::from_seed(seed); let mut clone = rng.clone(); for _ in range(0u, 16) { diff --git a/src/librand/lib.rs b/src/librand/lib.rs index 8eae7697376..c4dd08f9917 100644 --- a/src/librand/lib.rs +++ b/src/librand/lib.rs @@ -403,7 +403,7 @@ pub trait SeedableRng<Seed>: Rng { /// RNGs"](http://www.jstatsoft.org/v08/i14/paper). *Journal of /// Statistical Software*. Vol. 8 (Issue 14). #[allow(missing_copy_implementations)] -#[deriving(Clone)] +#[derive(Clone)] pub struct XorShiftRng { x: u32, y: u32, diff --git a/src/librustc/middle/infer/region_inference/mod.rs b/src/librustc/middle/infer/region_inference/mod.rs index 23e96dafa61..d30a6ff1cd9 100644 --- a/src/librustc/middle/infer/region_inference/mod.rs +++ b/src/librustc/middle/infer/region_inference/mod.rs @@ -22,7 +22,7 @@ use super::cres; use super::{RegionVariableOrigin, SubregionOrigin, TypeTrace, MiscVariable}; use middle::region; -use middle::ty::{mod, Ty}; +use middle::ty::{self, Ty}; use middle::ty::{BoundRegion, FreeRegion, Region, RegionVid}; use middle::ty::{ReEmpty, ReStatic, ReInfer, ReFree, ReEarlyBound}; use middle::ty::{ReLateBound, ReScope, ReVar, ReSkolemized, BrFresh}; @@ -69,7 +69,7 @@ pub enum Verify<'tcx> { VerifyGenericBound(GenericKind<'tcx>, SubregionOrigin<'tcx>, Region, Vec<Region>), } -#[deriving(Clone, Show, PartialEq, Eq)] +#[derive(Clone, Show, PartialEq, Eq)] pub enum GenericKind<'tcx> { Param(ty::ParamTy), Projection(ty::ProjectionTy<'tcx>), diff --git a/src/librustc_trans/back/write.rs b/src/librustc_trans/back/write.rs index 089d7f737d3..98e2b4b9ddd 100644 --- a/src/librustc_trans/back/write.rs +++ b/src/librustc_trans/back/write.rs @@ -22,7 +22,7 @@ use syntax::codemap; use syntax::diagnostic; use syntax::diagnostic::{Emitter, Handler, Level, mk_handler}; -use std::ffi::{mod, CString}; +use std::ffi::{self, CString}; use std::io::Command; use std::io::fs; use std::iter::Unfold; @@ -32,7 +32,7 @@ use std::mem; use std::sync::{Arc, Mutex}; use std::sync::mpsc::channel; use std::thread; -use libc::{mod, c_uint, c_int, c_void}; +use libc::{self, c_uint, c_int, c_void}; #[derive(Clone, Copy, PartialEq, PartialOrd, Ord, Eq)] pub enum OutputType { diff --git a/src/librustc_trans/trans/base.rs b/src/librustc_trans/trans/base.rs index 7031710c679..edcfaae0f80 100644 --- a/src/librustc_trans/trans/base.rs +++ b/src/librustc_trans/trans/base.rs @@ -88,7 +88,7 @@ use util::nodemap::NodeMap; use arena::TypedArena; use libc::{c_uint, uint64_t}; -use std::ffi::{mod, CString}; +use std::ffi::{self, CString}; use std::cell::{Cell, RefCell}; use std::collections::HashSet; use std::mem; diff --git a/src/librustc_typeck/check/_match.rs b/src/librustc_typeck/check/_match.rs index c5b5325e9d4..80e7e706059 100644 --- a/src/librustc_typeck/check/_match.rs +++ b/src/librustc_typeck/check/_match.rs @@ -195,10 +195,10 @@ pub fn check_pat<'a, 'tcx>(pcx: &pat_ctxt<'a, 'tcx>, ast::PatRegion(ref inner, mutbl) => { let inner_ty = fcx.infcx().next_ty_var(); - // SNAP c894171 remove this `if`-`else` entirely after next snapshot + // SNAP b2085d9 remove this `if`-`else` entirely after next snapshot let mutbl = if mutbl == ast::MutImmutable { ty::deref(fcx.infcx().shallow_resolve(expected), true) - .map(|mt| mt.mutbl).unwrap_or(ast::MutImmutable); + .map(|mt| mt.mutbl).unwrap_or(ast::MutImmutable) } else { mutbl }; diff --git a/src/librustc_typeck/check/regionck.rs b/src/librustc_typeck/check/regionck.rs index b7397b5f9ee..c7df5ed8453 100644 --- a/src/librustc_typeck/check/regionck.rs +++ b/src/librustc_typeck/check/regionck.rs @@ -92,7 +92,7 @@ use middle::region::CodeExtent; use middle::traits; use middle::ty::{ReScope}; use middle::ty::{self, Ty, MethodCall}; -use middle::infer::{mod, GenericKind}; +use middle::infer::{self, GenericKind}; use middle::pat_util; use util::ppaux::{ty_to_string, Repr}; diff --git a/src/libserialize/json_stage0.rs b/src/libserialize/json_stage0.rs index 9932f8d0306..a157d917274 100644 --- a/src/libserialize/json_stage0.rs +++ b/src/libserialize/json_stage0.rs @@ -2298,7 +2298,7 @@ impl ::Decoder<DecoderError> for Decoder { } /// A trait for converting values to JSON -pub trait ToJson for Sized? { +pub trait ToJson { /// Converts the value of `self` to an instance of JSON fn to_json(&self) -> Json; } diff --git a/src/libserialize/serialize_stage0.rs b/src/libserialize/serialize_stage0.rs index c4317b99dce..fd37bb63230 100644 --- a/src/libserialize/serialize_stage0.rs +++ b/src/libserialize/serialize_stage0.rs @@ -172,7 +172,7 @@ pub trait Decoder<E> { fn error(&mut self, err: &str) -> E; } -pub trait Encodable<S:Encoder<E>, E> for Sized? { +pub trait Encodable<S:Encoder<E>, E> { fn encode(&self, s: &mut S) -> Result<(), E>; } diff --git a/src/libstd/dynamic_lib.rs b/src/libstd/dynamic_lib.rs index 66cb1f2c948..2d013a8a5b8 100644 --- a/src/libstd/dynamic_lib.rs +++ b/src/libstd/dynamic_lib.rs @@ -128,8 +128,8 @@ impl DynamicLibrary { // This function should have a lifetime constraint of 'a on // T but that feature is still unimplemented + let raw_string = CString::from_slice(symbol.as_bytes()); let maybe_symbol_value = dl::check_for_errors_in(|| { - let raw_string = CString::from_slice(symbol.as_bytes()); dl::symbol(self.handle, raw_string.as_ptr()) }); diff --git a/src/libstd/lib.rs b/src/libstd/lib.rs index e937cd24d8d..b9f226c5aca 100644 --- a/src/libstd/lib.rs +++ b/src/libstd/lib.rs @@ -253,8 +253,6 @@ pub mod num; /* Runtime and platform support */ -pub mod thread_local; // first for macros - #[cfg_attr(stage0, macro_escape)] #[cfg_attr(not(stage0), macro_use)] pub mod thread_local; diff --git a/src/libstd/rand/mod.rs b/src/libstd/rand/mod.rs index cadaae5de5c..8855a7e5293 100644 --- a/src/libstd/rand/mod.rs +++ b/src/libstd/rand/mod.rs @@ -245,7 +245,7 @@ pub mod reader; /// The standard RNG. This is designed to be efficient on the current /// platform. -#[deriving(Copy, Clone)] +#[derive(Copy, Clone)] pub struct StdRng { rng: IsaacWordRng, } @@ -322,7 +322,7 @@ static THREAD_RNG_RESEED_THRESHOLD: uint = 32_768; type ThreadRngInner = reseeding::ReseedingRng<StdRng, ThreadRngReseeder>; /// The thread-local RNG. -#[deriving(Clone)] +#[derive(Clone)] pub struct ThreadRng { rng: Rc<RefCell<ThreadRngInner>>, } diff --git a/src/libstd/sys/windows/process.rs b/src/libstd/sys/windows/process.rs index 9b3f2ca0373..7b667416b17 100644 --- a/src/libstd/sys/windows/process.rs +++ b/src/libstd/sys/windows/process.rs @@ -466,19 +466,17 @@ fn free_handle(handle: *mut ()) { #[cfg(test)] mod tests { - use c_str::ToCStr; + use prelude::v1::*; + use str; + use ffi::CString; + use super::make_command_line; #[test] fn test_make_command_line() { - use prelude::v1::*; - use str; - use c_str::CString; - use super::make_command_line; - fn test_wrapper(prog: &str, args: &[&str]) -> String { - make_command_line(&prog.to_c_str(), + make_command_line(&CString::from_slice(prog.as_bytes()), args.iter() - .map(|a| a.to_c_str()) + .map(|a| CString::from_slice(a.as_bytes())) .collect::<Vec<CString>>() .as_slice()) } diff --git a/src/libsyntax/feature_gate.rs b/src/libsyntax/feature_gate.rs index 43e40393308..0810d4ee93a 100644 --- a/src/libsyntax/feature_gate.rs +++ b/src/libsyntax/feature_gate.rs @@ -267,7 +267,7 @@ impl<'a, 'v> Visitor<'v> for PostExpansionVisitor<'a> { } } - ast::ItemImpl(_, polarity, _, _, _, ref items) => { + ast::ItemImpl(_, polarity, _, _, _, _) => { match polarity { ast::ImplPolarity::Negative => { self.gate_feature("optin_builtin_traits", @@ -294,18 +294,6 @@ impl<'a, 'v> Visitor<'v> for PostExpansionVisitor<'a> { i.span, "the new orphan check rules will eventually be strictly enforced"); } - - for item in items.iter() { - match *item { - ast::MethodImplItem(_) => {} - ast::TypeImplItem(ref typedef) => { - self.gate_feature("associated_types", - typedef.span, - "associated types are \ - experimental") - } - } - } } _ => {} diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs index cdfbd2c74b6..32f8f5ee3d6 100644 --- a/src/libsyntax/parse/parser.rs +++ b/src/libsyntax/parse/parser.rs @@ -1244,7 +1244,7 @@ impl<'a> Parser<'a> { let _ = self.parse_ret_ty(); - self.obsolete(ty_closure_span, ObsoleteClosureType); + self.obsolete(ty_closure_span, ObsoleteSyntax::ClosureType); TyInfer } @@ -3897,16 +3897,10 @@ impl<'a> Parser<'a> { _ => { let e = self.mk_mac_expr(span.lo, span.hi, -<<<<<<< HEAD - macro.and_then(|m| m.node)); + mac.and_then(|m| m.node)); let e = self.parse_dot_or_call_expr_with(e); let e = self.parse_more_binops(e, 0); let e = self.parse_assign_expr_with(e); -======= - mac.and_then(|m| m.node)); - let e = - self.parse_dot_or_call_expr_with(e); ->>>>>>> kmc/macro-reform self.handle_expression_like_statement( e, ast::DUMMY_NODE_ID, @@ -5082,7 +5076,7 @@ impl<'a> Parser<'a> { } let _tref = Parser::trait_ref_from_ident(ident, span); - self.obsolete(span, ObsoleteForSized); + self.obsolete(span, ObsoleteSyntax::ForSized); None } else { diff --git a/src/libsyntax/show_span.rs b/src/libsyntax/show_span.rs index 51d655ec0f2..57520257fe1 100644 --- a/src/libsyntax/show_span.rs +++ b/src/libsyntax/show_span.rs @@ -65,8 +65,8 @@ impl<'a, 'v> Visitor<'v> for ShowSpanVisitor<'a> { visit::walk_ty(self, t); } - fn visit_mac(&mut self, macro: &ast::Mac) { - visit::walk_mac(self, macro); + fn visit_mac(&mut self, mac: &ast::Mac) { + visit::walk_mac(self, mac); } } diff --git a/src/test/auxiliary/traitimpl.rs b/src/test/auxiliary/traitimpl.rs index fd454509b39..33824af6187 100644 --- a/src/test/auxiliary/traitimpl.rs +++ b/src/test/auxiliary/traitimpl.rs @@ -10,7 +10,7 @@ // Test inherant trait impls work cross-crait. -pub trait Bar<'a> for ?Sized : 'a {} +pub trait Bar<'a> : 'a {} impl<'a> Bar<'a> { pub fn bar(&self) {} diff --git a/src/test/auxiliary/two_macros.rs b/src/test/auxiliary/two_macros.rs index 11b6108b99e..060960f0dbc 100644 --- a/src/test/auxiliary/two_macros.rs +++ b/src/test/auxiliary/two_macros.rs @@ -8,8 +8,6 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// force-host - #[macro_export] macro_rules! macro_one { () => ("one") } diff --git a/src/test/compile-fail/associated-type-projection-from-multiple-supertraits.rs b/src/test/compile-fail/associated-type-projection-from-multiple-supertraits.rs index 6555aa32027..c55e24e81ad 100644 --- a/src/test/compile-fail/associated-type-projection-from-multiple-supertraits.rs +++ b/src/test/compile-fail/associated-type-projection-from-multiple-supertraits.rs @@ -11,8 +11,6 @@ // Test equality constraints in a where clause where the type being // equated appears in a supertrait. -#![feature(associated_types)] - pub trait Vehicle { type Color; diff --git a/src/test/compile-fail/associated-type-projection-from-supertrait.rs b/src/test/compile-fail/associated-type-projection-from-supertrait.rs index 01f9bd3541f..abaf79fb4cb 100644 --- a/src/test/compile-fail/associated-type-projection-from-supertrait.rs +++ b/src/test/compile-fail/associated-type-projection-from-supertrait.rs @@ -11,8 +11,6 @@ // Test equality constraints in a where clause where the type being // equated appears in a supertrait. -#![feature(associated_types)] - pub trait Vehicle { type Color; diff --git a/src/test/compile-fail/associated-types-binding-to-type-defined-in-supertrait.rs b/src/test/compile-fail/associated-types-binding-to-type-defined-in-supertrait.rs index a362529bee8..b1194154911 100644 --- a/src/test/compile-fail/associated-types-binding-to-type-defined-in-supertrait.rs +++ b/src/test/compile-fail/associated-types-binding-to-type-defined-in-supertrait.rs @@ -11,8 +11,6 @@ // Test equality constraints in a where clause where the type being // equated appears in a supertrait. -#![feature(associated_types)] - pub trait Vehicle { type Color; diff --git a/src/test/compile-fail/associated-types-feature-gate.rs b/src/test/compile-fail/associated-types-feature-gate.rs deleted file mode 100644 index d95b94f0067..00000000000 --- a/src/test/compile-fail/associated-types-feature-gate.rs +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright 2014 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or -// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license -// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -trait Get { - type Value; //~ ERROR associated types are experimental - fn get(&self) -> Get::Value; -} - -struct Struct { - x: int, -} - -impl Get for Struct { - type Value = int; //~ ERROR associated types are experimental - fn get(&self) -> int { - self.x - } -} - -fn main() { - let s = Struct { - x: 100, - }; - assert_eq!(s.get(), 100); -} - diff --git a/src/test/compile-fail/associated-types-invalid-trait-ref-issue-18865.rs b/src/test/compile-fail/associated-types-invalid-trait-ref-issue-18865.rs index 8afd86195ff..b04b83e575b 100644 --- a/src/test/compile-fail/associated-types-invalid-trait-ref-issue-18865.rs +++ b/src/test/compile-fail/associated-types-invalid-trait-ref-issue-18865.rs @@ -11,8 +11,6 @@ // Test that we report an error if the trait ref in an qualified type // uses invalid type arguments. -#![feature(associated_types)] - trait Foo<T> { type Bar; fn get_bar(&self) -> Self::Bar; diff --git a/src/test/compile-fail/associated-types-issue-17359.rs b/src/test/compile-fail/associated-types-issue-17359.rs index 764b79c4cc6..6c79105abee 100644 --- a/src/test/compile-fail/associated-types-issue-17359.rs +++ b/src/test/compile-fail/associated-types-issue-17359.rs @@ -11,8 +11,6 @@ // Test that we do not ICE when an impl is missing an associated type (and that we report // a useful error, of course). -#![feature(associated_types)] - trait Trait { type Type; } diff --git a/src/test/compile-fail/gated-default-type-param-usage.rs b/src/test/compile-fail/gated-default-type-param-usage.rs deleted file mode 100644 index 4c8b5de4c86..00000000000 --- a/src/test/compile-fail/gated-default-type-param-usage.rs +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright 2014 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or -// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license -// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -// aux-build:default_type_params_xc.rs - -#![deny(default_type_param_usage)] - -extern crate default_type_params_xc; - -pub struct FooAlloc; - -pub type VecFoo<T> = default_type_params_xc::FakeVec<T, FooAlloc>; -//~^ ERROR: default type parameters are experimental - -fn main() {} diff --git a/src/test/compile-fail/gated-default-type-params.rs b/src/test/compile-fail/gated-default-type-params.rs deleted file mode 100644 index 65575d4fa85..00000000000 --- a/src/test/compile-fail/gated-default-type-params.rs +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright 2014 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or -// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license -// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -struct Heap; - -struct Vec<T, A = Heap>; //~ ERROR: default type parameters are experimental - -fn main() {} diff --git a/src/test/compile-fail/gated-glob-imports.rs b/src/test/compile-fail/gated-glob-imports.rs deleted file mode 100644 index cc7ba785e7e..00000000000 --- a/src/test/compile-fail/gated-glob-imports.rs +++ /dev/null @@ -1,14 +0,0 @@ -// Copyright 2013 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or -// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license -// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -use std::*; -//~^ ERROR: glob import statements are experimental - -fn main() {} diff --git a/src/test/compile-fail/macros-no-semicolon.rs b/src/test/compile-fail/macros-no-semicolon.rs index fd5f5866f09..0e85551e216 100644 --- a/src/test/compile-fail/macros-no-semicolon.rs +++ b/src/test/compile-fail/macros-no-semicolon.rs @@ -10,7 +10,7 @@ fn main() { assert!(1 == 2) - assert!(3 == 4) //~ ERROR expected one of `.`, `;`, or `}`, found `assert` + assert!(3 == 4) //~ ERROR expected one of `.`, `;`, `}`, or an operator, found `assert` println!("hello"); } diff --git a/src/test/compile-fail/mut-pattern-mismatched.rs b/src/test/compile-fail/mut-pattern-mismatched.rs index 74e6141a2b3..81985a3d6aa 100644 --- a/src/test/compile-fail/mut-pattern-mismatched.rs +++ b/src/test/compile-fail/mut-pattern-mismatched.rs @@ -13,8 +13,8 @@ fn main() { // (separate lines to ensure the spans are accurate) - // SNAP c894171 uncomment this after the next snapshot - // NOTE(stage0) just in case tidy doesn't check SNAP's in tests + // SNAP b2085d9 uncomment this after the next snapshot + // NOTE(stage0) just in case tidy doesn't check snap's in tests // let &_ // ~ ERROR expected `&mut int`, found `&_` // = foo; let &mut _ = foo; diff --git a/src/test/compile-fail/regions-close-associated-type-into-object.rs b/src/test/compile-fail/regions-close-associated-type-into-object.rs index 84664078d56..816314529b5 100644 --- a/src/test/compile-fail/regions-close-associated-type-into-object.rs +++ b/src/test/compile-fail/regions-close-associated-type-into-object.rs @@ -8,8 +8,6 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -#![feature(associated_types)] - trait X {} trait Iter { diff --git a/src/test/compile-fail/unsized3.rs b/src/test/compile-fail/unsized3.rs index 1b0368a351a..9b7d10b0d0f 100644 --- a/src/test/compile-fail/unsized3.rs +++ b/src/test/compile-fail/unsized3.rs @@ -20,7 +20,7 @@ fn f2<X>(x: &X) { } // Bounded. -trait T for {} +trait T {} fn f3<X: ?Sized + T>(x: &X) { f4::<X>(x); //~^ ERROR the trait `core::kinds::Sized` is not implemented diff --git a/src/test/run-pass/const-str-ptr.rs b/src/test/run-pass/const-str-ptr.rs index 1a84236793b..e846501be6e 100644 --- a/src/test/run-pass/const-str-ptr.rs +++ b/src/test/run-pass/const-str-ptr.rs @@ -18,8 +18,6 @@ pub fn main() { unsafe { let foo = &A as *const u8; assert_eq!(str::from_utf8_unchecked(&A), "hi"); - assert_eq!(String::from_raw_buf_len(foo, A.len()), "hi".to_string()); - assert_eq!(String::from_raw_buf_len(C, B.len()), "hi".to_string()); assert!(*C == A[0]); assert!(*(&B[0] as *const u8) == A[0]); } diff --git a/src/test/run-pass/method-recursive-blanket-impl.rs b/src/test/run-pass/method-recursive-blanket-impl.rs index 4e4fb75b428..e81244d4bea 100644 --- a/src/test/run-pass/method-recursive-blanket-impl.rs +++ b/src/test/run-pass/method-recursive-blanket-impl.rs @@ -16,7 +16,7 @@ use std::kinds::Sized; // Note: this must be generic for the problem to show up -trait Foo<A> for ?Sized { +trait Foo<A> { fn foo(&self); } diff --git a/src/test/run-pass/regions-relate-bound-regions-on-closures-to-inference-variables.rs b/src/test/run-pass/regions-relate-bound-regions-on-closures-to-inference-variables.rs index aa0ed023da3..2bdc883b9ce 100644 --- a/src/test/run-pass/regions-relate-bound-regions-on-closures-to-inference-variables.rs +++ b/src/test/run-pass/regions-relate-bound-regions-on-closures-to-inference-variables.rs @@ -27,7 +27,7 @@ struct Foo<'a,'tcx:'a> { impl<'a,'tcx> Foo<'a,'tcx> { fn bother(&mut self) -> int { - self.elaborate_bounds(|this| { + self.elaborate_bounds(box |this| { // (*) Here: type of `this` is `&'f0 Foo<&'f1, '_2>`, // where `'f0` and `'f1` are fresh, free regions that // result from the bound regions on the closure, and `'2` @@ -50,7 +50,7 @@ impl<'a,'tcx> Foo<'a,'tcx> { fn elaborate_bounds( &mut self, - mk_cand: for<'b>|this: &mut Foo<'b, 'tcx>| -> int) + mut mk_cand: Box<for<'b> FnMut(&mut Foo<'b, 'tcx>) -> int>) -> int { mk_cand(self) diff --git a/src/test/run-pass/running-with-no-runtime.rs b/src/test/run-pass/running-with-no-runtime.rs index fc53737bb44..6f807fc3499 100644 --- a/src/test/run-pass/running-with-no-runtime.rs +++ b/src/test/run-pass/running-with-no-runtime.rs @@ -8,6 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +use std::ffi; use std::io::process::{Command, ProcessOutput}; use std::os; use std::rt::unwind::try; @@ -34,7 +35,8 @@ fn start(argc: int, argv: *const *const u8) -> int { let args = unsafe { range(0, argc as uint).map(|i| { - String::from_raw_buf(*argv.offset(i as int)).into_bytes() + let ptr = *argv.offset(i as int) as *const _; + ffi::c_str_to_bytes(&ptr).to_vec() }).collect::<Vec<_>>() }; let me = args[0].as_slice(); diff --git a/src/test/run-pass/unsized.rs b/src/test/run-pass/unsized.rs index 07b9fac6655..e6dd8d46952 100644 --- a/src/test/run-pass/unsized.rs +++ b/src/test/run-pass/unsized.rs @@ -12,9 +12,9 @@ // Test syntax checks for `?Sized` syntax. -trait T1 for ?Sized {} -pub trait T2 for ?Sized {} -trait T3<X: T1> for ?Sized: T2 {} +trait T1 {} +pub trait T2 {} +trait T3<X: T1> : T2 {} trait T4<X: ?Sized> {} trait T5<X: ?Sized, Y> {} trait T6<Y, X: ?Sized> {} diff --git a/src/test/run-pass/unsized2.rs b/src/test/run-pass/unsized2.rs index 8d2c99d4414..c7e8b2a05ec 100644 --- a/src/test/run-pass/unsized2.rs +++ b/src/test/run-pass/unsized2.rs @@ -22,7 +22,7 @@ fn f2<X>(x: &X) { } // Bounded. -trait T for ?Sized {} +trait T {} fn f3<X: T+?Sized>(x: &X) { f3::<X>(x); } @@ -32,7 +32,7 @@ fn f4<X: T>(x: &X) { } // Self type. -trait T2 for ?Sized { +trait T2 { fn f() -> Box<Self>; } struct S; @@ -48,7 +48,7 @@ fn f6<X: T2>(x: &X) { let _: Box<X> = T2::f(); } -trait T3 for ?Sized { +trait T3 { fn f() -> Box<Self>; } impl T3 for S { diff --git a/src/test/run-pass/vec-macro-no-std.rs b/src/test/run-pass/vec-macro-no-std.rs index c04afffb120..7b2c35aa08d 100644 --- a/src/test/run-pass/vec-macro-no-std.rs +++ b/src/test/run-pass/vec-macro-no-std.rs @@ -11,6 +11,8 @@ #![feature(lang_items)] #![no_std] +extern crate "std" as other; + #[macro_use] extern crate core; extern crate libc; @@ -22,10 +24,6 @@ use core::option::Option::Some; use core::slice::SliceExt; use collections::vec::Vec; -#[lang = "stack_exhausted"] extern fn stack_exhausted() {} -#[lang = "eh_personality"] extern fn eh_personality() {} -#[lang = "panic_fmt"] fn panic_fmt() -> ! { loop {} } - // Issue #16806 #[start] |
