-
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.
Resolve const lifetimes to static in trait too
- Loading branch information
1 parent
b92dbb9
commit e9327f1
Showing
8 changed files
with
69 additions
and
124 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
56 changes: 12 additions & 44 deletions
56
tests/ui/suggestions/missing-lifetime-in-assoc-const-type.default.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,57 +1,25 @@ | ||
error[E0106]: missing lifetime specifier | ||
--> $DIR/missing-lifetime-in-assoc-const-type.rs:6:14 | ||
| | ||
LL | const A: &str = ""; | ||
| ^ expected named lifetime parameter | ||
| | ||
help: consider introducing a named lifetime parameter | ||
| | ||
LL ~ trait ZstAssert<'a>: Sized { | ||
LL ~ const A: &'a str = ""; | ||
| | ||
|
||
error[E0106]: missing lifetime specifier | ||
error[E0726]: implicit elided lifetime not allowed here | ||
--> $DIR/missing-lifetime-in-assoc-const-type.rs:7:14 | ||
| | ||
LL | const B: S = S { s: &() }; | ||
| ^ expected named lifetime parameter | ||
| | ||
help: consider introducing a named lifetime parameter | ||
| | ||
LL ~ trait ZstAssert<'a>: Sized { | ||
LL | const A: &str = ""; | ||
LL ~ const B: S<'a> = S { s: &() }; | ||
| ^ expected lifetime parameter | ||
| | ||
|
||
error[E0106]: missing lifetime specifier | ||
--> $DIR/missing-lifetime-in-assoc-const-type.rs:8:15 | ||
| | ||
LL | const C: &'_ str = ""; | ||
| ^^ expected named lifetime parameter | ||
| | ||
help: consider introducing a named lifetime parameter | ||
| | ||
LL ~ trait ZstAssert<'a>: Sized { | ||
LL | const A: &str = ""; | ||
LL | const B: S = S { s: &() }; | ||
LL ~ const C: &'a str = ""; | ||
help: indicate the anonymous lifetime | ||
| | ||
LL | const B: S<'_> = S { s: &() }; | ||
| ++++ | ||
|
||
error[E0106]: missing lifetime specifiers | ||
error[E0726]: implicit elided lifetime not allowed here | ||
--> $DIR/missing-lifetime-in-assoc-const-type.rs:9:14 | ||
| | ||
LL | const D: T = T { a: &(), b: &() }; | ||
| ^ expected 2 lifetime parameters | ||
| | ||
help: consider introducing a named lifetime parameter | ||
| ^ expected lifetime parameters | ||
| | ||
LL ~ trait ZstAssert<'a>: Sized { | ||
LL | const A: &str = ""; | ||
LL | const B: S = S { s: &() }; | ||
LL | const C: &'_ str = ""; | ||
LL ~ const D: T<'a, 'a> = T { a: &(), b: &() }; | ||
help: indicate the anonymous lifetimes | ||
| | ||
LL | const D: T<'_, '_> = T { a: &(), b: &() }; | ||
| ++++++++ | ||
|
||
error: aborting due to 4 previous errors | ||
error: aborting due to 2 previous errors | ||
|
||
For more information about this error, try `rustc --explain E0106`. | ||
For more information about this error, try `rustc --explain E0726`. |
46 changes: 12 additions & 34 deletions
46
tests/ui/suggestions/missing-lifetime-in-assoc-const-type.generic_const_items.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,47 +1,25 @@ | ||
error[E0106]: missing lifetime specifier | ||
--> $DIR/missing-lifetime-in-assoc-const-type.rs:6:14 | ||
| | ||
LL | const A: &str = ""; | ||
| ^ expected named lifetime parameter | ||
| | ||
help: consider introducing a named lifetime parameter | ||
| | ||
LL | const A<'a>: &'a str = ""; | ||
| ++++ ++ | ||
|
||
error[E0106]: missing lifetime specifier | ||
error[E0726]: implicit elided lifetime not allowed here | ||
--> $DIR/missing-lifetime-in-assoc-const-type.rs:7:14 | ||
| | ||
LL | const B: S = S { s: &() }; | ||
| ^ expected named lifetime parameter | ||
| | ||
help: consider introducing a named lifetime parameter | ||
| | ||
LL | const B<'a>: S<'a> = S { s: &() }; | ||
| ++++ ++++ | ||
|
||
error[E0106]: missing lifetime specifier | ||
--> $DIR/missing-lifetime-in-assoc-const-type.rs:8:15 | ||
| | ||
LL | const C: &'_ str = ""; | ||
| ^^ expected named lifetime parameter | ||
| ^ expected lifetime parameter | ||
| | ||
help: consider introducing a named lifetime parameter | ||
help: indicate the anonymous lifetime | ||
| | ||
LL | const C<'a>: &'a str = ""; | ||
| ++++ ~~ | ||
LL | const B: S<'_> = S { s: &() }; | ||
| ++++ | ||
|
||
error[E0106]: missing lifetime specifiers | ||
error[E0726]: implicit elided lifetime not allowed here | ||
--> $DIR/missing-lifetime-in-assoc-const-type.rs:9:14 | ||
| | ||
LL | const D: T = T { a: &(), b: &() }; | ||
| ^ expected 2 lifetime parameters | ||
| ^ expected lifetime parameters | ||
| | ||
help: consider introducing a named lifetime parameter | ||
help: indicate the anonymous lifetimes | ||
| | ||
LL | const D<'a>: T<'a, 'a> = T { a: &(), b: &() }; | ||
| ++++ ++++++++ | ||
LL | const D: T<'_, '_> = T { a: &(), b: &() }; | ||
| ++++++++ | ||
|
||
error: aborting due to 4 previous errors | ||
error: aborting due to 2 previous errors | ||
|
||
For more information about this error, try `rustc --explain E0106`. | ||
For more information about this error, try `rustc --explain E0726`. |
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