Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed type-alias-bounds lint doc #61111

Merged
merged 1 commit into from
May 25, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions src/doc/rustc/src/lints/listing/warn-by-default.md
Original file line number Diff line number Diff line change
Expand Up @@ -529,18 +529,21 @@ This lint detects bounds in type aliases. These are not currently enforced.
Some example code that triggers this lint:

```rust
#[allow(dead_code)]
type SendVec<T: Send> = Vec<T>;
```

This will produce:

```text
warning: type alias is never used: `SendVec`
--> src/main.rs:1:1
warning: bounds on generic parameters are not enforced in type aliases
--> 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
Expand Down