1
Fork 0
rust/compiler/rustc_data_structures/src
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
..
base_n Stabilize the size of incr comp object file names 2024-04-22 10:50:07 -04:00
binary_search_util Remove invariant comments 2023-11-05 17:35:37 -06:00
fingerprint remove redundant imports 2023-12-10 10:56:22 +08:00
flock bumpt compiler and tools to windows 0.59 2025-01-21 16:48:44 +03:00
graph Revert "Use workspace lints for crates in compiler/ #138084" 2025-03-10 18:12:47 +08:00
intern remove redundant imports 2023-12-10 10:56:22 +08:00
obligation_forest Auto merge of #128440 - oli-obk:defines, r=lcnr 2025-03-11 18:13:31 +00:00
owned_slice Reformat using the new identifier sorting from rustfmt 2024-09-22 19:11:29 -04:00
profiling Don't use serde_json to serialize a simple JSON object 2023-04-16 15:00:06 +02:00
small_c_str Fix SmallCStr conversion from CStr 2024-02-14 18:40:53 -08:00
snapshot_map Reformat use declarations. 2024-07-29 08:26:52 +10:00
sorted_map Rollup merge of #136610 - Jarcho:range_idx, r=Noratrieb 2025-02-24 02:11:32 -05:00
sso Greatly simplify lifetime captures in edition 2024 2025-02-22 22:24:52 +00:00
stable_hasher rename BitSet to DenseBitSet 2025-01-11 11:34:01 +00:00
sync Revert "Use workspace lints for crates in compiler/ #138084" 2025-03-10 18:12:47 +08:00
tagged_ptr Revert "Use workspace lints for crates in compiler/ #138084" 2025-03-10 18:12:47 +08:00
thousands Overhaul to_readable_str. 2025-01-31 16:04:13 +11:00
transitive_relation get rid of RefCell in TransitiveRelation 2022-08-22 18:08:46 +08:00
vec_cache Rustfmt 2025-02-08 22:12:13 +00:00
aligned.rs compiler: Use size_of from the prelude instead of imported 2025-03-07 13:37:04 -08:00
atomic_ref.rs
base_n.rs chore: Fix typos in 'compiler' (batch 1) 2024-09-02 07:42:38 +02:00
fingerprint.rs Move hashes from rustc_data_structure to rustc_hashes so they can be shared with rust-analyzer 2025-02-16 16:18:30 -05:00
flat_map_in_place.rs Fix UB in ThinVec::flat_map_in_place 2025-02-26 15:49:19 +00:00
flock.rs update cfg(bootstrap) 2025-02-18 09:32:44 -08:00
frozen.rs Remove double spaces after dots in comments 2023-01-17 08:09:33 +00:00
fx.rs rustc_mir_transform: Make DestinationPropagation stable for queries 2024-01-05 20:55:32 +01:00
intern.rs Enforce T: Hash for Interned<...> 2025-02-17 21:35:52 -05:00
jobserver.rs Remove jobserver from Session 2024-12-13 10:21:22 +00:00
lib.rs Adapt librustdoc to 2024 edition lifetieme capture rules 2025-03-04 12:35:23 +02:00
marker.rs Ensure that negative auto impls are always applicable 2025-03-04 17:45:18 +00:00
memmap.rs Couple of changes to run rustc in miri 2025-02-05 13:52:22 +00:00
owned_slice.rs compiler/rustc_data_structures/src/sync.rs: delete Sync and Send 2025-02-11 09:15:54 +03:00
packed.rs MatchBranchSimplification: Consider empty-unreachable otherwise branch 2024-12-27 10:57:46 +00:00
profiling.rs compiler: Use size_of from the prelude instead of imported 2025-03-07 13:37:04 -08:00
sharded.rs compiler: Use size_of from the prelude instead of imported 2025-03-07 13:37:04 -08:00
small_c_str.rs Fix SmallCStr conversion from CStr 2024-02-14 18:40:53 -08:00
sorted_map.rs Optimize empty provenance range checks. 2025-02-27 18:10:17 +11:00
stable_hasher.rs Move hashes from rustc_data_structure to rustc_hashes so they can be shared with rust-analyzer 2025-02-16 16:18:30 -05:00
stack.rs Stacker now handles miri using a noop impl itself 2025-02-21 13:54:45 +00:00
steal.rs update bootstrap configs 2024-10-15 20:30:23 -07:00
svh.rs Reformat use declarations. 2024-07-29 08:26:52 +10:00
sync.rs Revert "Use workspace lints for crates in compiler/ #138084" 2025-03-10 18:12:47 +08:00
tagged_ptr.rs De-abstract tagged pointer abstraction 2025-01-12 14:56:10 +00:00
temp_dir.rs Reformat use declarations. 2024-07-29 08:26:52 +10:00
thinvec.rs Add ExtractIf for ThinVec 2024-10-12 15:17:03 +01:00
transitive_relation.rs Greatly simplify lifetime captures in edition 2024 2025-02-22 22:24:52 +00:00
unhash.rs Handle clippy cases of rustc::potential_query_instability lint 2024-10-05 07:34:14 +03:00
unord.rs Add UnordMap::clear method 2024-11-20 18:11:37 +01:00
vec_cache.rs Notes on types/traits used for in-memory query caching 2025-02-03 22:36:01 +11:00
work_queue.rs rename BitSet to DenseBitSet 2025-01-11 11:34:01 +00:00