Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Rust: extract source files of dependencies #19506

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 4 commits into
base: main
Choose a base branch
Loading
from

Conversation

aibaars
Copy link
Contributor

@aibaars aibaars commented May 16, 2025

No description provided.

@github-actions github-actions bot added the Rust Pull requests that update Rust code label May 16, 2025
@aibaars aibaars force-pushed the aibaars/rust-extract-libs branch from 03e78be to 69eed04 Compare May 16, 2025 13:03
@aibaars aibaars force-pushed the aibaars/rust-extract-libs branch from 69eed04 to e4ee4a9 Compare May 16, 2025 14:57
Comment on lines +625 to +630
if let Some(body) = syntax.parent().and_then(Fn::cast).and_then(|x| x.body()) {
if body.syntax() == syntax {
tracing::debug!("Skipping Fn body");
return true;
}
}
Copy link
Contributor

Choose a reason for hiding this comment

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

this should be equivalent and less nested, right?

Suggested change
if let Some(body) = syntax.parent().and_then(Fn::cast).and_then(|x| x.body()) {
if body.syntax() == syntax {
tracing::debug!("Skipping Fn body");
return true;
}
}
if syntax.parent().and_then(Fn::cast).and_then(|x| x.body().syntax()) == Some(syntax) {
tracing::debug!("Skipping Fn body");
return true;
}

@@ -612,6 +620,31 @@ impl<'a> Translator<'a> {
}

pub(crate) fn should_be_excluded(&self, item: &impl ast::HasAttrs) -> bool {
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm wondering, shouldn't we also skip private things? or is that too hard because of the re-exporting thing?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think we should, but I first want to make the tests work again before optimising things.

@redsun82 redsun82 changed the title Rust: extract source files of depdendencies Rust: extract source files of dependencies May 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Rust Pull requests that update Rust code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
Morty Proxy This is a proxified and sanitized view of the page, visit original site.