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 13 pull requests #73498

Merged
merged 47 commits into from
Jun 19, 2020
Merged

Rollup of 13 pull requests #73498

merged 47 commits into from
Jun 19, 2020

Commits on May 24, 2020

  1. Fix asinh of negative values

    When `x` has large magnitude, `x + ((x * x) + 1.0).sqrt()` approaches
    `x + x.abs()`. For negative values of `x`, this leads to catastrophic
    cancellation, resulting in large errors or even 0 being passed to
    `ln`, producing incorrect results including `-inf`.
    
    Becuase asinh is an odd function, i.e. -asinh(x) = asinh(-x) for all
    x, we can avoid the catastrophic cancellation and obtain correct
    results by taking the absolute value of `self` for the first
    term. `self * self` is always positive, so in effect this gives us
    `x.abs().asinh().copysign(x)` which as discussed above is
    algebraically equivalent, but is much more accurate.
    Ralith committed May 24, 2020
    Configuration menu
    Copy the full SHA
    730f736 View commit details
    Browse the repository at this point in the history

Commits on May 30, 2020

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

Commits on Jun 7, 2020

  1. Don't intern memory in const prop.

    This isn't sound without validation. We don't want to report errors in case of failure to intern and validate, we just don't want to const prop. Interning and const prop is not built for this, let's not do it until we have a clearer picture on aggregate propagation.
    oli-obk authored and wesleywiser committed Jun 7, 2020
    Configuration menu
    Copy the full SHA
    20abc70 View commit details
    Browse the repository at this point in the history

Commits on Jun 9, 2020

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

Commits on Jun 11, 2020

  1. Configuration menu
    Copy the full SHA
    9ceb9bb View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    638ebbc View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    961974f View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    5d29883 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    e9ac01a View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    43905cd View commit details
    Browse the repository at this point in the history

Commits on Jun 14, 2020

  1. Configuration menu
    Copy the full SHA
    d5ea0e9 View commit details
    Browse the repository at this point in the history
  2. Add rust features to print target features

    `crt-static` is a rust specific target feature that's absent from llvm feature table, adding it there.
    aszenz committed Jun 14, 2020
    Configuration menu
    Copy the full SHA
    e32db84 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    a40156e View commit details
    Browse the repository at this point in the history

Commits on Jun 15, 2020

  1. Configuration menu
    Copy the full SHA
    0906066 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    d3ca6fd View commit details
    Browse the repository at this point in the history
  3. Update src/librustc_typeck/check/cast.rs

    Co-authored-by: lzutao <taolzu@gmail.com>
    nikomatsakis and tesuji committed Jun 15, 2020
    Configuration menu
    Copy the full SHA
    b5809b0 View commit details
    Browse the repository at this point in the history
  4. add FIXME to EnumTagInfo

    RalfJung committed Jun 15, 2020
    Configuration menu
    Copy the full SHA
    10c8d2a View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    e0975b9 View commit details
    Browse the repository at this point in the history

Commits on Jun 16, 2020

  1. Adjust error message

    oddg committed Jun 16, 2020
    Configuration menu
    Copy the full SHA
    f3dfe80 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    1990f97 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    4506a35 View commit details
    Browse the repository at this point in the history
  4. break long line for formatting

    aszenz committed Jun 16, 2020
    Configuration menu
    Copy the full SHA
    9f50f84 View commit details
    Browse the repository at this point in the history
  5. trim whitespace

    aszenz committed Jun 16, 2020
    Configuration menu
    Copy the full SHA
    457acbd View commit details
    Browse the repository at this point in the history

Commits on Jun 17, 2020

  1. add blank line bw sections

    Separate target features from rust ones with a blank line
    
    Co-authored-by: Josh Stone <cuviper@gmail.com>
    aszenz and cuviper committed Jun 17, 2020
    Configuration menu
    Copy the full SHA
    caffb28 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    6351850 View commit details
    Browse the repository at this point in the history
  3. Reduce pointer casts in Box::into_boxed_slice

    We only need to cast the pointer once to change `Box<T>` to an array
    `Box<[T; 1]>`, then we can let unsized coercion return `Box<[T]>`.
    cuviper committed Jun 17, 2020
    Configuration menu
    Copy the full SHA
    a7c2cf8 View commit details
    Browse the repository at this point in the history

