Auto merge of #10703 - flip1995:rustup, r=flip1995

Rustup

r? `@ghost`

changelog: none
This commit is contained in:
bors 2023-04-23 11:07:14 +00:00
commit f16bfa478f
55 changed files with 129 additions and 87 deletions

View file

@ -1,5 +1,8 @@
// Regression test for https://github.com/rust-lang/rust-clippy/issues/5207
// compile-flags: --cap-lints=warn
// ^ for https://github.com/rust-lang/rust-clippy/issues/10645
// Regression test for https://github.com/rust-lang/rust-clippy/issues/5207
#![warn(clippy::future_not_send)]
pub async fn bar<'a, T: 'a>(_: T) {}
fn main() {}

View file

@ -0,0 +1,16 @@
error: future cannot be sent between threads safely
--> $DIR/ice-5207.rs:6:35
|
LL | pub async fn bar<'a, T: 'a>(_: T) {}
| ^ future returned by `bar` is not `Send`
|
note: captured value is not `Send`
--> $DIR/ice-5207.rs:6:29
|
LL | pub async fn bar<'a, T: 'a>(_: T) {}
| ^ has type `T` which is not `Send`
= note: `T` doesn't implement `std::marker::Send`
= note: `-D clippy::future-not-send` implied by `-D warnings`
error: aborting due to previous error

View file

@ -6,11 +6,11 @@ LL | _n: PhantomData,
|
help: consider importing one of these items
|
LL | use core::marker::PhantomData;
LL + use core::marker::PhantomData;
|
LL | use serde::__private::PhantomData;
LL + use serde::__private::PhantomData;
|
LL | use std::marker::PhantomData;
LL + use std::marker::PhantomData;
|
error[E0412]: cannot find type `VAL` in this scope

View file

@ -14,7 +14,8 @@ LL | | }
= help: remove the manual implementation...
help: ...and instead derive it
|
LL | #[derive(Default)]
LL + #[derive(Default)]
LL | struct FooDefault<'a> {
|
error: this `impl` can be derived
@ -30,7 +31,8 @@ LL | | }
= help: remove the manual implementation...
help: ...and instead derive it
|
LL | #[derive(Default)]
LL + #[derive(Default)]
LL | struct TupleDefault(bool, i32, u64);
|
error: this `impl` can be derived
@ -46,7 +48,8 @@ LL | | }
= help: remove the manual implementation...
help: ...and instead derive it
|
LL | #[derive(Default)]
LL + #[derive(Default)]
LL | struct StrDefault<'a>(&'a str);
|
error: this `impl` can be derived
@ -62,7 +65,8 @@ LL | | }
= help: remove the manual implementation...
help: ...and instead derive it
|
LL | #[derive(Default)]
LL + #[derive(Default)]
LL | struct Y(u32);
|
error: this `impl` can be derived
@ -78,7 +82,8 @@ LL | | }
= help: remove the manual implementation...
help: ...and instead derive it
|
LL | #[derive(Default)]
LL + #[derive(Default)]
LL | struct WithoutSelfCurly {
|
error: this `impl` can be derived
@ -94,7 +99,8 @@ LL | | }
= help: remove the manual implementation...
help: ...and instead derive it
|
LL | #[derive(Default)]
LL + #[derive(Default)]
LL | struct WithoutSelfParan(bool);
|
error: this `impl` can be derived
@ -110,7 +116,8 @@ LL | | }
= help: remove the manual implementation...
help: ...and instead derive it
|
LL | #[derive(Default)]
LL + #[derive(Default)]
LL | pub struct RepeatDefault1 {
|
error: this `impl` can be derived
@ -126,7 +133,8 @@ LL | | }
= help: remove the manual implementation...
help: ...and instead derive it...
|
LL | #[derive(Default)]
LL + #[derive(Default)]
LL | pub enum SimpleEnum {
|
help: ...and mark the default variant
|

View file

@ -16,7 +16,7 @@ extern crate macro_use_helper as mac;
extern crate proc_macro_derive as mini_mac;
mod a {
use mac::{pub_macro, function_macro, ty_macro, inner_mod_macro, pub_in_private_macro};
use mac::{pub_macro, inner_mod_macro, function_macro, ty_macro, pub_in_private_macro};
use mac;
use mini_mac::ClippyMiniMacroTest;
use mini_mac;

View file

@ -22,7 +22,7 @@ error: `macro_use` attributes are no longer needed in the Rust 2018 edition
--> $DIR/macro_use_imports.rs:19:5
|
LL | #[macro_use]
| ^^^^^^^^^^^^ help: remove the attribute and import the macro directly, try: `use mac::{pub_macro, function_macro, ty_macro, inner_mod_macro, pub_in_private_macro};`
| ^^^^^^^^^^^^ help: remove the attribute and import the macro directly, try: `use mac::{pub_macro, inner_mod_macro, function_macro, ty_macro, pub_in_private_macro};`
error: aborting due to 4 previous errors

View file

@ -25,7 +25,7 @@ fn else_if_option(string: Option<&str>) -> Option<(bool, &str)> {
fn unop_bad(string: &Option<&str>, mut num: Option<i32>) {
let _ = string.map_or(0, |s| s.len());
let _ = num.as_ref().map_or(&0, |s| s);
let _ = num.as_mut().map_or(&mut 0, |s| {
let _ = num.as_mut().map_or(&0, |s| {
*s += 1;
s
});
@ -34,7 +34,7 @@ fn unop_bad(string: &Option<&str>, mut num: Option<i32>) {
s += 1;
s
});
let _ = num.as_mut().map_or(&mut 0, |s| {
let _ = num.as_mut().map_or(&0, |s| {
*s += 1;
s
});

View file

@ -33,7 +33,7 @@ fn unop_bad(string: &Option<&str>, mut num: Option<i32>) {
*s += 1;
s
} else {
&mut 0
&0
};
let _ = if let Some(ref s) = num { s } else { &0 };
let _ = if let Some(mut s) = num {
@ -46,7 +46,7 @@ fn unop_bad(string: &Option<&str>, mut num: Option<i32>) {
*s += 1;
s
} else {
&mut 0
&0
};
}

View file

@ -30,13 +30,13 @@ LL | let _ = if let Some(s) = &mut num {
LL | | *s += 1;
LL | | s
LL | | } else {
LL | | &mut 0
LL | | &0
LL | | };
| |_____^
|
help: try
|
LL ~ let _ = num.as_mut().map_or(&mut 0, |s| {
LL ~ let _ = num.as_mut().map_or(&0, |s| {
LL + *s += 1;
LL + s
LL ~ });
@ -76,13 +76,13 @@ LL | let _ = if let Some(ref mut s) = num {
LL | | *s += 1;
LL | | s
LL | | } else {
LL | | &mut 0
LL | | &0
LL | | };
| |_____^
|
help: try
|
LL ~ let _ = num.as_mut().map_or(&mut 0, |s| {
LL ~ let _ = num.as_mut().map_or(&0, |s| {
LL + *s += 1;
LL + s
LL ~ });