rollup merge of #20568: huonw/ungate-AT-globs

These aren't in their final form, but are all aiming to be part of 1.0, so at the very least encouraging usage now to find the bugs is nice.

Also, the widespread roll-out of associated types in the standard library indicates they're getting good, and it's lame to have to activate a feature in essentially every crate ever.
This commit is contained in:
Alex Crichton 2015-01-05 18:42:00 -08:00
commit b24431970e
186 changed files with 37 additions and 409 deletions

View file

@ -12,7 +12,6 @@
// cross-crate scenario.
#![crate_type="lib"]
#![feature(associated_types)]
pub trait Bar {
type T;

View file

@ -8,8 +8,6 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![feature(default_type_params)]
pub struct Heap;
pub struct FakeHeap;

View file

@ -9,7 +9,6 @@
// except according to those terms.
#![crate_type = "lib"]
#![feature(associated_types)]
pub struct TreeBuilder<H>;

View file

@ -8,8 +8,6 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![feature(associated_types)]
pub trait T {
type C;
}

View file

@ -9,7 +9,6 @@
// except according to those terms.
#![allow(unused_imports)]
#![feature(globs)]
extern crate issue_2316_a;

View file

@ -10,7 +10,7 @@
// force-host
#![feature(globs, plugin_registrar, macro_rules, quote)]
#![feature(plugin_registrar, macro_rules, quote)]
extern crate syntax;
extern crate rustc;

View file

@ -7,7 +7,6 @@
// <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.
#![feature(globs)]
pub use Foo::*;
@ -34,5 +33,3 @@ pub mod nest {
pub fn foo() {}
}
}

View file

