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:
commit
b24431970e
186 changed files with 37 additions and 409 deletions
|
@ -272,7 +272,6 @@ pub fn phase_2_configure_and_expand(sess: &Session,
|
||||||
}
|
}
|
||||||
let cfg = syntax::ext::expand::ExpansionConfig {
|
let cfg = syntax::ext::expand::ExpansionConfig {
|
||||||
crate_name: crate_name.to_string(),
|
crate_name: crate_name.to_string(),
|
||||||
deriving_hash_type_parameter: sess.features.borrow().default_type_params,
|
|
||||||
enable_quotes: sess.features.borrow().quote,
|
enable_quotes: sess.features.borrow().quote,
|
||||||
recursion_limit: sess.recursion_limit.get(),
|
recursion_limit: sess.recursion_limit.get(),
|
||||||
};
|
};
|
||||||
|
|
|
@ -24,6 +24,7 @@
|
||||||
#![feature(globs)]
|
#![feature(globs)]
|
||||||
#![feature(link_args)]
|
#![feature(link_args)]
|
||||||
#![feature(unboxed_closures)]
|
#![feature(unboxed_closures)]
|
||||||
|
#![feature(old_orphan_check)]
|
||||||
|
|
||||||
extern crate libc;
|
extern crate libc;
|
||||||
|
|
||||||
|
|
|
@ -19,6 +19,7 @@
|
||||||
#![feature(globs, phase, slicing_syntax)]
|
#![feature(globs, phase, slicing_syntax)]
|
||||||
#![feature(rustc_diagnostic_macros)]
|
#![feature(rustc_diagnostic_macros)]
|
||||||
#![feature(associated_types)]
|
#![feature(associated_types)]
|
||||||
|
#![feature(old_orphan_check)]
|
||||||
|
|
||||||
#[phase(plugin, link)] extern crate log;
|
#[phase(plugin, link)] extern crate log;
|
||||||
#[phase(plugin, link)] extern crate syntax;
|
#[phase(plugin, link)] extern crate syntax;
|
||||||
|
|
|
@ -361,14 +361,6 @@ fn create_substs_for_ast_path<'tcx>(
|
||||||
supplied_ty_param_count)[]);
|
supplied_ty_param_count)[]);
|
||||||
}
|
}
|
||||||
|
|
||||||
if supplied_ty_param_count > required_ty_param_count
|
|
||||||
&& !this.tcx().sess.features.borrow().default_type_params {
|
|
||||||
span_err!(this.tcx().sess, span, E0108,
|
|
||||||
"default type parameters are experimental and possibly buggy");
|
|
||||||
span_help!(this.tcx().sess, span,
|
|
||||||
"add #![feature(default_type_params)] to the crate attributes to enable");
|
|
||||||
}
|
|
||||||
|
|
||||||
let mut substs = Substs::new_type(types, regions);
|
let mut substs = Substs::new_type(types, regions);
|
||||||
|
|
||||||
match self_ty {
|
match self_ty {
|
||||||
|
|
|
@ -25,20 +25,14 @@ pub fn expand_deriving_hash<F>(cx: &mut ExtCtxt,
|
||||||
F: FnOnce(P<Item>),
|
F: FnOnce(P<Item>),
|
||||||
{
|
{
|
||||||
|
|
||||||
let (path, generics, args) = if cx.ecfg.deriving_hash_type_parameter {
|
let path = Path::new_(vec!("std", "hash", "Hash"), None,
|
||||||
(Path::new_(vec!("std", "hash", "Hash"), None,
|
vec!(box Literal(Path::new_local("__S"))), true);
|
||||||
vec!(box Literal(Path::new_local("__S"))), true),
|
let generics = LifetimeBounds {
|
||||||
LifetimeBounds {
|
|
||||||
lifetimes: Vec::new(),
|
lifetimes: Vec::new(),
|
||||||
bounds: vec!(("__S",
|
bounds: vec!(("__S",
|
||||||
vec!(Path::new(vec!("std", "hash", "Writer"))))),
|
vec!(Path::new(vec!("std", "hash", "Writer"))))),
|
||||||
},
|
|
||||||
Path::new_local("__S"))
|
|
||||||
} else {
|
|
||||||
(Path::new(vec!("std", "hash", "Hash")),
|
|
||||||
LifetimeBounds::empty(),
|
|
||||||
Path::new(vec!("std", "hash", "sip", "SipState")))
|
|
||||||
};
|
};
|
||||||
|
let args = Path::new_local("__S");
|
||||||
let inline = cx.meta_word(span, InternedString::new("inline"));
|
let inline = cx.meta_word(span, InternedString::new("inline"));
|
||||||
let attrs = vec!(cx.attribute(span, inline));
|
let attrs = vec!(cx.attribute(span, inline));
|
||||||
let hash_trait_def = TraitDef {
|
let hash_trait_def = TraitDef {
|
||||||
|
|
|
@ -1161,7 +1161,6 @@ fn new_span(cx: &ExtCtxt, sp: Span) -> Span {
|
||||||
|
|
||||||
pub struct ExpansionConfig {
|
pub struct ExpansionConfig {
|
||||||
pub crate_name: String,
|
pub crate_name: String,
|
||||||
pub deriving_hash_type_parameter: bool,
|
|
||||||
pub enable_quotes: bool,
|
pub enable_quotes: bool,
|
||||||
pub recursion_limit: uint,
|
pub recursion_limit: uint,
|
||||||
}
|
}
|
||||||
|
@ -1170,7 +1169,6 @@ impl ExpansionConfig {
|
||||||
pub fn default(crate_name: String) -> ExpansionConfig {
|
pub fn default(crate_name: String) -> ExpansionConfig {
|
||||||
ExpansionConfig {
|
ExpansionConfig {
|
||||||
crate_name: crate_name,
|
crate_name: crate_name,
|
||||||
deriving_hash_type_parameter: false,
|
|
||||||
enable_quotes: false,
|
enable_quotes: false,
|
||||||
recursion_limit: 64,
|
recursion_limit: 64,
|
||||||
}
|
}
|
||||||
|
|
|
@ -36,7 +36,7 @@ use std::ascii::AsciiExt;
|
||||||
|
|
||||||
// if you change this list without updating src/doc/reference.md, @cmr will be sad
|
// if you change this list without updating src/doc/reference.md, @cmr will be sad
|
||||||
static KNOWN_FEATURES: &'static [(&'static str, Status)] = &[
|
static KNOWN_FEATURES: &'static [(&'static str, Status)] = &[
|
||||||
("globs", Active),
|
("globs", Accepted),
|
||||||
("macro_rules", Active),
|
("macro_rules", Active),
|
||||||
("struct_variant", Accepted),
|
("struct_variant", Accepted),
|
||||||
("asm", Active),
|
("asm", Active),
|
||||||
|
@ -54,7 +54,7 @@ static KNOWN_FEATURES: &'static [(&'static str, Status)] = &[
|
||||||
("lang_items", Active),
|
("lang_items", Active),
|
||||||
|
|
||||||
("simd", Active),
|
("simd", Active),
|
||||||
("default_type_params", Active),
|
("default_type_params", Accepted),
|
||||||
("quote", Active),
|
("quote", Active),
|
||||||
("link_llvm_intrinsics", Active),
|
("link_llvm_intrinsics", Active),
|
||||||
("linkage", Active),
|
("linkage", Active),
|
||||||
|
@ -67,7 +67,7 @@ static KNOWN_FEATURES: &'static [(&'static str, Status)] = &[
|
||||||
("import_shadowing", Active),
|
("import_shadowing", Active),
|
||||||
("advanced_slice_patterns", Active),
|
("advanced_slice_patterns", Active),
|
||||||
("tuple_indexing", Accepted),
|
("tuple_indexing", Accepted),
|
||||||
("associated_types", Active),
|
("associated_types", Accepted),
|
||||||
("visible_private_types", Active),
|
("visible_private_types", Active),
|
||||||
("slicing_syntax", Active),
|
("slicing_syntax", Active),
|
||||||
|
|
||||||
|
@ -112,7 +112,6 @@ enum Status {
|
||||||
/// A set of features to be used by later passes.
|
/// A set of features to be used by later passes.
|
||||||
#[derive(Copy)]
|
#[derive(Copy)]
|
||||||
pub struct Features {
|
pub struct Features {
|
||||||
pub default_type_params: bool,
|
|
||||||
pub unboxed_closures: bool,
|
pub unboxed_closures: bool,
|
||||||
pub rustc_diagnostic_macros: bool,
|
pub rustc_diagnostic_macros: bool,
|
||||||
pub import_shadowing: bool,
|
pub import_shadowing: bool,
|
||||||
|
@ -125,7 +124,6 @@ pub struct Features {
|
||||||
impl Features {
|
impl Features {
|
||||||
pub fn new() -> Features {
|
pub fn new() -> Features {
|
||||||
Features {
|
Features {
|
||||||
default_type_params: false,
|
|
||||||
unboxed_closures: false,
|
unboxed_closures: false,
|
||||||
rustc_diagnostic_macros: false,
|
rustc_diagnostic_macros: false,
|
||||||
import_shadowing: false,
|
import_shadowing: false,
|
||||||
|
@ -232,13 +230,7 @@ impl<'a, 'v> Visitor<'v> for PostExpansionVisitor<'a> {
|
||||||
|
|
||||||
fn visit_view_item(&mut self, i: &ast::ViewItem) {
|
fn visit_view_item(&mut self, i: &ast::ViewItem) {
|
||||||
match i.node {
|
match i.node {
|
||||||
ast::ViewItemUse(ref path) => {
|
ast::ViewItemUse(..) => {}
|
||||||
if let ast::ViewPathGlob(..) = path.node {
|
|
||||||
self.gate_feature("globs", path.span,
|
|
||||||
"glob import statements are \
|
|
||||||
experimental and possibly buggy");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
ast::ViewItemExternCrate(..) => {
|
ast::ViewItemExternCrate(..) => {
|
||||||
for attr in i.attrs.iter() {
|
for attr in i.attrs.iter() {
|
||||||
if attr.name().get() == "phase"{
|
if attr.name().get() == "phase"{
|
||||||
|
@ -313,18 +305,6 @@ impl<'a, 'v> Visitor<'v> for PostExpansionVisitor<'a> {
|
||||||
many unsafe patterns and may be \
|
many unsafe patterns and may be \
|
||||||
removed in the future");
|
removed in the future");
|
||||||
}
|
}
|
||||||
|
|
||||||
for item in items.iter() {
|
|
||||||
match *item {
|
|
||||||
ast::MethodImplItem(_) => {}
|
|
||||||
ast::TypeImplItem(ref typedef) => {
|
|
||||||
self.gate_feature("associated_types",
|
|
||||||
typedef.span,
|
|
||||||
"associated types are \
|
|
||||||
experimental")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
_ => {}
|
_ => {}
|
||||||
|
@ -333,17 +313,6 @@ impl<'a, 'v> Visitor<'v> for PostExpansionVisitor<'a> {
|
||||||
visit::walk_item(self, i);
|
visit::walk_item(self, i);
|
||||||
}
|
}
|
||||||
|
|
||||||
fn visit_trait_item(&mut self, trait_item: &ast::TraitItem) {
|
|
||||||
match *trait_item {
|
|
||||||
ast::RequiredMethod(_) | ast::ProvidedMethod(_) => {}
|
|
||||||
ast::TypeTraitItem(ref ti) => {
|
|
||||||
self.gate_feature("associated_types",
|
|
||||||
ti.ty_param.span,
|
|
||||||
"associated types are experimental")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
fn visit_foreign_item(&mut self, i: &ast::ForeignItem) {
|
fn visit_foreign_item(&mut self, i: &ast::ForeignItem) {
|
||||||
if attr::contains_name(i.attrs[], "linkage") {
|
if attr::contains_name(i.attrs[], "linkage") {
|
||||||
self.gate_feature("linkage", i.span,
|
self.gate_feature("linkage", i.span,
|
||||||
|
@ -379,20 +348,6 @@ impl<'a, 'v> Visitor<'v> for PostExpansionVisitor<'a> {
|
||||||
visit::walk_expr(self, e);
|
visit::walk_expr(self, e);
|
||||||
}
|
}
|
||||||
|
|
||||||
fn visit_generics(&mut self, generics: &ast::Generics) {
|
|
||||||
for type_parameter in generics.ty_params.iter() {
|
|
||||||
match type_parameter.default {
|
|
||||||
Some(ref ty) => {
|
|
||||||
self.gate_feature("default_type_params", ty.span,
|
|
||||||
"default type parameters are \
|
|
||||||
experimental and possibly buggy");
|
|
||||||
}
|
|
||||||
None => {}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
visit::walk_generics(self, generics);
|
|
||||||
}
|
|
||||||
|
|
||||||
fn visit_attribute(&mut self, attr: &ast::Attribute) {
|
fn visit_attribute(&mut self, attr: &ast::Attribute) {
|
||||||
if attr::contains_name(slice::ref_slice(attr), "lang") {
|
if attr::contains_name(slice::ref_slice(attr), "lang") {
|
||||||
self.gate_feature("lang_items",
|
self.gate_feature("lang_items",
|
||||||
|
@ -498,7 +453,6 @@ fn check_crate_inner<F>(cm: &CodeMap, span_handler: &SpanHandler, krate: &ast::C
|
||||||
check(&mut cx, krate);
|
check(&mut cx, krate);
|
||||||
|
|
||||||
(Features {
|
(Features {
|
||||||
default_type_params: cx.has_feature("default_type_params"),
|
|
||||||
unboxed_closures: cx.has_feature("unboxed_closures"),
|
unboxed_closures: cx.has_feature("unboxed_closures"),
|
||||||
rustc_diagnostic_macros: cx.has_feature("rustc_diagnostic_macros"),
|
rustc_diagnostic_macros: cx.has_feature("rustc_diagnostic_macros"),
|
||||||
import_shadowing: cx.has_feature("import_shadowing"),
|
import_shadowing: cx.has_feature("import_shadowing"),
|
||||||
|
|
|
@ -12,7 +12,6 @@
|
||||||
// cross-crate scenario.
|
// cross-crate scenario.
|
||||||
|
|
||||||
#![crate_type="lib"]
|
#![crate_type="lib"]
|
||||||
#![feature(associated_types)]
|
|
||||||
|
|
||||||
pub trait Bar {
|
pub trait Bar {
|
||||||
type T;
|
type T;
|
||||||
|
|
|
@ -8,8 +8,6 @@
|
||||||
// option. This file may not be copied, modified, or distributed
|
// option. This file may not be copied, modified, or distributed
|
||||||
// except according to those terms.
|
// except according to those terms.
|
||||||
|
|
||||||
#![feature(default_type_params)]
|
|
||||||
|
|
||||||
pub struct Heap;
|
pub struct Heap;
|
||||||
|
|
||||||
pub struct FakeHeap;
|
pub struct FakeHeap;
|
||||||
|
|
|
@ -9,7 +9,6 @@
|
||||||
// except according to those terms.
|
// except according to those terms.
|
||||||
|
|
||||||
#![crate_type = "lib"]
|
#![crate_type = "lib"]
|
||||||
#![feature(associated_types)]
|
|
||||||
|
|
||||||
pub struct TreeBuilder<H>;
|
pub struct TreeBuilder<H>;
|
||||||
|
|
||||||
|
|
|
@ -8,8 +8,6 @@
|
||||||
// option. This file may not be copied, modified, or distributed
|
// option. This file may not be copied, modified, or distributed
|
||||||
// except according to those terms.
|
// except according to those terms.
|
||||||
|
|
||||||
#![feature(associated_types)]
|
|
||||||
|
|
||||||
pub trait T {
|
pub trait T {
|
||||||
type C;
|
type C;
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,7 +9,6 @@
|
||||||
// except according to those terms.
|
// except according to those terms.
|
||||||
|
|
||||||
#![allow(unused_imports)]
|
#![allow(unused_imports)]
|
||||||
#![feature(globs)]
|
|
||||||
|
|
||||||
extern crate issue_2316_a;
|
extern crate issue_2316_a;
|
||||||
|
|
||||||
|
|
|
@ -10,7 +10,7 @@
|
||||||
|
|
||||||
// force-host
|
// force-host
|
||||||
|
|
||||||
#![feature(globs, plugin_registrar, macro_rules, quote)]
|
#![feature(plugin_registrar, macro_rules, quote)]
|
||||||
|
|
||||||
extern crate syntax;
|
extern crate syntax;
|
||||||
extern crate rustc;
|
extern crate rustc;
|
||||||
|
|
|
@ -7,7 +7,6 @@
|
||||||
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
||||||
// option. This file may not be copied, modified, or distributed
|
// option. This file may not be copied, modified, or distributed
|
||||||
// except according to those terms.
|
// except according to those terms.
|
||||||
#![feature(globs)]
|
|
||||||
|
|
||||||
pub use Foo::*;
|
pub use Foo::*;
|
||||||
|
|
||||||
|
@ -34,5 +33,3 @@ pub mod nest {
|
||||||
pub fn foo() {}
|
pub fn foo() {}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -8,8 +8,6 @@
|
||||||
// option. This file may not be copied, modified, or distributed
|
// option. This file may not be copied, modified, or distributed
|
||||||
// except according to those terms.
|
// except according to those terms.
|
||||||
|
|
||||||
#![feature(associated_types)]
|
|
||||||
|
|
||||||
use std::ops::Deref;
|
use std::ops::Deref;
|
||||||
|
|
||||||
struct DerefWithHelper<H, T> {
|
struct DerefWithHelper<H, T> {
|
||||||
|
|
|
@ -11,7 +11,7 @@
|
||||||
// force-host
|
// force-host
|
||||||
|
|
||||||
#![crate_type = "dylib"]
|
#![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-extension-with-dll-deps-1" as other;
|
||||||
extern crate syntax;
|
extern crate syntax;
|
||||||
|
|
|
@ -8,8 +8,6 @@
|
||||||
// option. This file may not be copied, modified, or distributed
|
// option. This file may not be copied, modified, or distributed
|
||||||
// except according to those terms.
|
// except according to those terms.
|
||||||
|
|
||||||
#![feature(associated_types)]
|
|
||||||
|
|
||||||
use std::cmp::PartialEq;
|
use std::cmp::PartialEq;
|
||||||
use std::ops::{Add, Sub, Mul};
|
use std::ops::{Add, Sub, Mul};
|
||||||
|
|
||||||
|
|
|
@ -38,7 +38,7 @@
|
||||||
// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
|
// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
|
||||||
// OF THE POSSIBILITY OF SUCH DAMAGE.
|
// OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
|
||||||
#![feature(associated_types, slicing_syntax)]
|
#![feature(slicing_syntax)]
|
||||||
|
|
||||||
use std::cmp::min;
|
use std::cmp::min;
|
||||||
use std::io::{BufferedWriter, File};
|
use std::io::{BufferedWriter, File};
|
||||||
|
|
|
@ -40,7 +40,7 @@
|
||||||
|
|
||||||
// ignore-android see #10393 #13206
|
// ignore-android see #10393 #13206
|
||||||
|
|
||||||
#![feature(associated_types, slicing_syntax)]
|
#![feature(slicing_syntax)]
|
||||||
|
|
||||||
use std::ascii::OwnedAsciiExt;
|
use std::ascii::OwnedAsciiExt;
|
||||||
use std::iter::repeat;
|
use std::iter::repeat;
|
||||||
|
|
|
@ -40,8 +40,6 @@
|
||||||
|
|
||||||
// no-pretty-expanded FIXME #15189
|
// no-pretty-expanded FIXME #15189
|
||||||
|
|
||||||
#![feature(associated_types)]
|
|
||||||
|
|
||||||
use std::iter::repeat;
|
use std::iter::repeat;
|
||||||
use std::sync::Arc;
|
use std::sync::Arc;
|
||||||
use std::sync::mpsc::channel;
|
use std::sync::mpsc::channel;
|
||||||
|
|
|
@ -40,7 +40,7 @@
|
||||||
|
|
||||||
// ignore-android see #10393 #13206
|
// ignore-android see #10393 #13206
|
||||||
|
|
||||||
#![feature(associated_types, slicing_syntax, unboxed_closures)]
|
#![feature(slicing_syntax, unboxed_closures)]
|
||||||
|
|
||||||
extern crate libc;
|
extern crate libc;
|
||||||
|
|
||||||
|
|
|
@ -12,7 +12,7 @@
|
||||||
// just propagate the error.
|
// just propagate the error.
|
||||||
|
|
||||||
#![crate_type = "lib"]
|
#![crate_type = "lib"]
|
||||||
#![feature(associated_types, default_type_params, lang_items)]
|
#![feature(lang_items)]
|
||||||
#![no_std]
|
#![no_std]
|
||||||
|
|
||||||
#[lang="sized"]
|
#[lang="sized"]
|
||||||
|
|
|
@ -10,8 +10,6 @@
|
||||||
|
|
||||||
// Test equality constraints on associated types in a where clause.
|
// Test equality constraints on associated types in a where clause.
|
||||||
|
|
||||||
#![feature(associated_types)]
|
|
||||||
|
|
||||||
pub trait ToInt {
|
pub trait ToInt {
|
||||||
fn to_int(&self) -> int;
|
fn to_int(&self) -> int;
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,8 +11,6 @@
|
||||||
// Test equality constraints on associated types. Check that unsupported syntax
|
// Test equality constraints on associated types. Check that unsupported syntax
|
||||||
// does not ICE.
|
// does not ICE.
|
||||||
|
|
||||||
#![feature(associated_types)]
|
|
||||||
|
|
||||||
pub trait Foo {
|
pub trait Foo {
|
||||||
type A;
|
type A;
|
||||||
fn boo(&self) -> <Self as Foo>::A;
|
fn boo(&self) -> <Self as Foo>::A;
|
||||||
|
|
|
@ -11,8 +11,6 @@
|
||||||
// Test equality constraints on associated types. Check we get an error when an
|
// Test equality constraints on associated types. Check we get an error when an
|
||||||
// equality constraint is used in a qualified path.
|
// equality constraint is used in a qualified path.
|
||||||
|
|
||||||
#![feature(associated_types)]
|
|
||||||
|
|
||||||
pub trait Foo {
|
pub trait Foo {
|
||||||
type A;
|
type A;
|
||||||
fn boo(&self) -> <Self as Foo>::A;
|
fn boo(&self) -> <Self as Foo>::A;
|
||||||
|
|
|
@ -11,8 +11,6 @@
|
||||||
// Test equality constraints on associated types. Check we get type errors
|
// Test equality constraints on associated types. Check we get type errors
|
||||||
// where we should.
|
// where we should.
|
||||||
|
|
||||||
#![feature(associated_types)]
|
|
||||||
|
|
||||||
pub trait Foo {
|
pub trait Foo {
|
||||||
type A;
|
type A;
|
||||||
fn boo(&self) -> <Self as Foo>::A;
|
fn boo(&self) -> <Self as Foo>::A;
|
||||||
|
|
|
@ -10,8 +10,6 @@
|
||||||
|
|
||||||
// Check that an associated type cannot be bound in an expression path.
|
// Check that an associated type cannot be bound in an expression path.
|
||||||
|
|
||||||
#![feature(associated_types)]
|
|
||||||
|
|
||||||
trait Foo {
|
trait Foo {
|
||||||
type A;
|
type A;
|
||||||
fn bar() -> int;
|
fn bar() -> int;
|
||||||
|
|
|
@ -10,8 +10,6 @@
|
||||||
|
|
||||||
// Check testing of equality constraints in a higher-ranked context.
|
// Check testing of equality constraints in a higher-ranked context.
|
||||||
|
|
||||||
#![feature(associated_types)]
|
|
||||||
|
|
||||||
pub trait TheTrait<T> {
|
pub trait TheTrait<T> {
|
||||||
type A;
|
type A;
|
||||||
|
|
||||||
|
|
|
@ -8,8 +8,6 @@
|
||||||
// option. This file may not be copied, modified, or distributed
|
// option. This file may not be copied, modified, or distributed
|
||||||
// except according to those terms.
|
// except according to those terms.
|
||||||
|
|
||||||
#![feature(associated_types)]
|
|
||||||
|
|
||||||
trait Get {
|
trait Get {
|
||||||
type Value;
|
type Value;
|
||||||
fn get(&self) -> <Self as Get>::Value;
|
fn get(&self) -> <Self as Get>::Value;
|
||||||
|
@ -22,4 +20,3 @@ trait Other {
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -8,8 +8,6 @@
|
||||||
// option. This file may not be copied, modified, or distributed
|
// option. This file may not be copied, modified, or distributed
|
||||||
// except according to those terms.
|
// except according to those terms.
|
||||||
|
|
||||||
#![feature(associated_types)]
|
|
||||||
|
|
||||||
trait Get {
|
trait Get {
|
||||||
type Value;
|
type Value;
|
||||||
fn get(&self) -> <Self as Get>::Value;
|
fn get(&self) -> <Self as Get>::Value;
|
||||||
|
@ -26,4 +24,3 @@ trait Grab {
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -11,8 +11,6 @@
|
||||||
// Check that the user gets an errror if they omit a binding from an
|
// Check that the user gets an errror if they omit a binding from an
|
||||||
// object type.
|
// object type.
|
||||||
|
|
||||||
#![feature(associated_types)]
|
|
||||||
|
|
||||||
pub trait Foo {
|
pub trait Foo {
|
||||||
type A;
|
type A;
|
||||||
type B;
|
type B;
|
||||||
|
|
|
@ -11,7 +11,6 @@
|
||||||
// Test that we reliably check the value of the associated type.
|
// Test that we reliably check the value of the associated type.
|
||||||
|
|
||||||
#![crate_type = "lib"]
|
#![crate_type = "lib"]
|
||||||
#![feature(associated_types)]
|
|
||||||
#![no_implicit_prelude]
|
#![no_implicit_prelude]
|
||||||
|
|
||||||
use std::option::Option::{self, None, Some};
|
use std::option::Option::{self, None, Some};
|
||||||
|
|
|
@ -8,8 +8,6 @@
|
||||||
// option. This file may not be copied, modified, or distributed
|
// option. This file may not be copied, modified, or distributed
|
||||||
// except according to those terms.
|
// except according to those terms.
|
||||||
|
|
||||||
#![feature(associated_types)]
|
|
||||||
|
|
||||||
trait Get {
|
trait Get {
|
||||||
type Value;
|
type Value;
|
||||||
fn get(&self) -> <Self as Get>::Value;
|
fn get(&self) -> <Self as Get>::Value;
|
||||||
|
@ -26,4 +24,3 @@ impl Struct {
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -8,8 +8,6 @@
|
||||||
// option. This file may not be copied, modified, or distributed
|
// option. This file may not be copied, modified, or distributed
|
||||||
// except according to those terms.
|
// except according to those terms.
|
||||||
|
|
||||||
#![feature(associated_types)]
|
|
||||||
|
|
||||||
// Check that we get an error when you use `<Self as Get>::Value` in
|
// 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`.
|
// the trait definition but `Self` does not, in fact, implement `Get`.
|
||||||
|
|
||||||
|
|
|
@ -10,8 +10,6 @@
|
||||||
|
|
||||||
// Test that we have one and only one associated type per ref.
|
// Test that we have one and only one associated type per ref.
|
||||||
|
|
||||||
#![feature(associated_types)]
|
|
||||||
|
|
||||||
pub trait Foo {
|
pub trait Foo {
|
||||||
type A;
|
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 f2<T: Foo + Bar>(a: T, x: T::A) {} //~ERROR ambiguous associated type `A`
|
||||||
|
|
||||||
pub fn main() {}
|
pub fn main() {}
|
||||||
|
|
||||||
|
|
|
@ -10,8 +10,6 @@
|
||||||
|
|
||||||
// Test type checking of uses of associated types via sugary paths.
|
// Test type checking of uses of associated types via sugary paths.
|
||||||
|
|
||||||
#![feature(associated_types)]
|
|
||||||
|
|
||||||
pub trait Foo {
|
pub trait Foo {
|
||||||
type A;
|
type A;
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,8 +11,6 @@
|
||||||
// Test you can't use a higher-ranked trait bound inside of a qualified
|
// Test you can't use a higher-ranked trait bound inside of a qualified
|
||||||
// path (just won't parse).
|
// path (just won't parse).
|
||||||
|
|
||||||
#![feature(associated_types)]
|
|
||||||
|
|
||||||
pub trait Foo<T> {
|
pub trait Foo<T> {
|
||||||
type A;
|
type A;
|
||||||
|
|
||||||
|
|
|
@ -11,8 +11,6 @@
|
||||||
// Check projection of an associated type out of a higher-ranked
|
// Check projection of an associated type out of a higher-ranked
|
||||||
// trait-bound in the context of a function body.
|
// trait-bound in the context of a function body.
|
||||||
|
|
||||||
#![feature(associated_types)]
|
|
||||||
|
|
||||||
pub trait Foo<T> {
|
pub trait Foo<T> {
|
||||||
type A;
|
type A;
|
||||||
|
|
||||||
|
|
|
@ -11,8 +11,6 @@
|
||||||
// Check projection of an associated type out of a higher-ranked trait-bound
|
// Check projection of an associated type out of a higher-ranked trait-bound
|
||||||
// in the context of a function signature.
|
// in the context of a function signature.
|
||||||
|
|
||||||
#![feature(associated_types)]
|
|
||||||
|
|
||||||
pub trait Foo<T> {
|
pub trait Foo<T> {
|
||||||
type A;
|
type A;
|
||||||
|
|
||||||
|
|
|
@ -11,8 +11,6 @@
|
||||||
// Check projection of an associated type out of a higher-ranked trait-bound
|
// Check projection of an associated type out of a higher-ranked trait-bound
|
||||||
// in the context of a struct definition.
|
// in the context of a struct definition.
|
||||||
|
|
||||||
#![feature(associated_types)]
|
|
||||||
|
|
||||||
pub trait Foo<T> {
|
pub trait Foo<T> {
|
||||||
type A;
|
type A;
|
||||||
|
|
||||||
|
|
|
@ -11,8 +11,6 @@
|
||||||
// Check projection of an associated type out of a higher-ranked trait-bound
|
// Check projection of an associated type out of a higher-ranked trait-bound
|
||||||
// in the context of a method definition in a trait.
|
// in the context of a method definition in a trait.
|
||||||
|
|
||||||
#![feature(associated_types)]
|
|
||||||
|
|
||||||
pub trait Foo<T> {
|
pub trait Foo<T> {
|
||||||
type A;
|
type A;
|
||||||
|
|
||||||
|
|
|
@ -10,8 +10,6 @@
|
||||||
|
|
||||||
// Check that an associated type cannot be bound in an expression path.
|
// Check that an associated type cannot be bound in an expression path.
|
||||||
|
|
||||||
#![feature(associated_types)]
|
|
||||||
|
|
||||||
trait Foo {
|
trait Foo {
|
||||||
type A;
|
type A;
|
||||||
fn bar() -> int;
|
fn bar() -> int;
|
||||||
|
|
|
@ -8,8 +8,6 @@
|
||||||
// option. This file may not be copied, modified, or distributed
|
// option. This file may not be copied, modified, or distributed
|
||||||
// except according to those terms.
|
// except according to those terms.
|
||||||
|
|
||||||
#![feature(associated_types)]
|
|
||||||
|
|
||||||
trait Get {
|
trait Get {
|
||||||
type Sized? Value;
|
type Sized? Value;
|
||||||
fn get(&self) -> <Self as Get>::Value;
|
fn get(&self) -> <Self as Get>::Value;
|
||||||
|
@ -21,4 +19,3 @@ fn foo<T:Get>(t: T) {
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -10,8 +10,6 @@
|
||||||
|
|
||||||
// Test that binary operators consume their arguments
|
// 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};
|
use std::ops::{Add, Sub, Mul, Div, Rem, BitAnd, BitXor, BitOr, Shl, Shr};
|
||||||
|
|
||||||
fn add<A: Add<B, Output=()>, B>(lhs: A, rhs: B) {
|
fn add<A: Add<B, Output=()>, B>(lhs: A, rhs: B) {
|
||||||
|
|
|
@ -10,8 +10,6 @@
|
||||||
|
|
||||||
// Test that move restrictions are enforced on overloaded binary operations
|
// Test that move restrictions are enforced on overloaded binary operations
|
||||||
|
|
||||||
#![feature(associated_types, default_type_params)]
|
|
||||||
|
|
||||||
use std::ops::Add;
|
use std::ops::Add;
|
||||||
|
|
||||||
fn double_move<T: Add<Output=()>>(x: T) {
|
fn double_move<T: Add<Output=()>>(x: T) {
|
||||||
|
|
|
@ -11,8 +11,6 @@
|
||||||
// Test how overloaded deref interacts with borrows when DerefMut
|
// Test how overloaded deref interacts with borrows when DerefMut
|
||||||
// is implemented.
|
// is implemented.
|
||||||
|
|
||||||
#![feature(associated_types)]
|
|
||||||
|
|
||||||
use std::ops::{Deref, DerefMut};
|
use std::ops::{Deref, DerefMut};
|
||||||
|
|
||||||
struct Own<T> {
|
struct Own<T> {
|
||||||
|
|
|
@ -11,8 +11,6 @@
|
||||||
// Test how overloaded deref interacts with borrows when only
|
// Test how overloaded deref interacts with borrows when only
|
||||||
// Deref and not DerefMut is implemented.
|
// Deref and not DerefMut is implemented.
|
||||||
|
|
||||||
#![feature(associated_types)]
|
|
||||||
|
|
||||||
use std::ops::Deref;
|
use std::ops::Deref;
|
||||||
|
|
||||||
struct Rc<T> {
|
struct Rc<T> {
|
||||||
|
|
|
@ -11,8 +11,6 @@
|
||||||
// Test how overloaded deref interacts with borrows when DerefMut
|
// Test how overloaded deref interacts with borrows when DerefMut
|
||||||
// is implemented.
|
// is implemented.
|
||||||
|
|
||||||
#![feature(associated_types)]
|
|
||||||
|
|
||||||
use std::ops::{Deref, DerefMut};
|
use std::ops::{Deref, DerefMut};
|
||||||
|
|
||||||
struct Own<T> {
|
struct Own<T> {
|
||||||
|
|
|
@ -11,8 +11,6 @@
|
||||||
// Test how overloaded deref interacts with borrows when only
|
// Test how overloaded deref interacts with borrows when only
|
||||||
// Deref and not DerefMut is implemented.
|
// Deref and not DerefMut is implemented.
|
||||||
|
|
||||||
#![feature(associated_types)]
|
|
||||||
|
|
||||||
use std::ops::Deref;
|
use std::ops::Deref;
|
||||||
|
|
||||||
struct Rc<T> {
|
struct Rc<T> {
|
||||||
|
|
|
@ -8,8 +8,6 @@
|
||||||
// option. This file may not be copied, modified, or distributed
|
// option. This file may not be copied, modified, or distributed
|
||||||
// except according to those terms.
|
// except according to those terms.
|
||||||
|
|
||||||
#![feature(associated_types)]
|
|
||||||
|
|
||||||
use std::ops::Add;
|
use std::ops::Add;
|
||||||
|
|
||||||
#[derive(Clone)]
|
#[derive(Clone)]
|
||||||
|
|
|
@ -8,8 +8,6 @@
|
||||||
// option. This file may not be copied, modified, or distributed
|
// option. This file may not be copied, modified, or distributed
|
||||||
// except according to those terms.
|
// except according to those terms.
|
||||||
|
|
||||||
#![feature(associated_types, default_type_params)]
|
|
||||||
|
|
||||||
use std::ops::Add;
|
use std::ops::Add;
|
||||||
|
|
||||||
#[derive(Copy)]
|
#[derive(Copy)]
|
||||||
|
|
|
@ -8,8 +8,6 @@
|
||||||
// option. This file may not be copied, modified, or distributed
|
// option. This file may not be copied, modified, or distributed
|
||||||
// except according to those terms.
|
// except according to those terms.
|
||||||
|
|
||||||
#![feature(associated_types)]
|
|
||||||
|
|
||||||
use std::ops::Index;
|
use std::ops::Index;
|
||||||
|
|
||||||
struct MyVec<T> {
|
struct MyVec<T> {
|
||||||
|
|
|
@ -11,8 +11,6 @@
|
||||||
// Test that we still see borrowck errors of various kinds when using
|
// Test that we still see borrowck errors of various kinds when using
|
||||||
// indexing and autoderef in combination.
|
// indexing and autoderef in combination.
|
||||||
|
|
||||||
#![feature(associated_types)]
|
|
||||||
|
|
||||||
use std::ops::{Index, IndexMut};
|
use std::ops::{Index, IndexMut};
|
||||||
|
|
||||||
struct Foo {
|
struct Foo {
|
||||||
|
@ -95,5 +93,3 @@ fn test9(mut f: Box<Bar>, g: Bar, s: String) {
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -8,8 +8,6 @@
|
||||||
// option. This file may not be copied, modified, or distributed
|
// option. This file may not be copied, modified, or distributed
|
||||||
// except according to those terms.
|
// except according to those terms.
|
||||||
|
|
||||||
#![feature(associated_types)]
|
|
||||||
|
|
||||||
use std::ops::{Index, IndexMut};
|
use std::ops::{Index, IndexMut};
|
||||||
|
|
||||||
struct Foo {
|
struct Foo {
|
||||||
|
@ -70,5 +68,3 @@ fn main() {
|
||||||
s[2] = 20;
|
s[2] = 20;
|
||||||
//~^ ERROR cannot assign to immutable dereference (dereference is implicit, due to indexing)
|
//~^ ERROR cannot assign to immutable dereference (dereference is implicit, due to indexing)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -11,8 +11,6 @@
|
||||||
// Test that overloaded index expressions with DST result types
|
// Test that overloaded index expressions with DST result types
|
||||||
// can't be used as rvalues
|
// can't be used as rvalues
|
||||||
|
|
||||||
#![feature(associated_types)]
|
|
||||||
|
|
||||||
use std::ops::Index;
|
use std::ops::Index;
|
||||||
use std::fmt::Show;
|
use std::fmt::Show;
|
||||||
|
|
||||||
|
|
|
@ -8,8 +8,6 @@
|
||||||
// option. This file may not be copied, modified, or distributed
|
// option. This file may not be copied, modified, or distributed
|
||||||
// except according to those terms.
|
// except according to those terms.
|
||||||
|
|
||||||
#![feature(default_type_params)]
|
|
||||||
|
|
||||||
struct Foo<A, B, C = (A, B)>;
|
struct Foo<A, B, C = (A, B)>;
|
||||||
|
|
||||||
impl<A, B, C = (A, B)> Foo<A, B, C> {
|
impl<A, B, C = (A, B)> Foo<A, B, C> {
|
||||||
|
|
|
@ -8,8 +8,6 @@
|
||||||
// option. This file may not be copied, modified, or distributed
|
// option. This file may not be copied, modified, or distributed
|
||||||
// except according to those terms.
|
// except according to those terms.
|
||||||
|
|
||||||
#![feature(default_type_params)]
|
|
||||||
|
|
||||||
struct Heap;
|
struct Heap;
|
||||||
|
|
||||||
struct Vec<T, A = Heap>;
|
struct Vec<T, A = Heap>;
|
||||||
|
|
|
@ -8,8 +8,6 @@
|
||||||
// option. This file may not be copied, modified, or distributed
|
// option. This file may not be copied, modified, or distributed
|
||||||
// except according to those terms.
|
// except according to those terms.
|
||||||
|
|
||||||
#![feature(default_type_params)]
|
|
||||||
|
|
||||||
struct Heap;
|
struct Heap;
|
||||||
|
|
||||||
struct Vec<A = Heap, T>; //~ ERROR type parameters with a default must be trailing
|
struct Vec<A = Heap, T>; //~ ERROR type parameters with a default must be trailing
|
||||||
|
|
|
@ -8,8 +8,6 @@
|
||||||
// option. This file may not be copied, modified, or distributed
|
// option. This file may not be copied, modified, or distributed
|
||||||
// except according to those terms.
|
// except according to those terms.
|
||||||
|
|
||||||
#![feature(default_type_params)]
|
|
||||||
|
|
||||||
struct Heap;
|
struct Heap;
|
||||||
|
|
||||||
struct Vec<T, A = Heap>;
|
struct Vec<T, A = Heap>;
|
||||||
|
|
|
@ -8,8 +8,6 @@
|
||||||
// option. This file may not be copied, modified, or distributed
|
// option. This file may not be copied, modified, or distributed
|
||||||
// except according to those terms.
|
// except according to those terms.
|
||||||
|
|
||||||
#![feature(default_type_params)]
|
|
||||||
|
|
||||||
struct Heap;
|
struct Heap;
|
||||||
|
|
||||||
struct Vec<T, A = Heap>;
|
struct Vec<T, A = Heap>;
|
||||||
|
|
|
@ -8,8 +8,6 @@
|
||||||
// option. This file may not be copied, modified, or distributed
|
// option. This file may not be copied, modified, or distributed
|
||||||
// except according to those terms.
|
// except according to those terms.
|
||||||
|
|
||||||
#![feature(default_type_params)]
|
|
||||||
|
|
||||||
// Ensure that we get an error and not an ICE for this problematic case.
|
// Ensure that we get an error and not an ICE for this problematic case.
|
||||||
struct Foo<T = Option<U>, U = bool>;
|
struct Foo<T = Option<U>, U = bool>;
|
||||||
//~^ ERROR type parameters with a default cannot use forward declared identifiers
|
//~^ ERROR type parameters with a default cannot use forward declared identifiers
|
||||||
|
|
|
@ -8,8 +8,6 @@
|
||||||
// option. This file may not be copied, modified, or distributed
|
// option. This file may not be copied, modified, or distributed
|
||||||
// except according to those terms.
|
// except according to those terms.
|
||||||
|
|
||||||
#![feature(default_type_params)]
|
|
||||||
|
|
||||||
struct A;
|
struct A;
|
||||||
struct B;
|
struct B;
|
||||||
struct C;
|
struct C;
|
||||||
|
|
|
@ -10,8 +10,6 @@
|
||||||
|
|
||||||
// Make sure that globs only bring in public things.
|
// Make sure that globs only bring in public things.
|
||||||
|
|
||||||
#![feature(globs)]
|
|
||||||
|
|
||||||
use bar::*;
|
use bar::*;
|
||||||
|
|
||||||
mod bar {
|
mod bar {
|
||||||
|
|
|
@ -10,8 +10,6 @@
|
||||||
|
|
||||||
// error-pattern: unresolved name
|
// error-pattern: unresolved name
|
||||||
|
|
||||||
#![feature(globs)]
|
|
||||||
|
|
||||||
use module_of_many_things::*;
|
use module_of_many_things::*;
|
||||||
|
|
||||||
mod module_of_many_things {
|
mod module_of_many_things {
|
||||||
|
|
|
@ -10,8 +10,6 @@
|
||||||
|
|
||||||
// error-pattern: unresolved
|
// error-pattern: unresolved
|
||||||
|
|
||||||
#![feature(globs)]
|
|
||||||
|
|
||||||
mod circ1 {
|
mod circ1 {
|
||||||
pub use circ2::f2;
|
pub use circ2::f2;
|
||||||
pub fn f1() { println!("f1"); }
|
pub fn f1() { println!("f1"); }
|
||||||
|
|
|
@ -11,7 +11,6 @@
|
||||||
// Test that import shadowing using globs causes errors
|
// Test that import shadowing using globs causes errors
|
||||||
|
|
||||||
#![no_implicit_prelude]
|
#![no_implicit_prelude]
|
||||||
#![feature(globs)]
|
|
||||||
|
|
||||||
use foo::*;
|
use foo::*;
|
||||||
use bar::*; //~ERROR a type named `Baz` has already been imported in this module
|
use bar::*; //~ERROR a type named `Baz` has already been imported in this module
|
||||||
|
|
|
@ -11,7 +11,6 @@
|
||||||
// Test that import shadowing using globs causes errors
|
// Test that import shadowing using globs causes errors
|
||||||
|
|
||||||
#![no_implicit_prelude]
|
#![no_implicit_prelude]
|
||||||
#![feature(globs)]
|
|
||||||
|
|
||||||
use foo::*;
|
use foo::*;
|
||||||
use foo::*; //~ERROR a type named `Baz` has already been imported in this module
|
use foo::*; //~ERROR a type named `Baz` has already been imported in this module
|
||||||
|
|
|
@ -11,7 +11,6 @@
|
||||||
// Test that import shadowing using globs causes errors
|
// Test that import shadowing using globs causes errors
|
||||||
|
|
||||||
#![no_implicit_prelude]
|
#![no_implicit_prelude]
|
||||||
#![feature(globs)]
|
|
||||||
|
|
||||||
use foo::Baz;
|
use foo::Baz;
|
||||||
use bar::*; //~ERROR a type named `Baz` has already been imported in this module
|
use bar::*; //~ERROR a type named `Baz` has already been imported in this module
|
||||||
|
|
|
@ -11,7 +11,6 @@
|
||||||
// Test that import shadowing using globs causes errors
|
// Test that import shadowing using globs causes errors
|
||||||
|
|
||||||
#![no_implicit_prelude]
|
#![no_implicit_prelude]
|
||||||
#![feature(globs)]
|
|
||||||
|
|
||||||
use foo::*;
|
use foo::*;
|
||||||
use bar::Baz; //~ERROR a type named `Baz` has already been imported in this module
|
use bar::Baz; //~ERROR a type named `Baz` has already been imported in this module
|
||||||
|
|
|
@ -11,7 +11,6 @@
|
||||||
// Test that import shadowing using globs causes errors
|
// Test that import shadowing using globs causes errors
|
||||||
|
|
||||||
#![no_implicit_prelude]
|
#![no_implicit_prelude]
|
||||||
#![feature(globs)]
|
|
||||||
|
|
||||||
use foo::Baz;
|
use foo::Baz;
|
||||||
use bar::Baz; //~ERROR a type named `Baz` has already been imported in this module
|
use bar::Baz; //~ERROR a type named `Baz` has already been imported in this module
|
||||||
|
|
|
@ -11,7 +11,6 @@
|
||||||
// Test that import shadowing using globs causes errors
|
// Test that import shadowing using globs causes errors
|
||||||
|
|
||||||
#![no_implicit_prelude]
|
#![no_implicit_prelude]
|
||||||
#![feature(globs)]
|
|
||||||
|
|
||||||
use qux::*;
|
use qux::*;
|
||||||
use foo::*; //~ERROR a type named `Baz` has already been imported in this module
|
use foo::*; //~ERROR a type named `Baz` has already been imported in this module
|
||||||
|
|
|
@ -11,7 +11,6 @@
|
||||||
// Test that import shadowing using globs causes errors
|
// Test that import shadowing using globs causes errors
|
||||||
|
|
||||||
#![no_implicit_prelude]
|
#![no_implicit_prelude]
|
||||||
#![feature(globs)]
|
|
||||||
|
|
||||||
use foo::*;
|
use foo::*;
|
||||||
use qux::*; //~ERROR a type named `Baz` has already been imported in this module
|
use qux::*; //~ERROR a type named `Baz` has already been imported in this module
|
||||||
|
|
|
@ -10,8 +10,6 @@
|
||||||
|
|
||||||
// error-pattern: reached the recursion limit while auto-dereferencing
|
// error-pattern: reached the recursion limit while auto-dereferencing
|
||||||
|
|
||||||
#![feature(associated_types)]
|
|
||||||
|
|
||||||
use std::ops::Deref;
|
use std::ops::Deref;
|
||||||
|
|
||||||
struct Foo;
|
struct Foo;
|
||||||
|
|
|
@ -10,8 +10,6 @@
|
||||||
|
|
||||||
// Testing that we don't fail abnormally after hitting the errors
|
// 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
|
use unresolved::*; //~ ERROR unresolved import `unresolved::*`. Maybe a missing `extern crate unres
|
||||||
|
|
||||||
fn main() {}
|
fn main() {}
|
||||||
|
|
|
@ -9,7 +9,6 @@
|
||||||
// except according to those terms.
|
// except according to those terms.
|
||||||
|
|
||||||
#![feature(unboxed_closures)]
|
#![feature(unboxed_closures)]
|
||||||
#![feature(associated_types)]
|
|
||||||
|
|
||||||
use std::any::Any;
|
use std::any::Any;
|
||||||
use std::intrinsics::TypeId;
|
use std::intrinsics::TypeId;
|
||||||
|
|
|
@ -8,8 +8,6 @@
|
||||||
// option. This file may not be copied, modified, or distributed
|
// option. This file may not be copied, modified, or distributed
|
||||||
// except according to those terms.
|
// except according to those terms.
|
||||||
|
|
||||||
#![feature(associated_types)]
|
|
||||||
|
|
||||||
use std::ops::Deref;
|
use std::ops::Deref;
|
||||||
|
|
||||||
struct MyPtr<'a>(&'a mut uint);
|
struct MyPtr<'a>(&'a mut uint);
|
||||||
|
|
|
@ -8,8 +8,6 @@
|
||||||
// option. This file may not be copied, modified, or distributed
|
// option. This file may not be copied, modified, or distributed
|
||||||
// except according to those terms.
|
// except according to those terms.
|
||||||
|
|
||||||
#![feature(associated_types)]
|
|
||||||
|
|
||||||
fn add_state(op: <int as HasState>::State) {
|
fn add_state(op: <int as HasState>::State) {
|
||||||
//~^ ERROR the trait `HasState` is not implemented for the type `int`
|
//~^ ERROR the trait `HasState` is not implemented for the type `int`
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,8 +8,6 @@
|
||||||
// option. This file may not be copied, modified, or distributed
|
// option. This file may not be copied, modified, or distributed
|
||||||
// except according to those terms.
|
// except according to those terms.
|
||||||
|
|
||||||
#![feature(associated_types)]
|
|
||||||
|
|
||||||
trait Foo {
|
trait Foo {
|
||||||
type Item;
|
type Item;
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,8 +8,6 @@
|
||||||
// option. This file may not be copied, modified, or distributed
|
// option. This file may not be copied, modified, or distributed
|
||||||
// except according to those terms.
|
// except according to those terms.
|
||||||
|
|
||||||
#![feature(associated_types)]
|
|
||||||
|
|
||||||
trait From<Src> {
|
trait From<Src> {
|
||||||
type Output;
|
type Output;
|
||||||
|
|
||||||
|
|
|
@ -8,8 +8,6 @@
|
||||||
// option. This file may not be copied, modified, or distributed
|
// option. This file may not be copied, modified, or distributed
|
||||||
// except according to those terms.
|
// except according to those terms.
|
||||||
|
|
||||||
#![feature(associated_types)]
|
|
||||||
|
|
||||||
trait From<Src> {
|
trait From<Src> {
|
||||||
type Result;
|
type Result;
|
||||||
|
|
||||||
|
|
|
@ -8,8 +8,6 @@
|
||||||
// option. This file may not be copied, modified, or distributed
|
// option. This file may not be copied, modified, or distributed
|
||||||
// except according to those terms.
|
// except according to those terms.
|
||||||
|
|
||||||
#![feature(globs)]
|
|
||||||
|
|
||||||
// ensures that 'use foo:*' doesn't import non-public item
|
// ensures that 'use foo:*' doesn't import non-public item
|
||||||
|
|
||||||
use m1::*;
|
use m1::*;
|
||||||
|
@ -36,4 +34,3 @@ mod m1 {
|
||||||
fn main() {
|
fn main() {
|
||||||
foo(); //~ ERROR: unresolved name
|
foo(); //~ ERROR: unresolved name
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -13,8 +13,6 @@
|
||||||
// ensures that 'use foo:*' doesn't import non-public 'use' statements in the
|
// ensures that 'use foo:*' doesn't import non-public 'use' statements in the
|
||||||
// module 'foo'
|
// module 'foo'
|
||||||
|
|
||||||
#![feature(globs)]
|
|
||||||
|
|
||||||
use m1::*;
|
use m1::*;
|
||||||
|
|
||||||
mod foo {
|
mod foo {
|
||||||
|
|
|
@ -8,10 +8,7 @@
|
||||||
// option. This file may not be copied, modified, or distributed
|
// option. This file may not be copied, modified, or distributed
|
||||||
// except according to those terms.
|
// except according to those terms.
|
||||||
|
|
||||||
#![feature(globs)]
|
|
||||||
|
|
||||||
use self::*; //~ ERROR: unresolved import
|
use self::*; //~ ERROR: unresolved import
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -10,7 +10,6 @@
|
||||||
|
|
||||||
// When denying at the crate level, be sure to not get random warnings from the
|
// When denying at the crate level, be sure to not get random warnings from the
|
||||||
// injected intrinsics by the compiler.
|
// injected intrinsics by the compiler.
|
||||||
#![feature(globs)]
|
|
||||||
#![deny(missing_docs)]
|
#![deny(missing_docs)]
|
||||||
#![allow(dead_code)]
|
#![allow(dead_code)]
|
||||||
#![allow(missing_copy_implementations)]
|
#![allow(missing_copy_implementations)]
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
// aux-build:stability_cfg1.rs
|
// aux-build:stability_cfg1.rs
|
||||||
// aux-build:stability_cfg2.rs
|
// aux-build:stability_cfg2.rs
|
||||||
|
|
||||||
#![feature(globs, phase)]
|
#![feature(phase)]
|
||||||
#![deny(unstable)]
|
#![deny(unstable)]
|
||||||
#![deny(deprecated)]
|
#![deny(deprecated)]
|
||||||
#![deny(experimental)]
|
#![deny(experimental)]
|
||||||
|
|
|
@ -10,7 +10,6 @@
|
||||||
|
|
||||||
// aux-build:lint-unused-extern-crate.rs
|
// aux-build:lint-unused-extern-crate.rs
|
||||||
|
|
||||||
#![feature(globs)]
|
|
||||||
#![deny(unused_extern_crates)]
|
#![deny(unused_extern_crates)]
|
||||||
#![allow(unused_variables)]
|
#![allow(unused_variables)]
|
||||||
|
|
||||||
|
|
|
@ -8,7 +8,6 @@
|
||||||
// option. This file may not be copied, modified, or distributed
|
// option. This file may not be copied, modified, or distributed
|
||||||
// except according to those terms.
|
// except according to those terms.
|
||||||
|
|
||||||
#![feature(globs)]
|
|
||||||
#![deny(unused_imports)]
|
#![deny(unused_imports)]
|
||||||
#![allow(dead_code)]
|
#![allow(dead_code)]
|
||||||
|
|
||||||
|
|
|
@ -8,8 +8,6 @@
|
||||||
// option. This file may not be copied, modified, or distributed
|
// option. This file may not be copied, modified, or distributed
|
||||||
// except according to those terms.
|
// except according to those terms.
|
||||||
|
|
||||||
#![feature(globs)]
|
|
||||||
|
|
||||||
// error-pattern:declaration of `None` shadows
|
// error-pattern:declaration of `None` shadows
|
||||||
use std::option::*;
|
use std::option::*;
|
||||||
|
|
||||||
|
|
|
@ -9,8 +9,6 @@
|
||||||
// except according to those terms.
|
// except according to those terms.
|
||||||
|
|
||||||
// aux-build:namespaced_enums.rs
|
// aux-build:namespaced_enums.rs
|
||||||
#![feature(globs)]
|
|
||||||
|
|
||||||
extern crate namespaced_enums;
|
extern crate namespaced_enums;
|
||||||
|
|
||||||
mod m {
|
mod m {
|
||||||
|
@ -25,4 +23,3 @@ pub fn main() {
|
||||||
bar(); //~ ERROR unresolved name `bar`
|
bar(); //~ ERROR unresolved name `bar`
|
||||||
m::bar(); //~ ERROR unresolved name `m::bar`
|
m::bar(); //~ ERROR unresolved name `m::bar`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -7,7 +7,6 @@
|
||||||
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
||||||
// option. This file may not be copied, modified, or distributed
|
// option. This file may not be copied, modified, or distributed
|
||||||
// except according to those terms.
|
// except according to those terms.
|
||||||
#![feature(globs)]
|
|
||||||
|
|
||||||
mod m2 {
|
mod m2 {
|
||||||
pub enum Foo {
|
pub enum Foo {
|
||||||
|
|
|
@ -11,7 +11,6 @@
|
||||||
// Check we do the correct privacy checks when we import a name and there is an
|
// 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.
|
// item with that name in both the value and type namespaces.
|
||||||
|
|
||||||
#![feature(globs)]
|
|
||||||
#![allow(dead_code)]
|
#![allow(dead_code)]
|
||||||
#![allow(unused_imports)]
|
#![allow(unused_imports)]
|
||||||
|
|
||||||
|
@ -64,4 +63,3 @@ fn test_glob3() {
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -11,7 +11,6 @@
|
||||||
// Check we do the correct privacy checks when we import a name and there is an
|
// 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.
|
// item with that name in both the value and type namespaces.
|
||||||
|
|
||||||
#![feature(globs)]
|
|
||||||
#![allow(dead_code)]
|
#![allow(dead_code)]
|
||||||
#![allow(unused_imports)]
|
#![allow(unused_imports)]
|
||||||
|
|
||||||
|
@ -88,4 +87,3 @@ fn test_list3() {
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
// option. This file may not be copied, modified, or distributed
|
// option. This file may not be copied, modified, or distributed
|
||||||
// except according to those terms.
|
// except according to those terms.
|
||||||
|
|
||||||
#![feature(globs, lang_items)]
|
#![feature(lang_items)]
|
||||||
#![no_std] // makes debugging this test *a lot* easier (during resolve)
|
#![no_std] // makes debugging this test *a lot* easier (during resolve)
|
||||||
|
|
||||||
#[lang="sized"]
|
#[lang="sized"]
|
||||||
|
|
|
@ -8,7 +8,6 @@
|
||||||
// option. This file may not be copied, modified, or distributed
|
// option. This file may not be copied, modified, or distributed
|
||||||
// except according to those terms.
|
// except according to those terms.
|
||||||
|
|
||||||
#![feature(globs)]
|
|
||||||
#![no_std] // makes debugging this test *a lot* easier (during resolve)
|
#![no_std] // makes debugging this test *a lot* easier (during resolve)
|
||||||
|
|
||||||
// Test to make sure that globs don't leak in regular `use` statements.
|
// 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 }
|
#[start] fn main(_: int, _: *const *const u8) -> int { 3 }
|
||||||
|
|
||||||
|
|
|
@ -8,7 +8,6 @@
|
||||||
// option. This file may not be copied, modified, or distributed
|
// option. This file may not be copied, modified, or distributed
|
||||||
// except according to those terms.
|
// except according to those terms.
|
||||||
|
|
||||||
#![feature(globs)]
|
|
||||||
#![no_std] // makes debugging this test *a lot* easier (during resolve)
|
#![no_std] // makes debugging this test *a lot* easier (during resolve)
|
||||||
|
|
||||||
// Test to make sure that private items imported through globs remain private
|
// Test to make sure that private items imported through globs remain private
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
// option. This file may not be copied, modified, or distributed
|
// option. This file may not be copied, modified, or distributed
|
||||||
// except according to those terms.
|
// except according to those terms.
|
||||||
|
|
||||||
#![feature(globs, lang_items)]
|
#![feature(lang_items)]
|
||||||
#![no_std] // makes debugging this test *a lot* easier (during resolve)
|
#![no_std] // makes debugging this test *a lot* easier (during resolve)
|
||||||
|
|
||||||
#[lang = "sized"] pub trait Sized for Sized? {}
|
#[lang = "sized"] pub trait Sized for Sized? {}
|
||||||
|
|
|
@ -8,8 +8,6 @@
|
||||||
// option. This file may not be copied, modified, or distributed
|
// option. This file may not be copied, modified, or distributed
|
||||||
// except according to those terms.
|
// except according to those terms.
|
||||||
|
|
||||||
#![feature(associated_types)]
|
|
||||||
|
|
||||||
struct StateMachineIter<'a> {
|
struct StateMachineIter<'a> {
|
||||||
statefn: &'a StateMachineFunc<'a>
|
statefn: &'a StateMachineFunc<'a>
|
||||||
}
|
}
|
||||||
|
@ -61,4 +59,3 @@ fn main() {
|
||||||
println!("{}",it.next());
|
println!("{}",it.next());
|
||||||
println!("{}",it.next());
|
println!("{}",it.next());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -10,7 +10,6 @@
|
||||||
|
|
||||||
// Issue #8380
|
// Issue #8380
|
||||||
|
|
||||||
#![feature(globs)]
|
|
||||||
|
|
||||||
use std::sync::atomic::*;
|
use std::sync::atomic::*;
|
||||||
use std::ptr;
|
use std::ptr;
|
||||||
|
|
|
@ -11,7 +11,7 @@
|
||||||
// Test interaction between unboxed closure sugar and default type
|
// Test interaction between unboxed closure sugar and default type
|
||||||
// parameters (should be exactly as if angle brackets were used).
|
// parameters (should be exactly as if angle brackets were used).
|
||||||
|
|
||||||
#![feature(default_type_params, unboxed_closures)]
|
#![feature(unboxed_closures)]
|
||||||
#![allow(dead_code)]
|
#![allow(dead_code)]
|
||||||
|
|
||||||
trait Foo<T,U,V=T> {
|
trait Foo<T,U,V=T> {
|
||||||
|
|
|
@ -12,7 +12,7 @@
|
||||||
// parameters (should be exactly as if angle brackets were used
|
// parameters (should be exactly as if angle brackets were used
|
||||||
// and regions omitted).
|
// and regions omitted).
|
||||||
|
|
||||||
#![feature(default_type_params, unboxed_closures)]
|
#![feature(unboxed_closures)]
|
||||||
#![allow(dead_code)]
|
#![allow(dead_code)]
|
||||||
|
|
||||||
use std::kinds::marker;
|
use std::kinds::marker;
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue