Rollup merge of #61111 - Cerberuser:patch-1, r=steveklabnik
Fixed type-alias-bounds lint doc The example code under type-alias-bounds lint produced two warnings - one from the lint itself and another from the dead_code lint, and only the second one was in the doc. This looked like an error, so I've added `#[allow(dead_code)]` and replaced the example output with the expected one. [Playground](https://play.rust-lang.org/?version=stable&mode=debug&edition=2018&code=%23%5Ballow(dead_code)%5D%0Atype%20SendVec%3CT%3A%20Send%3E%20%3D%20Vec%3CT%3E%3B) According to guidelines, r? @steveklabnik
This commit is contained in:
commit
65ddf284b6
@ -529,18 +529,21 @@ This lint detects bounds in type aliases. These are not currently enforced.
|
|||||||
Some example code that triggers this lint:
|
Some example code that triggers this lint:
|
||||||
|
|
||||||
```rust
|
```rust
|
||||||
|
#[allow(dead_code)]
|
||||||
type SendVec<T: Send> = Vec<T>;
|
type SendVec<T: Send> = Vec<T>;
|
||||||
```
|
```
|
||||||
|
|
||||||
This will produce:
|
This will produce:
|
||||||
|
|
||||||
```text
|
```text
|
||||||
warning: type alias is never used: `SendVec`
|
warning: bounds on generic parameters are not enforced in type aliases
|
||||||
--> src/main.rs:1:1
|
--> src/lib.rs:2:17
|
||||||
|
|
|
|
||||||
1 | type SendVec<T: Send> = Vec<T>;
|
2 | type SendVec<T: Send> = Vec<T>;
|
||||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
| ^^^^
|
||||||
|
|
|
|
||||||
|
= note: #[warn(type_alias_bounds)] on by default
|
||||||
|
= help: the bound will not be checked when the type alias is used, and should be removed
|
||||||
```
|
```
|
||||||
|
|
||||||
## tyvar-behind-raw-pointer
|
## tyvar-behind-raw-pointer
|
||||||
|
Loading…
Reference in New Issue
Block a user