]> git.lizzy.rs Git - rust.git/commitdiff
Auto merge of #26232 - eefriedman:rename-sty, r=nrc
authorbors <bors@rust-lang.org>
Fri, 12 Jun 2015 19:57:27 +0000 (19:57 +0000)
committerbors <bors@rust-lang.org>
Fri, 12 Jun 2015 19:57:27 +0000 (19:57 +0000)
Use camel-case naming, and use names which actually make sense in modern Rust.

.travis.yml
src/doc/complement-lang-faq.md
src/doc/reference.md
src/doc/trpl/hello-cargo.md
src/doc/trpl/installing-rust.md
src/librustc_typeck/check/mod.rs
src/librustc_typeck/check/wf.rs
src/test/compile-fail/trait-bounds-on-structs-and-enums.rs

index 03e38f4e0c1ac03ac0bf020f4292bb22132b2de5..29d287bfb48493febe59f2e46ec450c285509ff2 100644 (file)
@@ -16,6 +16,11 @@ before_script:
 script:
   - make tidy
 
+# Real testing happens on http://buildbot.rust-lang.org/
+#
+# See https://github.com/rust-lang/rust-buildbot
+#     CONTRIBUTING.md#pull-requests
+
 notifications:
   email: false
 
index 7a3d1940858625772e3b7f9e7ad002ca8c4c63b2..8b9467589c6541da4a0b34aceaba02c9cffb69ab 100644 (file)
@@ -37,6 +37,7 @@ Yes. For example (incomplete):
 * [wit.ai](https://github.com/wit-ai/witd)
 * [Codius](https://codius.org/blog/codius-rust/)
 * [MaidSafe](http://maidsafe.net/)
+* [Terminal.com](https://terminal.com)
 
 ## Does it run on Windows?
 
index 2a0f7b659d168cfd7da5267ef4826fb6ff266a65..c19aec78de2e45b0bd2bef97afd5b3af428c05a6 100644 (file)
@@ -1111,7 +1111,7 @@ extern fn new_i32() -> i32 { 0 }
 extern "stdcall" fn new_i32_stdcall() -> i32 { 0 }
 ```
 
-Unlike normal functions, extern fns have an `extern "ABI" fn()`. This is the
+Unlike normal functions, extern fns have type `extern "ABI" fn()`. This is the
 same type as the functions declared in an extern block.
 
 ```
index 9920e8e00685bf43640d8906bac7d3d218561552..8e479977887d7637d94c370ad3ea81cbb8f9711b 100644 (file)
@@ -145,8 +145,7 @@ To start a new project with Cargo, use `cargo new`:
 $ cargo new hello_world --bin
 ```
 
-We’re passing `--bin` because we're making a binary program: if we were making
-a library, we'd leave it off.
+We’re passing `--bin` because our goal is to get straight to making an executable application, as opposed to a library. Executables are often called ‘binaries.’ (as in `/usr/bin`, if you’re on a Unix system)
 
 Let's check out what Cargo has generated for us:
 
index 73bbe77fe2685bc3d90b36f378179759c8d28a24..44eafd5192945fd457cb99d132e9d6107c324237 100644 (file)
@@ -24,11 +24,9 @@ $ sh rustup.sh
 
 [insecurity]: http://curlpipesh.tumblr.com
 
-If you're on Windows, please download either the [32-bit installer][win32] or
-the [64-bit installer][win64] and run it.
+If you're on Windows, please download the appropriate [installer][install-page].
 
-[win32]: https://static.rust-lang.org/dist/rust-1.0.0-i686-pc-windows-gnu.msi
-[win64]: https://static.rust-lang.org/dist/rust-1.0.0-x86_64-pc-windows-gnu.msi
+[install-page]: http://www.rust-lang.org/install.html
 
 ## Uninstalling
 
@@ -51,7 +49,6 @@ documentation on [building Rust from Source][from-source], or [the official
 binary downloads][install-page].
 
 [from-source]: https://github.com/rust-lang/rust#building-from-source
-[install-page]: http://www.rust-lang.org/install.html
 
 Oh, we should also mention the officially supported platforms:
 
@@ -75,10 +72,11 @@ If you've got Rust installed, you can open up a shell, and type this:
 $ rustc --version
 ```
 
-You should see the version number, commit hash, commit date and build date:
+You should see the version number, commit hash, and commit date. If you just
+installed version 1.0.0, you should see:
 
 ```bash
-rustc 1.0.0 (a59de37e9 2015-05-13) (built 2015-05-14)
+rustc 1.0.0 (a59de37e9 2015-05-13)
 ```
 
 If you did, Rust has been installed successfully! Congrats!
index 8493715aa4bc3733cf9a2f25edb77f84d9537dfb..9cab4a477321745abaf6f6d5cec37f0e9dad3077 100644 (file)
@@ -1626,10 +1626,9 @@ pub fn to_ty(&self, ast_t: &ast::Ty) -> Ty<'tcx> {
         let t = ast_ty_to_ty(self, self, ast_t);
 
         let mut bounds_checker = wf::BoundsChecker::new(self,
-                                                        ast_t.span,
                                                         self.body_id,
                                                         None);
-        bounds_checker.check_ty(t);
+        bounds_checker.check_ty(t, ast_t.span);
 
         t
     }
index cf324ef97e7fe39150bd16f42ea68ab0ecec1e6f..779f48d1e1b9e0109ed627fd4e67ee4053f5884b 100644 (file)
@@ -23,7 +23,7 @@
 use std::collections::HashSet;
 use syntax::ast;
 use syntax::ast_util::local_def;
-use syntax::codemap::Span;
+use syntax::codemap::{DUMMY_SP, Span};
 use syntax::parse::token::{self, special_idents};
 use syntax::visit;
 use syntax::visit::Visitor;
@@ -162,15 +162,14 @@ fn check_type_defn<F>(&mut self, item: &ast::Item, mut lookup_fields: F) where
         self.with_fcx(item, |this, fcx| {
             let variants = lookup_fields(fcx);
             let mut bounds_checker = BoundsChecker::new(fcx,
-                                                        item.span,
                                                         item.id,
                                                         Some(&mut this.cache));
             debug!("check_type_defn at bounds_checker.scope: {:?}", bounds_checker.scope);
 
-             for variant in &variants {
+            for variant in &variants {
                 for field in &variant.fields {
                     // Regions are checked below.
-                    bounds_checker.check_traits_in_ty(field.ty);
+                    bounds_checker.check_traits_in_ty(field.ty, field.span);
                 }
 
                 // For DST, all intermediate types must be sized.
@@ -199,7 +198,6 @@ fn check_item_type(&mut self,
     {
         self.with_fcx(item, |this, fcx| {
             let mut bounds_checker = BoundsChecker::new(fcx,
-                                                        item.span,
                                                         item.id,
                                                         Some(&mut this.cache));
             debug!("check_item_type at bounds_checker.scope: {:?}", bounds_checker.scope);
@@ -209,7 +207,7 @@ fn check_item_type(&mut self,
                                                       &fcx.inh.param_env.free_substs,
                                                       &type_scheme.ty);
 
-            bounds_checker.check_traits_in_ty(item_ty);
+            bounds_checker.check_traits_in_ty(item_ty, item.span);
         });
     }
 
@@ -218,7 +216,6 @@ fn check_impl(&mut self,
     {
         self.with_fcx(item, |this, fcx| {
             let mut bounds_checker = BoundsChecker::new(fcx,
-                                                        item.span,
                                                         item.id,
                                                         Some(&mut this.cache));
             debug!("check_impl at bounds_checker.scope: {:?}", bounds_checker.scope);
@@ -231,7 +228,7 @@ fn check_impl(&mut self,
                                                       &fcx.inh.param_env.free_substs,
                                                       &self_ty);
 
-            bounds_checker.check_traits_in_ty(self_ty);
+            bounds_checker.check_traits_in_ty(self_ty, item.span);
 
             // Similarly, obtain an "inside" reference to the trait
             // that the impl implements.
@@ -252,7 +249,7 @@ fn check_impl(&mut self,
             // trait reference. Instead, this is done at the impl site.
             // Arguably this is wrong and we should treat the trait-reference
             // the same way as we treat the self-type.
-            bounds_checker.check_trait_ref(&trait_ref);
+            bounds_checker.check_trait_ref(&trait_ref, item.span);
 
             let cause =
                 traits::ObligationCause::new(
@@ -483,11 +480,10 @@ pub struct BoundsChecker<'cx,'tcx:'cx> {
 
 impl<'cx,'tcx> BoundsChecker<'cx,'tcx> {
     pub fn new(fcx: &'cx FnCtxt<'cx,'tcx>,
-               span: Span,
                scope: ast::NodeId,
                cache: Option<&'cx mut HashSet<Ty<'tcx>>>)
                -> BoundsChecker<'cx,'tcx> {
-        BoundsChecker { fcx: fcx, span: span, scope: scope,
+        BoundsChecker { fcx: fcx, span: DUMMY_SP, scope: scope,
                         cache: cache, binding_count: 0 }
     }
 
@@ -500,30 +496,32 @@ pub fn new(fcx: &'cx FnCtxt<'cx,'tcx>,
     ///
     /// Note that it does not (currently, at least) check that `A : Copy` (that check is delegated
     /// to the point where impl `A : Trait<B>` is implemented).
-    pub fn check_trait_ref(&mut self, trait_ref: &ty::TraitRef<'tcx>) {
+    pub fn check_trait_ref(&mut self, trait_ref: &ty::TraitRef<'tcx>, span: Span) {
         let trait_predicates = ty::lookup_predicates(self.fcx.tcx(), trait_ref.def_id);
 
-        let bounds = self.fcx.instantiate_bounds(self.span,
+        let bounds = self.fcx.instantiate_bounds(span,
                                                  trait_ref.substs,
                                                  &trait_predicates);
 
         self.fcx.add_obligations_for_parameters(
             traits::ObligationCause::new(
-                self.span,
+                span,
                 self.fcx.body_id,
                 traits::ItemObligation(trait_ref.def_id)),
             &bounds);
 
         for &ty in &trait_ref.substs.types {
-            self.check_traits_in_ty(ty);
+            self.check_traits_in_ty(ty, span);
         }
     }
 
-    pub fn check_ty(&mut self, ty: Ty<'tcx>) {
+    pub fn check_ty(&mut self, ty: Ty<'tcx>, span: Span) {
+        self.span = span;
         ty.fold_with(self);
     }
 
-    fn check_traits_in_ty(&mut self, ty: Ty<'tcx>) {
+    fn check_traits_in_ty(&mut self, ty: Ty<'tcx>, span: Span) {
+        self.span = span;
         // When checking types outside of a type def'n, we ignore
         // region obligations. See discussion below in fold_ty().
         self.binding_count += 1;
index c18c5b386e8b21816be1abd6ff4e38818ea86978..c13f7346b1178c6c0ad8d73c147397e168b9738f 100644 (file)
@@ -32,23 +32,27 @@ fn uhoh() {}
 }
 
 struct Baz {
-//~^ ERROR not implemented
-    a: Foo<isize>,
+    a: Foo<isize>, //~ ERROR not implemented
 }
 
 enum Boo {
-//~^ ERROR not implemented
-    Quux(Bar<usize>),
+    Quux(Bar<usize>), //~ ERROR not implemented
 }
 
 struct Badness<U> {
-//~^ ERROR not implemented
-    b: Foo<U>,
+    b: Foo<U>, //~ ERROR not implemented
 }
 
 enum MoreBadness<V> {
-//~^ ERROR not implemented
-    EvenMoreBadness(Bar<V>),
+    EvenMoreBadness(Bar<V>), //~ ERROR not implemented
+}
+
+struct TupleLike(
+    Foo<i32>, //~ ERROR not implemented
+);
+
+enum Enum {
+    DictionaryLike { field: Bar<i32> }, //~ ERROR not implemented
 }
 
 trait PolyTrait<T>