-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Logging of newtyped uints is broken #3506
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
Comments
This is a real hindrance to debugging the type checker, so I put it as a blocker for 0.4. |
Even more interesting:
Produces:
Where the printed value changes in each invocation... |
This issue can be fixed with diff --git a/src/libcore/repr.rs b/src/libcore/repr.rs
index a0d6b01..610cc6f 100644
--- a/src/libcore/repr.rs
+++ b/src/libcore/repr.rs
@@ -881,13 +881,13 @@ impl ReprPrinterWrapper : TyVisitor {
let mut enum_state = stack.last();
match enum_state.state {
PreVariant => {
- let disr_ptr = self.printer.ptr as *int;
- if *disr_ptr == disr_val {
+ //let disr_ptr = self.printer.ptr as *int;
+ //if *disr_ptr == disr_val {
enum_state.state = InVariant;
self.printer.writer.write_str(name);
- self.printer.bump(sys::size_of::<int>());
+ //self.printer.bump(sys::size_of::<int>());
stack.set_elt(stack.len() - 1, enum_state);
- }
+ //}
}
InVariant | PostVariant => {}
} This is almost certainly not the correct fix, but might be a hint about where the problem is. |
Thanks, I hadn't gotten around to opening repr.rs, but after your |
Oh, I should rebase before I repeat @pcwalton's work :) |
fix not to emit version
Running this program:
yields the output:
Not so good.
The text was updated successfully, but these errors were encountered: