diff --git a/doc/tutorial-container.md b/doc/tutorial-container.md index 1b195e9997989..148afb4bda952 100644 --- a/doc/tutorial-container.md +++ b/doc/tutorial-container.md @@ -108,12 +108,14 @@ impl Iterator for ZeroStream { ## Container iterators Containers implement iteration over the contained elements by returning an -iterator object. For example, vector slices have four iterators available: +iterator object. For example, vector slices several iterators available: -* `vector.iter()`, for immutable references to the elements -* `vector.mut_iter()`, for mutable references to the elements -* `vector.rev_iter()`, for immutable references to the elements in reverse order -* `vector.mut_rev_iter()`, for mutable references to the elements in reverse order +* `iter()` and `rev_iter()`, for immutable references to the elements +* `mut_iter()` and `mut_rev_iter()`, for mutable references to the elements +* `consume_iter()` and `consume_rev_iter`, to move the elements out by-value + +A typical mutable container will implement at least `iter()`, `mut_iter()` and +`consume_iter()` along with the reverse variants if it maintains an order. ### Freezing diff --git a/src/librustc/middle/lint.rs b/src/librustc/middle/lint.rs index 4bcb40a5fba50..d6e6db8354a0f 100644 --- a/src/librustc/middle/lint.rs +++ b/src/librustc/middle/lint.rs @@ -79,7 +79,6 @@ pub enum lint { non_camel_case_types, non_uppercase_statics, type_limits, - default_methods, unused_unsafe, managed_heap_memory, @@ -222,13 +221,6 @@ static lint_table: &'static [(&'static str, LintSpec)] = &[ default: warn }), - ("default_methods", - LintSpec { - lint: default_methods, - desc: "allow default methods", - default: allow - }), - ("unused_unsafe", LintSpec { lint: unused_unsafe, @@ -690,23 +682,6 @@ fn lint_type_limits() -> visit::vt<@mut Context> { }) } -fn check_item_default_methods(cx: &Context, item: &ast::item) { - match item.node { - ast::item_trait(_, _, ref methods) => { - for methods.iter().advance |method| { - match *method { - ast::required(*) => {} - ast::provided(*) => { - cx.span_lint(default_methods, item.span, - "default methods are experimental"); - } - } - } - } - _ => {} - } -} - fn check_item_ctypes(cx: &Context, it: &ast::item) { fn check_ty(cx: &Context, ty: &ast::Ty) { match ty.node { @@ -1143,7 +1118,6 @@ pub fn check_crate(tcx: ty::ctxt, crate: @ast::Crate) { check_item_ctypes(cx, it); check_item_non_camel_case_types(cx, it); check_item_non_uppercase_statics(cx, it); - check_item_default_methods(cx, it); check_item_heap(cx, it); cx.process(Item(it)); diff --git a/src/libstd/cmp.rs b/src/libstd/cmp.rs index 8a13cab28c3bf..35de01b460e62 100644 --- a/src/libstd/cmp.rs +++ b/src/libstd/cmp.rs @@ -21,7 +21,6 @@ and `Eq` to overload the `==` and `!=` operators. */ #[allow(missing_doc)]; -#[allow(default_methods)]; // NOTE: Remove when allowed in stage0 /** * Trait for values that can be compared for equality and inequality. diff --git a/src/libstd/iterator.rs b/src/libstd/iterator.rs index 0c2a7bb7b400c..8620cf5f44c62 100644 --- a/src/libstd/iterator.rs +++ b/src/libstd/iterator.rs @@ -17,8 +17,6 @@ implementing the `Iterator` trait. */ -#[allow(default_methods)]; // still off by default in stage0 - use cmp; use iter::Times; use num::{Zero, One}; diff --git a/src/rt/rust_task.cpp b/src/rt/rust_task.cpp index a4afb1c0bc535..72979d67eefc8 100644 --- a/src/rt/rust_task.cpp +++ b/src/rt/rust_task.cpp @@ -152,8 +152,6 @@ cleanup_task(cleanup_args *args) { #endif } -extern "C" CDECL void upcall_exchange_free(void *ptr); - // This runs on the Rust stack void task_start_wrapper(spawn_args *a) { diff --git a/src/test/compile-fail/lint-default-methods.rs b/src/test/compile-fail/lint-default-methods.rs deleted file mode 100644 index 23befde7559c7..0000000000000 --- a/src/test/compile-fail/lint-default-methods.rs +++ /dev/null @@ -1,7 +0,0 @@ -#[forbid(default_methods)]; - -trait Foo { //~ ERROR default methods are experimental - fn bar(&self) { println("hi"); } -} - -fn main() {} diff --git a/src/test/run-pass/issue-7712.rs b/src/test/run-pass/issue-7712.rs index d4faae415d202..41c4af86bac95 100644 --- a/src/test/run-pass/issue-7712.rs +++ b/src/test/run-pass/issue-7712.rs @@ -10,8 +10,6 @@ // compile-flags:-Z debug-info -#[allow(default_methods)]; - pub trait TraitWithDefaultMethod { pub fn method(self) { () @@ -24,4 +22,4 @@ impl TraitWithDefaultMethod for MyStruct { } fn main() { MyStruct.method(); -} \ No newline at end of file +}