1. 14 5月, 2014 40 次提交
    • B
      d9906813
    • B
      auto merge of #14179 : luqmana/rust/acp, r=alexcrichton · 03053580
      bors 提交于
      It's a bit odd to single out just android when we don't do this for any other cross compiling targets. Android builds will still work since we just pass the full path for gcc and ar with `-C linker` and `-C ar`.
      
      I did add the flag to compiletest though so it can find gdb. Though, i'm pretty sure we don't run debuginfo tests on android anyways right now.
      
      [breaking-change]
      03053580
    • B
      auto merge of #14169 : alexcrichton/rust/atomics, r=sanxiyn · db5ca231
      bors 提交于
      This module is a foundation on which many other algorithms are built. When hardware support is missing, stubs are provided in libcompiler-rt.a, so this should be available on all platforms.
      db5ca231
    • A
      core: Allow using failure outside of libcore · 949443ef
      Alex Crichton 提交于
      Due to our excellent macro hygiene, this involves having a global path and a
      hidden module in libcore itself.
      949443ef
    • A
      core: Document should_not_exist's existence · 82a8a5eb
      Alex Crichton 提交于
      Explain why it should not exist, and the plan of attack for removing it.
      82a8a5eb
    • A
      core: Add a crate doc block · 57f3b6ee
      Alex Crichton 提交于
      57f3b6ee
    • A
      core: Inherit the atomics module · 325cc515
      Alex Crichton 提交于
      325cc515
    • L
      Get rid of the android-cross-path flag to rustc. · d0d800f1
      Luqman Aden 提交于
      There's no need to include this specific flag just for android. We can
      already deal with what it tries to solve by using -C linker=/path/to/cc
      and -C ar=/path/to/ar. The Makefiles for rustc already set this up when
      we're crosscompiling.
      
      I did add the flag to compiletest though so it can find gdb. Though, I'm
      pretty sure we don't run debuginfo tests on android anyways right now.
      
      [breaking-change]
      d0d800f1
    • B
      auto merge of #14178 : alexcrichton/rust/more-ignores, r=brson · 2e02f6ef
      bors 提交于
      It was thought that these failures only happened on windows, turns out they
      happen on any 32-bit machine.
      
      cc #14064
      2e02f6ef
    • B
      auto merge of #13127 : kballard/rust/read_at_least, r=alexcrichton · e4414739
      bors 提交于
      Reader.read_at_least() ensures that at least a given number of bytes
      have been read. The most common use-case for this is ensuring at least 1
      byte has been read. If the reader returns 0 enough times in a row, a new
      error kind NoProgress will be returned instead of looping infinitely.
      
      This change is necessary in order to properly support Readers that
      repeatedly return 0, either because they're broken, or because they're
      attempting to do a non-blocking read on some resource that never becomes
      available.
      
      Also add .push() and .push_at_least() methods. push() is like read() but
      the results are appended to the passed Vec.
      
      Remove Reader.fill() and Reader.push_exact() as they end up being thin
      wrappers around read_at_least() and push_at_least().
      
      [breaking-change]
      e4414739
    • K
      io: Add .read_at_least() to Reader · 972f2e58
      Kevin Ballard 提交于
      Reader.read_at_least() ensures that at least a given number of bytes
      have been read. The most common use-case for this is ensuring at least 1
      byte has been read. If the reader returns 0 enough times in a row, a new
      error kind NoProgress will be returned instead of looping infinitely.
      
      This change is necessary in order to properly support Readers that
      repeatedly return 0, either because they're broken, or because they're
      attempting to do a non-blocking read on some resource that never becomes
      available.
      
      Also add .push() and .push_at_least() methods. push() is like read() but
      the results are appended to the passed Vec.
      
      Remove Reader.fill() and Reader.push_exact() as they end up being thin
      wrappers around read_at_least() and push_at_least().
      
      [breaking-change]
      972f2e58
    • B
      auto merge of #14187 : alexcrichton/rust/rollup, r=alexcrichton · b2b383ca
      bors 提交于
      Closes #14184 (std: Move the owned module from core to std)
      Closes #14183 (Allow blocks in const expressions)
      Closes #14176 (Add tests for from_bits.)
      Closes #14175 (Replaced ~T by Box<T> in manual)
      Closes #14173 (Implements Default trait for BigInt and BigUint)
      Closes #14171 (Fix #8391)
      Closes #14159 (Clean up unicode code in libstd)
      Closes #14126 (docs: Add a not found page)
      Closes #14123 (add a line to the example to clarify semantics)
      Closes #14106 (Pretty printer improvements)
      Closes #14083 (rustllvm: Add LLVMRustArrayType)
      Closes #13957 (io: Implement process wait timeouts)
      b2b383ca
    • A
      io: Implement process wait timeouts · f09592a5
      Alex Crichton 提交于
      This implements set_timeout() for std::io::Process which will affect wait()
      operations on the process. This follows the same pattern as the rest of the
      timeouts emerging in std::io::net.
      
      The implementation was super easy for everything except libnative on unix
      (backwards from usual!), which required a good bit of signal handling. There's a
      doc comment explaining the strategy in libnative. Internally, this also required
      refactoring the "helper thread" implementation used by libnative to allow for an
      extra helper thread (not just the timer).
      
      This is a breaking change in terms of the io::Process API. It is now possible
      for wait() to fail, and subsequently wait_with_output(). These two functions now
      return IoResult<T> due to the fact that they can time out.
      
      Additionally, the wait_with_output() function has moved from taking `&mut self`
      to taking `self`. If a timeout occurs while waiting with output, the semantics
      are undesirable in almost all cases if attempting to re-wait on the process.
      Equivalent functionality can still be achieved by dealing with the output
      handles manually.
      
      [breaking-change]
      
      cc #13523
      f09592a5
    • K
      rustllvm: Add LLVMRustArrayType · 9f7caed2
      klutzy 提交于
      LLVM internally uses `uint64_t` for array size, but the corresponding
      C API (`LLVMArrayType`) uses `unsigned int` so ths value is truncated.
      Therefore rustc generates wrong type for fixed-sized large vector e.g.
      `[0 x i8]` for `[0u8, ..(1 << 32)]`.
      
      This patch adds `LLVMRustArrayType` function for `uint64_t` support.
      9f7caed2
    • A
      syntax: Improve --pretty normal slightly · 6878039c
      Alex Crichton 提交于
      When printing doc comments, always put a newline after them in a macro
      invocation to ensure that a line-doc-comment doesn't consume remaining tokens on
      the line.
      6878039c
    • A
      syntax: Preserve attributes in #[deriving] · 25ac81eb
      Alex Crichton 提交于
      Now that the #[deriving] attribute is removed, the raw_pointers_deriving lint
      was broken. This commit restores the lint by preserving lint attributes
      across #[deriving] to the implementations and using #[automatically_derived] as
      the trigger for activating the lint.
      25ac81eb
    • A
      f912005e
    • A
      syntax: Print suffixed token literals correctly · d92b9ae7
      Alex Crichton 提交于
      Previously, literals "1i" were printed as "1". This fixes the
      numeric-method-autoexport test for pretty printing.
      d92b9ae7
    • A
      test: Ignore a pretty expanded failing test · 1581fb8d
      Alex Crichton 提交于
      When expanding, an extra unsafe block is generated which is currently not
      handled well.
      1581fb8d
    • A
      test: Fix a pretty printing test · 560def15
      Alex Crichton 提交于
      The pretty printer handles inlines comments quite badly
      560def15
    • A
      syntax: Fix parsing << with closure types · ac1a2704
      Alex Crichton 提交于
      This uses the trick of replacing the << token with a < token to parse closure
      types correctly.
      
      Closes #13324
      ac1a2704
    • A
      syntax: Fix printing INT64_MIN · 042c8ae4
      Alex Crichton 提交于
      Integers are always parsed as a u64 in libsyntax, but they're stored as i64. The
      parser and pretty printer both printed an i64 instead of u64, sometimes
      introducing an extra negative sign.
      042c8ae4
    • A
      Touch up and rebase previous commits · 12375304
      Alex Crichton 提交于
      * Added `// no-pretty-expanded` to pretty-print a test, but not run it through
        the `expanded` variant.
      * Removed #[deriving] and other expanded attributes after they are expanded
      * Removed hacks around &str and &&str and friends (from both the parser and the
        pretty printer).
      * Un-ignored a bunch of tests
      12375304
    • K
      compiletest: Test `--pretty expanded` · ce8c467b
      klutzy 提交于
      After testing `--pretty normal`, it tries to run `--pretty expanded` and
      typecheck output.
      Here we don't check convergence since it really diverges: for every
      iteration, some extra lines (e.g.`extern crate std`) are inserted.
      
      Some tests are `ignore-pretty`-ed since they cause various issues
      with `--pretty expanded`.
      ce8c467b
    • K
      compiletest: Modernize typenames · 96eeda97
      klutzy 提交于
      96eeda97
    • K
      test: Add missing `#![feature(managed_boxes)]` · 0350d8e6
      klutzy 提交于
      The tests use managed boxes, but are not perfectly feature-gated because
      they use `@` inside macros. (It causes issue after `--pretty expanded`.)
      0350d8e6
    • K
      libsyntax: Workaround pprust `for` issue · bdd360bb
      klutzy 提交于
      bdd360bb
    • K
      pprust: Remove unnecessary && of `print_tt` · 90d976e8
      klutzy 提交于
      90d976e8
    • K
      pprust: Print `&&e` instead of `& &e` · 4675a87c
      klutzy 提交于
      4675a87c
    • K
      pprust: Fix asm output · cc31bb0a
      klutzy 提交于
      cc31bb0a
    • K
      pprust: Add parentheses to some Expr · 7f203b69
      klutzy 提交于
      Some `Expr` needs parentheses when printed. For example, without
      parentheses, `ExprUnary(UnNeg, ExprBinary(BiAdd, ..))` becomes
      `-lhs + rhs` which is wrong.
      
      Those cases don't appear in ordinary code (since parentheses are
      explicitly added) but they can appear in manually crafted ast by
      extensions.
      7f203b69
    • K
      rustc: Make std_inject valid for pretty-printer · 6d535b5b
      klutzy 提交于
      Inject `extern crate {std, native}` before `use` statements.
      Add `#![feature(glob)]` since `use std::prelude::*` is used.
      
      (Unfortunately `rustc --pretty expanded` does not converge,
      since `extern crate` and `use std::prelude::*` is injected at every
      iteration.)
      6d535b5b
    • Z
      add a line to the example to clarify semantics · 0004953c
      Zooko Wilcox-O'Hearn 提交于
      This is to clarify that match construct doesn't define a new variable, since I
      observed a person reading the Rust tutorial who seemed to incorrectly think
      that it did. Fixes https://github.com/mozilla/rust/issues/13571 .
      0004953c
    • R
      docs: Add a not found page · ef23fa17
      Richo Healey 提交于
      ef23fa17
    • F
      std: Rename str::Normalizations to str::Decompositions · df802a27
      Florian Zeitz 提交于
      The Normalizations iterator has been renamed to Decompositions.
      It does not currently include all forms of Unicode normalization,
      but only encompasses decompositions.
      If implemented recomposition would likely be a separate iterator
      which works on the result of this one.
      
      [breaking-change]
      df802a27
    • F
      core: Move Hangul decomposition into unicode.rs · 8c54d5bf
      Florian Zeitz 提交于
      8c54d5bf
    • F
      2f71b72a
    • F
      std, core: Generate unicode.rs using unicode.py · 74ad0236
      Florian Zeitz 提交于
      74ad0236
    • E
      check_match: get rid of superfluous clones · 21867fa1
      Edward Wang 提交于
      21867fa1
    • E
      Fix #8391 · 5bf268d0
      Edward Wang 提交于
      Closes #8391
      5bf268d0