File tree Expand file tree Collapse file tree 1 file changed +7
-4
lines changed
src/doc/rustc/src/lints/listing Expand file tree Collapse file tree 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.
529529Some example code that triggers this lint:
530530
531531``` rust
532+ #[allow(dead_code)]
532533type SendVec <T : Send > = Vec <T >;
533534```
534535
535536This will produce:
536537
537538``` 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
540541 |
541- 1 | type SendVec<T: Send> = Vec<T>;
542- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^
542+ 2 | type SendVec<T: Send> = Vec<T>;
543+ | ^^^^
543544 |
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
544547```
545548
546549## tyvar-behind-raw-pointer
You can’t perform that action at this time.
0 commit comments