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 16 pull requests #74191

Closed
wants to merge 48 commits into from

Commits on Jun 12, 2020

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

Commits on Jul 5, 2020

  1. Configuration menu
    Copy the full SHA
    8a2e376 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    f25811e View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    f07100a View commit details
    Browse the repository at this point in the history

Commits on Jul 6, 2020

  1. Use relative path for local links to primitives in libcore

    Else, links to `char::foo` would point into `/path/to/src/libcore/std/primitive.char.html#method.foo`.
    
    Split out from rust-lang#73804.
    sethp committed Jul 6, 2020
    Configuration menu
    Copy the full SHA
    81fbfc4 View commit details
    Browse the repository at this point in the history
  2. Touch up checked_log PR

    dtolnay committed Jul 6, 2020
    Configuration menu
    Copy the full SHA
    6cef103 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    ee3a0f8 View commit details
    Browse the repository at this point in the history
  4. Hide &mut self methods from Deref in sidebar

    If there are no `DerefMut` impl for the type.
    nbdd0121 committed Jul 6, 2020
    Configuration menu
    Copy the full SHA
    e0b69f2 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    5702e02 View commit details
    Browse the repository at this point in the history
  6. Add UI test for issue 74082

    nbdd0121 committed Jul 6, 2020
    Configuration menu
    Copy the full SHA
    97867bb View commit details
    Browse the repository at this point in the history
  7. Add test for issue 74083

    nbdd0121 committed Jul 6, 2020
    Configuration menu
    Copy the full SHA
    368aa6f View commit details
    Browse the repository at this point in the history

Commits on Jul 7, 2020

  1. Two new rustdoc tests for intra links

    They both produce less-than-desirable output (links going to docs.rust-lang.org), but I haven't figured out yet how to assert about them properly.
    sethp committed Jul 7, 2020
    Configuration menu
    Copy the full SHA
    33a5d00 View commit details
    Browse the repository at this point in the history
  2. build extern docs as well

    sethp committed Jul 7, 2020
    Configuration menu
    Copy the full SHA
    165aecb View commit details
    Browse the repository at this point in the history
  3. Assert current behavior for links

    For the two of these tests that have a local `char` to link to, this behavior isn't what's expected, but is what's happening presently.
    sethp committed Jul 7, 2020
    Configuration menu
    Copy the full SHA
    865b930 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    f258d98 View commit details
    Browse the repository at this point in the history
  5. Update books

    ehuss committed Jul 7, 2020
    Configuration menu
    Copy the full SHA
    b50c13c View commit details
    Browse the repository at this point in the history
  6. Revert "Add guard to check for local core crate"

    This reverts commit ee3a0f8.
    sethp committed Jul 7, 2020
    Configuration menu
    Copy the full SHA
    8d267db View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    dd07774 View commit details
    Browse the repository at this point in the history

Commits on Jul 8, 2020

  1. Liballoc use vec instead of vector

    Keep congruency with other parts, full word vector is rarely used.
    pickfire authored Jul 8, 2020
    Configuration menu
    Copy the full SHA
    7bc85e2 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    3c63fba View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    9366458 View commit details
    Browse the repository at this point in the history
  4. Avoid "blacklist"

    Other terms are more inclusive and precise.
    
    Clippy still has a lint named "blacklisted-name", but renaming it would
    be a breaking change, so is left for future work.
    
    The target configuration option "abi-blacklist" has been depreciated and
    renamed to "unsupported-abis". The old name continues to work.
    tamird committed Jul 8, 2020
    Configuration menu
    Copy the full SHA
    1e567c1 View commit details
    Browse the repository at this point in the history
  5. Avoid running test on Windows platforms

    There don't seem to be any other compiletests that are 1) building a standalone "no_core" create and then 2) trying to link against it. There seems to be a platform-specific limitation in doing so:
    
    ```
    2020-07-08T16:07:42.9419409Z   = note:    Creating library D:\a\rust\rust\build\i686-pc-windows-msvc\test\rustdoc\intra-link-prim-methods-external-core\auxiliary\my_core.dll.lib and object D:\a\rust\rust\build\i686-pc-windows-msvc\test\rustdoc\intra-link-prim-methods-external-core\auxiliary\my_core.dll.exp
    2020-07-08T16:07:42.9419810Z           LINK : error LNK2001: unresolved external symbol __DllMainCRTStartup@12
    2020-07-08T16:07:42.9420032Z           D:\a\rust\rust\build\i686-pc-windows-msvc\test\rustdoc\intra-link-prim-methods-external-core\auxiliary\my_core.dll : fatal error LNK1120: 1 unresolved externals
    ```
    
    Possibly this could be resolved by adding a `__DllMainCRTStartup` or `__DllMainCRTStartup@12` symbol in an architecture- and platform-specific way.
    sethp committed Jul 8, 2020
    Configuration menu
    Copy the full SHA
    56b6b44 View commit details
    Browse the repository at this point in the history
  6. Update cargo

    ehuss committed Jul 8, 2020
    Configuration menu
    Copy the full SHA
    ca22091 View commit details
    Browse the repository at this point in the history