@ -8,8 +8,6 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![feature(associated_types)]
use std::ops::Deref;
struct DerefWithHelper<H, T> {

View file

@ -11,7 +11,7 @@
// force-host
#![crate_type = "dylib"]
#![feature(plugin_registrar, quote, globs)]
#![feature(plugin_registrar, quote)]
extern crate "syntax-extension-with-dll-deps-1" as other;
extern crate syntax;

View file

@ -8,8 +8,6 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![feature(associated_types)]
use std::cmp::PartialEq;
use std::ops::{Add, Sub, Mul};

View file

@ -38,7 +38,7 @@
// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
// OF THE POSSIBILITY OF SUCH DAMAGE.
#![feature(associated_types, slicing_syntax)]
#![feature(slicing_syntax)]
use std::cmp::min;
use std::io::{BufferedWriter, File};

View file

@ -40,7 +40,7 @@
// ignore-android see #10393 #13206
#![feature(associated_types, slicing_syntax)]
#![feature(slicing_syntax)]
use std::ascii::OwnedAsciiExt;
use std::iter::repeat;

View file

@ -40,8 +40,6 @@
// no-pretty-expanded FIXME #15189
#![feature(associated_types)]
use std::iter::repeat;
use std::sync::Arc;
use std::sync::mpsc::channel;

View file

@ -40,7 +40,7 @@
// ignore-android see #10393 #13206
#![feature(associated_types, slicing_syntax, unboxed_closures)]
#![feature(slicing_syntax, unboxed_closures)]
extern crate libc;

View file

@ -12,7 +12,7 @@
// just propagate the error.
#![crate_type = "lib"]
#![feature(associated_types, default_type_params, lang_items)]
#![feature(lang_items)]
#![no_std]
#[lang="sized"]

View file

@ -10,8 +10,6 @@
// Test equality constraints on associated types in a where clause.
#![feature(associated_types)]
pub trait ToInt {
fn to_int(&self) -> int;
}

View file

@ -11,8 +11,6 @@
// Test equality constraints on associated types. Check that unsupported syntax
// does not ICE.
#![feature(associated_types)]
pub trait Foo {
type A;
fn boo(&self) -> <Self as Foo>::A;

View file

@ -11,8 +11,6 @@
// Test equality constraints on associated types. Check we get an error when an
// equality constraint is used in a qualified path.
#![feature(associated_types)]
pub trait Foo {
type A;
fn boo(&self) -> <Self as Foo>::A;

View file

@ -11,8 +11,6 @@
// Test equality constraints on associated types. Check we get type errors
// where we should.
#![feature(associated_types)]
pub trait Foo {
type A;
fn boo(&self) -> <Self as Foo>::A;

View file

@ -10,8 +10,6 @@
// Check that an associated type cannot be bound in an expression path.
#![feature(associated_types)]
trait Foo {
type A;
fn bar() -> int;

View file

@ -10,8 +10,6 @@
// Check testing of equality constraints in a higher-ranked context.
#![feature(associated_types)]
pub trait TheTrait<T> {
type A;

View file

@ -8,8 +8,6 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![feature(associated_types)]
trait Get {
type Value;
fn get(&self) -> <Self as Get>::Value;
@ -22,4 +20,3 @@ trait Other {
fn main() {
}

View file

@ -8,8 +8,6 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![feature(associated_types)]
trait Get {
type Value;
fn get(&self) -> <Self as Get>::Value;
@ -26,4 +24,3 @@ trait Grab {
fn main() {
}

View file

@ -11,8 +11,6 @@
// Check that the user gets an errror if they omit a binding from an
// object type.
#![feature(associated_types)]
pub trait Foo {
type A;
type B;

View file

@ -11,7 +11,6 @@
// Test that we reliably check the value of the associated type.
#![crate_type = "lib"]
#![feature(associated_types)]
#![no_implicit_prelude]
use std::option::Option::{self, None, Some};

View file

@ -8,8 +8,6 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![feature(associated_types)]
trait Get {
type Value;
fn get(&self) -> <Self as Get>::Value;
@ -26,4 +24,3 @@ impl Struct {
fn main() {
}

View file

@ -8,8 +8,6 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![feature(associated_types)]
// Check that we get an error when you use `<Self as Get>::Value` in
// the trait definition but `Self` does not, in fact, implement `Get`.

View file

@ -10,8 +10,6 @@
// Test that we have one and only one associated type per ref.
#![feature(associated_types)]
pub trait Foo {
type A;
}
@ -23,4 +21,3 @@ pub fn f1<T>(a: T, x: T::A) {} //~ERROR associated type `A` not found
pub fn f2<T: Foo + Bar>(a: T, x: T::A) {} //~ERROR ambiguous associated type `A`
pub fn main() {}

View file

@ -10,8 +10,6 @@
// Test type checking of uses of associated types via sugary paths.
#![feature(associated_types)]
pub trait Foo {
type A;
}

View file

@ -11,8 +11,6 @@
// Test you can't use a higher-ranked trait bound inside of a qualified
// path (just won't parse).
#![feature(associated_types)]
pub trait Foo<T> {
type A;

View file

@ -11,8 +11,6 @@
// Check projection of an associated type out of a higher-ranked
// trait-bound in the context of a function body.
#![feature(associated_types)]
pub trait Foo<T> {
type A;

View file

@ -11,8 +11,6 @@
// Check projection of an associated type out of a higher-ranked trait-bound
// in the context of a function signature.
#![feature(associated_types)]
pub trait Foo<T> {
type A;

View file

@ -11,8 +11,6 @@
// Check projection of an associated type out of a higher-ranked trait-bound
// in the context of a struct definition.
#![feature(associated_types)]
pub trait Foo<T> {
type A;

View file

@ -11,8 +11,6 @@
// Check projection of an associated type out of a higher-ranked trait-bound
// in the context of a method definition in a trait.
#![feature(associated_types)]
pub trait Foo<T> {
type A;

View file

@ -10,8 +10,6 @@
// Check that an associated type cannot be bound in an expression path.
#![feature(associated_types)]
trait Foo {
type A;
fn bar() -> int;

View file

@ -8,8 +8,6 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![feature(associated_types)]
trait Get {
type Sized? Value;
fn get(&self) -> <Self as Get>::Value;
@ -21,4 +19,3 @@ fn foo<T:Get>(t: T) {
fn main() {
}

View file

@ -10,8 +10,6 @@
// Test that binary operators consume their arguments
#![feature(associated_types, default_type_params)]
use std::ops::{Add, Sub, Mul, Div, Rem, BitAnd, BitXor, BitOr, Shl, Shr};
fn add<A: Add<B, Output=()>, B>(lhs: A, rhs: B) {

View file

@ -10,8 +10,6 @@
// Test that move restrictions are enforced on overloaded binary operations
#![feature(associated_types, default_type_params)]
use std::ops::Add;
fn double_move<T: Add<Output=()>>(x: T) {

View file

@ -11,8 +11,6 @@
// Test how overloaded deref interacts with borrows when DerefMut
// is implemented.
#![feature(associated_types)]
use std::ops::{Deref, DerefMut};
struct Own<T> {

View file

@ -11,8 +11,6 @@
// Test how overloaded deref interacts with borrows when only
// Deref and not DerefMut is implemented.
#![feature(associated_types)]
use std::ops::Deref;
struct Rc<T> {

View file

@ -11,8 +11,6 @@
// Test how overloaded deref interacts with borrows when DerefMut
// is implemented.
#![feature(associated_types)]
use std::ops::{Deref, DerefMut};
struct Own<T> {

View file

@ -11,8 +11,6 @@
// Test how overloaded deref interacts with borrows when only
// Deref and not DerefMut is implemented.
#![feature(associated_types)]
use std::ops::Deref;
struct Rc<T> {

View file

@ -8,8 +8,6 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![feature(associated_types)]
use std::ops::Add;
#[derive(Clone)]

View file

@ -8,8 +8,6 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![feature(associated_types, default_type_params)]
use std::ops::Add;
#[derive(Copy)]

View file

@ -8,8 +8,6 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![feature(associated_types)]
use std::ops::Index;
struct MyVec<T> {

View file

@ -11,8 +11,6 @@
// Test that we still see borrowck errors of various kinds when using
// indexing and autoderef in combination.
#![feature(associated_types)]
use std::ops::{Index, IndexMut};
struct Foo {
@ -95,5 +93,3 @@ fn test9(mut f: Box<Bar>, g: Bar, s: String) {
fn main() {
}

View file

@ -8,8 +8,6 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![feature(associated_types)]
use std::ops::{Index, IndexMut};
struct Foo {
@ -70,5 +68,3 @@ fn main() {
s[2] = 20;
//~^ ERROR cannot assign to immutable dereference (dereference is implicit, due to indexing)
}

View file

@ -11,8 +11,6 @@
// Test that overloaded index expressions with DST result types
// can't be used as rvalues
#![feature(associated_types)]
use std::ops::Index;
use std::fmt::Show;

View file

@ -8,8 +8,6 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![feature(default_type_params)]
struct Foo<A, B, C = (A, B)>;
impl<A, B, C = (A, B)> Foo<A, B, C> {

View file

@ -8,8 +8,6 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![feature(default_type_params)]
struct Heap;
struct Vec<T, A = Heap>;

View file

@ -8,8 +8,6 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![feature(default_type_params)]
struct Heap;
struct Vec<A = Heap, T>; //~ ERROR type parameters with a default must be trailing

View file

@ -8,8 +8,6 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![feature(default_type_params)]
struct Heap;
struct Vec<T, A = Heap>;

View file

@ -8,8 +8,6 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![feature(default_type_params)]
struct Heap;
struct Vec<T, A = Heap>;

View file

@ -8,8 +8,6 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![feature(default_type_params)]
// Ensure that we get an error and not an ICE for this problematic case.
struct Foo<T = Option<U>, U = bool>;
//~^ ERROR type parameters with a default cannot use forward declared identifiers

View file

@ -8,8 +8,6 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![feature(default_type_params)]
struct A;
struct B;
struct C;

View file

@ -10,8 +10,6 @@
// Make sure that globs only bring in public things.
#![feature(globs)]
use bar::*;
mod bar {

View file

@ -10,8 +10,6 @@
// error-pattern: unresolved name
#![feature(globs)]
use module_of_many_things::*;
mod module_of_many_things {

View file

@ -10,8 +10,6 @@
// error-pattern: unresolved
#![feature(globs)]
mod circ1 {
pub use circ2::f2;
pub fn f1() { println!("f1"); }

View file

@ -11,7 +11,6 @@
// Test that import shadowing using globs causes errors
#![no_implicit_prelude]
#![feature(globs)]
use foo::*;
use bar::*; //~ERROR a type named `Baz` has already been imported in this module

View file

@ -11,7 +11,6 @@
// Test that import shadowing using globs causes errors
#![no_implicit_prelude]
#![feature(globs)]
use foo::*;
use foo::*; //~ERROR a type named `Baz` has already been imported in this module

View file

@ -11,7 +11,6 @@
// Test that import shadowing using globs causes errors
#![no_implicit_prelude]
#![feature(globs)]
use foo::Baz;
use bar::*; //~ERROR a type named `Baz` has already been imported in this module

View file

@ -11,7 +11,6 @@
// Test that import shadowing using globs causes errors
#![no_implicit_prelude]
#![feature(globs)]
use foo::*;
use bar::Baz; //~ERROR a type named `Baz` has already been imported in this module

View file

@ -11,7 +11,6 @@
// Test that import shadowing using globs causes errors
#![no_implicit_prelude]
#![feature(globs)]
use foo::Baz;
use bar::Baz; //~ERROR a type named `Baz` has already been imported in this module

View file

@ -11,7 +11,6 @@
// Test that import shadowing using globs causes errors
#![no_implicit_prelude]
#![feature(globs)]
use qux::*;
use foo::*; //~ERROR a type named `Baz` has already been imported in this module

View file

@ -11,7 +11,6 @@
// Test that import shadowing using globs causes errors
#![no_implicit_prelude]
#![feature(globs)]
use foo::*;
use qux::*; //~ERROR a type named `Baz` has already been imported in this module

View file

@ -10,8 +10,6 @@
// error-pattern: reached the recursion limit while auto-dereferencing
#![feature(associated_types)]
use std::ops::Deref;
struct Foo;

View file

@ -10,8 +10,6 @@
// Testing that we don't fail abnormally after hitting the errors
#![feature(globs)]
use unresolved::*; //~ ERROR unresolved import `unresolved::*`. Maybe a missing `extern crate unres
fn main() {}

View file

@ -9,7 +9,6 @@
// except according to those terms.
#![feature(unboxed_closures)]
#![feature(associated_types)]
use std::any::Any;
use std::intrinsics::TypeId;

View file

@ -8,8 +8,6 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![feature(associated_types)]
use std::ops::Deref;
struct MyPtr<'a>(&'a mut uint);

View file

@ -8,8 +8,6 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![feature(associated_types)]
fn add_state(op: <int as HasState>::State) {
//~^ ERROR the trait `HasState` is not implemented for the type `int`
}

View file

@ -8,8 +8,6 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![feature(associated_types)]
trait Foo {
type Item;
}

View file

@ -8,8 +8,6 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![feature(associated_types)]
trait From<Src> {
type Output;

View file

@ -8,8 +8,6 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![feature(associated_types)]
trait From<Src> {
type Result;

View file

@ -8,8 +8,6 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![feature(globs)]
// ensures that 'use foo:*' doesn't import non-public item
use m1::*;
@ -36,4 +34,3 @@ mod m1 {
fn main() {
foo(); //~ ERROR: unresolved name
}

View file

@ -13,8 +13,6 @@
// ensures that 'use foo:*' doesn't import non-public 'use' statements in the
// module 'foo'
#![feature(globs)]
use m1::*;
mod foo {

View file

@ -8,10 +8,7 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![feature(globs)]
use self::*; //~ ERROR: unresolved import
fn main() {
}

View file

@ -10,7 +10,6 @@
// When denying at the crate level, be sure to not get random warnings from the
// injected intrinsics by the compiler.
#![feature(globs)]
#![deny(missing_docs)]
#![allow(dead_code)]
#![allow(missing_copy_implementations)]

View file

@ -13,7 +13,7 @@
// aux-build:stability_cfg1.rs
// aux-build:stability_cfg2.rs
#![feature(globs, phase)]
#![feature(phase)]
#![deny(unstable)]
#![deny(deprecated)]
#![deny(experimental)]

View file

@ -10,7 +10,6 @@
// aux-build:lint-unused-extern-crate.rs
#![feature(globs)]
#![deny(unused_extern_crates)]
#![allow(unused_variables)]

View file

@ -8,7 +8,6 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![feature(globs)]
#![deny(unused_imports)]
#![allow(dead_code)]

View file

@ -8,8 +8,6 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![feature(globs)]
// error-pattern:declaration of `None` shadows
use std::option::*;

View file

@ -9,8 +9,6 @@
// except according to those terms.
// aux-build:namespaced_enums.rs
#![feature(globs)]
extern crate namespaced_enums;
mod m {
@ -25,4 +23,3 @@ pub fn main() {
bar(); //~ ERROR unresolved name `bar`
m::bar(); //~ ERROR unresolved name `m::bar`
}

View file

@ -7,7 +7,6 @@
// <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.
#![feature(globs)]
mod m2 {
pub enum Foo {

View file

@ -11,7 +11,6 @@
// Check we do the correct privacy checks when we import a name and there is an
// item with that name in both the value and type namespaces.
#![feature(globs)]
#![allow(dead_code)]
#![allow(unused_imports)]
@ -64,4 +63,3 @@ fn test_glob3() {
fn main() {
}

View file

@ -11,7 +11,6 @@
// Check we do the correct privacy checks when we import a name and there is an
// item with that name in both the value and type namespaces.
#![feature(globs)]
#![allow(dead_code)]
#![allow(unused_imports)]
@ -88,4 +87,3 @@ fn test_list3() {
fn main() {
}

View file

@ -8,7 +8,7 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![feature(globs, lang_items)]
#![feature(lang_items)]
#![no_std] // makes debugging this test *a lot* easier (during resolve)
#[lang="sized"]

View file

@ -8,7 +8,6 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![feature(globs)]
#![no_std] // makes debugging this test *a lot* easier (during resolve)
// Test to make sure that globs don't leak in regular `use` statements.
@ -34,4 +33,3 @@ fn test2() {
}
#[start] fn main(_: int, _: *const *const u8) -> int { 3 }

View file

@ -8,7 +8,6 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![feature(globs)]
#![no_std] // makes debugging this test *a lot* easier (during resolve)
// Test to make sure that private items imported through globs remain private

View file

@ -8,7 +8,7 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![feature(globs, lang_items)]
#![feature(lang_items)]
#![no_std] // makes debugging this test *a lot* easier (during resolve)
#[lang = "sized"] pub trait Sized for Sized? {}

View file

@ -8,8 +8,6 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![feature(associated_types)]
struct StateMachineIter<'a> {
statefn: &'a StateMachineFunc<'a>
}
@ -61,4 +59,3 @@ fn main() {
println!("{}",it.next());
println!("{}",it.next());
}

View file

@ -10,7 +10,6 @@
// Issue #8380
#![feature(globs)]
use std::sync::atomic::*;
use std::ptr;

View file

@ -11,7 +11,7 @@
// Test interaction between unboxed closure sugar and default type
// parameters (should be exactly as if angle brackets were used).
#![feature(default_type_params, unboxed_closures)]
#![feature(unboxed_closures)]
#![allow(dead_code)]
trait Foo<T,U,V=T> {

View file

@ -12,7 +12,7 @@
// parameters (should be exactly as if angle brackets were used
// and regions omitted).
#![feature(default_type_params, unboxed_closures)]
#![feature(unboxed_closures)]
#![allow(dead_code)]
use std::kinds::marker;

View file

@ -13,8 +13,6 @@
// (In this case the mul method should take &f64 and not f64)
// See: #11450
#![feature(associated_types, default_type_params)]
use std::ops::Mul;
struct Vec1 {

View file

@ -15,7 +15,6 @@
// Expanded pretty printing causes resolve conflicts.
// error-pattern:panic works
#![feature(globs)]
use std::*;

View file

@ -8,8 +8,6 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![feature(associated_types)]
trait Foo {
type T;
}
@ -23,4 +21,3 @@ fn main() {
let y: int = 44;
assert_eq!(x * 2, y);
}

View file

@ -10,8 +10,6 @@
// Test equality constraints on associated types in a where clause.
#![feature(associated_types)]
pub trait Foo {
type A;
fn boo(&self) -> <Self as Foo>::A;

View file

@ -10,8 +10,6 @@
// Test equality constraints on associated types in a where clause.
#![feature(associated_types)]
pub trait ToInt {
fn to_int(&self) -> int;
}

View file

@ -13,8 +13,6 @@
// Test that we are able to reference cross-crate traits that employ
// associated types.
#![feature(associated_types)]
extern crate "associated-types-cc-lib" as bar;
use bar::Bar;

View file

@ -14,8 +14,6 @@
// `Target=[A]`, then the impl marked with `(*)` is seen to conflict
// with all the others.
#![feature(associated_types, default_type_params)]
use std::ops::Deref;
pub trait MyEq<Sized? U=Self> for Sized? {

Some files were not shown because too many files have changed in this diff Show more