Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Commits on Mar 4, 2015
  1. bors

    Auto merge of #22958 - laijs:option_map_for_iter_map, r=alexcrichton

    bors authored
    Signed-off-by: Lai Jiangshan <laijs@cn.fujitsu.com>
Commits on Mar 3, 2015
  1. Felix S Klock II
  2. Felix S Klock II

    Switched to Box::new in many places.

    pnkfelix authored
    Many of the modifications putting in `Box::new` calls also include a
    pointer to Issue 22405, which tracks going back to `box <expr>` if
    possible in the future.
    
    (Still tried to use `Box<_>` where it sufficed; thus some tests still
    have `box_syntax` enabled, as they use a mix of `box` and `Box::new`.)
    
    Precursor for overloaded-`box` and placement-`in`; see Issue 22181.
  3. Felix S Klock II

    inline `Box::new` always.

    pnkfelix authored
    (You shouldn't use it, but it is a semi-reasonable way to annotate
    types when necessary.)
  4. Felix S Klock II

    Add `: Box<_>` or `::Box<_>` type annotations to various places.

    pnkfelix authored
    This is the kind of change that one is expected to need to make to
    accommodate overloaded-`box`.
    
    ----
    
    Note that this is not *all* of the changes necessary to accommodate
    Issue 22181.  It is merely the subset of those cases where there was
    already a let-binding in place that made it easy to add the necesasry
    type ascription.
    
    (For unnamed intermediate `Box` values, one must go down a different
    route; `Box::new` is the option that maximizes portability, but has
    potential inefficiency depending on whether the call is inlined.)
    
    ----
    
    There is one place worth note, `run-pass/coerce-match.rs`, where I
    used an ugly form of `Box<_>` type ascription where I would have
    preferred to use `Box::new` to accommodate overloaded-`box`.  I
    deliberately did not use `Box::new` here, because that is already done
    in coerce-match-calls.rs.
    
    ----
    
    Precursor for overloaded-`box` and placement-`in`; see Issue 22181.
  5. bors

    Auto merge of #22532 - pnkfelix:arith-overflow, r=pnkfelix,eddyb

    bors authored
    Rebase and follow-through on work done by @cmr and @aatch.
    
    Implements most of rust-lang/rfcs#560. Errors encountered from the checks during building were fixed.
    
    The checks for division, remainder and bit-shifting have not been implemented yet.
    
    See also PR #20795
    
    cc @Aatch ; cc @nikomatsakis
  6. Felix S Klock II
  7. Manish Goregaokar
  8. tbu- Manish Goregaokar

    Revert incorrect `usize` -> `u32` replacements from #22510

    tbu- authored Manishearth committed
    Conflicts:
    	src/libstd/thread.rs
  9. Manish Goregaokar
  10. Manish Goregaokar

    Rollup merge of #22974 - nagisa:reintuint-std, r=alexcrichton

    Manishearth authored
     Reverts a small part of c74d49c because compilation pukes with warnings now.
  11. Manish Goregaokar

    Rollup merge of #22970 - pnkfelix:fsk-robust-backtrace-test-against-e…

    Manishearth authored
    …nv, r=alexcrichton
    
     Make `test/run-pass/backtrace.rs` more robust about own host environment
    
    Namely, I have been annoyed in the past when I have done `RUST_BACKTRACE=1 make check` only to discover (again) that such a trick causes this test to fail, because it assumes that the `RUST_BACKTRACE` environment variable is not set.
    
    Fix #22870
  12. Manish Goregaokar

    Rollup merge of #22956 - ejjeong:aarch64-linux-android, r=alexcrichton

    Manishearth authored
     aarch64-linux-android build has been broken since #22839.
    Aarch64 android has _Unwind_GetIPInfo, so re-define this only for arm32 android.
    r? @alexcrichton
  13. Manish Goregaokar

    Rollup merge of #22952 - huonw:missing-stable, r=alexcrichton

    Manishearth authored
     Unstable is the conservative choice.
    
    cc #22950.
  14. Manish Goregaokar

    Rollup merge of #22951 - huonw:weak-chuck-slice, r=alexcrichton

    Manishearth authored
     `#[derive(Clone)]` unnecessarily requires the element type to also be
    `Clone`.
  15. Manish Goregaokar

    Rollup merge of #22876 - Florob:const, r=nikomatsakis

    Manishearth authored
     This changes the type of some public constants/statics in libunicode.
    Notably some `&'static &'static [(char, char)]` have changed
    to `&'static [(char, char)]`. The regexp crate seems to be the
    sole user of these, yet this is technically a [breaking-change]
  16. Manish Goregaokar

    Rollup merge of #22990 - japaric:privATe, r=alexcrichton

    Manishearth authored
     Associated types are now treated as part of the public API by the privacy checker.
    
    If you were exposing a private type in your public API via an associated type, make that type public:
    
    ``` diff
      pub struct PublicType { .. }
    
    - struct Struct { .. }
    + pub struct Struct { .. }
    
      pub trait PublicTrait {
          type Output;
    
          fn foo(&self) -> Self::Output;
      }
    
      impl PublicTrait for PublicType {
          type Output = Struct;
    
          fn foo(&self) -> Struct {  // `Struct` is part of the public API, it must be marked as `pub`lic
              ..
          }
      }
    ```
    
    [breaking-change]
    
    ---
    
    r? @nikomatsakis
    closes #22912
  17. Manish Goregaokar

    Rollup merge of #22989 - laijs:fix_FromStr_bool_comment, r=alexcrichton

    Manishearth authored
     Fix the return type in the comments.
    
    An old commit 082bfde (\"Fallout of std::str stabilization\") removed
    the example of FromStr::from_str(), this commit adds it back. But
    the example of StrExt::parse() is still kept with an additinal note.
    
    Signed-off-by: Lai Jiangshan <laijs@cn.fujitsu.com>
  18. Manish Goregaokar

    Rollup merge of #22969 - dotdash:no_alloca_zeroed, r=huonw

    Manishearth authored
     Its only user was lvalue_scratch_datum which is called with zero=true
    anymore, so it's effectively unused.
  19. Manish Goregaokar

    Rollup merge of #22960 - huonw:static-assert, r=huonw

    Manishearth authored
     The API this exposes is a little strange (being attached to `static`s),
    so it makes sense to conservatively feature gate it. If it is highly
    popular, it is possible to reverse this gating.
  20. Manish Goregaokar

    Rollup merge of #22943 - ipetkov:lint-recursion, r=alexcrichton

    Manishearth authored
     * The lint visitor's visit_ty method did not recurse, and had a
      reference to the now closed #10894
    * The newly enabled recursion has only affected the `deprectated` lint
      which now detects uses of deprecated items in trait impls and
      function return types
    * Renamed some references to `CowString` and `CowVec` to `Cow<str>` and
      `Cow<[T]>`, respectively, which appear outside of the crate which
      defines them
    * Replaced a few instances of `InvariantType<T>` with
      `PhantomData<Cell<T>>`
    * Disabled the `deprecated` lint in several places that
      reference/implement traits on deprecated items which will get cleaned
      up in the future
    * Unfortunately, this means that if a library declares
      `#![deny(deprecated)]` and marks anything as deprecated, it will have
      to disable the lint for any uses of said item, e.g. any impl the now
      deprecated item
    
    For any library that denies deprecated items but has deprecated items
    of its own, this is a [breaking-change]
    
    I had originally intended for the lint to ignore uses of deprecated items that are declared in the same crate, but this goes against some previous test cases that expect the lint to capture *all* uses of deprecated items, so I maintained the previous approach to avoid changing the expected behavior of the lint.
    
    Tested locally on OS X, so hopefully there aren't any deprecated item uses behind a `cfg` that I may have missed.
  21. Manish Goregaokar

    Rollup merge of #22916 - rprichard:fmt-num-cleanup, r=alexcrichton

    Manishearth authored
      * Make num::UpperHex private.  I was unable to determine why this struct
       is public.  The num module itself is not public, and the UpperHex struct
       is not referenced anywhere in the core::fmt module.  (Only the UpperHex
       trait is reference.)  num::LowerHex is not public.
    
     * Remove the suffix parameters from the macros that generate integral
       display traits.
    
       The code to print the Debug::fmt suffixes was removed when Show was
       renamed to Debug.  It was an intentional change.  From RFC 0565:
    
        * Focus on the *runtime* aspects of a type; repeating information such
          as suffixes for integer literals is not generally useful since that
          data is readily available from the type definition.
    
     * Because Show was renamed to Debug, rename show! to debug!.
  22. Manish Goregaokar Felix S Klock II

    Fix backtrace tests for Linux

    Manishearth authored pnkfelix committed
  23. Felix S Klock II
  24. Felix S Klock II
  25. Felix S Klock II

    Fix span typo in the arithmetic overflow for array length reporting.

    pnkfelix authored
    Added pair of regression tests that I should have made when I thought
    of doing this in the first place.
  26. Felix S Klock II
  27. Felix S Klock II

    Switch to eval_const_expr_partial in `trans::consts`.

    pnkfelix authored
    However, I left the ICEs rather than switching to nicer error
    reporting there; these cases *should* be detected prior to hitting
    trans, and thus ICE'ing here is appropriate.
    
    (So why switch to `eval_const_expr_partial`? Because I want to try to
    eliminate all uses of `eval_const_expr` entirely.)
  28. Felix S Klock II
  29. Felix S Klock II

    Address arith-overflow and error-handling in `const_eval.rs`.

    pnkfelix authored
     1. Detect and report arithmetic overflow during const-expr eval.
    
     2. Instead `eval_const_expr_partial` returning `Err(String)`, it now
        has a dedicated enum of different cases. The main benefit of this
        is the ability to pass along an interpretable payload, namely the
        two inputs that caused an overlfow.
    
    I attempted to minimize fallout to error output in tests, but some was
    unavoidable. Those changes are in a follow-on commit.
  30. Felix S Klock II

    Avoid fatal errors in astconv; just err and return `ty_err` instead.

    pnkfelix authored
    This allows computation to proceed and find further errors.
    
    (However, this is also annoying at times when the subsequent errors
    are just reporting that a ty_err occurred. I have thoughts on ways to
    fix this that I will experiment with separately.)
  31. Felix S Klock II

    Catch arith-overflow explicitly during `rustc::middle::const_eval`.

    pnkfelix authored
    This only replaces the conditional arith-overflow asserts with
    unconditional errors from the guts of const-eval; it does *not*
    attempt to sanely handle such errors e.g. with a nice error message
    from `rustc`.  So the same test that led me to add this commit are
    still failing, and must be addressed.
  32. Felix S Klock II
  33. Felix S Klock II

    `core::iter`: fix bug uncovered by arith-overflow.

    pnkfelix authored
    (The bug was in `impl RandomAccessIterator for Rev`; it may or may not
    have been innocuous, depending on what guarantees one has about the
    behavior of `idx` for the underlying iterator.)
  34. Felix S Klock II

    Accommodate arith-overflow in `rand` and `std::rand`.

    pnkfelix authored
    Regarding the `rand` changes: It is unfortunate that Wrapping(T) does
    not support the `+=` operator.  We may want to try to fix that before
    1.0 to make porting code like this palatable.
    
    Regarding `std::rand`, just arith-overflow in first example from
    `std::rand::random()` doc.
Something went wrong with that request. Please try again.