Commits on Jun 18, 2020

  1. Document format correction

    qy3u committed Jun 18, 2020
    Configuration menu
    Copy the full SHA
    d134870 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    abb5800 View commit details
    Browse the repository at this point in the history
  3. Fix liballoc doc spelling

    pickfire committed Jun 18, 2020
    Configuration menu
    Copy the full SHA
    8aecafe View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    ec8ff1c View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    111c2d2 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    5a9ff05 View commit details
    Browse the repository at this point in the history

Commits on Jun 19, 2020

  1. Remove now-redundant branch

    Ralith committed Jun 19, 2020
    Configuration menu
    Copy the full SHA
    35a2915 View commit details
    Browse the repository at this point in the history
  2. Rollup merge of rust-lang#70740 - haraldh:static-pie, r=petrochenkov

    Enabling static-pie for musl
    
    and make it the default for the x86_64-unknown-linux-musl target
    
    This is a quick implementation for rust-lang#70693
    
    Opening it as a draft PR to gather some feedback, before I put more work in it.
    
    ```console
    ❯ cat hello.rs
    fn main() {
        println!("main = {:#x}", &main as *const _ as usize);
    }
    
    ❯  /tmp/rust-musl/bin/rustc  --target x86_64-unknown-linux-musl  ~/hello.rs
    
    ❯ ldd hello
    	statically linked
    
    ❯ file hello
    hello: ELF 64-bit LSB shared object, x86-64, version 1 (GNU/Linux), statically linked, BuildID[sha1]=fec5cdc170f503a712a63a6958691ce5ce433654, with debug_info, not stripped
    
    ❯ ./hello
    main = 0x7f233ca30008
    
    ❯ ./hello
    main = 0x7f9ddc529008
    
    ❯ ./hello
    main = 0x7f1e5a224008
    
    ❯ ./hello
    main = 0x7f4485c7c008
    
    ❯ /tmp/rust-musl/bin/rustc  --target x86_64-unknown-linux-musl  -Z print-link-args  ~/hello.rs
    "cc" "-Wl,--as-needed" "-Wl,-z,noexecstack" "-Wl,--eh-frame-hdr" "-m64" "-nostdlib" "/tmp/rust-musl/lib/rustlib/x86_64-unknown-linux-musl/lib/rcrt1.o" "/tmp/rust-musl/lib/rustlib/x86_64-unknown-linux-musl/lib/crti.o" "-L" "/tmp/rust-musl/lib/rustlib/x86_64-unknown-linux-musl/lib" "hello.hello.7rcbfp3g-cgu.0.rcgu.o" "hello.hello.7rcbfp3g-cgu.1.rcgu.o" "hello.hello.7rcbfp3g-cgu.2.rcgu.o" "hello.hello.7rcbfp3g-cgu.3.rcgu.o" "hello.hello.7rcbfp3g-cgu.4.rcgu.o" "hello.hello.7rcbfp3g-cgu.5.rcgu.o" "-o" "hello" "hello.1nxjf9so94czdgcz.rcgu.o" "-Wl,--gc-sections" "-static-pie" "-Wl,-zrelro" "-Wl,-znow" "-nodefaultlibs" "-L" "/tmp/rust-musl/lib/rustlib/x86_64-unknown-linux-musl/lib" "-Wl,--start-group" "-Wl,-Bstatic" "/tmp/rust-musl/lib/rustlib/x86_64-unknown-linux-musl/lib/libstd-0f9cb7646f9e2c34.rlib" "/tmp/rust-musl/lib/rustlib/x86_64-unknown-linux-musl/lib/libpanic_unwind-ba857f2f2e4e7187.rlib" "/tmp/rust-musl/lib/rustlib/x86_64-unknown-linux-musl/lib/libhashbrown-58ba5e25bbdf9d29.rlib" "/tmp/rust-musl/lib/rustlib/x86_64-unknown-linux-musl/lib/librustc_std_workspace_alloc-886bfe43afa847dc.rlib" "/tmp/rust-musl/lib/rustlib/x86_64-unknown-linux-musl/lib/libbacktrace-fbfb8fe99f19a67b.rlib" "/tmp/rust-musl/lib/rustlib/x86_64-unknown-linux-musl/lib/libbacktrace_sys-85fa859e7d364cc9.rlib" "/tmp/rust-musl/lib/rustlib/x86_64-unknown-linux-musl/lib/librustc_demangle-07ab026cd3ec0d82.rlib" "/tmp/rust-musl/lib/rustlib/x86_64-unknown-linux-musl/lib/libunwind-a8ec5932d92ea864.rlib" "/tmp/rust-musl/lib/rustlib/x86_64-unknown-linux-musl/lib/libcfg_if-0ba4cc2f38a198d5.rlib" "/tmp/rust-musl/lib/rustlib/x86_64-unknown-linux-musl/lib/liblibc-c1bb2b3ce4f78b7c.rlib" "/tmp/rust-musl/lib/rustlib/x86_64-unknown-linux-musl/lib/liballoc-0ff673c1cf0d451a.rlib" "/tmp/rust-musl/lib/rustlib/x86_64-unknown-linux-musl/lib/librustc_std_workspace_core-c8ff2001db856926.rlib" "/tmp/rust-musl/lib/rustlib/x86_64-unknown-linux-musl/lib/libcore-2ae14177140eeca2.rlib" "-Wl,--end-group" "/tmp/rust-musl/lib/rustlib/x86_64-unknown-linux-musl/lib/libcompiler_builtins-4fd81b5ce1b08a9c.rlib" "-static" "-Wl,-Bdynamic" "/tmp/rust-musl/lib/rustlib/x86_64-unknown-linux-musl/lib/crtn.o"
    ```
    
    Closes rust-lang#70693
    Closes rust-lang#53968
    RalfJung committed Jun 19, 2020
    Configuration menu
    Copy the full SHA
    27d4737 View commit details
    Browse the repository at this point in the history
  3. Rollup merge of rust-lang#72331 - oddg:forbid-cast-of-cenum-implement…

    …ing-drop, r=matthewjasper,nikomatsakis
    
    Report error when casting an C-like enum implementing Drop
    
    Following approach described in rust-lang#35941
    RalfJung committed Jun 19, 2020
    Configuration menu
    Copy the full SHA
    9c54c65 View commit details
    Browse the repository at this point in the history
  4. Rollup merge of rust-lang#72486 - Ralith:asinh-fix, r=dtolnay

    Fix asinh of negative values
    
    Rust's current implementation of asinh has [large errors](https://www.wolframalpha.com/input/?i=arcsinh%28x%29%2C+ln%28x%2B%28x%5E2%2B1%29%5E0.5%29%2C+x+from+-67452095.07139316+to+0) in its negative range. ~These are (mostly) not numerical, but rather seem due to an incorrect implementation.~ This appears to be due to avoidable catastrophic cancellation.
    [Playground before/after](https://play.rust-lang.org/?version=stable&mode=debug&edition=2018&gist=bd04ae6d86d06612e4e389a8b95d19ab).
    [glibc uses](https://github.com/bminor/glibc/blob/81dca813cc35f91414731fdd0ff6b756d5e1827f/sysdeps/ieee754/dbl-64/s_asinh.c#L56) abs here.
    
    Many thanks to @danieldeankon for finding this weird behavior, @jebrosen for diagnosing it, and @toasteater for identifying the probable implementation error!
    RalfJung committed Jun 19, 2020
    Configuration menu
    Copy the full SHA
    99be102 View commit details
    Browse the repository at this point in the history
  5. Rollup merge of rust-lang#72497 - RalfJung:tag-term, r=oli-obk

    tag/niche terminology cleanup
    
    The term "discriminant" was used in two ways throughout the compiler:
    * every enum variant has a corresponding discriminant, that can be given explicitly with `Variant = N`.
    * that discriminant is then encoded in memory to store which variant is active -- but this encoded form of the discriminant was also often called "discriminant", even though it is conceptually quite different (e.g., it can be smaller in size, or even use niche-filling).
    
    After discussion with @eddyb, this renames the second term to "tag". The way the tag is encoded can be either `TagEncoding::Direct` (formerly `DiscriminantKind::Tag`) or `TagEncoding::Niche` (formerly `DiscrimianntKind::Niche`).
    
    This finally resolves some long-standing confusion I had about the handling of variant indices and discriminants, which surfaced in rust-lang#72419.
    
    (There is also a `DiscriminantKind` type in libcore, it remains unaffected. I think this corresponds to the discriminant, not the tag, so that seems all right.)
    
    r? @eddyb
    RalfJung committed Jun 19, 2020
    Configuration menu
    Copy the full SHA
    5e7eec2 View commit details
    Browse the repository at this point in the history
  6. Rollup merge of rust-lang#72999 - mati865:separate-self-contained-dir…

    …, r=Mark-Simulacrum
    
    Create self-contained directory and move there some of external binaries/libs
    
    One of the steps to reach design described in rust-lang#68887 (comment)
    This PR moves things around and allows link code to handle the new directory structure.
    RalfJung committed Jun 19, 2020
    Configuration menu
    Copy the full SHA
    ea3c309 View commit details
    Browse the repository at this point in the history
  7. Rollup merge of rust-lang#73130 - wesleywiser:remove_const_prop_for_i…

    …ndirects, r=oli-obk
    
    Remove const prop for indirects
    
    This was only used by one mir-opt test and since it causes buggy behavior under `-Zmir-opt-level=2`, it seems like we should remove it.
    
    This was split out from rust-lang#71946.
    
    Closes rust-lang#72679
    Closes rust-lang#72372
    Closes rust-lang#72285
    RalfJung committed Jun 19, 2020
    Configuration menu
    Copy the full SHA
    098949b View commit details
    Browse the repository at this point in the history
  8. Rollup merge of rust-lang#73142 - ehuss:std-benches, r=dtolnay

    Ensure std benchmarks get tested.
    
    This ensures that the std benchmarks don't break in the future. Currently they aren't compiled or tested on CI, so they can easily bitrot.  Testing a benchmark runs it with one iteration. Adding these should only add a few seconds to CI.
    
    Closes rust-lang#54176
    Closes rust-lang#61913
    RalfJung committed Jun 19, 2020
    Configuration menu
    Copy the full SHA
    78f3e9c View commit details
    Browse the repository at this point in the history
  9. Rollup merge of rust-lang#73305 - crlf0710:disallow_loading_monsters,…

    … r=petrochenkov
    
    Disallow loading crates with non-ascii identifier name.
    
    This turns off external crate loading with non-ascii identifier names.
    
    cc rust-lang#55467.
    RalfJung committed Jun 19, 2020
    Configuration menu
    Copy the full SHA
    3b4bec2 View commit details
    Browse the repository at this point in the history
  10. Rollup merge of rust-lang#73346 - aszenz:patch-1, r=cuviper

    Add rust specific features to print target features
    
    Fixes rust-lang#71583
    
    `crt-static` is a rust specific target feature that's absent from llvm feature table, adding it there so that it shows under `rustc --print target-features`.
    
    Probably the most native implementation I could think of, would love to get feedback.
    RalfJung committed Jun 19, 2020
    Configuration menu
    Copy the full SHA
    8d79ebd View commit details
    Browse the repository at this point in the history
  11. Rollup merge of rust-lang#73362 - erikdesjardins:bounds, r=nikomatsakis

    Test that bounds checks are elided when slice len is checked up-front
    
    Closes rust-lang#69101
    RalfJung committed Jun 19, 2020
    Configuration menu
    Copy the full SHA
    7d3238f View commit details
    Browse the repository at this point in the history
  12. Rollup merge of rust-lang#73459 - cuviper:into_boxed_slice-unicast, r…

    …=dtolnay
    
    Reduce pointer casts in Box::into_boxed_slice
    
    We only need to cast the pointer once to change `Box<T>` to an array
    `Box<[T; 1]>`, then we can let unsized coercion return `Box<[T]>`.
    RalfJung committed Jun 19, 2020
    Configuration menu
    Copy the full SHA
    fc2ce7c View commit details
    Browse the repository at this point in the history
  13. Rollup merge of rust-lang#73464 - qy3u:fs-document-format-correction,…

    … r=jonas-schievink
    
    Document format correction
    
    Minor amendments to the document.
    
    r? @steveklabnik
    RalfJung committed Jun 19, 2020
    Configuration menu
    Copy the full SHA
    f7d833e View commit details
    Browse the repository at this point in the history
  14. Rollup merge of rust-lang#73479 - pickfire:liballoc-spell, r=dtolnay

    Minor tweaks to liballoc
    RalfJung committed Jun 19, 2020
    Configuration menu
    Copy the full SHA
    028c908 View commit details
    Browse the repository at this point in the history