Skip to content

Translate SourceLocExpr - #468

Merged
nunoplopes merged 6 commits into
Cpp2Rust:masterfrom
lucic71:5-source-loc-expr
Oct 7, 2026
Merged

nunoplopes merged 6 commits into
Cpp2Rust:masterfrom
lucic71:5-source-loc-expr

Conversation

@lucic71

@lucic71 lucic71 commented Oct 7, 2026

Copy link
Copy Markdown
Contributor

No description provided.

@nunoplopes

Copy link
Copy Markdown
Contributor

Use file! and line!

@lucic71

lucic71 commented Oct 7, 2026

Copy link
Copy Markdown
Contributor Author

Use file! and line!

But that will change the behaviour of the original program. Is that ok?

@nunoplopes

Copy link
Copy Markdown
Contributor

will -> may

Yes, that's fine.

@lucic71

lucic71 commented Oct 7, 2026

Copy link
Copy Markdown
Contributor Author

will -> may

Yes, that's fine.

Done


std::string ConverterRefCount::GetSourceFileAsString(clang::QualType type) {
return std::format(
"Ptr::<{}>::from_string_literal(concat!(file!(), \"\\0\").as_bytes())",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I don't think that \0 is needed

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Done

@nunoplopes
nunoplopes merged commit 370bf3d into Cpp2Rust:master Oct 7, 2026
9 checks passed
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.

2 participants