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 6 pull requests #96877

Merged
merged 20 commits into from
May 9, 2022
Merged

Rollup of 6 pull requests #96877

merged 20 commits into from
May 9, 2022

Commits on Mar 30, 2022

  1. Improve floating point documentation:

    - Refine the "NaN as a special value" top level explanation of f32
    - Refine `const NAN` docstring.
    - Refine `fn is_sign_positive` and `fn is_sign_negative` docstrings.
    - Refine `fn min` and `fn max` docstrings.
    - Refine `fn trunc` docstrings.
    - Refine `fn powi` docstrings.
    - Refine `fn copysign` docstrings.
    - Reword `NaN` and `NAN` as plain "NaN", unless they refer to the specific `const NAN`.
    - Reword "a number" to `self` in function docstrings to clarify.
    - Remove "Returns NAN if the number is NAN" as this is told to be the default behavior in the top explanation.
    - Remove "propagating NaNs", as full propagation (preservation of payloads) is not guaranteed.
    golddranks committed Mar 30, 2022
    Configuration menu
    Copy the full SHA
    3561187 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    a965778 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    fff5a06 View commit details
    Browse the repository at this point in the history

Commits on Mar 31, 2022

  1. Configuration menu
    Copy the full SHA
    4ee8b64 View commit details
    Browse the repository at this point in the history
  2. Re-introduce "propagating NaN" to maximum/minimum, add "ignoring …

    …NaN" to `max`/`min`, add disclaimer about the "propagation".
    golddranks committed Mar 31, 2022
    Configuration menu
    Copy the full SHA
    57eec0c View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    21f1037 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    7175c49 View commit details
    Browse the repository at this point in the history

Commits on May 2, 2022

  1. Fix nits

    golddranks committed May 2, 2022
    Configuration menu
    Copy the full SHA
    dea7765 View commit details
    Browse the repository at this point in the history

Commits on May 8, 2022

  1. Configuration menu
    Copy the full SHA
    df446cb View commit details
    Browse the repository at this point in the history
  2. Actually fix ICE from rust-lang#96583

    PR rust-lang#96746 fixed a very similar bug, so the same logic is used in a
    different place.
    Badel2 committed May 8, 2022
    Configuration menu
    Copy the full SHA
    84adf0d View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    9d157ad View commit details
    Browse the repository at this point in the history

