Skip to content

Commit c75489e

Browse files
author
wickerwaka
committed
---
yaml --- r: 130429 b: refs/heads/try c: d3d14d6 h: refs/heads/master i: 130427: 2fe7b8c v: v3
1 parent b49c68c commit c75489e

File tree

3 files changed

+19
-2
lines changed

3 files changed

+19
-2
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
refs/heads/master: c964cb229bd342bdeb0b4506c3a6d32b03e575f6
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: 67b97ab6d2b7de9b69fd97dc171fcf8feec932ff
5-
refs/heads/try: f5776f81fd69cfe73de2806b31ef04215501fb0c
5+
refs/heads/try: d3d14d6a41141c4780b9d0ddcdfa3748036de570
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: 147ecfdd8221e4a4d4e090486829a06da1e0ca3c

branches/try/src/librustc/middle/typeck/check/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4000,7 +4000,7 @@ fn check_expr_with_unifier(fcx: &FnCtxt,
40004000
}
40014001
Some(def::DefTrait(def_id)) => {
40024002
span_err!(tcx.sess, path.span, E0159,
4003-
"`{}` is a trait not a structure",
4003+
"use of trait `{}` as a struct constructor",
40044004
pprust::path_to_string(path));
40054005
check_struct_fields_on_error(fcx,
40064006
id,
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
// Copyright 2014 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 TraitNotAStruct { }
12+
13+
fn main() {
14+
TraitNotAStruct{ value: 0 };
15+
//~^ ERROR: use of trait `TraitNotAStruct` as a struct constructor [E0159]
16+
}
17+

0 commit comments

Comments
 (0)