<feed xmlns='http://www.w3.org/2005/Atom'>
<title>rust/src/test/ui/impl-trait/issues, branch 1.60.0</title>
<subtitle>https://github.com/rust-lang/rust
</subtitle>
<id>http://git.dreamy.place/mirrors/rust/atom?h=1.60.0</id>
<link rel='self' href='http://git.dreamy.place/mirrors/rust/atom?h=1.60.0'/>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/'/>
<updated>2022-02-18T03:18:42+00:00</updated>
<entry>
<title>fix impl trait message, bless tests</title>
<updated>2022-02-18T03:18:42+00:00</updated>
<author>
<name>Michael Goulet</name>
<email>michael@errs.io</email>
</author>
<published>2022-02-18T03:18:42+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=207fb5f070174368ebb56a17b6f4e5a161cabe51'/>
<id>urn:sha1:207fb5f070174368ebb56a17b6f4e5a161cabe51</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Add more information to `impl Trait` deny error</title>
<updated>2022-02-18T02:45:53+00:00</updated>
<author>
<name>Michael Goulet</name>
<email>michael@errs.io</email>
</author>
<published>2022-01-12T03:00:34+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=f04f732503a239b3fac22be2238d21971aa03dce'/>
<id>urn:sha1:f04f732503a239b3fac22be2238d21971aa03dce</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Update chalk tests</title>
<updated>2022-02-12T13:39:52+00:00</updated>
<author>
<name>Matthew Jasper</name>
<email>mjjasper1@gmail.com</email>
</author>
<published>2022-02-09T10:19:31+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=f718b516900105ccfce2b32c915b3c3b1a136a1c'/>
<id>urn:sha1:f718b516900105ccfce2b32c915b3c3b1a136a1c</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Revert "Auto merge of #92007 - oli-obk:lazy_tait2, r=nikomatsakis"</title>
<updated>2022-02-11T07:18:06+00:00</updated>
<author>
<name>Oli Scherer</name>
<email>git-spam-no-reply9815368754983@oli-obk.de</email>
</author>
<published>2022-02-11T07:18:06+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=d54195db22421c51fd14560aba3bbf9b79a52677'/>
<id>urn:sha1:d54195db22421c51fd14560aba3bbf9b79a52677</id>
<content type='text'>
This reverts commit e7cc3bddbe0d0e374d05e7003e662bba1742dbae, reversing
changes made to 734368a200904ef9c21db86c595dc04263c87be0.
</content>
</entry>
<entry>
<title>Revert "Auto merge of #92306 - Aaron1011:opaque-type-op, r=oli-obk"</title>
<updated>2022-02-11T07:17:16+00:00</updated>
<author>
<name>Oli Scherer</name>
<email>git-spam-no-reply9815368754983@oli-obk.de</email>
</author>
<published>2022-02-11T07:17:16+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=2d8b8f359312210e34b251906179484ffc7287c6'/>
<id>urn:sha1:2d8b8f359312210e34b251906179484ffc7287c6</id>
<content type='text'>
This reverts commit 1f0a96862ac9d4c6ca3e4bb500c8b9eac4d83049, reversing
changes made to bf242bb1199e25ca2274df5c4114e0c9436b74e9.
</content>
</entry>
<entry>
<title>Revert "Fix regression from lazy opaque types"</title>
<updated>2022-02-11T07:14:58+00:00</updated>
<author>
<name>Oli Scherer</name>
<email>git-spam-no-reply9815368754983@oli-obk.de</email>
</author>
<published>2022-02-11T07:14:58+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=7a71b7a99e6744097c1882a785f88e1aac3acfa0'/>
<id>urn:sha1:7a71b7a99e6744097c1882a785f88e1aac3acfa0</id>
<content type='text'>
This reverts commit 239f1e716dcb1e145b5df5f9439524c817d123b2.
</content>
</entry>
<entry>
<title>Auto merge of #92306 - Aaron1011:opaque-type-op, r=oli-obk</title>
<updated>2022-02-09T09:41:48+00:00</updated>
<author>
<name>bors</name>
<email>bors@rust-lang.org</email>
</author>
<published>2022-02-09T09:41:48+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=1f0a96862ac9d4c6ca3e4bb500c8b9eac4d83049'/>
<id>urn:sha1:1f0a96862ac9d4c6ca3e4bb500c8b9eac4d83049</id>
<content type='text'>
Improve opaque type higher-ranked region error message under NLL

Currently, any higher-ranked region errors involving opaque types
fall back to a generic "higher-ranked subtype error" message when
run under NLL. This PR adds better error message handling for this
case, giving us the same kinds of error messages that we currently
get without NLL:

