diff --git a/Cargo.lock b/Cargo.lock index c97313d9..788d785c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -73,7 +73,7 @@ dependencies = [ "serde", "serde_derive", "serde_json", - "syn", + "syn 2.0.106", "toml", ] @@ -96,7 +96,7 @@ dependencies = [ "proc-macro2", "quote", "rustc_version", - "syn", + "syn 3.0.3", ] [[package]] @@ -106,7 +106,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "479ca8adacdd7ce8f1fb39ce9ecccbfe93a3f1344b3d0d97f20bc0196208f62b" dependencies = [ "proc-macro2", - "syn", + "syn 2.0.106", ] [[package]] @@ -165,7 +165,7 @@ checksum = "7eb0b34b42edc17f6b7cac84a52a1c5f0e1bb2227e997ca9011ea3dd34e8610b" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.106", ] [[package]] @@ -199,6 +199,17 @@ dependencies = [ "unicode-ident", ] +[[package]] +name = "syn" +version = "3.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "53e9bae58849f64dfa4f5d5ae372c8341f7305f82a3868709269343628b659a3" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + [[package]] name = "target-triple" version = "0.1.4" diff --git a/internal/Cargo.toml b/internal/Cargo.toml index e2714fb3..a434acf6 100644 --- a/internal/Cargo.toml +++ b/internal/Cargo.toml @@ -16,7 +16,7 @@ proc-macro = true [dependencies] quote = "1.0.40" proc-macro2 = "1.0.101" -syn = { version = "2.0.106", features = ["full", "parsing", "visit-mut"] } +syn = { version = "3", features = ["full", "parsing", "visit-mut"] } [build-dependencies] rustc_version = "0.4" diff --git a/internal/src/pin_data.rs b/internal/src/pin_data.rs index 44381076..13e25dfc 100644 --- a/internal/src/pin_data.rs +++ b/internal/src/pin_data.rs @@ -140,7 +140,11 @@ pub(crate) fn pin_data( fn is_phantom_pinned(ty: &Type) -> bool { match ty { - Type::Path(TypePath { qself: None, path }) => { + Type::Path(TypePath { + qself: None, + path, + attrs: _, + }) => { // Cannot possibly refer to `PhantomPinned` (except alias, but that's on the user). if path.segments.len() > 3 { return false; diff --git a/internal/src/pinned_drop.rs b/internal/src/pinned_drop.rs index a20ac314..addef870 100644 --- a/internal/src/pinned_drop.rs +++ b/internal/src/pinned_drop.rs @@ -16,8 +16,8 @@ pub(crate) fn pinned_drop( } input.unsafety = Some(Token![unsafe](input.impl_token.span)); match &mut input.trait_ { - Some((not, path, _for)) => { - if let Some(not) = not { + Some((path, _for)) => { + if let Some(not) = input.modifiers.polarity { dcx.error(not, "cannot implement `!PinnedDrop`"); } for (seg, expected) in path diff --git a/tests/ui/compile-fail/init/missing_error_type.stderr b/tests/ui/compile-fail/init/missing_error_type.stderr index 9e9a1478..8be1335e 100644 --- a/tests/ui/compile-fail/init/missing_error_type.stderr +++ b/tests/ui/compile-fail/init/missing_error_type.stderr @@ -1,4 +1,4 @@ -error: unexpected end of input, expected one of: `for`, parentheses, `fn`, `unsafe`, `extern`, identifier, `::`, `<`, `dyn`, square brackets, `*`, `&`, `!`, `impl`, `_`, lifetime +error: unexpected end of input, expected one of: `for`, parentheses, `unsafe`, `fn`, `extern`, identifier, `::`, `<`, `dyn`, square brackets, `*`, `&`, `!`, `impl`, `_`, lifetime --> tests/ui/compile-fail/init/missing_error_type.rs:8:13 | 8 | let _ = init!(Foo { x: Box::new(0)? }?);