forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Auto merge of rust-lang#92352 - matthiaskrgr:rollup-19fbq7u, r=matthi…
…askrgr Rollup of 7 pull requests Successful merges: - rust-lang#92076 (Ignore other `PredicateKind`s in rustdoc auto trait finder) - rust-lang#92219 (Remove VCVARS_BAT) - rust-lang#92238 (Add a test suite for stringify macro) - rust-lang#92330 (Add myself to .mailmap) - rust-lang#92333 (Tighten span when suggesting lifetime on path) - rust-lang#92335 (Document units for `std::column`) - rust-lang#92344 (:arrow_up: rust-analyzer) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
- Loading branch information
Showing
12 changed files
with
993 additions
and
11 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
34 changes: 34 additions & 0 deletions
34
src/test/ui/in-band-lifetimes/missing-lifetime-in-alias.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,34 @@ | ||
#![feature(generic_associated_types)] | ||
#![allow(unused)] | ||
|
||
trait Trait<'a> { | ||
type Foo; | ||
|
||
type Bar<'b> | ||
//~^ NOTE associated type defined here, with 1 lifetime parameter | ||
//~| NOTE | ||
where | ||
Self: 'b; | ||
} | ||
|
||
struct Impl<'a>(&'a ()); | ||
|
||
impl<'a> Trait<'a> for Impl<'a> { | ||
type Foo = &'a (); | ||
type Bar<'b> = &'b (); | ||
} | ||
|
||
type A<'a> = Impl<'a>; | ||
|
||
type B<'a> = <A<'a> as Trait>::Foo; | ||
//~^ ERROR missing lifetime specifier | ||
//~| NOTE expected named lifetime parameter | ||
|
||
type C<'a, 'b> = <A<'a> as Trait>::Bar; | ||
//~^ ERROR missing lifetime specifier | ||
//~| ERROR missing generics for associated type | ||
//~| NOTE expected named lifetime parameter | ||
//~| NOTE these named lifetimes are available to use | ||
//~| NOTE expected 1 lifetime argument | ||
|
||
fn main() {} |
43 changes: 43 additions & 0 deletions
43
src/test/ui/in-band-lifetimes/missing-lifetime-in-alias.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,43 @@ | ||
error[E0106]: missing lifetime specifier | ||
--> $DIR/missing-lifetime-in-alias.rs:23:24 | ||
| | ||
LL | type B<'a> = <A<'a> as Trait>::Foo; | ||
| ^^^^^ expected named lifetime parameter | ||
| | ||
help: consider using the `'a` lifetime | ||
| | ||
LL | type B<'a> = <A<'a> as Trait<'a>>::Foo; | ||
| ~~~~~~~~~ | ||
|
||
error[E0106]: missing lifetime specifier | ||
--> $DIR/missing-lifetime-in-alias.rs:27:28 | ||
| | ||
LL | type C<'a, 'b> = <A<'a> as Trait>::Bar; | ||
| ^^^^^ expected named lifetime parameter | ||
| | ||
note: these named lifetimes are available to use | ||
--> $DIR/missing-lifetime-in-alias.rs:27:8 | ||
| | ||
LL | type C<'a, 'b> = <A<'a> as Trait>::Bar; | ||
| ^^ ^^ | ||
|
||
error[E0107]: missing generics for associated type `Trait::Bar` | ||
--> $DIR/missing-lifetime-in-alias.rs:27:36 | ||
| | ||
LL | type C<'a, 'b> = <A<'a> as Trait>::Bar; | ||
| ^^^ expected 1 lifetime argument | ||
| | ||
note: associated type defined here, with 1 lifetime parameter: `'b` | ||
--> $DIR/missing-lifetime-in-alias.rs:7:10 | ||
| | ||
LL | type Bar<'b> | ||
| ^^^ -- | ||
help: add missing lifetime argument | ||
| | ||
LL | type C<'a, 'b> = <A<'a> as Trait>::Bar<'a>; | ||
| ~~~~~~~ | ||
|
||
error: aborting due to 3 previous errors | ||
|
||
Some errors have detailed explanations: E0106, E0107. | ||
For more information about an error, try `rustc --explain E0106`. |
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
Oops, something went wrong.