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

0.4: Expand glob imports #335

Merged
merged 8 commits into from
Dec 26, 2021
Merged
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
1 change: 0 additions & 1 deletion .github/CODEOWNERS

This file was deleted.

2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -37,7 +37,7 @@ jobs:
- uses: taiki-e/github-actions/install-rust@main
with:
toolchain: ${{ matrix.rust }}
component: rustfmt
component: rustfmt,rust-src
- name: Pre Cache cargo-expand
run: |
mkdir -p .github/caching
35 changes: 22 additions & 13 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -4,13 +4,21 @@ All notable changes to this project will be documented in this file.

This project adheres to [Semantic Versioning](https://semver.org).

<!--
NOTE: In this file, do not use the hard wrap in the middle of a sentence for compatibility with GitHub comment style markdown rendering.
-->

## [Unreleased]

## [0.4.29] - 2021-12-26

- [Fix compile error with `syn` 1.0.84 and later.](https://github.com/taiki-e/pin-project/pull/335)

## [0.4.28] - 2021-03-28

- [Fix `unused_must_use` warning on unused borrows, which will be added to rustc in the future.](https://github.com/taiki-e/pin-project/pull/322) See [#322](https://github.com/taiki-e/pin-project/pull/322) for more details.

(Note: 1.0 does not have this problem.)
(NOTE: 1.0 does not have this problem.)

## [0.4.27] - 2020-10-11

@@ -24,13 +32,13 @@ This project adheres to [Semantic Versioning](https://semver.org).

- [Suppress `drop_bounds` lint, which will be added to rustc in the future.](https://github.com/taiki-e/pin-project/pull/273) See [#272](https://github.com/taiki-e/pin-project/issues/272) for more details.

(Note: 1.0.0-alpha.1 already contains this change.)
(NOTE: 1.0.0-alpha.1 already contains this change.)

## [0.4.24] - 2020-09-26

- [Fix compatibility of generated code with `forbid(future_incompatible)`.](https://github.com/taiki-e/pin-project/pull/282)

Note: This does not guarantee compatibility with `forbid(future_incompatible)` in the future.
NOTE: This does not guarantee compatibility with `forbid(future_incompatible)` in the future.
If rustc adds a new lint, we may not be able to keep this.

## [0.4.23] - 2020-07-27
@@ -161,7 +169,7 @@ This project adheres to [Semantic Versioning](https://semver.org).
}
```

*[Note: This raises the minimum supported Rust version of this crate from Rust 1.33 to Rust 1.34.](https://github.com/taiki-e/pin-project/pull/219#pullrequestreview-408644187)*
*[NOTE: This raises the minimum supported Rust version of this crate from Rust 1.33 to Rust 1.34.](https://github.com/taiki-e/pin-project/pull/219#pullrequestreview-408644187)*

- [Fix an issue where duplicate `#[project]` attributes were ignored.](https://github.com/taiki-e/pin-project/pull/218)

@@ -195,7 +203,7 @@ This project adheres to [Semantic Versioning](https://semver.org).

## [0.4.11] - 2020-05-07

**Note: This release has been yanked.** See [#206](https://github.com/taiki-e/pin-project/issues/206) for details.
**NOTE:** This release has been yanked. See [#206](https://github.com/taiki-e/pin-project/issues/206) for details.

- [Fix an issue that `#[project]` on non-statement expression does not work without unstable features.](https://github.com/taiki-e/pin-project/pull/197)

@@ -249,7 +257,7 @@ This project adheres to [Semantic Versioning](https://semver.org).

## [0.4.3] - 2019-10-15

**Note: This release has been yanked.** See [#148](https://github.com/taiki-e/pin-project/pull/148) for details.
**NOTE:** This release has been yanked. See [#148](https://github.com/taiki-e/pin-project/pull/148) for details.

- [`#[pin_project]` can now interoperate with `#[cfg_attr()]`.](https://github.com/taiki-e/pin-project/pull/135)

@@ -261,19 +269,19 @@ This project adheres to [Semantic Versioning](https://semver.org).

## [0.4.2] - 2019-09-29

**Note: This release has been yanked.** See [#148](https://github.com/taiki-e/pin-project/pull/148) for details.
**NOTE:** This release has been yanked. See [#148](https://github.com/taiki-e/pin-project/pull/148) for details.

- [Fix support for DSTs(Dynamically Sized Types).](https://github.com/taiki-e/pin-project/pull/113)

## [0.4.1] - 2019-09-26

**Note: This release has been yanked.** See [#148](https://github.com/taiki-e/pin-project/pull/148) for details.
**NOTE:** This release has been yanked. See [#148](https://github.com/taiki-e/pin-project/pull/148) for details.

- [Fix an issue that caused an error when using `#[pin_project]` on a type that has `#[pin]` + `!Unpin` field with no generics or lifetime.](https://github.com/taiki-e/pin-project/pull/111)

## [0.4.0] - 2019-09-25

**Note: This release has been yanked.** See [#148](https://github.com/taiki-e/pin-project/pull/148) for details.
**NOTE:** This release has been yanked. See [#148](https://github.com/taiki-e/pin-project/pull/148) for details.

- [**Pin projection has become a safe operation.**](https://github.com/taiki-e/pin-project/pull/18) In the absence of other unsafe code that you write, it is impossible to cause undefined behavior.

@@ -402,7 +410,7 @@ Changes since the 0.4.0-beta.1 release:

- `Unpin` impls must be specified with an impl of `UnsafeUnpin`, instead of implementing the normal `Unpin` trait.

- Made `#[project]` attribute disabled by default.
- Make `#[project]` attribute disabled by default.

See also [tracking issue for 0.4 release](https://github.com/taiki-e/pin-project/issues/21).

@@ -416,7 +424,7 @@ See also [tracking issue for 0.4 release](https://github.com/taiki-e/pin-project

## [0.3.3] - 2019-07-15

**Note: This release has been yanked.** See [#16](https://github.com/taiki-e/pin-project/issues/16) for details.
**NOTE:** This release has been yanked. See [#16](https://github.com/taiki-e/pin-project/issues/16) for details.

- Diagnostic improvements.

@@ -490,11 +498,12 @@ See also [tracking issue for 0.4 release](https://github.com/taiki-e/pin-project

## [0.1.0] - 2019-01-08

**Note: This release has been yanked.**
**NOTE:** This release has been yanked.

Initial release

[Unreleased]: https://github.com/taiki-e/pin-project/compare/v0.4.28...HEAD
[Unreleased]: https://github.com/taiki-e/pin-project/compare/v0.4.29...v0.4
[0.4.29]: https://github.com/taiki-e/pin-project/compare/v0.4.28...v0.4.29
[0.4.28]: https://github.com/taiki-e/pin-project/compare/v0.4.27...v0.4.28
[0.4.27]: https://github.com/taiki-e/pin-project/compare/v0.4.26...v0.4.27
[0.4.26]: https://github.com/taiki-e/pin-project/compare/v0.4.25...v0.4.26
11 changes: 7 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
[package]
name = "pin-project"
version = "0.4.28"
authors = ["Taiki Endo <te316e89@gmail.com>"]
version = "0.4.29"
edition = "2018"
rust-version = "1.34"
license = "Apache-2.0 OR MIT"
repository = "https://github.com/taiki-e/pin-project"
documentation = "https://docs.rs/pin-project"
keywords = ["pin", "macros", "attribute"]
categories = ["no-std", "rust-patterns"]
exclude = ["/.*", "/ci", "/tools"]
@@ -28,9 +27,13 @@ members = [
]

[dependencies]
pin-project-internal = { version = "=0.4.28", path = "pin-project-internal", default-features = false }
pin-project-internal = { version = "=0.4.29", path = "pin-project-internal", default-features = false }

[dev-dependencies]
pin-project-auxiliary-macro = { path = "tests/ui/auxiliary" }
rustversion = "1.0"
trybuild = "1.0"

# For test on MSRV.
ryu = "=1.0.6"
serde_json = "=1.0.72"
5 changes: 2 additions & 3 deletions pin-project-internal/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
[package]
name = "pin-project-internal"
version = "0.4.28"
authors = ["Taiki Endo <te316e89@gmail.com>"]
version = "0.4.29"
edition = "2018"
rust-version = "1.34"
license = "Apache-2.0 OR MIT"
repository = "https://github.com/taiki-e/pin-project"
documentation = "https://docs.rs/pin-project-internal"
keywords = ["pin", "macros", "attribute"]
categories = ["no-std", "rust-patterns"]
description = """
2 changes: 1 addition & 1 deletion pin-project-internal/src/lib.rs
Original file line number Diff line number Diff line change
@@ -6,7 +6,7 @@
))]
#![warn(unsafe_code)]
#![warn(rust_2018_idioms, single_use_lifetimes, unreachable_pub)]
#![warn(clippy::all, clippy::default_trait_access)]
#![warn(clippy::default_trait_access, clippy::wildcard_imports)]
// mem::take and #[non_exhaustive] requires Rust 1.40
#![allow(clippy::mem_replace_with_default, clippy::manual_non_exhaustive)]
#![allow(clippy::needless_doctest_main)]
2 changes: 1 addition & 1 deletion pin-project-internal/src/pin_project/attribute.rs
Original file line number Diff line number Diff line change
@@ -2,7 +2,7 @@ use proc_macro2::TokenStream;
use quote::quote;
use syn::{
parse::{Parse, ParseStream},
*,
Attribute, Result, Token, Visibility,
};

use super::PIN;
6 changes: 5 additions & 1 deletion pin-project-internal/src/pin_project/derive.rs
Original file line number Diff line number Diff line change
@@ -2,9 +2,13 @@ use proc_macro2::{Delimiter, Group, Span, TokenStream};
use quote::{format_ident, quote, quote_spanned, ToTokens};
use syn::{
parse::{Parse, ParseStream},
parse_quote,
spanned::Spanned,
token,
visit_mut::VisitMut,
*,
Attribute, Data, DataEnum, DataStruct, DeriveInput, Error, Field, Fields, FieldsNamed,
FieldsUnnamed, Generics, Ident, Index, Lifetime, LifetimeDef, Meta, MetaList, NestedMeta,
Result, Token, Type, Variant, Visibility, WhereClause,
};

use super::PIN;
6 changes: 5 additions & 1 deletion pin-project-internal/src/pinned_drop.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
use proc_macro2::TokenStream;
use quote::{quote, ToTokens};
use syn::{spanned::Spanned, visit_mut::VisitMut, *};
use syn::{
parse_quote, spanned::Spanned, visit_mut::VisitMut, Error, FnArg, GenericArgument, Ident,
ImplItem, ImplItemMethod, ItemImpl, Pat, Path, PathArguments, Result, ReturnType, Token, Type,
TypePath, TypeReference,
};

use crate::utils::{parse_as_empty, prepend_underscore_to_self, ReplaceReceiver, SliceExt};

5 changes: 4 additions & 1 deletion pin-project-internal/src/project.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
use proc_macro2::{Span, TokenStream};
use quote::ToTokens;
use syn::{
parse_quote,
visit_mut::{self, VisitMut},
*,
Expr, ExprLet, ExprMatch, Ident, ImplItem, Item, ItemFn, ItemImpl, ItemUse, Lifetime, Local,
Pat, PatBox, PatIdent, PatOr, PatPath, PatReference, PatStruct, PatTupleStruct, PatType, Path,
PathArguments, PathSegment, Result, Stmt, Type, TypePath, UseTree,
};

use crate::utils::{
6 changes: 5 additions & 1 deletion pin-project-internal/src/utils.rs
Original file line number Diff line number Diff line change
@@ -4,9 +4,13 @@ use proc_macro2::{Group, Spacing, Span, TokenStream, TokenTree};
use quote::{format_ident, quote, quote_spanned, ToTokens};
use syn::{
parse::{Parse, ParseBuffer, ParseStream},
parse_quote,
punctuated::Punctuated,
token,
visit_mut::{self, VisitMut},
*,
Attribute, ExprPath, ExprStruct, Generics, Ident, Item, Lifetime, LifetimeDef, Macro, PatPath,
PatStruct, PatTupleStruct, Path, PathArguments, PredicateType, QSelf, Result, Token, Type,
TypeParamBound, TypePath, Variant, Visibility, WherePredicate,
};

pub(crate) type Variants = Punctuated<Variant, Token![,]>;
2 changes: 1 addition & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
@@ -42,7 +42,7 @@
attr(deny(warnings, rust_2018_idioms, single_use_lifetimes), allow(dead_code))
))]
#![warn(missing_docs, rust_2018_idioms, single_use_lifetimes, unreachable_pub)]
#![warn(clippy::all, clippy::default_trait_access)]
#![warn(clippy::default_trait_access, clippy::wildcard_imports)]
// mem::take and #[non_exhaustive] requires Rust 1.40
#![allow(clippy::mem_replace_with_default, clippy::manual_non_exhaustive)]
#![allow(clippy::needless_doctest_main)]
1 change: 0 additions & 1 deletion tests/doc/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
[package]
name = "doctest"
version = "0.1.0"
authors = ["Taiki Endo <te316e89@gmail.com>"]
edition = "2018"
publish = false

7 changes: 3 additions & 4 deletions tests/doc/lib.rs
Original file line number Diff line number Diff line change
@@ -3,12 +3,11 @@
no_crate_inject,
attr(deny(warnings, rust_2018_idioms, single_use_lifetimes), allow(dead_code))
))]
#![cfg_attr(doctest, feature(external_doc))]

// As `feature(external_doc)` and `doc-comment` do not work with `cfg(test)`,
// As `doc = include_str!` and `doc-comment` do not work with `cfg(test)`,
// and `cfg(doctest)` requires 1.40, these tests are split into this crate until
// MSRV increases.

#[cfg(doctest)]
#[doc(include = "../../README.md")]
// https://github.com/rust-lang/rust/issues/82768
#[cfg_attr(doctest, cfg_attr(doctest, doc = include_str!("../../README.md")))]
const _README: () = ();
1 change: 0 additions & 1 deletion tests/expand/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
[package]
name = "expandtest"
version = "0.1.0"
authors = ["Taiki Endo <te316e89@gmail.com>"]
edition = "2018"
publish = false

1 change: 0 additions & 1 deletion tests/lint.rs
Original file line number Diff line number Diff line change
@@ -17,7 +17,6 @@
single_use_lifetimes,
trivial_casts,
trivial_numeric_casts,
unaligned_references,
unreachable_pub,
unused_extern_crates,
unused_import_braces,
1 change: 0 additions & 1 deletion tests/no-core/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
[package]
name = "no-core"
version = "0.1.0"
authors = ["Taiki Endo <te316e89@gmail.com>"]
edition = "2018"
publish = false

1 change: 0 additions & 1 deletion tests/no-std/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
[package]
name = "no-std"
version = "0.1.0"
authors = ["Taiki Endo <te316e89@gmail.com>"]
edition = "2018"
publish = false

1 change: 0 additions & 1 deletion tests/rust-2015/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
[package]
name = "rust-2015"
version = "0.1.0"
authors = ["Taiki Endo <te316e89@gmail.com>"]
edition = "2015"
publish = false

1 change: 0 additions & 1 deletion tests/ui/auxiliary/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
[package]
name = "pin-project-auxiliary-macro"
version = "0.0.0"
authors = ["Taiki Endo <te316e89@gmail.com>"]
edition = "2018"
publish = false

2 changes: 1 addition & 1 deletion tests/ui/cfg/cfg_attr-resolve.stderr
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
error[E0599]: no method named `project` found for struct `Pin<&mut Foo<u8>>` in the current scope
--> $DIR/cfg_attr-resolve.rs:10:31
--> tests/ui/cfg/cfg_attr-resolve.rs:10:31
|
10 | let _x = Pin::new(&mut x).project(); //~ ERROR E0599
| ^^^^^^^ method not found in `Pin<&mut Foo<u8>>`
4 changes: 2 additions & 2 deletions tests/ui/cfg/cfg_attr-type-mismatch.stderr
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
error[E0308]: mismatched types
--> $DIR/cfg_attr-type-mismatch.rs:19:27
--> tests/ui/cfg/cfg_attr-type-mismatch.rs:19:27
|
19 | let _: Pin<&mut u8> = x.inner; //~ ERROR E0308
| ------------ ^^^^^^^ expected struct `Pin`, found `&mut u8`
@@ -10,7 +10,7 @@ error[E0308]: mismatched types
found mutable reference `&mut u8`

error[E0308]: mismatched types
--> $DIR/cfg_attr-type-mismatch.rs:23:22
--> tests/ui/cfg/cfg_attr-type-mismatch.rs:23:22
|
23 | let _: &mut u8 = x.inner; //~ ERROR E0308
| ------- ^^^^^^^
Loading