-
Notifications
You must be signed in to change notification settings - Fork 156
anyhow
Error
#398
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
anyhow
Error
#398
Conversation
r? @Emilgardis (rust_highfive has picked a reviewer for you, use r? to override) |
cc @therealprof Looks like it works:
|
Sweet! |
Cargo.toml
Outdated
|
||
[dependencies.svd-parser] | ||
git = "https://github.com/rust-embedded/svd" | ||
branch = "anyhow" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Assuming this is just for the draft.
We could use the new git+version support added for publishing crates added recently, but I'm not sure myself how to properly use it.
That would also not be backwards compatible
src/main.rs
Outdated
.read_to_string(xml) | ||
.chain_err(|| "couldn't read the SVD file")?; | ||
.context("couldn't read the SVD file")?; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missed this when implementing, should probably be uppercase "C"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cannot vs couldn't vs can not
I prefer cannot for this
src/main.rs
Outdated
} | ||
None => { | ||
let stdin = std::io::stdin(); | ||
stdin | ||
.lock() | ||
.read_to_string(xml) | ||
.chain_err(|| "couldn't read from stdin")?; | ||
.context("couldn't read from stdin")?; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See above
src/generate/peripheral.rs
Outdated
@@ -600,7 +600,7 @@ fn expand_cluster(cluster: &Cluster, defs: &RegisterProperties) -> Result<Vec<Re | |||
let defs = cluster.default_register_properties.derive_from(defs); | |||
|
|||
let cluster_size = cluster_size_in_bits(cluster, &defs) | |||
.chain_err(|| format!("Cluster {} has no determinable `size` field", cluster.name))?; | |||
.context(format!("Cluster {} has no determinable `size` field", cluster.name))?; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use with_context
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Think there are some other places in rust-embedded/svd#98 that could do the same, but I'm sure it doesnt really matter in optimized builds.
We can merge this as is, if we do we'd bump the required cargo version to publish, but not to compile (published) crate. |
First we need make new release of |
By the way what MSRV version now? Can we merge #381 ? |
@burrbull It changes the MSRV of the PACs to 1.37? I don't think we want to do that just yet. Bumping the MSRV of svd or svd2rust would be fine. |
bors try |
tryBuild failed |
bors try |
tryBuild failed |
|
bors try |
tryBuild succeeded |
Now it works on stable, but without backtrace. If compile |
@burrbull Can you rebase this, fix the conflicts and add a ChangeLog entry? |
Looks like std::backtrace::Backtrace not stable yet. |
Rebased |
bors try |
tryBuild succeeded: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks!
bors r+
Build succeeded: |
rust-embedded/svd#98