-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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 #92397 - matthiaskrgr:rollup-xnfou17, r=matthiaskrgr
Rollup of 7 pull requests Successful merges: - #92075 (rustdoc: Only special case struct fields for intra-doc links, not enum variants) - #92118 (Parse and suggest moving where clauses after equals for type aliases) - #92237 (Visit expressions in-order when resolving pattern bindings) - #92340 (rustdoc: Start cleaning up search index generation) - #92351 (Add long error explanation for E0227) - #92371 (Remove pretty printer space inside block with only outer attrs) - #92372 (Print space after formal generic params in fn type) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
- Loading branch information
Showing
30 changed files
with
382 additions
and
130 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
This error indicates that the compiler is unable to determine whether there is | ||
exactly one unique region in the set of derived region bounds. | ||
|
||
Example of erroneous code: | ||
|
||
```compile_fail,E0227 | ||
trait Foo<'foo>: 'foo {} | ||
trait Bar<'bar>: 'bar {} | ||
trait FooBar<'foo, 'bar>: Foo<'foo> + Bar<'bar> {} | ||
struct Baz<'foo, 'bar> { | ||
baz: dyn FooBar<'foo, 'bar>, | ||
} | ||
``` | ||
|
||
Here, `baz` can have either `'foo` or `'bar` lifetimes. | ||
|
||
To resolve this error, provide an explicit lifetime: | ||
|
||
```rust | ||
trait Foo<'foo>: 'foo {} | ||
trait Bar<'bar>: 'bar {} | ||
|
||
trait FooBar<'foo, 'bar>: Foo<'foo> + Bar<'bar> {} | ||
|
||
struct Baz<'foo, 'bar, 'baz> | ||
where | ||
'baz: 'foo + 'bar, | ||
{ | ||
obj: dyn FooBar<'foo, 'bar> + 'baz, | ||
} | ||
``` |
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
Oops, something went wrong.