commit | 55043f067dcf7067e7c6ebccf3639af94ff57bda | [log] [tgz] |
---|---|---|
author | bors <bors@rust-lang.org> | Sun Sep 22 00:31:03 2024 +0000 |
committer | bors <bors@rust-lang.org> | Sun Sep 22 00:31:03 2024 +0000 |
tree | b68c490fe50e1087af0df4daf9674e9bc1eec23c | |
parent | 764e6aec81517cde60214ccd00a709a34eb0c07d [diff] | |
parent | 781ec111b728a4d1ae513ae57d5eecf27680a216 [diff] |
Auto merge of #130337 - BoxyUwU:anon_const_macro_call, r=camelid Fix anon const def-creation when macros are involved take 2 Fixes #130321 There were two cases that #129137 did not handle correctly: - Given a const argument `Foo<{ bar!() }>` in which `bar!()` expands to `N`, we would visit the anon const and then visit the `{ bar() }` expression instead of visiting the macro call. This meant that we would build a def for the anon const as `{ bar!() }` is not a trivial const argument as `bar!()` is not a path. - Given a const argument `Foo<{ bar!() }>` is which `bar!()` expands to `{ qux!() }` in which `qux!()` expands to `N`, it should not be considered a trivial const argument as `{{ N }}` has two pairs of braces. If we only looked at `qux`'s expansion it would *look* like a trivial const argument even though it is not. We have to track whether we have "unwrapped" a brace already when recursing into the expansions of `bar`/`qux`/any macro r? `@camelid`
Website | Getting started | Learn | Documentation | Contributing
This is the main source code repository for Rust. It contains the compiler, standard library, and documentation.
Performance: Fast and memory-efficient, suitable for critical services, embedded devices, and easily integrate with other languages.
Reliability: Our rich type system and ownership model ensure memory and thread safety, reducing bugs at compile-time.
Productivity: Comprehensive documentation, a compiler committed to providing great diagnostics, and advanced tooling including package manager and build tool (Cargo), auto-formatter (rustfmt), linter (Clippy) and editor support (rust-analyzer).
Read “Installation” from The Book.
If you really want to install from source (though this is not recommended), see INSTALL.md.
See https://www.rust-lang.org/community for a list of chat platforms and forums.
See CONTRIBUTING.md.
Rust is primarily distributed under the terms of both the MIT license and the Apache License (Version 2.0), with portions covered by various BSD-like licenses.
See LICENSE-APACHE, LICENSE-MIT, and COPYRIGHT for details.
The Rust Foundation owns and protects the Rust and Cargo trademarks and logos (the “Rust Trademarks”).
If you want to use these names or brands, please read the media guide.
Third-party logos may be subject to third-party copyrights and trademarks. See Licenses for details.