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.78
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.79
Choose a head ref
  • 6 commits
  • 6 files changed
  • 1 contributor

Commits on Feb 1, 2024

  1. Verified

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

Commits on Feb 8, 2024

  1. Ignore dead_code warning in test

        warning: trait `IsNotImplemented` is never used
          --> tests/marker.rs:24:27
           |
        24 |                     trait IsNotImplemented {
           |                           ^^^^^^^^^^^^^^^^
        ...
        47 | assert_impl!(Group is not Send or Sync);
           | --------------------------------------- in this macro invocation
           |
           = note: `#[warn(dead_code)]` on by default
           = note: this warning originates in the macro `assert_impl` (in Nightly builds, run with -Z macro-backtrace for more info)
    dtolnay committed Feb 8, 2024
    Copy the full SHA
    18c75c6 View commit details

Commits on Feb 10, 2024

  1. Ignore incompatible_msrv clippy lint for conditionally compiled code

        warning: current MSRV (Minimum Supported Rust Version) is `1.56.0` but this item is stable since `1.66.0`
           --> src/wrapper.rs:514:36
            |
        514 |             Span::Compiler(s) => s.source_text(),
            |                                    ^^^^^^^^^^^^^
            |
            = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#incompatible_msrv
            = note: `-W clippy::incompatible-msrv` implied by `-W clippy::all`
            = help: to override `-W clippy::all` add `#[allow(clippy::incompatible_msrv)]`
    dtolnay committed Feb 10, 2024
    Copy the full SHA
    e94f432 View commit details

Commits on Mar 12, 2024

  1. Fix dead_code warning on fallback SourceFile

        warning: struct `SourceFile` is never constructed
           --> src/fallback.rs:301:19
            |
        301 | pub(crate) struct SourceFile {
            |                   ^^^^^^^^^^
            |
            = note: `#[warn(dead_code)]` on by default
    
        warning: methods `path` and `is_real` are never used
           --> src/fallback.rs:307:12
            |
        305 | impl SourceFile {
            | --------------- methods in this implementation
        306 |     /// Get the path to this source file as a string.
        307 |     pub fn path(&self) -> PathBuf {
            |            ^^^^
        ...
        311 |     pub fn is_real(&self) -> bool {
            |            ^^^^^^^
    dtolnay committed Mar 12, 2024
    Copy the full SHA
    b9cd864 View commit details
  2. Prevent new lint from turning off nightly span support under -Dwarnings

    dtolnay committed Mar 12, 2024
    Copy the full SHA
    b176581 View commit details
  3. Release 1.0.79

    dtolnay committed Mar 12, 2024
    Copy the full SHA
    4ba4ab1 View commit details
Showing with 11 additions and 4 deletions.
  1. +1 −1 Cargo.toml
  2. +1 −0 build.rs
  3. +4 −0 src/fallback.rs
  4. +2 −1 src/lib.rs
  5. +1 −0 tests/marker.rs
  6. +2 −2 tests/ui/test-not-send.stderr
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.78"
version = "1.0.79"
authors = ["David Tolnay <dtolnay@gmail.com>", "Alex Crichton <alex@alexcrichton.com>"]
autobenches = false
categories = ["development-tools::procedural-macro-helpers"]
1 change: 1 addition & 0 deletions build.rs
Original file line number Diff line number Diff line change
@@ -156,6 +156,7 @@ fn compile_probe(rustc_bootstrap: bool) -> bool {
.arg("--edition=2021")
.arg("--crate-name=proc_macro2")
.arg("--crate-type=lib")
.arg("--cap-lints=allow")
.arg("--emit=dep-info,metadata")
.arg("--out-dir")
.arg(out_dir)
4 changes: 4 additions & 0 deletions src/fallback.rs
Original file line number Diff line number Diff line change
@@ -16,6 +16,7 @@ use core::ops::Range;
use core::ops::RangeBounds;
use core::ptr;
use core::str::FromStr;
#[cfg(procmacro2_semver_exempt)]
use std::path::PathBuf;

/// Force use of proc-macro2's fallback implementation of the API for now, even
@@ -297,11 +298,13 @@ impl IntoIterator for TokenStream {
}
}

#[cfg(procmacro2_semver_exempt)]
#[derive(Clone, PartialEq, Eq)]
pub(crate) struct SourceFile {
path: PathBuf,
}

#[cfg(procmacro2_semver_exempt)]
impl SourceFile {
/// Get the path to this source file as a string.
pub fn path(&self) -> PathBuf {
@@ -313,6 +316,7 @@ impl SourceFile {
}
}

#[cfg(procmacro2_semver_exempt)]
impl Debug for SourceFile {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
f.debug_struct("SourceFile")
3 changes: 2 additions & 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.78")]
#![doc(html_root_url = "https://docs.rs/proc-macro2/1.0.79")]
#![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))]
@@ -96,6 +96,7 @@
clippy::cast_possible_truncation,
clippy::checked_conversions,
clippy::doc_markdown,
clippy::incompatible_msrv,
clippy::items_after_statements,
clippy::iter_without_into_iter,
clippy::let_underscore_untyped,
1 change: 1 addition & 0 deletions tests/marker.rs
Original file line number Diff line number Diff line change
@@ -21,6 +21,7 @@ macro_rules! assert_impl {
$(
{
// Implemented for types that implement $marker.
#[allow(dead_code)]
trait IsNotImplemented {
fn assert_not_implemented() {}
}
4 changes: 2 additions & 2 deletions tests/ui/test-not-send.stderr
Original file line number Diff line number Diff line change
@@ -4,7 +4,7 @@ error[E0277]: `proc_macro::Span` cannot be sent between threads safely
5 | requires_send::<Span>();
| ^^^^ `proc_macro::Span` cannot be sent between threads safely
|
= help: within `Span`, the trait `Send` is not implemented for `proc_macro::Span`
= help: within `Span`, the trait `Send` is not implemented for `proc_macro::Span`, which is required by `Span: Send`
note: required because it appears within the type `proc_macro2::imp::Span`
--> $WORKSPACE/src/wrapper.rs
|
@@ -27,7 +27,7 @@ error[E0277]: `Rc<()>` cannot be sent between threads safely
5 | requires_send::<Span>();
| ^^^^ `Rc<()>` cannot be sent between threads safely
|
= help: within `Span`, the trait `Send` is not implemented for `Rc<()>`
= help: within `Span`, the trait `Send` is not implemented for `Rc<()>`, which is required by `Span: Send`
note: required because it appears within the type `PhantomData<Rc<()>>`
--> $RUST/core/src/marker.rs
|