Skip to content
New issue

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

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

Already on GitHub? # to your account

Adjust the die macro to only accept ~str and to work in statement positi... #4153

Closed
wants to merge 1 commit into from

Conversation

brson
Copy link
Contributor

@brson brson commented Dec 11, 2012

r? @pcwalton

The error messages when failing to use ~str are bad:

<core-macros>:17:37: 17:43 error: mismatched types: expected `~str` but found `&static/str` (str storage differs: expected ~ but found &static)
<core-macros>:17                 let msgptr: &~str = &{$msg};
                                                      ^~~~~~
<core-macros>:13:4: 1:0 note: in expansion of die!
/home/brian/dev/rust/src/test/compile-fail/die-not-unique.rs:4:4: 4:17 note: expansion site
<core-macros>:17:36: 17:43 error: mismatched types: expected `&~str` but found `&&static/str` (str storage differs: expected ~ but found &static)
<core-macros>:17                 let msgptr: &~str = &{$msg};
                                                     ^~~~~~~
<core-macros>:13:4: 1:0 note: in expansion of die!
/home/brian/dev/rust/src/test/compile-fail/die-not-unique.rs:4:4: 4:17 note: expansion site
error: aborting due to 2 previous errors

@brson
Copy link
Contributor Author

brson commented Dec 11, 2012

I wonder if this still works in expr position... yes, it does.

@pcwalton
Copy link
Contributor

r- per IRC.

@brson brson closed this Dec 11, 2012
RalfJung added a commit to RalfJung/rust that referenced this pull request Jan 26, 2025
…lookups

Pre-intern name when searching module children
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants