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 12 pull requests #73864

Closed
wants to merge 29 commits into from

Commits on Jun 18, 2020

  1. bootstrap: Configurable musl libdir

    Make it possible to customize the location of musl libdir using
    musl-libdir in config.toml, e.g., to use lib64 instead of lib.
    tmiasko committed Jun 18, 2020
    Configuration menu
    Copy the full SHA
    5c20ef4 View commit details
    Browse the repository at this point in the history

Commits on Jun 24, 2020

  1. Update Box::from_raw example to generalize better

    I know very little about rust, so I saw this example and tried to generalize it by writing,
    ```
        let layout = Layout::new::<T>();
        let new_obj = unsafe {
            let ptr = alloc(layout) as *mut T;
            *ptr = obj;
            Box::from_raw(ptr)
        };
    ```
    for some more complicated `T`, which ended up crashing with SIGSEGV,
    because it tried to `drop_in_place` the previous object in `ptr` which is
    of course garbage. I also added a comment that explains why `.write`
    is used, but I think adding that comment is optional and may be too verbose
    here. I do however think that changing this example is a good idea to
    suggest the correct generalization. `.write` is also used in most of the rest
    of the documentation here, even if the example is `i32`, so it would additionally
    be more consistent.
    Keno authored Jun 24, 2020
    Configuration menu
    Copy the full SHA
    0c88dd6 View commit details
    Browse the repository at this point in the history

Commits on Jun 25, 2020

  1. Configuration menu
    Copy the full SHA
    2bbc2b3 View commit details
    Browse the repository at this point in the history

Commits on Jun 26, 2020

  1. Merge pull request rust-lang#2 from rust-lang/master

    update master
    TyPR124 authored Jun 26, 2020
    Configuration menu
    Copy the full SHA
    00ef461 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    b71a3e1 View commit details
    Browse the repository at this point in the history

Commits on Jun 27, 2020

  1. Configuration menu
    Copy the full SHA
    0d0865f View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    3fc5593 View commit details
    Browse the repository at this point in the history
  3. Use an 'approximate' universal upper bound when reporting region errors

    Fixes rust-lang#67765
    
    When reporting errors during MIR region inference, we sometimes use
    `universal_upper_bound` to obtain a named universal region that we
    can display to the user. However, this is not always possible - in a
    case like `fn foo<'a, 'b>() { .. }`, the only upper bound for a region
    containing `'a` and `'b` is `'static`. When displaying diagnostics, it's
    usually better to display *some* named region (even if there are
    multiple involved) rather than fall back to a generic error involving
    `'static`.
    
    This commit adds a new `approx_universal_upper_bound` method, which
    uses the lowest-numbered universal region if the only alternative is to
    return `'static`.
    Aaron1011 committed Jun 27, 2020
    Configuration menu
    Copy the full SHA
    517d361 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    7055c23 View commit details
    Browse the repository at this point in the history

Commits on Jun 28, 2020

  1. Configuration menu
    Copy the full SHA
    14d0370 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    7231e57 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    e611a3f View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    e8f5785 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    dfd454b View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    824b2bb View commit details
    Browse the repository at this point in the history
  7. Fix small nits

    poliorcetics committed Jun 28, 2020
    Configuration menu
    Copy the full SHA
    4224313 View commit details
    Browse the repository at this point in the history

