Skip to content

Commit

Permalink
Merge pull request #28 from dtolnay/local
Browse files Browse the repository at this point in the history
Ignore non_local_definitions false positive in macro-generated impls
  • Loading branch information
dtolnay authored Feb 26, 2024
2 parents eda19ab + f206812 commit edb2e4a
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/macros.rs
Original file line number Diff line number Diff line change
Expand Up @@ -88,21 +88,28 @@ macro_rules! __internal_clone_trait_object {

// The impl.
(impl ($($generics:tt)*) ($($path:tt)*) ($($bound:tt)*)) => {
#[allow(unknown_lints, non_local_definitions)] // false positive: https://github.com/rust-lang/rust/issues/121621
impl<'clone, $($generics)*> $crate::__private::Clone for $crate::__private::Box<dyn $($path)* + 'clone> where $($bound)* {
fn clone(&self) -> Self {
$crate::clone_box(&**self)
}
}

#[allow(unknown_lints, non_local_definitions)] // false positive: https://github.com/rust-lang/rust/issues/121621
impl<'clone, $($generics)*> $crate::__private::Clone for $crate::__private::Box<dyn $($path)* + $crate::__private::Send + 'clone> where $($bound)* {
fn clone(&self) -> Self {
$crate::clone_box(&**self)
}
}

#[allow(unknown_lints, non_local_definitions)] // false positive: https://github.com/rust-lang/rust/issues/121621
impl<'clone, $($generics)*> $crate::__private::Clone for $crate::__private::Box<dyn $($path)* + $crate::__private::Sync + 'clone> where $($bound)* {
fn clone(&self) -> Self {
$crate::clone_box(&**self)
}
}

#[allow(unknown_lints, non_local_definitions)] // false positive: https://github.com/rust-lang/rust/issues/121621
impl<'clone, $($generics)*> $crate::__private::Clone for $crate::__private::Box<dyn $($path)* + $crate::__private::Send + $crate::__private::Sync + 'clone> where $($bound)* {
fn clone(&self) -> Self {
$crate::clone_box(&**self)
Expand Down

0 comments on commit edb2e4a

Please sign in to comment.