forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rollup merge of rust-lang#79554 - b-naber:generic-associated-types-in…
…-trait-paths, r=jackh726 Generic associated types in trait paths This is the second part of rust-lang#78978 This should fix: Fixes rust-lang#67510 Fixes rust-lang#68648 Fixes rust-lang#68649 Fixes rust-lang#68650 Fixes rust-lang#68652 Fixes rust-lang#74684 Fixes rust-lang#76535 Fixes rust-lang#79422 Fixes rust-lang#80433 and implement the remaining functionality needed for rust-lang#44265 r? `@matthewjasper`
- Loading branch information
Showing
43 changed files
with
1,051 additions
and
112 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
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
12 changes: 12 additions & 0 deletions
12
src/test/ui/generic-associated-types/gat-in-trait-path-undeclared-lifetime.rs
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 |
---|---|---|
@@ -0,0 +1,12 @@ | ||
#![feature(generic_associated_types)] | ||
//~^ WARNING: the feature `generic_associated_types` is incomplete | ||
|
||
trait X { | ||
type Y<'x>; | ||
} | ||
|
||
fn main() { | ||
fn _f(arg : Box<dyn for<'a> X<Y<'x> = &'a [u32]>>) {} | ||
//~^ ERROR: use of undeclared lifetime name `'x` | ||
//~| ERROR: binding for associated type `Y` references lifetime | ||
} |
29 changes: 29 additions & 0 deletions
29
src/test/ui/generic-associated-types/gat-in-trait-path-undeclared-lifetime.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 |
---|---|---|
@@ -0,0 +1,29 @@ | ||
warning: the feature `generic_associated_types` is incomplete and may not be safe to use and/or cause compiler crashes | ||
--> $DIR/gat-in-trait-path-undeclared-lifetime.rs:1:12 | ||
| | ||
LL | #![feature(generic_associated_types)] | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^ | ||
| | ||
= note: `#[warn(incomplete_features)]` on by default | ||
= note: see issue #44265 <https://github.com/rust-lang/rust/issues/44265> for more information | ||
|
||
error[E0261]: use of undeclared lifetime name `'x` | ||
--> $DIR/gat-in-trait-path-undeclared-lifetime.rs:9:35 | ||
| | ||
LL | fn _f(arg : Box<dyn for<'a> X<Y<'x> = &'a [u32]>>) {} | ||
| - ^^ undeclared lifetime | ||
| | | ||
| help: consider introducing lifetime `'x` here: `<'x>` | ||
| | ||
= help: if you want to experiment with in-band lifetime bindings, add `#![feature(in_band_lifetimes)]` to the crate attributes | ||
|
||
error[E0582]: binding for associated type `Y` references lifetime `'a`, which does not appear in the trait input types | ||
--> $DIR/gat-in-trait-path-undeclared-lifetime.rs:9:33 | ||
| | ||
LL | fn _f(arg : Box<dyn for<'a> X<Y<'x> = &'a [u32]>>) {} | ||
| ^^^^^^^^^^^^^^^^^ | ||
|
||
error: aborting due to 2 previous errors; 1 warning emitted | ||
|
||
Some errors have detailed explanations: E0261, E0582. | ||
For more information about an error, try `rustc --explain E0261`. |
Oops, something went wrong.