```
error: implementation of `MyTrait` is not general enough
  --&gt; $DIR/opaque-hrtb.rs:12:13
   |
LL | fn foo() -&gt; impl for&lt;'a&gt; MyTrait&lt;&amp;'a str&gt; {
   |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ implementation of `MyTrait` is not general enough
   |
   = note: `impl MyTrait&lt;&amp;'2 str&gt;` must implement `MyTrait&lt;&amp;'1 str&gt;`, for any lifetime `'1`...
   = note: ...but it actually implements `MyTrait&lt;&amp;'2 str&gt;`, for some specific lifetime `'2`

error: aborting due to previous error
```

To accomplish this, several different refactoring needed to be made:

* We now have a dedicated `InstantiateOpaqueType` struct which
implements `TypeOp`. This is used to invoke `instantiate_opaque_types`
during MIR type checking.
* `TypeOp` is refactored to pass around a `MirBorrowckCtxt`, which is
needed to report opaque type region errors.
* We no longer assume that all `TypeOp`s correspond to canonicalized
queries. This allows us to properly handle opaque type instantiation
(which does not occur in a query) as a `TypeOp`.
A new `ErrorInfo` associated type is used to determine what
additional information is used during higher-ranked region error
handling.
* The body of `try_extract_error_from_fulfill_cx`
has been moved out to a new function `try_extract_error_from_region_constraints`.
This allows us to re-use the same error reporting code between
canonicalized queries (which can extract region constraints directly
from a fresh `InferCtxt`) and opaque type handling (which needs to take
region constraints from the pre-existing `InferCtxt` that we use
throughout MIR borrow checking).
</content>
</entry>
<entry>
<title>Improve opaque type higher-ranked region error message under NLL</title>
<updated>2022-02-08T17:35:42+00:00</updated>
<author>
<name>Aaron Hill</name>
<email>aa1ronham@gmail.com</email>
</author>
<published>2021-12-19T00:06:53+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=48a48fd1b85ce50a890303b7238550ccf0613433'/>
<id>urn:sha1:48a48fd1b85ce50a890303b7238550ccf0613433</id>
<content type='text'>
Currently, any higher-ranked region errors involving opaque types
fall back to a generic "higher-ranked subtype error" message when
run under NLL. This PR adds better error message handling for this
case, giving us the same kinds of error messages that we currently
get without NLL:

```
error: implementation of `MyTrait` is not general enough
  --&gt; $DIR/opaque-hrtb.rs:12:13
   |
LL | fn foo() -&gt; impl for&lt;'a&gt; MyTrait&lt;&amp;'a str&gt; {
   |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ implementation of `MyTrait` is not general enough
   |
   = note: `impl MyTrait&lt;&amp;'2 str&gt;` must implement `MyTrait&lt;&amp;'1 str&gt;`, for any lifetime `'1`...
   = note: ...but it actually implements `MyTrait&lt;&amp;'2 str&gt;`, for some specific lifetime `'2`

error: aborting due to previous error
```

To accomplish this, several different refactoring needed to be made:

* We now have a dedicated `InstantiateOpaqueType` struct which
implements `TypeOp`. This is used to invoke `instantiate_opaque_types`
during MIR type checking.
* `TypeOp` is refactored to pass around a `MirBorrowckCtxt`, which is
needed to report opaque type region errors.
* We no longer assume that all `TypeOp`s correspond to canonicalized
queries. This allows us to properly handle opaque type instantiation
(which does not occur in a query) as a `TypeOp`.
A new `ErrorInfo` associated type is used to determine what
additional information is used during higher-ranked region error
handling.
* The body of `try_extract_error_from_fulfill_cx`
has been moved out to a new function `try_extract_error_from_region_constraints`.
This allows us to re-use the same error reporting code between
canonicalized queries (which can extract region constraints directly
from a fresh `InferCtxt`) and opaque type handling (which needs to take
region constraints from the pre-existing `InferCtxt` that we use
throughout MIR borrow checking).
</content>
</entry>
<entry>
<title>Fix regression from lazy opaque types</title>
<updated>2022-02-08T17:01:33+00:00</updated>
<author>
<name>Oli Scherer</name>
<email>git-spam-no-reply9815368754983@oli-obk.de</email>
</author>
<published>2022-02-08T16:47:24+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=239f1e716dcb1e145b5df5f9439524c817d123b2'/>
<id>urn:sha1:239f1e716dcb1e145b5df5f9439524c817d123b2</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Prevent two opaque types in their defining scopes from being defined via the other</title>
<updated>2022-02-02T15:40:12+00:00</updated>
<author>
<name>Oli Scherer</name>
<email>git-spam-no-reply9815368754983@oli-obk.de</email>
</author>
<published>2022-02-01T17:28:46+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=7f608eb9edb38ff271ff5be50dbbbb424cbf348f'/>
<id>urn:sha1:7f608eb9edb38ff271ff5be50dbbbb424cbf348f</id>
<content type='text'>
</content>
</entry>
</feed>
