Auto merge of #11077 - y21:issue11076, r=Manishearth

[`arc_with_non_send_sync`]: don't lint if type has nested type parameters

Fixes #11076

changelog: [`arc_with_non_send_sync`]: don't lint if type has nested type parameters

r? `@Manishearth`
This commit is contained in:
bors 2023-07-03 09:48:05 +00:00
commit 2b03bb08b2
3 changed files with 9 additions and 2 deletions

View file

@ -7,6 +7,9 @@ fn foo<T>(x: T) {
// Should not lint - purposefully ignoring generic args.
let a = Arc::new(x);
}
fn issue11076<T>() {
let a: Arc<Vec<T>> = Arc::new(Vec::new());
}
fn main() {
// This is safe, as `i32` implements `Send` and `Sync`.

View file

@ -1,5 +1,5 @@
error: usage of `Arc<T>` where `T` is not `Send` or `Sync`
--> $DIR/arc_with_non_send_sync.rs:16:13
--> $DIR/arc_with_non_send_sync.rs:19:13
|
LL | let b = Arc::new(RefCell::new(42));
| ^^^^^^^^^^^^^^^^^^^^^^^^^^