Commits on May 9, 2022

  1. Remove subst_spanned

    jackh726 committed May 9, 2022
    Configuration menu
    Copy the full SHA
    e14eae6 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    657499d View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    521d2c3 View commit details
    Browse the repository at this point in the history
  4. Rollup merge of rust-lang#95483 - golddranks:improve_float_docs, r=jo…

    …shtriplett
    
    Improve floating point documentation
    
    This is my attempt to improve/solve rust-lang#95468 and rust-lang#73328 .
    
    Added/refined explanations:
    - Refine the "NaN as a special value" top level explanation of f32
    - Refine `const NAN` docstring: add an explanation about there being multitude of NaN bitpatterns and disclaimer about the portability/stability guarantees.
    - Refine `fn is_sign_positive` and `fn is_sign_negative` docstrings: add disclaimer about the sign bit of NaNs.
    - Refine `fn min` and `fn max` docstrings: explain the semantics and their relationship to the standard and libm better.
    - Refine `fn trunc` docstrings: explain the semantics slightly more.
    - Refine `fn powi` docstrings: add disclaimer that the rounding behaviour might be different from `powf`.
    - Refine `fn copysign` docstrings: add disclaimer about payloads of NaNs.
    - Refine `minimum` and `maximum`: add disclaimer that "propagating NaN" doesn't mean that propagating the NaN bit patterns is guaranteed.
    - Refine `max` and `min` docstrings: add "ignoring NaN" to bring the one-row explanation to parity with `minimum` and `maximum`.
    
    Cosmetic changes:
    - Reword `NaN` and `NAN` as plain "NaN", unless they refer to the specific `const NAN`.
    - Reword "a number" to `self` in function docstrings to clarify.
    - Remove "Returns NAN if the number is NAN" from `abs`, as this is told to be the default behavior in the top explanation.
    matthiaskrgr committed May 9, 2022
    Configuration menu
    Copy the full SHA
    28d800c View commit details
    Browse the repository at this point in the history
  5. Rollup merge of rust-lang#96008 - fmease:warn-on-useless-doc-hidden-o…

    …n-assoc-impl-items, r=lcnr
    
    Warn on unused `#[doc(hidden)]` attributes on trait impl items
    
    [Zulip conversation](https://rust-lang.zulipchat.com/#narrow/stream/266220-rustdoc/topic/.E2.9C.94.20Validy.20checks.20for.20.60.23.5Bdoc.28hidden.29.5D.60).
    
    Whether an associated item in a trait impl is shown or hidden in the documentation entirely depends on the corresponding item in the trait declaration. Rustdoc completely ignores `#[doc(hidden)]` attributes on impl items. No error or warning is emitted:
    
    ```rust
    pub trait Tr { fn f(); }
    pub struct Ty;
    impl Tr for Ty { #[doc(hidden)] fn f() {} }
    //               ^^^^^^^^^^^^^^ ignored by rustdoc and currently
    //                              no error or warning issued
    ```
    
    This may lead users to the wrong belief that the attribute has an effect. In fact, several such cases are found in the standard library (I've removed all of them in this PR).
    There does not seem to exist any incentive to allow this in the future either: Impl'ing a trait for a type means the type *fully* conforms to its API. Users can add `#[doc(hidden)]` to the whole impl if they want to hide the implementation or add the attribute to the corresponding associated item in the trait declaration to hide the specific item. Hiding an implementation of an associated item does not make much sense: The associated item can still be found on the trait page.
    
    This PR emits the warn-by-default lint `unused_attribute` for this case with a future-incompat warning.
    
    `@rustbot` label T-compiler T-rustdoc A-lint
    matthiaskrgr committed May 9, 2022
    Configuration menu
    Copy the full SHA
    6c8001b View commit details
    Browse the repository at this point in the history
  6. Rollup merge of rust-lang#96841 - thomcc:revert-osstr-join, r=m-ou-se

    Revert "Implement [OsStr]::join", which was merged without FCP.
    
    This reverts commit 4fcbc53, see rust-lang#96744. (I'm terribly sorry, and truly don't remember r+ing it, or even having seen it before yesterday, which is... genuinely very worrisome for me).
    
    r? `@m-ou-se`
    matthiaskrgr committed May 9, 2022
    Configuration menu
    Copy the full SHA
    f4bef2e View commit details
    Browse the repository at this point in the history
  7. Rollup merge of rust-lang#96844 - Badel2:actually-fix-96583, r=compil…

    …er-errors
    
    Actually fix ICE from rust-lang#96583
    
    PR rust-lang#96746 fixed a very similar bug, so the same logic is used in a different place.
    
    I originally concluded that the two issues (rust-lang#96583 and rust-lang#96738) were identical by comparing the backtrace, but I didn't look close enough.
    matthiaskrgr committed May 9, 2022
    Configuration menu
    Copy the full SHA
    84a8f8d View commit details
    Browse the repository at this point in the history
  8. Rollup merge of rust-lang#96854 - jackh726:subst-cleanup, r=compiler-…

    …errors
    
    Some subst cleanup
    
    Two separate things here. Both changes are useful for some refactoring I'm doing to add an "EarlyBinder" newtype. (Part of chalkification).
    
    1) Remove `subst_spanned` and just use `subst`. It wasn't used much anyways. In practice, I think we can probably get most of the info just from the actual error message. If not, outputting logs should do the trick. (The specific line probably wouldn't help much anyways).
    
    2) Call `.subst()` before `replace_bound_vars_with_fresh_vars` and `erase_late_bound_regions` in three places that do the opposite. I think there might have been some time in the past that the order here matter for something, but this shouldn't be the case anymore. Conceptually, it makes more sense to the of the *early bound* vars on `fn`s as "outside" the late bound vars.
    matthiaskrgr committed May 9, 2022
    Configuration menu
    Copy the full SHA
    0e00ed5 View commit details
    Browse the repository at this point in the history
  9. Rollup merge of rust-lang#96858 - notriddle:notriddle/cleanup-search-…

    …js, r=GuillaumeGomez
    
    Remove unused param from search.js::checkPath
    matthiaskrgr committed May 9, 2022
    Configuration menu
    Copy the full SHA
    5972222 View commit details
    Browse the repository at this point in the history