<feed xmlns='http://www.w3.org/2005/Atom'>
<title>rust/compiler/rustc_resolve/src/lib.rs, branch 1.84.1</title>
<subtitle>https://github.com/rust-lang/rust
</subtitle>
<id>http://git.dreamy.place/mirrors/rust/atom?h=1.84.1</id>
<link rel='self' href='http://git.dreamy.place/mirrors/rust/atom?h=1.84.1'/>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/'/>
<updated>2024-11-14T01:08:20+00:00</updated>
<entry>
<title>Remove `Resolver::empty_disambiguator`.</title>
<updated>2024-11-14T01:08:20+00:00</updated>
<author>
<name>Nicholas Nethercote</name>
<email>n.nethercote@gmail.com</email>
</author>
<published>2024-11-14T00:34:49+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=12747f188a9dba7b13cf1ccb01fef74c6ce3294e'/>
<id>urn:sha1:12747f188a9dba7b13cf1ccb01fef74c6ce3294e</id>
<content type='text'>
It was added in #115367 for anonymous ADTs. Those changes were then
reverted in #131045, but `empty_disambiguator` was left behind, perhaps
by mistake. It seems to be unnecessary.
</content>
</entry>
<entry>
<title>Tweak a `resolutions` loop.</title>
<updated>2024-11-14T00:35:26+00:00</updated>
<author>
<name>Nicholas Nethercote</name>
<email>n.nethercote@gmail.com</email>
</author>
<published>2024-11-07T21:50:51+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=d1d8be1d137404a52cdd28e78a9a9c59d38615b0'/>
<id>urn:sha1:d1d8be1d137404a52cdd28e78a9a9c59d38615b0</id>
<content type='text'>
In this case field access is more concise and easier to read than
destructuring, and it matches how other similar loops are done
elsewhere.
</content>
</entry>
<entry>
<title>fix clippy::clone_on_ref_ptr for compiler</title>
<updated>2024-10-28T15:05:08+00:00</updated>
<author>
<name>klensy</name>
<email>klensy@users.noreply.github.com</email>
</author>
<published>2024-10-07T19:22:51+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=746b675c5aabc7a61443f16a37223720657544d2'/>
<id>urn:sha1:746b675c5aabc7a61443f16a37223720657544d2</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Stop relying on hashmap iteration for unused macro rules arms</title>
<updated>2024-10-20T07:12:52+00:00</updated>
<author>
<name>Noratrieb</name>
<email>48135649+Noratrieb@users.noreply.github.com</email>
</author>
<published>2024-10-17T17:51:18+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=0c8d81b4df6c985b3c2ab383bc288a01ba8286aa'/>
<id>urn:sha1:0c8d81b4df6c985b3c2ab383bc288a01ba8286aa</id>
<content type='text'>
</content>
</entry>
<entry>
<title>rustdoc: prevent ctors from resolving</title>
<updated>2024-10-04T05:01:23+00:00</updated>
<author>
<name>Michael Howell</name>
<email>michael@notriddle.com</email>
</author>
<published>2024-10-04T00:42:08+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=253fec494fa336ee27c6cb027ffdb3d6e0b632c3'/>
<id>urn:sha1:253fec494fa336ee27c6cb027ffdb3d6e0b632c3</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Handle `rustc_metadata` cases of `rustc::potential_query_instability` lint</title>
<updated>2024-10-03T05:38:51+00:00</updated>
<author>
<name>ismailarilik</name>
<email>arilik.ismail@gmail.com</email>
</author>
<published>2024-10-03T05:23:30+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=3d8bd6bbc5dc51fbcc8d912a46f117611c98ee0d'/>
<id>urn:sha1:3d8bd6bbc5dc51fbcc8d912a46f117611c98ee0d</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Handle `rustc-hir-analysis` cases of `rustc::potential_query_instability` lint</title>
<updated>2024-10-02T05:28:45+00:00</updated>
<author>
<name>ismailarilik</name>
<email>arilik.ismail@gmail.com</email>
</author>
<published>2024-10-02T05:25:55+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=807e812077ff9d70840f14822ae6e0e9753bd1fb'/>
<id>urn:sha1:807e812077ff9d70840f14822ae6e0e9753bd1fb</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Reformat using the new identifier sorting from rustfmt</title>
<updated>2024-09-22T23:11:29+00:00</updated>
<author>
<name>Michael Goulet</name>
<email>michael@errs.io</email>
</author>
<published>2024-09-22T23:05:04+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=c682aa162b0d41e21cc6748f4fecfe01efb69d1f'/>
<id>urn:sha1:c682aa162b0d41e21cc6748f4fecfe01efb69d1f</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Handle macro calls in anon const def creation take 2</title>
<updated>2024-09-21T21:17:18+00:00</updated>
<author>
<name>Boxy</name>
<email>rust@boxyuwu.dev</email>
</author>
<published>2024-09-15T20:21:31+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=781ec111b728a4d1ae513ae57d5eecf27680a216'/>
<id>urn:sha1:781ec111b728a4d1ae513ae57d5eecf27680a216</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Auto merge of #129137 - camelid:lazy-def-macro-const, r=BoxyUwU</title>
<updated>2024-09-13T01:10:51+00:00</updated>
<author>
<name>bors</name>
<email>bors@rust-lang.org</email>
</author>
<published>2024-09-13T01:10:51+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=d3a8524e80244d66968ab4522d31145ccba610f4'/>
<id>urn:sha1:d3a8524e80244d66968ab4522d31145ccba610f4</id>
<content type='text'>
Fix anon const def-creation when macros are involved

Fixes #128016.

Ever since #125915, some `ast::AnonConst`s turn into `hir::ConstArgKind::Path`s,
which don't have associated `DefId`s. To deal with the fact that we don't have
resolution information in `DefCollector`, we decided to implement a process
where if the anon const *appeared* to be trivial (i.e., `N` or `{ N }`), we
would avoid creating a def for it in `DefCollector`. If later, in AST lowering,
we realized it turned out to be a unit struct literal, or we were lowering it
to something that didn't use `hir::ConstArg`, we'd create its def there.

However, let's say we have a macro `m!()` that expands to a reference to a free
constant `FOO`. If we use `m!()` in the body of an anon const (e.g., `Foo&lt;{ m!() }&gt;`),
then in def collection, it appears to be a nontrivial anon const and we create
a def. But the macro expands to something that looks like a trivial const arg,
but is not, so in AST lowering we "fix" the mistake we assumed def collection
made and create a def for it. This causes a duplicate definition ICE.

The long-term fix for this is to delay the creation of defs for all expression-like
nodes until AST lowering (see #128844 for an incomplete attempt at this). This
would avoid issues like this one that are caused by hacky workarounds. However,
doing this uncovers a pre-existing bug with opaque types that is quite involved
to fix (see #129023).

In the meantime, this PR fixes the bug by delaying def creation for anon consts
whose bodies are macro invocations until after we expand the macro and know
what is inside it. This is accomplished by adding information to create the
anon const's def to the data in `Resolver.invocation_parents`.

r? `@BoxyUwU`
</content>
</entry>
</feed>
