Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rollup of 5 pull requests #37678

Merged
merged 14 commits into from
Nov 10, 2016
Merged

Rollup of 5 pull requests #37678

merged 14 commits into from
Nov 10, 2016

Commits on Nov 9, 2016

  1. Configuration menu
    Copy the full SHA
    ba92b01 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    1e9aad7 View commit details
    Browse the repository at this point in the history
  3. rustc_llvm: Require 3.9 for --link-static

    Apparently stock Ubuntu 16.04 includes LLVM 3.8 which doesn't have this flag.
    alexcrichton committed Nov 9, 2016
    Configuration menu
    Copy the full SHA
    cc2c812 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    49772fb View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    ff0830d View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    6b3cc0b View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    9ce1044 View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    8e9106c View commit details
    Browse the repository at this point in the history

Commits on Nov 10, 2016

  1. Configuration menu
    Copy the full SHA
    de0ffad View commit details
    Browse the repository at this point in the history
  2. Rollup merge of rust-lang#37402 - eddyb:lazy-3, r=nikomatsakis

    [3/n] rustc: unify and simplify managing associated items.
    
    _This is part of a series ([prev](rust-lang#37401) | [next](rust-lang#37404)) of patches designed to rework rustc into an out-of-order on-demand pipeline model for both better feature support (e.g. [MIR-based](https://github.com/solson/miri) early constant evaluation) and incremental execution of compiler passes (e.g. type-checking), with beneficial consequences to IDE support as well.
    If any motivation is unclear, please ask for additional PR description clarifications or code comments._
    
    <hr>
    
    `ImplOrTraitItem`/`impl_or_trait_item` have been renamed to `AssociatedItem`/`associated_item`.
    
    The common fields from (what used to be) `ty::ImplOrTraitItem`'s variants have been pulled out, leaving only an `AssociatedKind` C-like enum to distinguish between methods, constants and types.
    
    The type information has been removed from `AssociatedItem`, and as such the latter can now be computed on-demand from the local HIR map, i.e. an extern-crate-enabled `TraitItem | ImplItem`.
    It may be moved to HIR in the future, if we intend to start using HIR types cross-crate.
    
    `ty::ExplicitSelfCategory` has been moved to `rustc_typeck` and is produced on-demand from the signature of the method, and a `method_has_self_argument` field on `AssociatedItem`, which is used to indicate that the first argument is a sugary "method receiver" and as such, method call syntax can be used.
    eddyb authored Nov 10, 2016
    Configuration menu
    Copy the full SHA
    8d4a350 View commit details
    Browse the repository at this point in the history
  3. Rollup merge of rust-lang#37412 - eddyb:lazy-6, r=nikomatsakis

    [6/n] rustc: transition HIR function bodies from Block to Expr.
    
    _This is part of a series ([prev](rust-lang#37408) | [next](rust-lang#37676)) of patches designed to rework rustc into an out-of-order on-demand pipeline model for both better feature support (e.g. [MIR-based](https://github.com/solson/miri) early constant evaluation) and incremental execution of compiler passes (e.g. type-checking), with beneficial consequences to IDE support as well.
    If any motivation is unclear, please ask for additional PR description clarifications or code comments._
    
    <hr>
    
    The main change here is that functions and closures both use `Expr` instead of `Block` for their bodies.
    For closures this actually allows a honest representation of brace-less closure bodies, e.g. `|x| x + 1` is now distinguishable from `|x| { x + 1 }`, therefore this PR is `[syntax-breaking]` (cc @Manishearth).
    
    Using `Expr` allows more logic to be shared between constant bodies and function bodies, with some small such changes already part of this PR, and eventually easing rust-lang#35078 and per-body type tables.
    
    Incidentally, there used to be some corners cut here and there and as such I had to (re)write divergence tracking for type-checking so that it is capable of understanding basic structured control-flow:
    
    ``` rust
    fn a(x: bool) -> i32 {
        // match also works (as long as all arms diverge)
        if x { panic!("true") } else { return 1; }
        0 // "unreachable expression" after this PR
    }
    ```
    
    And since liveness' "not all control paths return a value" moved to type-checking we can have nice things:
    
    ``` rust
    // before & after:
    fn b() -> i32 { 0; } // help: consider removing this semicolon
    
    // only after this PR
    fn c() -> i32 { { 0; } } // help: consider removing this semicolon
    fn d() { let x: i32 = { 0; }; } // help: consider removing this semicolon
    fn e() { f({ 0; }); } // help: consider removing this semicolon
    ```
    eddyb authored Nov 10, 2016
    Configuration menu
    Copy the full SHA
    368281a View commit details
    Browse the repository at this point in the history
  4. Rollup merge of rust-lang#37661 - brson:qmarkstab, r=nikomatsakis

    question_mark was stabilized in 1.13
    eddyb authored Nov 10, 2016
    Configuration menu
    Copy the full SHA
    8cc6be1 View commit details
    Browse the repository at this point in the history
  5. Rollup merge of rust-lang#37664 - est31:master, r=nrc

    Document the question mark operator in reference and the book's syntax index
    
    The question mark operator will be stabilized for the Rust 1.13 release (unfortunately). Even though I don't like the operator, it still should be documented in the syntax index in the book and in the reference.
    
    Maybe there are people who also want to change the book's chapters on error handling, depending on their views of what idiomatic error handling is, now that the operator is stable, but I don't want to and I'd prefer to keep this PR focused on the reference and syntax index only.
    
    Please also apply this PR to the beta branch of rust.
    eddyb authored Nov 10, 2016
    Configuration menu
    Copy the full SHA
    e733667 View commit details
    Browse the repository at this point in the history
  6. Rollup merge of rust-lang#37667 - alexcrichton:fix-llvm-version, r=ja…

    …paric
    
    rustc_llvm: Require 3.9 for --link-static
    
    Apparently stock Ubuntu 16.04 includes LLVM 3.8 which doesn't have this flag.
    eddyb authored Nov 10, 2016
    Configuration menu
    Copy the full SHA
    3a5b45a View commit details
    Browse the repository at this point in the history