1. 19 4月, 2021 7 次提交
    • K
      fix few typos · f43ee8eb
      klensy 提交于
      f43ee8eb
    • B
      Auto merge of #84283 - jsha:de-emphasize-attributes, r=GuillaumeGomez · 62652865
      bors 提交于
      rustdoc: Reduce visual weight of attributes.
      
      Followup from #83337. As part of that PR, we stopped hiding attributes behind a toggle, because most things have just zero or one attributes. However, this made clear that the current rendering of attributes emphasizes them a lot, which distracts from function signatures. This PR changes their color of attributes to be the same as the toggles, and reduces their font weight.
      
      This also removes `#[lang]` from the list of ALLOWED_ATTRIBUTES. This attribute is an implementation detail rather than part of the public-facing documentation.
      
      ![image](https://user-images.githubusercontent.com/220205/115131061-cc407d80-9fa9-11eb-9a77-ad3f3217f391.png)
      
      Demo at https://hoffman-andrews.com/rust/de-emph-attr/std/string/struct.String.html#method.trim
      62652865
    • B
      Auto merge of #84316 - teymour-aldridge:improve-defaulted-never-note, r=petrochenkov · 532609b0
      bors 提交于
      Improve an error message.
      532609b0
    • B
      Auto merge of #84288 - notriddle:short-links, r=jyn514 · 8108e17f
      bors 提交于
      rustdoc: get rid of CURRENT_DEPTH
      
      Fixes #82742
      8108e17f
    • B
      Auto merge of #83799 - crlf0710:stablize_non_ascii_idents, r=Manishearth · c4ba8e3e
      bors 提交于
      Stablize `non-ascii-idents`
      
      This is the stablization PR for RFC 2457. Currently this is waiting on fcp in [tracking issue](https://github.com/rust-lang/rust/issues/55467).
      
      r? `@Manishearth`
      c4ba8e3e
    • B
      Auto merge of #78880 - CDirkx:not_supported, r=joshtriplett · 5a4ab264
      bors 提交于
      Add `Unsupported` to `std::io::ErrorKind`
      
      I noticed a significant portion of the uses of `ErrorKind::Other` in std is for unsupported operations.
      The notion that a specific operation is not available on a target (and will thus never succeed) seems semantically distinct enough from just "an unspecified error occurred", which is why I am proposing to add the variant `Unsupported` to `std::io::ErrorKind`.
      
      **Implementation**:
      
      The following variant will be added to `std::io::ErrorKind`:
      
      ```rust
      /// This operation is unsupported on this platform.
      Unsupported
      ```
      `std::io::ErrorKind::Unsupported` is an error returned when a given operation is not supported on a platform, and will thus never succeed; there is no way for the software to recover. It will be used instead of `Other` where appropriate, e.g. on wasm for file and network operations.
      
      `decode_error_kind` will be updated  to decode operating system errors to `Unsupported`:
      - Unix and VxWorks: `libc::ENOSYS`
      - Windows: `c::ERROR_CALL_NOT_IMPLEMENTED`
      - WASI: `wasi::ERRNO_NOSYS`
      
      **Stability**:
      This changes the kind of error returned by some functions on some platforms, which I think is not covered by the stability guarantees of the std? User code could depend on this behavior, expecting `ErrorKind::Other`, however the docs already mention:
      
      > Errors that are `Other` now may move to a different or a new `ErrorKind` variant in the future. It is not recommended to match an error against `Other` and to expect any additional characteristics, e.g., a specific `Error::raw_os_error` return value.
      
      The most recent variant added to `ErrorKind` was `UnexpectedEof` in `1.6.0` (almost 5 years ago), but `ErrorKind` is marked as `#[non_exhaustive]` and the docs warn about exhaustively matching on it, so adding a new variant per se should not be a breaking change.
      
      The variant `Unsupported` itself could be marked as `#[unstable]`, however, because this PR also immediately uses this new variant and changes the errors returned by functions I'm inclined to agree with the others in this thread that the variant should be insta-stabilized.
      5a4ab264
    • T
      Improve an error message. · 567de4a2
      teymour-aldridge 提交于
      567de4a2
  2. 18 4月, 2021 30 次提交
  3. 17 4月, 2021 3 次提交