diff options
author | Joel Galenson <jgalenson@google.com> | 2021-08-11 15:12:13 +0000 |
---|---|---|
committer | Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> | 2021-08-11 15:12:13 +0000 |
commit | e43f58f322631f588c014f497d29aac986311335 (patch) | |
tree | 4ff684b6890583131074a1033210f0ac7abb1d0d /tests/lint.rs | |
parent | a5c0a13309164da22025014778cf4d794aec96a6 (diff) | |
parent | 5ca84867572d2f96230b8450e77205925f9a1848 (diff) | |
download | pin-project-e43f58f322631f588c014f497d29aac986311335.tar.gz |
Upgrade rust/crates/pin-project to 1.0.8 am: c1569cc62c am: 02a74e9451 am: 854e9fcb8c am: 5ca8486757
Original change: https://android-review.googlesource.com/c/platform/external/rust/crates/pin-project/+/1791108
Change-Id: Ic60b19fff1caa373f70662267f680ba63e0fd2bc
Diffstat (limited to 'tests/lint.rs')
-rw-r--r-- | tests/lint.rs | 67 |
1 files changed, 51 insertions, 16 deletions
diff --git a/tests/lint.rs b/tests/lint.rs index 4820816..5cdd2c6 100644 --- a/tests/lint.rs +++ b/tests/lint.rs @@ -1,14 +1,20 @@ +// Check interoperability with rustc and clippy lints. + +// for old compilers +#![allow(unknown_lints)] #![warn(nonstandard_style, rust_2018_idioms, unused)] // Note: This does not guarantee compatibility with forbidding these lints in the future. // If rustc adds a new lint, we may not be able to keep this. -#![forbid(future_incompatible, rust_2018_compatibility)] -#![allow(unknown_lints)] // for old compilers +#![forbid(future_incompatible, rust_2018_compatibility, rust_2021_compatibility)] +// lints forbidden as a part of future_incompatible, rust_2018_compatibility, and rust_2021_compatibility are not included in the list below. +// elided_lifetimes_in_paths, explicit_outlives_requirements, unused_extern_crates: as a part of rust_2018_idioms +// unsafe_block_in_unsafe_fn: unsafe_block_in_unsafe_fn: requires Rust 1.52. and, we don't generate unsafe fn. +// unstable_features: no way to generate #![feature(..)] by macros, expect for unstable inner attribute. and this lint is deprecated: https://doc.rust-lang.org/rustc/lints/listing/allowed-by-default.html#unstable-features +// unused_crate_dependencies: unrelated +// unsafe_code: checked in forbid_unsafe module #![warn( box_pointers, deprecated_in_future, - disjoint_capture_drop_reorder, - elided_lifetimes_in_paths, - explicit_outlives_requirements, macro_use_extern_crate, meta_variable_misuse, missing_abi, @@ -17,30 +23,20 @@ missing_docs, non_ascii_idents, noop_method_call, - or_patterns_back_compat, single_use_lifetimes, trivial_casts, trivial_numeric_casts, unreachable_pub, - unused_extern_crates, unused_import_braces, unused_lifetimes, unused_qualifications, unused_results, variant_size_differences )] -// absolute_paths_not_starting_with_crate, anonymous_parameters, keyword_idents, pointer_structural_match, semicolon_in_expressions_from_macros: forbidden as a part of future_incompatible -// unsafe_block_in_unsafe_fn: unstable: https://github.com/rust-lang/rust/issues/71668 -// unsafe_code: checked in forbid_unsafe module -// unstable_features: deprecated: https://doc.rust-lang.org/beta/rustc/lints/listing/allowed-by-default.html#unstable-features -// unused_crate_dependencies: unrelated -#![warn(clippy::all, clippy::pedantic, clippy::nursery)] -#![warn(clippy::restriction)] +#![warn(clippy::all, clippy::pedantic, clippy::nursery, clippy::restriction)] #![allow(clippy::blanket_clippy_restriction_lints)] // this is a test, so enable all restriction lints intentionally. #![allow(clippy::exhaustive_structs, clippy::exhaustive_enums)] // TODO -// Check interoperability with rustc and clippy lints. - pub mod basic { include!("include/basic.rs"); @@ -1081,6 +1077,45 @@ pub mod clippy_type_repetition_in_bounds { } } +pub mod clippy_use_self { + use pin_project::pin_project; + + pub trait Trait { + type Assoc; + } + + #[pin_project(project_replace)] + #[derive(Debug)] + pub struct Generics<T: Trait<Assoc = Self>> + where + Self: Trait<Assoc = Self>, + { + _f: T, + } + + pub mod inside_macro { + use pin_project::pin_project; + + use super::Trait; + + #[rustfmt::skip] + macro_rules! mac { + () => { + #[pin_project(project_replace)] + #[derive(Debug)] + pub struct Generics<T: Trait<Assoc = Self>> + where + Self: Trait<Assoc = Self>, + { + _f: T, + } + }; + } + + mac!(); + } +} + pub mod clippy_used_underscore_binding { use pin_project::pin_project; |