Skip to content
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

Change column!() / line!() return type from usize to u32. #19284 #21769

Merged
merged 2 commits into from
Feb 23, 2015
Merged

Change column!() / line!() return type from usize to u32. #19284 #21769

merged 2 commits into from
Feb 23, 2015

Conversation

brooksbp
Copy link
Contributor

Please see discussion in #19284 .

@rust-highfive
Copy link
Collaborator

Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @nick29581 (or someone else) soon.

If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. The way Github handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes.

Please see CONTRIBUTING.md for more information.

@@ -15,7 +15,8 @@ macro_rules! panic {
panic!("explicit panic")
);
($msg:expr) => ({
static _MSG_FILE_LINE: (&'static str, &'static str, usize) = ($msg, file!(), line!());
static _MSG_FILE_LINE: (&'static str, &'static str, usize) =
Copy link
Member

Choose a reason for hiding this comment

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

Can you change this to expect a u32 rather than casting to usize?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

#19284 has more details on that approach. Not much luck, so hoping someone familiar with this type of issue can shed some guidance.

Copy link
Member

Choose a reason for hiding this comment

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

Could you use #[cfg(stage0)] and #[cfg(not(stage0))] to provide usize and u32 versions and thus avoid the errors?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ah. I'll give this a shot. Thanks

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Well.. still hitting the stage0 assertion in LLVM when using #[cfg(stage0)]. I've added more details (backtrace of the stage0) in #19284. I'm afraid I need help from someone more familiar with the compiler.

@brooksbp brooksbp changed the title Change column! / line! return type from usize to u32. #19284 Change column!() / line!() return type from usize to u32. #19284 Feb 21, 2015
@nrc
Copy link
Member

nrc commented Feb 22, 2015

Hi, sorry, I was on vacation last week. I saw a notification email, but there are more commits now - is this ready to go now or are there still issues you need help with?

@brooksbp
Copy link
Contributor Author

@nick29581 I believe it's good to go. @vojtechkral helped get past the LLVM assertions, so now the changes handle both stage0 and stage1+. Once the column()! line()! return type propagates to the stage0 we should be able to remove the duplicated code conditional on the #[cfg(stageX)].

As a followup, src/libsyntax/codemap.rs Loc and friends should probably convert to u32 as well, but wanted to get this macro change in as it's my first contrib.

@nrc
Copy link
Member

nrc commented Feb 22, 2015

@bors r+ fc9fa1a

@bors
Copy link
Contributor

bors commented Feb 23, 2015

⌛ Testing commit fc9fa1a with merge f0f7ca2...

bors added a commit that referenced this pull request Feb 23, 2015
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.

5 participants