Skip to content

Commit 78200db

Browse files
committed
---
yaml --- r: 236153 b: refs/heads/stable c: a09bce1 h: refs/heads/master i: 236151: 39edc76 v: v3
1 parent 33ec2db commit 78200db

File tree

7 files changed

+31
-2
lines changed

7 files changed

+31
-2
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ refs/heads/tmp: afae2ff723393b3ab4ccffef6ac7c6d1809e2da0
2929
refs/tags/1.0.0-alpha.2: 4c705f6bc559886632d3871b04f58aab093bfa2f
3030
refs/tags/homu-tmp: f859507de8c410b648d934d8f5ec1c52daac971d
3131
refs/tags/1.0.0-beta: 8cbb92b53468ee2b0c2d3eeb8567005953d40828
32-
refs/heads/stable: 1c8194c4777ce1291d78066f2c0d9052b0d2a681
32+
refs/heads/stable: a09bce1047ab5714e56891edee0feab8813ba99e
3333
refs/tags/1.0.0: 55bd4f8ff2b323f317ae89e254ce87162d52a375
3434
refs/tags/1.1.0: bc3c16f09287e5545c1d3f76b7abd54f2eca868b
3535
refs/tags/1.2.0: f557861f822c34f07270347b94b5280de20a597e

branches/stable/src/libcore/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@
6565
#![allow(raw_pointer_derive)]
6666
#![deny(missing_docs)]
6767

68+
#![feature(associated_type_defaults)]
6869
#![feature(intrinsics)]
6970
#![feature(lang_items)]
7071
#![feature(on_unimplemented)]

branches/stable/src/libsyntax/feature_gate.rs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,10 @@ const KNOWN_FEATURES: &'static [(&'static str, &'static str, Status)] = &[
165165
("static_recursion", "1.3.0", Active),
166166

167167
// Allows default type parameters to influence type inference.
168-
("default_type_parameter_fallback", "1.3.0", Active)
168+
("default_type_parameter_fallback", "1.3.0", Active),
169+
170+
// Allows associated type defaults
171+
("associated_type_defaults", "1.2.0", Active),
169172
];
170173
// (changing above list without updating src/doc/reference.md makes @cmr sad)
171174

@@ -763,6 +766,10 @@ impl<'a, 'v> Visitor<'v> for PostExpansionVisitor<'a> {
763766
self.gate_feature("const_fn", ti.span, "const fn is unstable");
764767
}
765768
}
769+
ast::TypeTraitItem(_, Some(_)) => {
770+
self.gate_feature("associated_type_defaults", ti.span,
771+
"associated type defaults are unstable");
772+
}
766773
_ => {}
767774
}
768775
visit::walk_trait_item(self, ti);

branches/stable/src/test/auxiliary/xcrate_associated_type_defaults.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11+
#![feature(associated_type_defaults)]
12+
1113
pub trait Foo {
1214
type Input = usize;
1315
fn bar(&self, _: Self::Input) {}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
// Copyright 2015 The Rust Project Developers. See the COPYRIGHT
2+
// file at the top-level directory of this distribution and at
3+
// http://rust-lang.org/COPYRIGHT.
4+
//
5+
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6+
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7+
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8+
// option. This file may not be copied, modified, or distributed
9+
// except according to those terms.
10+
11+
trait Foo {
12+
type Bar = u8; //~ ERROR associated type defaults are unstable
13+
}
14+
15+
fn main() {}

branches/stable/src/test/run-pass/default-associated-types.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11+
#![feature(associated_type_defaults)]
12+
1113
trait Foo<T> {
1214
type Out = T;
1315
fn foo(&self) -> Self::Out;

branches/stable/src/test/run-pass/issue-25339.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11+
#![feature(associated_type_defaults)]
12+
1113
use std::marker::PhantomData;
1214

1315
pub trait Routing<I> {

0 commit comments

Comments
 (0)