File tree 1 file changed +7
-4
lines changed
src/doc/rustc/src/lints/listing
1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -529,18 +529,21 @@ This lint detects bounds in type aliases. These are not currently enforced.
529
529
Some example code that triggers this lint:
530
530
531
531
``` rust
532
+ #[allow(dead_code)]
532
533
type SendVec <T : Send > = Vec <T >;
533
534
```
534
535
535
536
This will produce:
536
537
537
538
``` text
538
- warning: type alias is never used: `SendVec`
539
- --> src/main .rs:1:1
539
+ warning: bounds on generic parameters are not enforced in type aliases
540
+ --> src/lib .rs:2:17
540
541
|
541
- 1 | type SendVec<T: Send> = Vec<T>;
542
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^
542
+ 2 | type SendVec<T: Send> = Vec<T>;
543
+ | ^^^^
543
544
|
545
+ = note: #[warn(type_alias_bounds)] on by default
546
+ = help: the bound will not be checked when the type alias is used, and should be removed
544
547
```
545
548
546
549
## tyvar-behind-raw-pointer
You can’t perform that action at this time.
0 commit comments