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 7 pull requests #104192

Merged
merged 25 commits into from
Nov 9, 2022
Merged

Rollup of 7 pull requests #104192

merged 25 commits into from
Nov 9, 2022

Commits on Oct 26, 2022

  1. stabilize int_log

    Lukas Markeffsky committed Oct 26, 2022
    Configuration menu
    Copy the full SHA
    9e36fd9 View commit details
    Browse the repository at this point in the history

Commits on Oct 28, 2022

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

Commits on Nov 3, 2022

  1. Rename some variables.

    These have been bugging me for a while.
    
    - `literal_text`: `src` is also used and is shorter and better.
    - `first_char`: used even when "first" doesn't make sense; `c` is
      shorter and better.
    - `curr`: `c` is shorter and better.
    - `unescaped_char`: `result` is also used and is shorter and better.
    - `second_char`: these have a single use and can be elided.
    nnethercote committed Nov 3, 2022
    Configuration menu
    Copy the full SHA
    f32e678 View commit details
    Browse the repository at this point in the history
  2. Clarify range calculations.

    There is some subtlety here.
    nnethercote committed Nov 3, 2022
    Configuration menu
    Copy the full SHA
    84ca2c3 View commit details
    Browse the repository at this point in the history
  3. Use Mode less.

    It's passed to numerous places where we just need an `is_byte` bool.
    Passing the bool avoids the need for some assertions.
    
    Also rename `is_bytes()` as `is_byte()`, to better match `Mode::Byte`,
    `Mode::ByteStr`, and `Mode::RawByteStr`.
    nnethercote committed Nov 3, 2022
    Configuration menu
    Copy the full SHA
    34b32b0 View commit details
    Browse the repository at this point in the history

Commits on Nov 4, 2022

  1. Make non-ASCII errors more consistent.

    There are three kinds of "byte" literals: byte literals, byte string
    literals, and raw byte string literals. None are allowed to have
    non-ASCII chars in them.
    
    Two `EscapeError` variants exist for when that constraint is violated.
    - `NonAsciiCharInByte`: used for byte literals and byte string literals.
    - `NonAsciiCharInByteString`: used for raw byte string literals.
    
    As a result, the messages for raw byte string literals use different
    wording, without good reason. Also, byte string literals are incorrectly
    described as "byte constants" in some error messages.
    
    This commit eliminates `NonAsciiCharInByteString` so the three cases are
    handled similarly, and described correctly. The `mode` is enough to
    distinguish them.
    
    Note: Some existing error messages mention "byte constants" and some
    mention "byte literals". I went with the latter here, because it's a
    more correct name, as used by the Reference.
    nnethercote committed Nov 4, 2022
    Configuration menu
    Copy the full SHA
    7dbf2c0 View commit details
    Browse the repository at this point in the history
  2. Improve comments.

    Remove a low-value comment, remove a duplicate comment, and correct a
    third comment.
    nnethercote committed Nov 4, 2022
    Configuration menu
    Copy the full SHA
    a21c045 View commit details
    Browse the repository at this point in the history
  3. Refactor cook_lexer_literal.

    It deals with eight cases: ints, floats, and the six quoted types
    (char/byte/strings). For ints and floats we have an early return, and
    the other six types fall through to the code at the end, which makes the
    function hard to read.
    
    This commit rearranges things to avoid the early returns.
    nnethercote committed Nov 4, 2022
    Configuration menu
    Copy the full SHA
    d963686 View commit details
    Browse the repository at this point in the history
  4. Inline and remove validate_int_literal.

    It has a single callsite, and is fairly small. The `Float` match arm
    already has base-specific checking inline, so this makes things more
    consistent.
    nnethercote committed Nov 4, 2022
    Configuration menu
    Copy the full SHA
    a203482 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    f8e2cef View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    57b2290 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    971a146 View commit details
    Browse the repository at this point in the history

Commits on Nov 5, 2022

  1. Remove unescape_byte_literal.

    It's easy to just use `unescape_literal` + `byte_from_char`.
    nnethercote committed Nov 5, 2022
    Configuration menu
    Copy the full SHA
    a838952 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    43d21b5 View commit details
    Browse the repository at this point in the history

Commits on Nov 7, 2022

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

