rust/library
bors 6650252439 Auto merge of #128440 - oli-obk:defines, r=lcnr
Add `#[define_opaques]` attribute and require it for all type-alias-impl-trait sites that register a hidden type

Instead of relying on the signature of items to decide whether they are constraining an opaque type, the opaque types that the item constrains must be explicitly listed.

A previous version of this PR used an actual attribute, but had to keep the resolved `DefId`s in a side table.

Now we just lower to fields in the AST that have no surface syntax, instead a builtin attribute macro fills in those fields where applicable.

Note that for convenience referencing opaque types in associated types from associated methods on the same impl will not require an attribute. If that causes problems `#[defines()]` can be used to overwrite the default of searching for opaques in the signature.

One wart of this design is that closures and static items do not have generics. So since I stored the opaques in the generics of functions, consts and methods, I would need to add a custom field to closures and statics to track this information. During a T-types discussion we decided to just not do this for now.

fixes #131298
2025-03-11 18:13:31 +00:00
..
alloc Stabilize const_vec_string_slice 2025-03-08 17:03:52 +01:00
alloctests Add comments 2025-03-07 19:11:13 +00:00
backtrace@9d2c34e7e6 Update backtrace 2025-02-13 14:32:50 -08:00
core Auto merge of #128440 - oli-obk:defines, r=lcnr 2025-03-11 18:13:31 +00:00
coretests Update tests. 2025-03-10 12:20:05 +01:00
panic_abort panic_abort: Apply unsafe_op_in_unsafe_fn 2025-02-14 07:36:17 -08:00
panic_unwind library: Use size_of from the prelude instead of imported 2025-03-06 20:20:38 -08:00
portable-simd Remove ignored #[must_use] attributes from portable-simd 2025-02-12 13:59:22 +01:00
proc_macro library: Use size_of from the prelude instead of imported 2025-03-06 20:20:38 -08:00
profiler_builtins compiler & tools dependencies: 2024-12-17 17:41:00 +00:00
rtstartup Mark extern blocks as unsafe 2025-02-09 17:11:13 +00:00
rustc-std-workspace-alloc Replace libstd, libcore, liballoc in line comments. 2022-12-30 14:00:42 +01:00
rustc-std-workspace-core update rustc-std-workspace crates 2024-11-04 07:45:15 +01:00
rustc-std-workspace-std
std Auto merge of #128440 - oli-obk:defines, r=lcnr 2025-03-11 18:13:31 +00:00
stdarch@9426bb5658 Update stdarch 2025-03-06 11:11:55 -08:00
sysroot Rollup merge of #135501 - tgross35:stdlib-dependencies-private, r=bjorn3 2025-02-23 00:16:18 +01:00
test Use correct error message casing for io::const_errors 2025-02-28 17:50:38 +01:00
unwind Target definition for wasm32-wali-linux-musl to support the Wasm Linux 2025-03-10 21:26:45 -04:00
windows_targets Don't link against advapi32, except on win7. 2025-03-08 10:55:47 -05:00
Cargo.lock Update hermit-abi to 0.5.0 2025-03-09 15:38:29 -07:00
Cargo.toml Move all alloc integration tests to a new alloctests crate 2025-03-07 19:11:11 +00:00