remove associated_consts feature gate

This commit is contained in:
Sean McArthur 2017-07-06 11:52:25 -07:00
parent ccf401f8f7
commit 74b2d69358
87 changed files with 64 additions and 266 deletions

View file

@ -8,7 +8,6 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![feature(associated_consts)]
pub use self::sub::{Bar, Baz};

View file

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

View file

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

View file

@ -8,7 +8,6 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![feature(associated_consts)]
trait Foo {
const ID: i32;

View file

@ -8,7 +8,6 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![feature(associated_consts)]
trait Foo {
const ID: usize;

View file

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

View file

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

View file

@ -8,7 +8,6 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![feature(associated_consts)]
trait Foo {
const NAME: &'static str;

View file

@ -8,7 +8,6 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![feature(associated_consts)]
trait Foo {
const BAR: u32; //~ NOTE type in trait

View file

@ -8,7 +8,6 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![feature(associated_consts)]
trait Foo {
const ID: i32;

View file

@ -8,7 +8,6 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![feature(associated_consts)]
mod bar1 {
pub use self::bar2::Foo;

View file

@ -8,7 +8,6 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![feature(associated_consts)]
pub enum EFoo { A, B, C, D }

View file

@ -8,7 +8,6 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![feature(associated_consts)]
pub trait Foo {
const Y: usize;

View file

@ -8,7 +8,6 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![feature(associated_consts)]
pub trait Foo {
const Y: usize;

View file

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

View file

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

View file

@ -10,7 +10,6 @@
// Test for issue #23969
#![feature(associated_consts)]
trait Foo {
type Ty;

View file

@ -8,7 +8,6 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![feature(associated_consts)]
#![feature(associated_type_defaults)]
pub trait Tr {

View file

@ -8,7 +8,6 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![feature(associated_consts)]
pub trait Trait {
const CONST: u32;

View file

@ -8,7 +8,6 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![feature(associated_consts)]
pub use self::sub::{Bar, Baz};

View file

@ -1,23 +0,0 @@
// Copyright 2015 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.
// gate-test-associated_consts
trait MyTrait {
const C: bool;
//~^ associated constants are experimental
}
struct Foo;
impl Foo {
const C: bool = true;
//~^ associated constants are experimental
}

View file

@ -10,7 +10,6 @@
// Can't use constants as tuple struct patterns
#![feature(associated_consts)]
const C1: i32 = 0;

View file

@ -8,7 +8,6 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![feature(associated_consts)]
enum Enum<T: Trait> {
X = Trait::Number,

View file

@ -10,7 +10,6 @@
// aux-build:issue_41549.rs
#![feature(associated_consts)]
extern crate issue_41549;

View file

@ -11,7 +11,6 @@
// Check that we correctly prevent users from making trait objects
// from traits with associated consts.
#![feature(associated_consts)]
trait Bar {
const X: usize;

View file

@ -8,7 +8,6 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![feature(associated_consts)]
#![feature(optin_builtin_traits)]
trait MarkerTr {}

View file

@ -11,7 +11,6 @@
// Private types and traits are not allowed in public interfaces.
// This test also ensures that the checks are performed even inside private modules.
#![feature(associated_consts)]
#![feature(associated_type_defaults)]
#![deny(private_in_public)]
#![allow(unused)]

View file

@ -11,7 +11,6 @@
// Private types and traits are not allowed in public interfaces.
// This test also ensures that the checks are performed even inside private modules.
#![feature(associated_consts)]
#![feature(associated_type_defaults)]
mod types {

View file

@ -9,7 +9,6 @@
// except according to those terms.
#![feature(custom_attribute)]
#![feature(associated_consts)]
macro_rules! stmt_mac {
() => {

View file

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

View file

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

View file

@ -8,7 +8,6 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![feature(associated_consts)]
use Trait::foo;
//~^ ERROR `foo` is not directly importable

View file

@ -30,7 +30,6 @@
#![crate_type="rlib"]
#![feature(associated_type_defaults)]
#![feature(intrinsics)]
#![feature(associated_consts)]
// Change trait visibility --------------------------------------------------------

View file

@ -8,7 +8,6 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![feature(associated_consts)]
trait Foo {
const NUM: usize;

View file

@ -10,7 +10,6 @@
// aux-build:associated-const-cc-lib.rs
#![feature(associated_consts)]
extern crate associated_const_cc_lib as foolib;

View file

@ -10,7 +10,6 @@
// aux-build:associated-const-cc-lib.rs
#![feature(associated_consts)]
extern crate associated_const_cc_lib as foolib;

View file

@ -10,7 +10,6 @@
// aux-build:associated-const-cc-lib.rs
#![feature(associated_consts)]
extern crate associated_const_cc_lib as foolib;

View file

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

View file

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

View file

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

View file

@ -10,7 +10,6 @@
// aux-build:empty-struct.rs
#![feature(associated_consts)]
extern crate empty_struct;
use empty_struct::XEmpty2 as XFoo;

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(associated_consts)]
trait Lattice {
const BOTTOM: Self;

View file

@ -8,7 +8,6 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![feature(associated_consts)]
trait Foo {
const ID: i32 = 2;

View file

@ -8,7 +8,6 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![feature(associated_consts)]
mod bar1 {
pub use self::bar2::Foo;

View file

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

View file

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

View file

@ -8,7 +8,6 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![feature(associated_consts)]
trait MyInt {
const ONE: Self;

View file

@ -8,7 +8,6 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![feature(associated_consts)]
trait Foo {
const X: i32;

View file

@ -8,7 +8,6 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![feature(associated_consts)]
trait Foo {
const ID: i32;

View file

@ -8,7 +8,6 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![feature(associated_consts)]
trait Foo {
const ID: i32 = 1;

View file

@ -8,7 +8,6 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![feature(associated_consts)]
// The main purpose of this test is to ensure that different impls of the same
// trait can refer to each other without setting off the static recursion check

View file

@ -8,7 +8,6 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![feature(associated_consts)]
trait Foo {
const ID: i32;

View file

@ -8,7 +8,6 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![feature(associated_consts)]
#![crate_type="lib"]

View file

@ -8,7 +8,6 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![feature(associated_consts)]
#![deny(dead_code)]
// use different types / traits to test all combinations

View file

@ -10,7 +10,6 @@
// #24947 ICE using a trait-associated const in an array size
#![feature(associated_consts)]
struct Foo;

View file

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

View file

@ -8,7 +8,6 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![feature(associated_consts)]
trait HasNumber<T> {
const Number: usize;

View file

@ -8,7 +8,6 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![feature(associated_consts)]
#[derive(Clone, Copy, Debug)]
struct Bar;

View file

@ -10,7 +10,6 @@
// Regression test for issue #31267
#![feature(associated_consts)]
struct Foo;

View file

@ -8,7 +8,6 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![feature(associated_consts)]
macro_rules! m { () => { 0 } }

View file

@ -8,7 +8,6 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![feature(associated_consts)]
pub trait Foo {
// @has assoc_consts/trait.Foo.html '//*[@class="rust trait"]' \

View file

@ -8,7 +8,6 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![feature(associated_consts)]
pub trait Foo {
const FOO: usize;

View file

@ -8,7 +8,6 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![feature(associated_consts)]
use std::marker::PhantomData;

View file

@ -9,7 +9,6 @@
// except according to those terms.
#![feature(associated_type_defaults)]
#![feature(associated_consts)]
// @has issue_28478/trait.Bar.html
pub trait Bar {

View file

@ -8,8 +8,6 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![feature(associated_consts, associated_types)]
// Test that associated item impls on primitive types don't crash rustdoc
pub trait Foo {

View file

@ -11,7 +11,6 @@
// Ensure constant and array length values are not taken from source
// code, which wreaks havoc with macros.
#![feature(associated_consts)]
macro_rules! make {
($n:expr) => {

View file

@ -8,7 +8,6 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![feature(associated_consts)]
pub trait X {
const CONSTANT: u32;

View file

@ -10,7 +10,6 @@
// aux-build:m1.rs
#![feature(associated_consts)]
extern crate m1;

View file

@ -1,10 +1,10 @@
error[E0601]: main function not found
error[E0046]: not all trait items implemented, missing: `CONSTANT`, `Type`, `method`
--> $DIR/m2.rs:20:1
--> $DIR/m2.rs:19:1
|
20 | / impl m1::X for X {
21 | | }
19 | / impl m1::X for X {
20 | | }
| |_^ missing `CONSTANT`, `Type`, `method` in implementation
|
= note: `CONSTANT` from trait: `const CONSTANT: u32;`

View file

@ -8,7 +8,6 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![feature(associated_consts)]
use std::fmt::Debug;

View file

@ -1,86 +1,86 @@
error[E0437]: type `bar` is not a member of trait `Foo`
--> $DIR/impl-wrong-item-for-trait.rs:47:5
--> $DIR/impl-wrong-item-for-trait.rs:46:5
|
47 | type bar = u64;
46 | type bar = u64;
| ^^^^^^^^^^^^^^^ not a member of trait `Foo`
error[E0323]: item `bar` is an associated const, which doesn't match its trait `Foo`
--> $DIR/impl-wrong-item-for-trait.rs:25:5
--> $DIR/impl-wrong-item-for-trait.rs:24:5
|
16 | fn bar(&self);
15 | fn bar(&self);
| -------------- item in trait
...
25 | const bar: u64 = 1;
24 | const bar: u64 = 1;
| ^^^^^^^^^^^^^^^^^^^ does not match trait
error[E0046]: not all trait items implemented, missing: `bar`
--> $DIR/impl-wrong-item-for-trait.rs:22:1
--> $DIR/impl-wrong-item-for-trait.rs:21:1
|
16 | fn bar(&self);
15 | fn bar(&self);
| -------------- `bar` from trait
...
22 | / impl Foo for FooConstForMethod {
23 | | //~^ ERROR E0046
24 | | //~| NOTE missing `bar` in implementation
25 | | const bar: u64 = 1;
21 | / impl Foo for FooConstForMethod {
22 | | //~^ ERROR E0046
23 | | //~| NOTE missing `bar` in implementation
24 | | const bar: u64 = 1;
... |
28 | | const MY_CONST: u32 = 1;
29 | | }
27 | | const MY_CONST: u32 = 1;
28 | | }
| |_^ missing `bar` in implementation
error[E0324]: item `MY_CONST` is an associated method, which doesn't match its trait `Foo`
--> $DIR/impl-wrong-item-for-trait.rs:37:5
--> $DIR/impl-wrong-item-for-trait.rs:36:5
|
17 | const MY_CONST: u32;
16 | const MY_CONST: u32;
| -------------------- item in trait
...
37 | fn MY_CONST() {}
36 | fn MY_CONST() {}
| ^^^^^^^^^^^^^^^^ does not match trait
error[E0046]: not all trait items implemented, missing: `MY_CONST`
--> $DIR/impl-wrong-item-for-trait.rs:33:1
--> $DIR/impl-wrong-item-for-trait.rs:32:1
|
17 | const MY_CONST: u32;
16 | const MY_CONST: u32;
| -------------------- `MY_CONST` from trait
...
33 | / impl Foo for FooMethodForConst {
34 | | //~^ ERROR E0046
35 | | //~| NOTE missing `MY_CONST` in implementation
36 | | fn bar(&self) {}
32 | / impl Foo for FooMethodForConst {
33 | | //~^ ERROR E0046
34 | | //~| NOTE missing `MY_CONST` in implementation
35 | | fn bar(&self) {}
... |
39 | | //~| NOTE does not match trait
40 | | }
38 | | //~| NOTE does not match trait
39 | | }
| |_^ missing `MY_CONST` in implementation
error[E0325]: item `bar` is an associated type, which doesn't match its trait `Foo`
--> $DIR/impl-wrong-item-for-trait.rs:47:5
--> $DIR/impl-wrong-item-for-trait.rs:46:5
|
16 | fn bar(&self);
15 | fn bar(&self);
| -------------- item in trait
...
47 | type bar = u64;
46 | type bar = u64;
| ^^^^^^^^^^^^^^^ does not match trait
error[E0046]: not all trait items implemented, missing: `bar`
--> $DIR/impl-wrong-item-for-trait.rs:44:1
--> $DIR/impl-wrong-item-for-trait.rs:43:1
|
16 | fn bar(&self);
15 | fn bar(&self);
| -------------- `bar` from trait
...
44 | / impl Foo for FooTypeForMethod {
45 | | //~^ ERROR E0046
46 | | //~| NOTE missing `bar` in implementation
47 | | type bar = u64;
43 | / impl Foo for FooTypeForMethod {
44 | | //~^ ERROR E0046
45 | | //~| NOTE missing `bar` in implementation
46 | | type bar = u64;
... |
50 | | const MY_CONST: u32 = 1;
51 | | }
49 | | const MY_CONST: u32 = 1;
50 | | }
| |_^ missing `bar` in implementation
error[E0046]: not all trait items implemented, missing: `fmt`
--> $DIR/impl-wrong-item-for-trait.rs:53:1
--> $DIR/impl-wrong-item-for-trait.rs:52:1
|
53 | / impl Debug for FooTypeForMethod {
54 | | }
52 | / impl Debug for FooTypeForMethod {
53 | | }
| |_^ missing `fmt` in implementation
|
= note: `fmt` from trait: `fn(&Self, &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error>`

View file

@ -8,7 +8,6 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![feature(associated_consts)]
trait Tr {
const C: Self;

View file

@ -1,7 +1,7 @@
error[E0277]: the trait bound `u8: Tr` is not satisfied
--> $DIR/issue-29595.rs:18:17
--> $DIR/issue-29595.rs:17:17
|
18 | let a: u8 = Tr::C; //~ ERROR the trait bound `u8: Tr` is not satisfied
17 | let a: u8 = Tr::C; //~ ERROR the trait bound `u8: Tr` is not satisfied
| ^^^^^ the trait `Tr` is not implemented for `u8`
|
= note: required by `Tr::C`