Commits on Nov 8, 2022

  1. Simplify unescape_{char,byte}.

    The `usize` isn't needed in the error case.
    nnethercote committed Nov 8, 2022
    Configuration menu
    Copy the full SHA
    d6c97a3 View commit details
    Browse the repository at this point in the history

Commits on Nov 9, 2022

  1. const Compare Tuples

    onestacked committed Nov 9, 2022
    Configuration menu
    Copy the full SHA
    f665847 View commit details
    Browse the repository at this point in the history
  2. Cleanup fn trait ref test

    onestacked committed Nov 9, 2022
    Configuration menu
    Copy the full SHA
    b6c05eb View commit details
    Browse the repository at this point in the history
  3. Rollup merge of rust-lang#103570 - lukas-code:stabilize-ilog, r=scottmcm

    Stabilize integer logarithms
    
    Stabilizes feature `int_log`.
    
    I've also made the functions const stable, because they don't depend on any unstable const features. `rustc_allow_const_fn_unstable` is just there for `Option::expect`, which could be replaced with a `match` and `panic!`. cc ``@rust-lang/wg-const-eval``
    
    closes rust-lang#70887 (tracking issue)
    
    ~~blocked on FCP finishing: rust-lang#70887 (comment)
    FCP finished: rust-lang#70887 (comment)
    Dylan-DPC authored Nov 9, 2022
    Configuration menu
    Copy the full SHA
    1db7f69 View commit details
    Browse the repository at this point in the history
  4. Rollup merge of rust-lang#103694 - WaffleLapkin:mask_doc_example, r=s…

    …cottmcm
    
    Add documentation examples for `pointer::mask`
    
    The examples are somewhat convoluted, but I don't know how to make this better :(
    Dylan-DPC authored Nov 9, 2022
    Configuration menu
    Copy the full SHA
    b457d70 View commit details
    Browse the repository at this point in the history
  5. Rollup merge of rust-lang#103919 - nnethercote:unescaping-cleanups, r…

    …=matklad
    
    Unescaping cleanups
    
    Some code improvements, and some error message improvements.
    
    Best reviewed one commit at a time.
    
    r? ````@matklad````
    Dylan-DPC authored Nov 9, 2022
    Configuration menu
    Copy the full SHA
    4b50fb3 View commit details
    Browse the repository at this point in the history
  6. Rollup merge of rust-lang#103933 - nicholasbishop:bishop-uefi-tier-2,…

    … r=JohnTitor
    
    Promote {aarch64,i686,x86_64}-unknown-uefi to Tier 2
    
    MCP: rust-lang/compiler-team#555
    
    CC `@dvdhrm`
    Dylan-DPC authored Nov 9, 2022
    Configuration menu
    Copy the full SHA
    2313d32 View commit details
    Browse the repository at this point in the history
  7. Rollup merge of rust-lang#103952 - ehuss:dont-intra-linkcheck-referen…

    …ce, r=Mark-Simulacrum
    
    Don't intra linkcheck reference
    
    This removes the reference from the intra-doc link checks. This causes problems if any of the reference content needs to change, it causes the linkchecker to break. The reference has its own broken link check (https://github.com/rust-lang/reference/tree/master/style-check) which uses pulldown-cmark on the source to find actual broken links (instead of false-positives like this regex does).
    
    I think the intra-doc link check could potentially be removed completely, since I think rustdoc is now checking for them well enough. However, it may serve as a decent regression check.
    Dylan-DPC authored Nov 9, 2022
    Configuration menu
    Copy the full SHA
    1d262cd View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    64e737c View commit details
    Browse the repository at this point in the history
  9. Rollup merge of rust-lang#104125 - ink-feather-org:const_cmp_tuples, …

    …r=fee1-dead
    
    Const Compare for Tuples
    
    Makes the impls for Tuples of ~const `PartialEq` types also `PartialEq`, impls for Tuples of ~const `PartialOrd` types also `PartialOrd`, for Tuples of ~const `Ord` types also `Ord`.
    
    behind the `#![feature(const_cmp)]` gate.
    
    ~~Do not merge before rust-lang#104113 is merged because I want to use this feature to clean up the new test that I added there.~~
    
    r? ``@fee1-dead``
    Dylan-DPC authored Nov 9, 2022
    Configuration menu
    Copy the full SHA
    062f2fc View commit details
    Browse the repository at this point in the history