Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Commits on Nov 25, 2013
  1. @bors

    auto merge of #10600 : ktt3ja/rust/add-doc, r=huonw

    bors authored
    I received a lot of helpful explanations when I was going through rustc's middle-end code. I document some of them here.
Commits on Nov 24, 2013
  1. @ktt3ja
  2. @bors

    auto merge of #10475 : astrieanna/rust/issue8763, r=alexcrichton

    bors authored
    Issue #8763 is about improving a particular error message.
    
    * added case & better error message for "impl trait for module"
    * added compile-fail test trait-impl-for-module.rs
    * updated copyright dates
    * revised compile-fail test trait-or-new-type-instead
       (the error message for the modified test is still unclear, but that's a different bug rust-lang#8767)
  3. @astrieanna

    Fix issue #8763

    astrieanna authored astrieanna committed
    * added case & better error message for "impl trait for module"
    * used better way to print the module
    * switched from //error-pattern to //~ ERROR
    * added compile-fail test trait-impl-for-module.rs
    * revised compile-fail test trait-or-new-type-instead
        (the error message for the modified test is still unclear, but that's a different bug)
    * added FIXME to trait-or-new-type-instead
  4. @bors
  5. @LeoTestard
  6. @bors
  7. @cmr

    Use -O1 for non-GNU linkers

    cmr authored
  8. @bors
  9. @bors
  10. @bors

    auto merge of #10578 : luqmana/rust/mingw64, r=alexcrichton

    bors authored
    With these changes I was able to cross compile for windows from a linux box. (Using the mingw-w64 package on Debian Testing).
    
    Fixed a bug where the `target_family` cfg would be wrong when targeting something with a different value than the host. (i.e windows -> unix or unix -> windows).
    
    Also, removed `LIBUV_FLAGS` in `mk/rt.mk` because of the redundancy between it and `CFG_GCCISH_CFLAGS_(target)`.
    
    After this we can create a snapshot and migrate to mingw64 instead of mingw32.
  11. @bors

    auto merge of #10514 : sfackler/rust/mut, r=cmr

    bors authored
    This is based off of @blake2-ppc's work on #9429. That PR bitrotted and I haven't been able to contact the original author so I decided to take up the cause.
    
    Overview
    ======
    `Mut` encapsulates a mutable, non-nullable slot. The `Cell` type is currently used to do this, but `Cell` is much more commonly used as a workaround for the inability to move values into non-once functions. `Mut` provides a more robust API.
    
    `Mut` duplicates the semantics of borrowed pointers with enforcement at runtime instead of compile time.
    ```rust
    let x = Mut::new(0);
    
    {
        // make some immutable borrows
        let p = x.borrow();
        let y = *p.get() + 10;
    
        // multiple immutable borrows are allowed simultaneously
        let p2 = x.borrow();
    
        // this would throw a runtime failure
        // let p_mut = x.borrow_mut();
    }
    
    // now we can mutably borrow
    let p = x.borrow_mut();
    *p.get() = 10;
    ```
    `borrow` returns a `Ref` type and `borrow_mut` returns a `RefMut` type, both of which are simple smart pointer types with a single method, `get`, which returns a reference to the wrapped data.
    
    This also allows `RcMut<T>` to be deleted, as it can be replaced with `Rc<Mut<T>>`.
    
    Changes
    ======
    I've done things a little bit differently than the original proposal.
    
    * I've added `try_borrow` and `try_borrow_mut` methods that return `Option<Ref<T>>` and `Option<RefMut<T>>` respectively instead of failing on a borrow check failure. I'm not totally sure when that'd be useful, but I don't see any reason to not put them in and @cmr requested them.
    * `ReadPtr` and `WritePtr` have been renamed to `Ref` and `RefMut` respectively, as `Ref` is to `ref foo` and `RefMut` is to `ref mut foo` as `Mut` is to `mut foo`.
    * `get` on `MutRef` now takes `&self` instead of `&mut self` for consistency with `&mut`. As @alexcrichton pointed, out this violates soundness by allowing aliasing `&mut` references.
    * `Cell` is being left as is. It solves a different problem than `Mut` is designed to solve.
    * There are no longer methods implemented for `Mut<Option<T>>`. Since `Cell` isn't going away, there's less of a need for these, and I didn't feel like they provided a huge benefit, especially as that kind of `impl` is very uncommon in the standard library.
    
    Open Questions
    ============
    * `Cell` should now be used exclusively for movement into closures. Should this be enforced by reducing its API to `new` and `take`? It seems like this use case will be completely going away once the transition to `proc` and co. finishes.
    * Should there be `try_map` and `try_map_mut` methods along with `map` and `map_mut`?
Commits on Nov 23, 2013
  1. @huonw
  2. @sfackler
  3. @cmr

    Use linker optimizations on Linux

    cmr authored
  4. @luqmana

    Use CXX not CC for linking.

    luqmana authored
  5. @bors

    auto merge of #10611 : cmr/rust/ascii_flesh, r=pcwalton

    bors authored
    These are super boring. I can add tests if really desired, but they'd be long
    and even more boring than the methods.
  6. @cmr

    Add ctype-likes to Ascii

    cmr authored
  7. @luqmana
  8. @sfackler

    Add Rc::from_mut

    sfackler authored
  9. @sfackler

    More Mut tests

    sfackler authored
  10. @sfackler

    Strip down Cell functionality

    sfackler authored
  11. @sfackler

    Change Mut::map to Mut::with

    sfackler authored
  12. @sfackler
  13. @sfackler

    Cell -> Mut switch in comm

    sfackler authored
  14. @sfackler

    Move Rc tests away from Cell

    sfackler authored
  15. @sfackler

    Remove RcMut

    sfackler authored
    Rc<Mut<T>> should be used instead
  16. @sfackler

    Introduce Mut<T> to libstd

    sfackler authored
    Based off of blake2-ppc's work in #9429.
  17. @luqmana
  18. @luqmana

    Fix up mingw64 target.

    luqmana authored
Commits on Nov 22, 2013
  1. @bors
  2. @huonw
  3. @bors

    auto merge of #10612 : pnkfelix/rust/remove-cut-and-pasted-rt-fixme, …

    bors authored
    …r=pcwalton
    
    I cannot tell whether the original comment was unsure about the
    arithmetic calculations, or if it was unsure about the assumptions
    being made about the alignment of the current allocation pointer.
    
    The arithmetic calculation looks fine to me, though.  This technique
    is documented e.g. in Henry Warren's "Hacker's Delight" (section 3-1).
    
    (I am sure one can find it elsewhere too, its not an obscure
    property.)
  4. @bors

    auto merge of #10583 : alexcrichton/rust/privacy-reexport, r=pcwalton

    bors authored
    I added a test case which does not compile today, and required changes on
    privacy's side of things to get right. Additionally, this moves a good bit of
    logic which did not belong in reachability into privacy.
    
    All of reachability should solely be responsible for determining what the
    reachable surface area of a crate is given the exported surface area (where the
    exported surface area is that which is usable by external crates).
    
    Privacy will now correctly figure out what's exported by deeply looking
    through reexports. Previously if a module were reexported under another name,
    nothing in the module would actually get exported in the executable. I also
    consolidated the phases of privacy to be clearer about what's an input to what.
    The privacy checking pass no longer uses the notion of an "all public" path, and
    the embargo visitor is no longer an input to the checking pass.
    
    Currently the embargo visitor is built as a saturating analysis because it's
    unknown what portions of the AST are going to get re-exported.
    
    This also cracks down on exported methods from impl blocks and trait blocks. If you implement a private trait, none of the symbols are exported, and if you have an impl for a private type none of the symbols are exported either. On the other hand, if you implement a public trait for a private type, the symbols are still exported. I'm unclear on whether this last part is correct, but librustc will fail to link unless it's in place.
  5. @alexcrichton

    Move more of the exportation burden into privacy

    alexcrichton authored
    I added a test case which does not compile today, and required changes on
    privacy's side of things to get right. Additionally, this moves a good bit of
    logic which did not belong in reachability into privacy.
    
    All of reachability should solely be responsible for determining what the
    reachable surface area of a crate is given the exported surface area (where the
    exported surface area is that which is usable by external crates).
    
    Privacy will now correctly figure out what's exported by deeply looking
    through reexports. Previously if a module were reexported under another name,
    nothing in the module would actually get exported in the executable. I also
    consolidated the phases of privacy to be clearer about what's an input to what.
    The privacy checking pass no longer uses the notion of an "all public" path, and
    the embargo visitor is no longer an input to the checking pass.
    
    Currently the embargo visitor is built as a saturating analysis because it's
    unknown what portions of the AST are going to get re-exported.
Something went wrong with that request. Please try again.