1. 05 7月, 2014 2 次提交
  2. 04 7月, 2014 37 次提交
    • B
      auto merge of #15051 : retep998/rust/master, r=alexcrichton · c9e2ca0d
      bors 提交于
      This implementation does have the minor issue of not handling things correctly when a codepoint is split across multiple writes or reads, but its better than not having unicode support at all.
      
      Adds a Windows specific struct `WindowsTTY` in `libnative` and make `tty_open` create that struct on Windows. Adds needed functions and constants to `c_win32.rs`.
      
      Libuv still needs to be updated before #15028 can be closed.
      c9e2ca0d
    • P
      windows: Unicode console support. · a34fd5a1
      Peter Atashian 提交于
      Adds a WindowsTTY for libnative that converts between UTF-8 and UTF-16.
      Signed-off-by: NPeter Atashian <retep998@gmail.com>
      a34fd5a1
    • B
      auto merge of #15403 : vhbit/rust/ios-llvm-fixme, r=pcwalton · 04ac2b08
      bors 提交于
      It was required to get iOS compilable but since
      that time a couple of changes were introduced
      which cause the same bug to re-appear and broke 
      build anyway. Fixing all of them doesn’t look a 
      viable alternative to me as it will pollute the 
      code too much.
      
      So it should be fixed from LLVM side and I hope 
      LLVM will upstream corresponding changes in a 
      month.
      
      Meanwhile, who wants to play with Rust on iOS is 
      better to use a fork which uses patched LLVM:
      https://github.com/vhbit/rust/tree/ios . It may 
      lag behind master a bit, but it is Travis-checked 
      to compile successfully.
      04ac2b08
    • B
      auto merge of #15388 : jakub-/rust/issue-12285, r=pcwalton · c0b76abf
      bors 提交于
      Unit-like struct patterns are irrefutable, no need for a branch.
      
      And some cleanup while I'm at it.
      c0b76abf
    • B
      auto merge of #15387 : huonw/rust/toc-space, r=alexcrichton · 36d7d746
      bors 提交于
      A margin for the top level list was leaking into nested ones.
      
      before; after:
      
      ![screenshot from 2014-07-04 08 18 32](https://cloud.githubusercontent.com/assets/1203825/3476459/0b7f8ea8-0300-11e4-8b67-0c47b7931d56.png)
      36d7d746
    • B
      auto merge of #15378 : mdinger/rust/Issue_15333, r=alexcrichton · 5012b858
      bors 提交于
      Here's the issue: https://github.com/rust-lang/rust/issues/15333
      
      Tested it. It works. FYI, in case anyone doesn't know: keyboard shortcut `'` restricts text search to only links on Firefox allowing this to be checked easily.
      5012b858
    • P
      librustc: Remove the `&LIFETIME EXPR` production from the language. · 29ec2506
      Patrick Walton 提交于
      This was parsed by the parser but completely ignored; not even stored in
      the AST!
      
      This breaks code that looks like:
      
          static X: &'static [u8] = &'static [1, 2, 3];
      
      Change this code to the shorter:
      
          static X: &'static [u8] = &[1, 2, 3];
      
      Closes #15312.
      
      [breaking-change]
      29ec2506
    • V
      Removed LLVM bug workaround · b86440f8
      Valerii Hiora 提交于
      It was required to get iOS compilable but since
      that time a couple of changes were introduced
      which cause the same bug to re-appear and broke 
      build anyway. Fixing all of them doesn’t look a 
      viable alternative to me as it will pollute the 
      code too much.
      
      So it should be fixed from LLVM side and I hope 
      LLVM will upstream corresponding changes in a 
      month.
      
      Meanwhile, who wants to play with Rust on iOS is 
      better to use a fork which uses patched LLVM:
      https://github.com/vhbit/rust/tree/ios . It may 
      lag behind master a bit, but it is Travis-checked 
      to compile successfully.
      b86440f8
    • V
      Fixed iOS build after *T removal · 2bd826ca
      Valerii Hiora 提交于
      2bd826ca
    • B
      auto merge of #15369 : omasanori/rust/asctime, r=alexcrichton · 9766b493
      bors 提交于
      In C, `ctime(t)` is equivalent to `asctime(localtime(t))`, so the result should depend on the local timezone. Current `ctime` is compatible with `asctime` in C, not `ctime`.
      
      This commit renames `ctime` to `asctime` and adds `ctime` which converts the time to the local timezone before formatting it.
      
      This commit also fixes the documentation of them. Current documentation of `ctime` says it returns "a string of the current time." However, it actually returns a string of the time represented as `self`, not the time when it is called.
      9766b493
    • B
      auto merge of #15356 : pcwalton/rust/wrong-implementor, r=alexcrichton · 1bff1ff8
      bors 提交于
      parameters.
      
      This can break code that mistakenly used type parameters in place of
      `Self`. For example, this will break:
      
          trait Foo {
              fn bar<X>(u: X) -> Self {
                  u
              }
          }
      
      Change this code to not contain a type error. For example:
      
          trait Foo {
              fn bar<X>(_: X) -> Self {
                  self
              }
          }
      
      Closes #15172.
      
      [breaking-change]
      
      r? @alexcrichton
      1bff1ff8
    • B
      auto merge of #15321 : huonw/rust/nil-prim, r=alexcrichton · d623a8bf
      bors 提交于
      This adds a primitive page for () like http://doc.rust-lang.org/master/std/uint/primitive.uint.html .
      
      I would prefer the modules to be `std::tuple::unit`, but rustdoc only searches at the top level (filed as #15320).
      d623a8bf
    • B
      5b11610c
    • H
      core: add a primitive page for `()`. · 7c92735f
      Huon Wilson 提交于
      7c92735f
    • J
      Fix #12285 · c2c27faa
      Jakub Wieczorek 提交于
      Unit-like struct patterns are irrefutable, no need for a branch.
      c2c27faa
    • H
      doc: reduce spacing of table of contents. · fb258f22
      Huon Wilson 提交于
      A margin for the top level list was leaking into nested ones.
      fb258f22
    • B
      auto merge of #15377 : alexcrichton/rust/rollup, r=alexcrichton · 5d5c2064
      bors 提交于
      Closes #15276 (Guide: if)
      Closes #15280 (std::os - Add join_paths, make setenv non-utf8 capable)
      Closes #15314 (Guide: functions)
      Closes #15327 (Simplify PatIdent to contain an Ident rather than a Path)
      Closes #15340 (Guide: add mutable binding section)
      Closes #15342 (Fix ICE with nested macro_rules!-style macros)
      Closes #15350 (Remove duplicated slash in install script path)
      Closes #15351 (correct a few spelling mistakes in the tutorial)
      Closes #15352 (librustc: Have the kind checker check sub-bounds in trait casts.)
      Closes #15359 (Fix spelling errors.)
      Closes #15361 (Rename set_broadast() to set_broadcast().)
      Closes #15366 (Simplify creating a parser from a token tree)
      Closes #15367 (Add examples for StrVector methods)
      Closes #15372 (Vec::grow should use reserve_additional, Vec::reserve should check against capacity)
      Closes #15373 (Fix minor issues in the documentation of libtime.)
      5d5c2064
    • B
      auto merge of #15076 : luqmana/rust/naim, r=pcwalton · dd812ccb
      bors 提交于
      ```Rust
      struct With {
          x: int,
          f: NoCopy
      }
      
      #[no_mangle]
      fn bar() {
          let mine = With { x: 3, f: NoCopy };
          match mine {
              c => {
                  foo(c);
              }
          }
      }
      
      #[no_mangle]
      fn foo(_: With) {}
      ```
      
      Before:
      ```LLVM
      define internal void @bar() unnamed_addr #1 {
      entry-block:
        %mine = alloca %"struct.With<[]>"
        %__llmatch = alloca %"struct.With<[]>"*
        %c = alloca %"struct.With<[]>"
        %0 = getelementptr inbounds %"struct.With<[]>"* %mine, i32 0, i32 0
        store i64 3, i64* %0
        %1 = getelementptr inbounds %"struct.With<[]>"* %mine, i32 0, i32 1
        store %"struct.With<[]>"* %mine, %"struct.With<[]>"** %__llmatch
        br label %case_body
      
      case_body:                                        ; preds = %entry-block
        %2 = load %"struct.With<[]>"** %__llmatch
        %3 = bitcast %"struct.With<[]>"* %2 to i8*
        %4 = bitcast %"struct.With<[]>"* %c to i8*
        call void @llvm.memcpy.p0i8.p0i8.i64(i8* %4, i8* %3, i64 8, i32 8, i1 false)
        %5 = load %"struct.With<[]>"* %c
        call void @foo(%"struct.With<[]>" %5)
        br label %join
      
      join:                                             ; preds = %case_body
        ret void
      }
      ```
      
      After:
      ```LLVM
      define internal void @bar() unnamed_addr #1 {
      entry-block:
        %mine = alloca %"struct.With<[]>"
        %c = alloca %"struct.With<[]>"*
        %0 = getelementptr inbounds %"struct.With<[]>"* %mine, i32 0, i32 0
        store i64 3, i64* %0
        %1 = getelementptr inbounds %"struct.With<[]>"* %mine, i32 0, i32 1
        store %"struct.With<[]>"* %mine, %"struct.With<[]>"** %c
        br label %case_body
      
      case_body:                                        ; preds = %entry-block
        %2 = load %"struct.With<[]>"** %c
        %3 = load %"struct.With<[]>"* %2
        call void @foo(%"struct.With<[]>" %3)
        br label %join
      
      join:                                             ; preds = %case_body
        ret void
      }
      ```
      
      r? @pcwalton
      dd812ccb
    • A
      Test fixes from the rollup · 9bd64799
      Alex Crichton 提交于
      9bd64799
    • O
      Fix minor issues in the documentation of libtime. · 0c5b6272
      OGINO Masanori 提交于
      - When the timezone is UTC, the "zone" field of the RFC 822 format is
        "GMT" (or "UT"), not "UTC."
      
      - Although the name of `rfc3999` refers to RFC 3999, the documentation
        of it refers only to ISO 8601. This commit adds a description of the
        relation between ISO 8601 and RFC 3999.
      Signed-off-by: NOGINO Masanori <masanori.ogino@gmail.com>
      0c5b6272
    • E
      451b7495
    • E
    • J
      Add examples for StrVector methods · 7db691e0
      Jason Thompson 提交于
      - examples for connect and concat
      - also fixed extra word in existing docs
      7db691e0
    • P
      Simplify creating a parser from a token tree · 2f355b79
      Piotr Jawniak 提交于
      Closes #15306
      2f355b79
    • J
      Rename set_broadast() to set_broadcast(). · 4a6fcc51
      Joseph Crail 提交于
      4a6fcc51
    • J
      Fix spelling errors. · e3fa23bc
      Joseph Crail 提交于
      e3fa23bc
    • P
      librustc: Have the kind checker check sub-bounds in trait casts. · 8297edd5
      Patrick Walton 提交于
      This can break code that looked like:
      
          struct S<T> {
              val: T,
          }
          trait Gettable<T> {
              ...
          }
          impl<T: Copy> Gettable<T> for S<T> {
              ...
          }
          let t: Box<S<String>> = box S {
              val: "one".to_string(),
          };
          let a = t as Box<Gettable<String>>;
          //                        ^ note no `Copy` bound
      
      Change this code to:
      
          impl<T> Gettable<T> for S<T> {
          //   ^ remove `Copy` bound
              ...
          }
      
      Closes #14061.
      
      [breaking-change]
      8297edd5
    • N
      correct a few spelling mistakes in the tutorial · 704f11d3
      Nathan Froyd 提交于
      704f11d3
    • R
      remove duplicated slash in install script path · 5d360050
      Ruud van Asseldonk 提交于
      5d360050
    • K
      Fix ICE with nested macro_rules!-style macros · b81905ee
      Kevin Ballard 提交于
      Fixes #10536.
      b81905ee
    • S
      Guide: add mutable binding section · 9868b65b
      Steve Klabnik 提交于
      Fixes #15334.
      9868b65b
    • J
      Simplify PatIdent to contain an Ident rather than a Path · e38cb972
      John Clements 提交于
      Rationale: for what appear to be historical reasons only, the PatIdent contains
      a Path rather than an Ident.  This means that there are many places in the code
      where an ident is artificially promoted to a path, and---much more problematically---
      a bunch of elements from a path are simply thrown away, which seems like an invitation
      to some really nasty bugs.
      
      This commit replaces the Path in a PatIdent with a SpannedIdent, which just contains an ident
      and a span.
      e38cb972
    • P
      cff79ab5
    • S
      Guide: functions · faf5d926
      Steve Klabnik 提交于
      Just a few words about functions and defining them.
      faf5d926
    • A
      Add os::join_paths, make setenv non-utf8 capable · 8877b81f
      Aaron Turon 提交于
      This commit changes `os` in three ways:
      
      * It adds a `join_paths` function that is the converse to `split_paths`,
        easing manipulation of the `PATH` environment variable according to
        platform conventions.
      
      * **Breaking change**: It changes `split_paths` to no longer drop empty paths, since they are
        meaningful to some shells (where they are synonymous with the current
        working directory).
      
      * It changes `setenv` to take a `BytesContainer` rather than a `&str`
        value, since environment variables may have non-utf8 values on some
        platforms. Since `&str` is a `BytesContainer`, this is *not* a
        breaking change.
      
      Along the way, it also refactors the `split_paths` function so that
      `cfg` switches are applied internally (and the function header is given
      only once). This fixes a bug: the doc comment had an example for only
      one platform.
      
      [breaking-change]
      8877b81f
    • S
      Guide: if · 748b9477
      Steve Klabnik 提交于
      748b9477
    • B
      auto merge of #15370 : alexcrichton/rust/fix-cargo, r=pnkfelix · eda75bcf
      bors 提交于
      This was causing lots of ICEs in cargo. I sadly wasn't ever able to reduce the
      test case down, but I presume that's because it has to do with node id
      collisions which are pretty difficult to turn up...
      eda75bcf
  3. 03 7月, 2014 1 次提交