Commits on Jun 29, 2020

  1. rustbuild: Move compiler-builtins build logic to manifest

    This commit moves the compiler-builtins-specific build logic from
    `src/bootstrap/bin/rustc.rs` into the workspace `Cargo.toml`'s
    `[profile]` configuration. Now that rust-lang/cargo#7253 is fixed we can
    ensure that Cargo knows about debug assertions settings, and it can also
    be configured to specifically disable debug assertions unconditionally
    for compiler-builtins. This should improve rebuild logic when
    debug-assertions settings change and also improve build-std integration
    where Cargo externally now has an avenue to learn how to build
    compiler-builtins as well.
    alexcrichton committed Jun 29, 2020
    Configuration menu
    Copy the full SHA
    3dfbf0b View commit details
    Browse the repository at this point in the history
  2. Rollup merge of rust-lang#73374 - alexcrichton:compiler-bulitins-debu…

    …g-assertions, r=Mark-Simulacrum
    
    rustbuild: Move compiler-builtins build logic to manifest
    
    This commit moves the compiler-builtins-specific build logic from
    `src/bootstrap/bin/rustc.rs` into the workspace `Cargo.toml`'s
    `[profile]` configuration. Now that rust-lang/cargo#7253 is fixed we can
    ensure that Cargo knows about debug assertions settings, and it can also
    be configured to specifically disable debug assertions unconditionally
    for compiler-builtins. This should improve rebuild logic when
    debug-assertions settings change and also improve build-std integration
    where Cargo externally now has an avenue to learn how to build
    compiler-builtins as well.
    Manishearth authored Jun 29, 2020
    Configuration menu
    Copy the full SHA
    a447cfe View commit details
    Browse the repository at this point in the history
  3. Rollup merge of rust-lang#73456 - tmiasko:musl-libdir, r=Mark-Simulacrum

    bootstrap: Configurable musl libdir
    
    Make it possible to customize the location of musl libdir using
    musl-libdir in config.toml, e.g., to use lib64 instead of lib.
    Manishearth authored Jun 29, 2020
    Configuration menu
    Copy the full SHA
    db95513 View commit details
    Browse the repository at this point in the history
  4. Rollup merge of rust-lang#73678 - Keno:patch-1, r=LukasKalbertodt

    Update Box::from_raw example to generalize better
    
    I know very little about rust, so I saw the example here
    ```
    use std::alloc::{alloc, Layout};
    
    unsafe {
        let ptr = alloc(Layout::new::<i32>()) as *mut i32;
        *ptr = 5;
        let x = Box::from_raw(ptr);
    }
    ```
    and tried to generalize it by writing,
    ```
        let layout = Layout::new::<T>();
        let new_obj = unsafe {
            let ptr = alloc(layout) as *mut T;
            *ptr = obj;
            Box::from_raw(ptr)
        };
    ```
    for some more complicated `T`, which ended up crashing with SIGSEGV,
    because it tried to `drop_in_place` the previous object in `ptr` which is
    of course garbage. I think that changing this example to use `.write` instead
    would be a good idea to suggest the correct generalization. It is also more
    consistent with other documentation items in this file, which use `.write`.
    I also added a comment to explain it, but I'm not too attached to that,
    and can see it being too verbose in this place.
    Manishearth authored Jun 29, 2020
    Configuration menu
    Copy the full SHA
    baf7f99 View commit details
    Browse the repository at this point in the history
  5. Rollup merge of rust-lang#73716 - poliorcetics:static-keyword, r=Luka…

    …sKalbertodt
    
    Document the static keyword
    
    Partial fix of rust-lang#34601.
    
    This documents the `static` keyword. It's basically a simplified version of the reference with more examples.
    
    @rustbot modify labels: T-doc,C-enhancement
    Manishearth authored Jun 29, 2020
    Configuration menu
    Copy the full SHA
    6d70043 View commit details
    Browse the repository at this point in the history
  6. Rollup merge of rust-lang#73752 - TyPR124:invalid-parameter-error, r=…

    …LukasKalbertodt
    
    Remap Windows ERROR_INVALID_PARAMETER to ErrorKind::InvalidInput from Other
    
    I don't know if this is acceptable or how likely it is to break existing code, but it seem to me ERROR_INVALID_PARAMETER "The parameter is incorrect" should map to ErrorKind::InvalidInput "A parameter was incorrect". Previously this value fell through to ErrorKind::Other.
    
    I can't speak for anyone but myself, but I instinctively thought it would be InvalidInput.
    Manishearth authored Jun 29, 2020
    Configuration menu
    Copy the full SHA
    6b2f6c4 View commit details
    Browse the repository at this point in the history
  7. Rollup merge of rust-lang#73805 - poliorcetics:type-keyword, r=kennytm

    Document the type keyword
    
    Partial fix of rust-lang#34601.
    
    Two small examples, one clarifying that `type` only defines an alias, not a completely new type, the other explaining the use in traits.
    
    @rustbot modify labels: T-doc,C-enhancement
    Manishearth authored Jun 29, 2020
    Configuration menu
    Copy the full SHA
    fd5f4ec View commit details
    Browse the repository at this point in the history
  8. Rollup merge of rust-lang#73806 - Aaron1011:feature/approx-universal-…

    …upper, r=estebank
    
    Use an 'approximate' universal upper bound when reporting region errors
    
    Fixes rust-lang#67765
    
    When reporting errors during MIR region inference, we sometimes use
    `universal_upper_bound` to obtain a named universal region that we
    can display to the user. However, this is not always possible - in a
    case like `fn foo<'a, 'b>() { .. }`, the only upper bound for a region
    containing `'a` and `'b` is `'static`. When displaying diagnostics, it's
    usually better to display *some* named region (even if there are
    multiple involved) rather than fall back to a generic error involving
    `'static`.
    
    This commit adds a new `approx_universal_upper_bound` method, which
    uses the lowest-numbered universal region if the only alternative is to
    return `'static`.
    Manishearth authored Jun 29, 2020
    Configuration menu
    Copy the full SHA
    2fef102 View commit details
    Browse the repository at this point in the history
  9. Rollup merge of rust-lang#73812 - petrochenkov:prettyref, r=varkor

    ast_pretty: Pass some token streams and trees by reference
    
    Salvaged from an intermediate version of rust-lang#73345.
    Manishearth authored Jun 29, 2020
    Configuration menu
    Copy the full SHA
    74c734d View commit details
    Browse the repository at this point in the history
  10. Rollup merge of rust-lang#73828 - nop:fix/parameter-name-help, r=este…

    …bank
    
    Fix wording for anonymous parameter name help
    
    ```
     --> exercises/functions/functions2.rs:8:15
      |
    8 | fn call_me(num) {
      |               ^ expected one of `:`, `@`, or `|`
      |
      = note: anonymous parameters are removed in the 2018 edition (see RFC 1685)
    help: if this is a `self` type, give it a parameter name
      |
    8 | fn call_me(self: num) {
      |            ^^^^^^^^^
    help: if this was a parameter name, give it a type
      |
    8 | fn call_me(num: TypeName) {
      |            ^^^^^^^^^^^^^
    help: if this is a type, explicitly ignore the parameter name
      |
    8 | fn call_me(_: num) {
      |
    ```
    This commit changes "if this was a parameter name" to "if this is a parameter name" to match the wording of similar errors.
    Manishearth authored Jun 29, 2020
    Configuration menu
    Copy the full SHA
    994894e View commit details
    Browse the repository at this point in the history
  11. Rollup merge of rust-lang#73834 - oli-obk:safe_intrinsics, r=ecstatic…

    …-morse
    
    Some refactoring around intrinsic type checking
    
    So... This PR went a bit overboard. I wanted to make the `rustc_peek` intrinsic safe (cc @ecstatic-morse ), and remembered a long-standing itch of mine. So I made that huge `&str` match for the intrinsic name a match on `Symbol`s (so basically `u32`s). This is unlikely to have a positive perf effect, even if it likely has better codegen (intrinsics are used rarely, mostly once in their wrapper), so it's mostly a consistency thing since other places actually match on the symbol name of the intrinsics.
    Manishearth authored Jun 29, 2020
    Configuration menu
    Copy the full SHA
    6267e00 View commit details
    Browse the repository at this point in the history
  12. Rollup merge of rust-lang#73839 - crlf0710:snapshot_the_reality, r=Ma…

    …nishearth
    
    Split and expand nonstandard-style lints unicode unit test.
    
    RFC 2457 requested that the `nonstandard_style` series of linted be adjusted to cover the non_ascii_identifier case. However when i read the code of those implementations, it seems they're already supporting non_ascii_identifiers. But the exact rules is a little different than what's proposed in RFC 2457.
    
    So I splitted and expanded the existing test case to try to exercise every branch in the code. I think it'll also be easier to examine the cases in these unit tests to see whether it's ok to just leave them as is, or some adjustments are needed.
    
    r? @Manishearth
    Manishearth authored Jun 29, 2020
    Configuration menu
    Copy the full SHA
    578a89e View commit details
    Browse the repository at this point in the history
  13. Rollup merge of rust-lang#73841 - tmiasko:print-region-graph, r=Mark-…

    …Simulacrum
    
    Remove defunct `-Z print-region-graph`
    Manishearth authored Jun 29, 2020
    Configuration menu
    Copy the full SHA
    339aee7 View commit details
    Browse the repository at this point in the history