Skip to content

Conversation

oli-obk
Copy link
Contributor

@oli-obk oli-obk commented Sep 6, 2016

fixes #32

I didn't touch the unimplemented!, since these probably need to go away by being implememented before moving miri into rustc.

src/bin/miri.rs Outdated
match lit.node {
syntax::ast::LitKind::Str(ref s, _) => s.clone(),
_ => panic!("attribute values need to be strings"),
_ => bug!("attribute values need to be strings"),
Copy link
Member

Choose a reason for hiding this comment

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

This should actually be a span_err, because it is a miri user fault, not miri progrmmer fault.

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 don't think the parser ever yields something other than a LitKind::Str. Rustc will error and abort long before we reach this.

Copy link
Member

Choose a reason for hiding this comment

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

#[memory_size=true] should give LitKind::Bool for the value.

Copy link
Contributor

Choose a reason for hiding this comment

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

@oli-obk It turns out this changed in a recent nightly. Beta still bails on non-string literals in attributes, but nightly accepts them if you use #![feature(attr_literals)].

src/primval.rs Outdated
// these have already been handled
Shl => bug!("`<<` operation should already have been handled"),
Shr => bug!("`>>` operation should already have been handled"),
Shl | Shr => bug!("`bin_op` operation should already have been handled", bin_op.to_hir_binop().as_str()),
Copy link
Contributor

Choose a reason for hiding this comment

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

s/bin_op/{}/

@solson solson merged commit be23dcd into rust-lang:master Sep 7, 2016
@oli-obk oli-obk deleted the unreachable_bugs branch September 7, 2016 10:40
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.

Use rustc's compiler error macros.

4 participants