Skip to content

Conversation

camelid
Copy link
Member

@camelid camelid commented Apr 8, 2025

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. labels Apr 8, 2025
@camelid camelid added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Apr 8, 2025
@rust-log-analyzer

This comment has been minimized.

@camelid camelid force-pushed the mgca-const-items branch from fa42f86 to 6054bd5 Compare April 9, 2025 16:14
@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@camelid camelid force-pushed the mgca-const-items branch from 4f6c9ab to a46aa4c Compare May 15, 2025 12:37
@rust-log-analyzer

This comment has been minimized.

@rustbot rustbot added the WG-trait-system-refactor The Rustc Trait System Refactor Initiative (-Znext-solver) label May 15, 2025
@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@camelid camelid added A-const-generics Area: const generics (parameters and arguments) F-min_generic_const_args `#![feature(min_generic_const_args)]` labels May 17, 2025
@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@bors
Copy link
Collaborator

bors commented May 21, 2025

☔ The latest upstream changes (presumably #141343) made this pull request unmergeable. Please resolve the merge conflicts.

@BoxyUwU
Copy link
Member

BoxyUwU commented May 23, 2025

@oli-obk I've assigned you to this PR alongside me because I'd definitely want you to review it before it lands since its so CTFE involved 🤔 I don't think it needs reviewing rn though, things are so up in the air and we're not bootstrapping yet :3

This was a pre-existing bug that was not exposed by the test suite.
We need a layer of branches for each level of the data, and since CStrs
are a wrapper around a slice, we were missing a branch here.
@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

}
}
}
||||||| parent of ed062304ce5 (mgca: Add ConstArg representation for const items)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

git whoopsie :3

@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer
Copy link
Collaborator

The job tidy failed! Check out the build log: (web) (plain enhanced) (plain)

Click to see the possible cause of the failure (guessed by this bot)
     ) -> bool {
         let tcx = self.tcx;
-        
+
         if let DefKind::AnonConst = tcx.def_kind(body_owner_def_id)
             && let ty::AnonConstKind::ItemBody = tcx.anon_const_kind(body_owner_def_id)
         {
Diff in /checkout/compiler/rustc_middle/src/hir/map.rs:984:
                 // Ensure that the returned span has the item's SyntaxContext.
                 fn_decl_span.find_ancestor_inside(*span).unwrap_or(*span)
             }
-            Node::AnonConst(anon) if let crate::ty::AnonConstKind::ItemBody = self.anon_const_kind(anon.def_id) => {
+            Node::AnonConst(anon)
+                if let crate::ty::AnonConstKind::ItemBody = self.anon_const_kind(anon.def_id) =>
+            {
                 return self.hir_span(self.parent_hir_id(self.parent_hir_id(hir_id)));
             }
             _ => self.hir_span_with_body(hir_id),
Diff in /checkout/compiler/rustc_middle/src/hir/map.rs:1004:
             Node::ImplItem(impl_item) => impl_item.span,
             Node::Variant(variant) => variant.span,
             Node::Field(field) => field.span,
-            Node::AnonConst(anon) if let crate::ty::AnonConstKind::ItemBody = self.anon_const_kind(anon.def_id) => {
+            Node::AnonConst(anon)
+                if let crate::ty::AnonConstKind::ItemBody = self.anon_const_kind(anon.def_id) =>
+            {
                 return self.hir_span_with_body(self.parent_hir_id(self.parent_hir_id(hir_id)));
             }
             Node::AnonConst(constant) => constant.span,
Diff in /checkout/compiler/rustc_resolve/src/def_collector.rs:21:
     expansion: LocalExpnId,
 ) {
     let invocation_parent = resolver.invocation_parents[&expansion];
-    let mut visitor = DefCollector { resolver, expansion, invocation_parent, overriden_anon_const_spans: FxHashMap::default(), };
+    let mut visitor = DefCollector {
+        resolver,
+        expansion,
+        invocation_parent,
+        overriden_anon_const_spans: FxHashMap::default(),
+    };
     fragment.visit_with(&mut visitor);
 }
 
Diff in /checkout/compiler/rustc_resolve/src/def_collector.rs:126:
                 if let Some(anon) = body {
                     self.overriden_anon_const_spans.insert(anon.id, i.span);
                 }
-                
+
                 DefKind::Const
             }
             ItemKind::Fn(..) | ItemKind::Delegation(..) => DefKind::Fn,
Diff in /checkout/compiler/rustc_resolve/src/def_collector.rs:351:
                 }
 
                 (*ident, DefKind::AssocConst)
-            },
+            }
             AssocItemKind::Type(box TyAlias { ident, .. }) => (*ident, DefKind::AssocTy),
             AssocItemKind::MacCall(..) | AssocItemKind::DelegationMac(..) => {
                 return self.visit_macro_invoc(i.id);
Diff in /checkout/compiler/rustc_resolve/src/def_collector.rs:371:
 
     fn visit_anon_const(&mut self, constant: &'a AnonConst) {
         // TODO: i dont think this actually does anything?? what does this span even correspond to
-        let span = self.overriden_anon_const_spans.get(&constant.id).copied().unwrap_or(constant.value.span);
+        let span = self
+            .overriden_anon_const_spans
+            .get(&constant.id)
+            .copied()
+            .unwrap_or(constant.value.span);
 
         let parent = self.create_def(constant.id, None, DefKind::AnonConst, span);
         self.with_parent(parent, |this| visit::walk_anon_const(this, constant));
fmt: checked 6440 files
Bootstrap failed while executing `test src/tools/tidy tidyselftest --extra-checks=py,cpp,js,spellcheck`
Build completed unsuccessfully in 0:00:47
  local time: Wed Oct  1 04:18:21 UTC 2025
  network time: Wed, 01 Oct 2025 04:18:22 GMT

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-const-generics Area: const generics (parameters and arguments) F-min_generic_const_args `#![feature(min_generic_const_args)]` S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. T-clippy Relevant to the Clippy team. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. T-rustfmt Relevant to the rustfmt team, which will review and decide on the PR/issue. WG-trait-system-refactor The Rustc Trait System Refactor Initiative (-Znext-solver)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants