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

Provide workaround for lifetime bug in rustlang #9

Merged
merged 1 commit into from
May 11, 2015

Conversation

worr
Copy link
Contributor

@worr worr commented May 11, 2015

Due to rust-lang/rust#22252, r-value temporaries
outlive the lifetimes of variables bound with let statements in a function
body. Because of this, device.rs fails to compile against newer rustc
nightlies.

This implements a simple workaround that binds the result of the match in
request_code to a local variable before returning it. This allows it to have
the same lifetime as req in one of the previous let bindings.

@GitCop
Copy link

GitCop commented May 11, 2015

Thanks for contributing. Unfortunately I have to tell you that there were the following issues with your Pull Request

  • Commit: 9649efc
    • Your commit message body contains a line that is longer than 72 characters
    • Commits must be in the following format: %{type}(%{scope}): %{description}

Guidelines are available at https://github.com/angular/angular.js/blob/master/CONTRIBUTING.md#-git-commit-guidelines


This message was auto-generated by https://gitcop.com

@worr worr force-pushed the bug/rvalue-lifetime-build-failures branch from 9649efc to 12f5052 Compare May 11, 2015 01:14
@GitCop
Copy link

GitCop commented May 11, 2015

Thanks for contributing. Unfortunately I have to tell you that there were the following issues with your Pull Request

  • Commit: 12f5052
    • Your commit message body contains a line that is longer than 72 characters

Guidelines are available at https://github.com/angular/angular.js/blob/master/CONTRIBUTING.md#-git-commit-guidelines


This message was auto-generated by https://gitcop.com

Due to rust-lang/rust#22252, r-value
temporaries outlive the lifetimes of variables bound with let
statements in a function body. Because of this, device.rs fails to
compile against newer rustc nightlies.

This implements a simple workaround that binds the result of the match
in `request_code` to a local variable before returning it. This allows
it to have the same lifetime as `req` in one of the previous let
bindings.
@worr worr force-pushed the bug/rvalue-lifetime-build-failures branch from 12f5052 to 47b68cf Compare May 11, 2015 01:16
@Byron
Copy link
Collaborator

Byron commented May 11, 2015

Thank you !
It's odd that I didn't see this 3-months old bug yet, the compiler I am using is rustc 1.1.0-nightly (7bd71637c 2015-05-06) (built 2015-05-05).
I will merge it and make a point-release, along with a ticket to trigger a review once Rust 1.0 is out.

Byron added a commit that referenced this pull request May 11, 2015
@Byron Byron merged commit bcdaac8 into dermesser:master May 11, 2015
@Byron
Copy link
Collaborator

Byron commented May 11, 2015

Sad, the release will have to wait as crates.io seems down :(.

@Byron
Copy link
Collaborator

Byron commented May 11, 2015

It's interesting: This issue has recently been introduced, and occurs from rustc 1.1.0-nightly (dc630d01e 2015-05-09) (built 2015-05-09) or before that, but worked with the version I posted previously.

@Byron
Copy link
Collaborator

Byron commented May 11, 2015

New release published: v0.4.5

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.

None yet

3 participants