Address review nits
This commit is contained in:
parent
90dfa24415
commit
c373d206cd
3 changed files with 8 additions and 9 deletions
|
@ -6,7 +6,7 @@ lint_array_into_iter =
|
||||||
or use `IntoIterator::into_iter(..)` instead of `.into_iter()` to explicitly iterate by value
|
or use `IntoIterator::into_iter(..)` instead of `.into_iter()` to explicitly iterate by value
|
||||||
|
|
||||||
lint_async_fn_in_trait = use of `async fn` in public traits is discouraged as auto trait bounds cannot be specified
|
lint_async_fn_in_trait = use of `async fn` in public traits is discouraged as auto trait bounds cannot be specified
|
||||||
.note = you can suppress this lint if you plan to use the trait locally, for concrete types, or do not care about auto traits like `Send` on the `Future`
|
.note = you can suppress this lint if you plan to use the trait only in your own code, or do not care about auto traits like `Send` on the `Future`
|
||||||
.suggestion = you can alternatively desugar to a normal `fn` that returns `impl Future` and add any desired bounds such as `Send`
|
.suggestion = you can alternatively desugar to a normal `fn` that returns `impl Future` and add any desired bounds such as `Send`
|
||||||
|
|
||||||
lint_atomic_ordering_fence = memory fences cannot have `Relaxed` ordering
|
lint_atomic_ordering_fence = memory fences cannot have `Relaxed` ordering
|
||||||
|
|
|
@ -39,8 +39,8 @@ declare_lint! {
|
||||||
/// }
|
/// }
|
||||||
///
|
///
|
||||||
/// fn test<T: Trait>(x: T) {
|
/// fn test<T: Trait>(x: T) {
|
||||||
/// fn is_send<T: Send>(_: T) {}
|
/// fn spawn<T: Send>(_: T) {}
|
||||||
/// is_send(x.method()); // Not OK.
|
/// spawn(x.method()); // Not OK.
|
||||||
/// }
|
/// }
|
||||||
/// ```
|
/// ```
|
||||||
///
|
///
|
||||||
|
@ -68,11 +68,10 @@ declare_lint! {
|
||||||
/// }
|
/// }
|
||||||
/// ```
|
/// ```
|
||||||
///
|
///
|
||||||
/// Conversely, if the trait is used only locally, if only concrete types
|
/// Conversely, if the trait is used only locally, if it is never used in
|
||||||
/// that implement the trait are used, or if the trait author otherwise
|
/// generic functions, or if it is only used in single-threaded contexts
|
||||||
/// does not care that the trait will not promise that the returned
|
/// that do not care whether the returned [`Future`] implements [auto traits]
|
||||||
/// [`Future`] implements any [auto traits] such as [`Send`], then the
|
/// such as [`Send`], then the lint may be suppressed.
|
||||||
/// lint may be suppressed.
|
|
||||||
///
|
///
|
||||||
/// [`Future`]: https://doc.rust-lang.org/core/future/trait.Future.html
|
/// [`Future`]: https://doc.rust-lang.org/core/future/trait.Future.html
|
||||||
/// [`Send`]: https://doc.rust-lang.org/core/marker/trait.Send.html
|
/// [`Send`]: https://doc.rust-lang.org/core/marker/trait.Send.html
|
||||||
|
|
|
@ -4,7 +4,7 @@ error: use of `async fn` in public traits is discouraged as auto trait bounds ca
|
||||||
LL | async fn not_send();
|
LL | async fn not_send();
|
||||||
| ^^^^^
|
| ^^^^^
|
||||||
|
|
|
|
||||||
= note: you can suppress this lint if you plan to use the trait locally, for concrete types, or do not care about auto traits like `Send` on the `Future`
|
= note: you can suppress this lint if you plan to use the trait only in your own code, or do not care about auto traits like `Send` on the `Future`
|
||||||
note: the lint level is defined here
|
note: the lint level is defined here
|
||||||
--> $DIR/warn.rs:4:9
|
--> $DIR/warn.rs:4:9
|
||||||
|
|
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue