]> git.lizzy.rs Git - rust.git/commitdiff
fix typo for copyright year and trait capitalise
authorXuefeng Wu <xfwu@thoughtworks.com>
Sat, 16 May 2015 07:36:17 +0000 (15:36 +0800)
committerXuefeng Wu <benewu@gmail.com>
Sat, 16 May 2015 09:29:48 +0000 (17:29 +0800)
src/librustc_resolve/lib.rs
src/test/compile-fail/issue-24968.rs [new file with mode: 0644]

index 7347b59dd4cf6674823eb6971b7d75e83e1da934..b5dd2f29093259a9bb85587a736187d14ecae605 100644 (file)
@@ -2367,7 +2367,7 @@ fn resolve_type(&mut self, ty: &Ty) {
                             maybe_qself.is_none() &&
                             path.segments[0].identifier.name == self_type_name;
                         let msg = if is_invalid_self_type_name {
-                            "use of Self outside of an impl".to_string()
+                            "use of `Self` outside of an impl or trait".to_string()
                         } else {
                             format!("use of undeclared {} `{}`",
                                 kind, path_names_to_string(path, 0))
diff --git a/src/test/compile-fail/issue-24968.rs b/src/test/compile-fail/issue-24968.rs
new file mode 100644 (file)
index 0000000..1bef740
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+fn foo(_: Self) {
+    //~^ ERROR use of `Self` outside of an impl or Trait
+}
+
+fn main() {}