Skip to content

Conversation

ahomescu
Copy link
Contributor

Update the refactoring tool to build and run with the same Rust nightly as the transpiler.

Copy link
Contributor

@kkysen kkysen left a comment

Choose a reason for hiding this comment

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

Okay I reviewed 100/127 files. I'll review the rest a bit later. Left a few comments, but it generally all looks fine to my cursory review so far.

Comment on lines +81 to +84
let (defaultness, generics, sig, body) = expect!([i.kind]
ItemKind::Fn(box Fn { defaultness, generics, sig, body })
=> (defaultness, generics, sig, body));
Copy link
Contributor

Choose a reason for hiding this comment

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

What's expect!?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Internal macro from src/macros.rs that tries to match a value against the given pattern, and panics if the matching fails. We could try to get rid of it but it's already used in a hundred other places, so I'm not sure it's worth the effort.

Copy link
Contributor

Choose a reason for hiding this comment

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

Perhaps. It's not very clear what it does vs. assert_matches!, although I'm not sure if it's worth the effort. I'd definitely prefer to use assert_matches! and matches! over the handrolled matches! and expect! here.

Copy link
Contributor

Choose a reason for hiding this comment

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

For new ones, though, I'd rather just use assert_matches!.

@ahomescu ahomescu force-pushed the ahomescu/restore_refactor branch 2 times, most recently from ac75014 to c958fe0 Compare August 29, 2025 21:22
@ahomescu ahomescu force-pushed the ahomescu/restore_refactor branch from c958fe0 to b0a8be1 Compare September 6, 2025 01:21
Copy link
Contributor

@kkysen kkysen left a comment

Choose a reason for hiding this comment

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

Reviewed some more. Still reviewing the last 15 files or so.

However, when I checked out the code, I got a bunch of compiler errors/warnings.

Copy link
Contributor

@kkysen kkysen left a comment

Choose a reason for hiding this comment

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

Oops, forgot to submit these comments.

if let Some(ldid) = def_id.as_local() {
let mod_hir_id = self.cx.ty_ctxt().parent_module_from_def_id(ldid);
let mod_id = self.cx.hir_map().local_def_id_to_node_id(mod_hir_id);
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we want to put this idiom in its own function? It's used a lot.

Copy link
Contributor

Choose a reason for hiding this comment

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

I guess that doesn't need to be done here in this PR.

@ahomescu ahomescu force-pushed the ahomescu/restore_refactor branch 3 times, most recently from da612cb to 073e366 Compare September 18, 2025 02:11
@ahomescu ahomescu force-pushed the ahomescu/restore_refactor branch from 4a917b1 to b998b55 Compare September 18, 2025 02:46
@ahomescu ahomescu force-pushed the ahomescu/restore_refactor branch 2 times, most recently from c351a8f to 71e9d3d Compare September 18, 2025 05:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants