Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 15 additions & 4 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion internal/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
6 changes: 5 additions & 1 deletion internal/src/pin_data.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions internal/src/pinned_drop.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion tests/ui/compile-fail/init/missing_error_type.stderr
Original file line number Diff line number Diff line change
@@ -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)? }?);
Expand Down