Commits on Jul 9, 2020

  1. update miri

    RalfJung committed Jul 9, 2020
    Configuration menu
    Copy the full SHA
    35fae73 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    09f51d4 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    271e2a9 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    08d3a74 View commit details
    Browse the repository at this point in the history
  5. Reduce indentation

    estebank committed Jul 9, 2020
    Configuration menu
    Copy the full SHA
    fc6ee8f View commit details
    Browse the repository at this point in the history
  6. Tweak :: -> : typo heuristic and reduce verbosity

    Do not trigger on correct type ascription expressions with trailing
    operators and _do_ trigger on likely path typos where a turbofish is
    used.
    
    On likely path typos, remove note explaining type ascription.
    estebank committed Jul 9, 2020
    Configuration menu
    Copy the full SHA
    e771a4f View commit details
    Browse the repository at this point in the history
  7. Move to unstable section

    Manishearth committed Jul 9, 2020
    Configuration menu
    Copy the full SHA
    36a229b View commit details
    Browse the repository at this point in the history
  8. Add test

    Manishearth committed Jul 9, 2020
    Configuration menu
    Copy the full SHA
    fe351e9 View commit details
    Browse the repository at this point in the history
  9. Rollup merge of rust-lang#70835 - yoshuawuyts:int-log2, r=dtolnay

    Add Integer::checked_{log,log2,log10}
    
    This implements `{log,log2,log10}` methods for all integer types. The implementation was provided by @substack for use in the stdlib.
    
    _Note: I'm not big on math, so this PR is a best effort written with limited knowledge. It's likely I'll be getting things wrong, but happy to learn and correct. Please bare with me._
    
    ## Motivation
    Calculating the logarithm of a number is a generally useful operation. Currently the stdlib only provides implementations for floats, which means that if we want to calculate the logarithm for an integer we have to cast it to a float and then back to an int.
    
    > would be nice if there was an integer log2 instead of having to either use the f32 version or leading_zeros() which i have to verify the results of every time to be sure
    
    _— [@substack, 2020-03-08](https://twitter.com/substack/status/1236445105197727744)_
    
    At higher numbers converting from an integer to a float we also risk overflows. This means that Rust currently only provides log operations for a limited set of integers.
    
    The process of doing log operations by converting between floats and integers is also prone to rounding errors. In the following example we're trying to calculate `base10` for an integer. We might try and calculate the `base2` for the values, and attempt [a base swap](https://www.rapidtables.com/math/algebra/Logarithm.html#log-rules) to arrive at `base10`. However because we're performing intermediate rounding we arrive at the wrong result:
    
    ```rust
    // log10(900) = ~2.95 = 2
    dbg!(900f32.log10() as u64);
    
    // log base change rule: logb(x) = logc(x) / logc(b)
    // log2(900) / log2(10) = 9/3 = 3
    dbg!((900f32.log2() as u64) / (10f32.log2() as u64));
    ```
    _[playground](https://play.rust-lang.org/?version=stable&mode=debug&edition=2018&gist=6bd6c68b3539e400f9ca4fdc6fc2eed0)_
    
    This is somewhat nuanced as a lot of the time it'll work well, but in real world code this could lead to some hard to track bugs. By providing correct log implementations directly on integers we can help prevent errors around this.
    
    ## Implementation notes
    
    I checked whether LLVM intrinsics existed before implementing this, and none exist yet. ~~Also I couldn't really find a better way to write the `ilog` function. One option would be to make it a private method on the number, but I didn't see any precedent for that. I also didn't know where to best place the tests, so I added them to the bottom of the file. Even though they might seem like quite a lot they take no time to execute.~~
    
    ## References
    
    - [Log rules](https://www.rapidtables.com/math/algebra/Logarithm.html#log-rules)
    - [Rounding error playground](https://play.rust-lang.org/?version=stable&mode=debug&edition=2018&gist=6bd6c68b3539e400f9ca4fdc6fc2eed0)
    - [substack's tweet asking about integer log2 in the stdlib](https://twitter.com/substack/status/1236445105197727744)
    - [Integer Logarithm, A. Jaffer 2008](https://people.csail.mit.edu/jaffer/III/ilog.pdf)
    Manishearth authored Jul 9, 2020
    Configuration menu
    Copy the full SHA
    9c7a750 View commit details
    Browse the repository at this point in the history
  10. Rollup merge of rust-lang#73292 - poliorcetics:fix-link-in-partialeq,…

    … r=Dylan-DPC
    
    Fixing broken link for the Eq trait
    
    Fixes rust-lang#73233.
    Manishearth authored Jul 9, 2020
    Configuration menu
    Copy the full SHA
    806cfce View commit details
    Browse the repository at this point in the history
  11. Rollup merge of rust-lang#73791 - Manishearth:parens-intra-doc, r=Gui…

    …llaumeGomez,jyn514
    
    Allow for parentheses after macro intra-doc-links
    
    None
    Manishearth authored Jul 9, 2020
    Configuration menu
    Copy the full SHA
    c191cd1 View commit details
    Browse the repository at this point in the history
  12. Rollup merge of rust-lang#74070 - eddyb:forall-tcx-providers, r=nikom…

    …atsakis
    
     Use for<'tcx> fn pointers in Providers, instead of having Providers<'tcx>.
    
    In order to work around normalization-under-HRTB (for `provide!` in `rustc_metadata`), we ended up with this:
    ```rust
    struct Providers<'tcx> {
        type_of: fn(TyCtxt<'tcx>, DefId) -> Ty<'tcx>,
        // ...
    }
    ```
    But what I initially wanted to do, IIRC, was this:
    ```rust
    struct Providers {
        type_of: for<'tcx> fn(TyCtxt<'tcx>, DefId) -> Ty<'tcx>,
        // ...
    }
    ```
    
    This PR moves to the latter, for the simple reason that only the latter allows keeping a `Providers` value, or a subset of its `fn` pointer fields, around in a `static` or `thread_local!`, which can be really useful for custom drivers that override queries.
    (@jyn514 and I came across a concrete usecase of that in `rustdoc`)
    
    The `provide!` macro in `rustc_metadata` is fixed by making the query key/value types available as type aliases under `ty::query::query_{keys,values}`, not just associated types (this is the first commit).
    
    r? @nikomatsakis
    Manishearth authored Jul 9, 2020
    Configuration menu
    Copy the full SHA
    da25c24 View commit details
    Browse the repository at this point in the history
  13. Rollup merge of rust-lang#74077 - sethp:docs/fix-intra-doc-primitive-…

    …link, r=jyn514
    
    Use relative path for local links to primitives
    
    Else, links to `char::foo` would point into `/path/to/src/libcore/std/primitive.char.html#method.foo`.
    
    Split out from rust-lang#73804.
    Manishearth authored Jul 9, 2020
    Configuration menu
    Copy the full SHA
    d07bb64 View commit details
    Browse the repository at this point in the history
  14. Rollup merge of rust-lang#74107 - nbdd0121:rustdoc, r=GuillaumeGomez

    Hide `&mut self` methods from Deref in sidebar if there are no `DerefMut` impl for the type.
    
    This partially addresses rust-lang#74083.
    Manishearth authored Jul 9, 2020
    Configuration menu
    Copy the full SHA
    69e30b5 View commit details
    Browse the repository at this point in the history
  15. Rollup merge of rust-lang#74109 - nbdd0121:issue-74082, r=petrochenkov

    Only allow `repr(i128/u128)` on enum
    
    Fixes rust-lang#74082
    Manishearth authored Jul 9, 2020
    Configuration menu
    Copy the full SHA
    60213e1 View commit details
    Browse the repository at this point in the history
  16. Rollup merge of rust-lang#74125 - ayazhafiz:i/74050, r=matthewjasper

    Correctly mark the ending span of a match arm
    
    Closes rust-lang#74050
    
    r? @matthewjasper
    Manishearth authored Jul 9, 2020
    Configuration menu
    Copy the full SHA
    8ec755c View commit details
    Browse the repository at this point in the history
  17. Rollup merge of rust-lang#74135 - ehuss:update-books, r=ehuss

    Update books
    
    ## book
    
    3 commits in 4e7c00bece1544d409312ec93467beb62b5bd0cb..84a31397b34f9d405df44f2899ff17a4828dba18
    2020-06-19 09:39:12 -0400 to 2020-07-04 10:50:18 -0500
    - Update Windows install instructions (rust-lang/book#2389)
    - Update ch01-02-hello-world.md (rust-lang/book#2386)
    - bump mdbook version in github action (rust-lang/book#2380)
    
    ## reference
    
    2 commits in 04d5d5d7ba624b6f5016298451f3a63d557f3260..0ea7bc494f1289234d8800bb9185021e0ad946f0
    2020-06-16 15:08:05 -0700 to 2020-07-02 15:33:04 -0700
    - Fix mis-capitalization of type name. (rust-lang/reference#844)
    - Fix name of trait for array indexing. (rust-lang/reference#840)
    
    ## embedded-book
    
    1 commits in 616962ad0dd80f34d8b802da038d0aed9dd691bb..94d9ea8460bcbbbfef1877b47cb930260b5849a7
    2020-06-23 16:03:45 +0000 to 2020-07-05 14:17:40 +0000
    - Note on transformation of static variables by attribute exception  (rust-embedded/book#251)
    
    ## rust-by-example
    
    1 commits in 6f94ccb48da6fa4ed0031290f21411cf789f7d5e..229c6945a26a53a751ffa4f9cb418388c00029d3
    2020-06-20 17:51:30 -0300 to 2020-07-06 10:13:15 -0300
    - Modify comments (rust-lang/rust-by-example#1359)
    Manishearth authored Jul 9, 2020
    Configuration menu
    Copy the full SHA
    f4d530d View commit details
    Browse the repository at this point in the history
  18. Rollup merge of rust-lang#74136 - JohnTitor:index-page-link, r=Guilla…

    …umeGomez
    
    Fix broken link in rustdocdoc
    
    The previous link redirects to https://www.rust-lang.org/learn.
    Manishearth authored Jul 9, 2020
    Configuration menu
    Copy the full SHA
    6e58716 View commit details
    Browse the repository at this point in the history
  19. Rollup merge of rust-lang#74137 - ehuss:update-cargo, r=ehuss

    Update cargo
    
    6 commits in fede83ccf973457de319ba6fa0e36ead454d2e20..4f74d9b2a771c58b7ef4906b2668afd075bc8081
    2020-07-02 21:51:34 +0000 to 2020-07-08 17:13:00 +0000
    - Disable long_file_names test if not supported on Windows. (rust-lang/cargo#8469)
    - Add support for deserializing enums in config files (rust-lang/cargo#8454)
    - Write GNU tar files, supporting long names. (rust-lang/cargo#8453)
    - Don't overwrite existing `rustdoc` args with --document-private-items (rust-lang/cargo#8449)
    - Add some help about rustup's +toolchain syntax. (rust-lang/cargo#8455)
    - Update metadata man page. (rust-lang/cargo#8451)
    Manishearth authored Jul 9, 2020
    Configuration menu
    Copy the full SHA
    9646357 View commit details
    Browse the repository at this point in the history
  20. Rollup merge of rust-lang#74142 - pickfire:patch-1, r=dtolnay

    Liballoc use vec instead of vector
    
    Keep congruency with other parts, full word vector is rarely used.
    Manishearth authored Jul 9, 2020
    Configuration menu
    Copy the full SHA
    f6dc620 View commit details
    Browse the repository at this point in the history
  21. Rollup merge of rust-lang#74146 - RalfJung:miri, r=RalfJung

    update miri
    
    Fixes rust-lang#74132
    Cc @rust-lang/miri r? @ghost
    Manishearth authored Jul 9, 2020
    Configuration menu
    Copy the full SHA
    feaf996 View commit details
    Browse the repository at this point in the history
  22. Rollup merge of rust-lang#74150 - tamird:blocklist, r=nikomatsakis

    Avoid "blacklist"
    
    Other terms are more inclusive and precise.
    
    Clippy still has a lint named "blacklisted-name", but renaming it would
    be a breaking change, so is left for future work.
    
    The target configuration option "abi-blacklist" has been depreciated and
    renamed to "unsupported-abis". The old name continues to work.
    Manishearth authored Jul 9, 2020
    Configuration menu
    Copy the full SHA
    71da131 View commit details
    Browse the repository at this point in the history
  23. Rollup merge of rust-lang#74184 - Manishearth:doc-intra-doc, r=Guilla…

    …umeGomez
    
    Add docs for intra-doc-links
    
    Fixes rust-lang#66000
    
    Hmm, for some reason my push closed the previous PR
    Manishearth authored Jul 9, 2020
    Configuration menu
    Copy the full SHA
    997bf0e View commit details
    Browse the repository at this point in the history
  24. Rollup merge of rust-lang#74188 - estebank:tweak-ascription-typo-heur…

    …istic, r=petrochenkov
    
    Tweak `::` -> `:` typo heuristic and reduce verbosity
    
    Do not trigger on correct type ascription expressions with trailing
    operators and _do_ trigger on likely path typos where a turbofish is
    used.
    
    On likely path typos, remove note explaining type ascription.
    
    Clean up indentation.
    
    r? @petrochenkov
    Manishearth authored Jul 9, 2020
    Configuration menu
    Copy the full SHA
    7d81bb4 View commit details
    Browse the repository at this point in the history