auto merge of #10475 : astrieanna/rust/issue8763, r=alexcrichton

Issue #8763 is about improving a particular error message.

* added case & better error message for "impl trait for module"
* added compile-fail test trait-impl-for-module.rs
* updated copyright dates
* revised compile-fail test trait-or-new-type-instead
   (the error message for the modified test is still unclear, but that's a different bug https://github.com/mozilla/rust/issues/8767)
This commit is contained in:
bors 2013-11-24 10:17:03 -08:00
commit b3ff24adaa
3 changed files with 33 additions and 5 deletions

View file

@ -0,0 +1,21 @@
// Copyright 2013 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.
mod a {
}
trait A {
}
impl A for a { //~ERROR found module name used as a type
}
fn main() {
}

View file

@ -1,4 +1,4 @@
// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
// Copyright 2012-2013 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
@ -8,8 +8,8 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
// error-pattern: found value name used as a type
impl<T> Option<T> {
// FIXME(#8767) bad error message; Option is not a module
impl<T> Option<T> { //~ERROR found module name used as a type
pub fn foo(&self) { }
}