-
Notifications
You must be signed in to change notification settings - Fork 13k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve the impl and diag output of lint type_alias_bounds
- Loading branch information
Showing
13 changed files
with
401 additions
and
335 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 8 additions & 7 deletions
15
tests/ui/associated-inherent-types/type-alias-bounds.stderr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,16 @@ | ||
warning: bounds on generic parameters are not enforced in type aliases | ||
warning: bounds on generic parameters in type aliases are not enforced | ||
--> $DIR/type-alias-bounds.rs:21:19 | ||
| | ||
LL | pub type Alias<T: Bound> = (Source<T>::Assoc,); | ||
| ^^^^^ | ||
| --^^^^^ | ||
| | | | ||
| | will not be checked at usage sites of the type alias | ||
| help: remove this bound | ||
| | ||
= note: this is a known limitation of the type checker that may be lifted in a future edition. | ||
see issue #112792 <https://github.com/rust-lang/rust/issues/112792> for more information | ||
= help: add `#![feature(lazy_type_alias)]` to the crate attributes to enable the desired semantics | ||
= 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 | ||
| | ||
LL - pub type Alias<T: Bound> = (Source<T>::Assoc,); | ||
LL + pub type Alias<T> = (Source<T>::Assoc,); | ||
| | ||
|
||
warning: 1 warning emitted | ||
|
Oops, something went wrong.