Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: dtolnay/proc-macro2
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 1.0.63
Choose a base ref
...
head repository: dtolnay/proc-macro2
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 1.0.64
Choose a head ref
  • 7 commits
  • 5 files changed
  • 1 contributor

Commits on Jul 3, 2023

  1. Resolve needless_rwa_string_hashes clippy lint in test suite

        error: unnecessary hashes around raw string literal
           --> tests/test.rs:683:17
            |
        683 |     check_spans(r###"r#"abc"#"###, &[(1, 0, 1, 8)]);
            |                 ^^^^^^^^^^^^^^^^^ help: try: `r##"r#"abc"#"##`
            |
            = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_raw_string_hashes
            = note: `-D clippy::needless-raw-string-hashes` implied by `-D clippy::all`
    
        error: unnecessary hashes around raw string literal
           --> tests/test.rs:684:17
            |
        684 |     check_spans(r###"r#"ábc"#"###, &[(1, 0, 1, 8)]);
            |                 ^^^^^^^^^^^^^^^^^ help: try: `r##"r#"ábc"#"##`
            |
            = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_raw_string_hashes
    dtolnay committed Jul 3, 2023

    Verified

    This commit was signed with the committer’s verified signature.
    dtolnay David Tolnay
    Copy the full SHA
    51ed1bb View commit details

Commits on Jul 4, 2023

  1. Verified

    This commit was signed with the committer’s verified signature.
    dtolnay David Tolnay
    Copy the full SHA
    bdfb5c1 View commit details

Commits on Jul 9, 2023

  1. Revert "Require \r whitespace to be followed by \n"

    This reverts commit 0c550b2.
    dtolnay committed Jul 9, 2023

    Verified

    This commit was signed with the committer’s verified signature.
    dtolnay David Tolnay
    Copy the full SHA
    d10651c View commit details
  2. Verified

    This commit was signed with the committer’s verified signature.
    dtolnay David Tolnay
    Copy the full SHA
    261ad4d View commit details
  3. Merge pull request #399 from dtolnay/carriagereturn

    Revert "Require \r whitespace to be followed by \n"
    dtolnay authored Jul 9, 2023

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    9c812bc View commit details
  4. Verified

    This commit was signed with the committer’s verified signature.
    dtolnay David Tolnay
    Copy the full SHA
    ab053d3 View commit details
  5. Release 1.0.64

    dtolnay committed Jul 9, 2023

    Verified

    This commit was signed with the committer’s verified signature.
    dtolnay David Tolnay
    Copy the full SHA
    075af34 View commit details
Showing with 21 additions and 14 deletions.
  1. +12 −1 .github/workflows/ci.yml
  2. +1 −1 Cargo.toml
  3. +1 −1 src/lib.rs
  4. +3 −7 src/parse.rs
  5. +4 −4 tests/test.rs
13 changes: 12 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -74,7 +74,18 @@ jobs:
run: cargo test
env:
RUSTFLAGS: -Z allow-features= ${{env.RUSTFLAGS}}
- run: cargo update -Z minimal-versions && cargo build

minimal:
name: Minimal versions
needs: pre_ci
if: needs.pre_ci.outputs.continue
runs-on: ubuntu-latest
timeout-minutes: 45
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@nightly
- run: cargo generate-lockfile -Z minimal-versions
- run: cargo check --locked

webassembly:
name: WebAssembly
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "proc-macro2"
version = "1.0.63" # remember to update html_root_url
version = "1.0.64" # remember to update html_root_url
authors = ["David Tolnay <dtolnay@gmail.com>", "Alex Crichton <alex@alexcrichton.com>"]
autobenches = false
categories = ["development-tools::procedural-macro-helpers"]
2 changes: 1 addition & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
@@ -86,7 +86,7 @@
//! a different thread.
// Proc-macro2 types in rustdoc of other crates get linked to here.
#![doc(html_root_url = "https://docs.rs/proc-macro2/1.0.63")]
#![doc(html_root_url = "https://docs.rs/proc-macro2/1.0.64")]
#![cfg_attr(any(proc_macro_span, super_unstable), feature(proc_macro_span))]
#![cfg_attr(super_unstable, feature(proc_macro_def_site))]
#![cfg_attr(doc_cfg, feature(doc_cfg))]
10 changes: 3 additions & 7 deletions src/parse.rs
Original file line number Diff line number Diff line change
@@ -104,15 +104,11 @@ fn skip_whitespace(input: Cursor) -> Cursor {
}
}
match byte {
b' ' | 0x09..=0x0c => {
b' ' | 0x09..=0x0d => {
s = s.advance(1);
continue;
}
b'\r' if s.as_bytes().get(1) == Some(&b'\n') => {
s = s.advance(2);
continue;
}
b if b <= 0x7f => {}
b if b.is_ascii() => {}
_ => {
let ch = s.chars().next().unwrap();
if is_whitespace(ch) {
@@ -460,7 +456,7 @@ fn cooked_byte_string(mut input: Cursor) -> Result<Cursor, Reject> {
}
_ => break,
},
b if b < 0x80 => {}
b if b.is_ascii() => {}
_ => break,
}
}
8 changes: 4 additions & 4 deletions tests/test.rs
Original file line number Diff line number Diff line change
@@ -680,8 +680,8 @@ fn non_ascii_tokens() {
check_spans("/*** ábc */ x", &[(1, 12, 1, 13)]);
check_spans(r#""abc""#, &[(1, 0, 1, 5)]);
check_spans(r#""ábc""#, &[(1, 0, 1, 5)]);
check_spans(r###"r#"abc"#"###, &[(1, 0, 1, 8)]);
check_spans(r###"r#"ábc"#"###, &[(1, 0, 1, 8)]);
check_spans(r##"r#"abc"#"##, &[(1, 0, 1, 8)]);
check_spans(r##"r#"ábc"#"##, &[(1, 0, 1, 8)]);
check_spans("r#\"a\nc\"#", &[(1, 0, 2, 3)]);
check_spans("r#\"á\nc\"#", &[(1, 0, 2, 3)]);
check_spans("'a'", &[(1, 0, 1, 3)]);
@@ -739,8 +739,8 @@ fn whitespace() {
let tokens = various_spaces.parse::<TokenStream>().unwrap();
assert_eq!(tokens.into_iter().count(), 0);

let lone_carriage_return = " \r ";
lone_carriage_return.parse::<TokenStream>().unwrap_err();
let lone_carriage_returns = " \r \r\r\n ";
lone_carriage_returns.parse::<TokenStream>().unwrap();
}

#[test]