diff options
| author | bors <bors@rust-lang.org> | 2015-07-04 11:10:16 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2015-07-04 11:10:16 +0000 |
| commit | 638ffecbd72bfa6e3f2eb4a74b3e7650cc5d2206 (patch) | |
| tree | 282bc78a385126bec9081dce88c3269301b6e013 /src/test | |
| parent | 0dc08240ea755679e3daec3832a04b22a8fc90bf (diff) | |
| parent | 6b27005f2f8b20834838828588233b877a29d509 (diff) | |
| download | rust-638ffecbd72bfa6e3f2eb4a74b3e7650cc5d2206.tar.gz rust-638ffecbd72bfa6e3f2eb4a74b3e7650cc5d2206.zip | |
Auto merge of #26728 - arielb1:assoc-maybe, r=nrc
r? @nrc
Diffstat (limited to 'src/test')
| -rw-r--r-- | src/test/compile-fail/associated-types-overridden-default.rs | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/src/test/compile-fail/associated-types-overridden-default.rs b/src/test/compile-fail/associated-types-overridden-default.rs new file mode 100644 index 00000000000..eb519e79006 --- /dev/null +++ b/src/test/compile-fail/associated-types-overridden-default.rs @@ -0,0 +1,25 @@ +// 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. + +#![feature(associated_consts)] + +pub trait Tr { + type Assoc = u8; + type Assoc2 = Self::Assoc; + const C: u8 = 11; + fn foo(&self) {} +} + +impl Tr for () { + type Assoc = (); + //~^ ERROR need to be reimplemented as `Assoc` was overridden: `Assoc2`, `C`, `foo` +} + +fn main() {} |
