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

Rust 1.17 regression - yamlette 0.0.2 #40964

Closed
alexcrichton opened this issue Mar 31, 2017 · 6 comments
Closed

Rust 1.17 regression - yamlette 0.0.2 #40964

alexcrichton opened this issue Mar 31, 2017 · 6 comments
Labels
A-typesystem Area: The type system regression-from-stable-to-beta Performance or correctness regression from stable to beta. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@alexcrichton
Copy link
Member

[~/code/yamlette[master]] $ CARGO_TARGET_DIR=beta cargo +beta build                                                                                                                                                                                    [alex@acrichton-desktop]
   Compiling yamlette v0.0.2 (file:///home/alex/code/yamlette)
error[E0495]: cannot infer an appropriate lifetime for lifetime parameter 'c in function call due to conflicting requirements
   --> src/orchestra/conductor.rs:635:22
    |
635 |                 self.do_the_music (music, performer_buffers, volumes) ?;
    |                      ^^^^^^^^^^^^
    |
note: first, the lifetime cannot outlive the anonymous lifetime #5 defined on the body at 573:31...
   --> src/orchestra/conductor.rs:573:32
    |
573 |     ) -> Result<(), OrchError> {
    |                                ^
note: ...so that reference does not outlive borrowed content
   --> src/orchestra/conductor.rs:635:62
    |
635 |                 self.do_the_music (music, performer_buffers, volumes) ?;
    |                                                              ^^^^^^^
note: but, the lifetime must be valid for the anonymous lifetime #3 defined on the body at 573:31...
   --> src/orchestra/conductor.rs:573:32
    |
573 |     ) -> Result<(), OrchError> {
    |                                ^
note: ...so that types are compatible (expected &[model::renderer::Node], found &[model::renderer::Node])
   --> src/orchestra/conductor.rs:635:43
    |
635 |                 self.do_the_music (music, performer_buffers, volumes) ?;
    |                                           ^^^^^^^^^^^^^^^^^

error: aborting due to previous error

error: Could not compile `yamlette`.

To learn more, run the command again with --verbose.
[~/code/yamlette[master]] $ git log -1                                                                                                                                                                                                                 [alex@acrichton-desktop]
commit 9bca6d6569afd1b6603c8ecbc3a0c44d530f98d4
Author: dnsl48 <dnsl48@gmail.com>
Date:   Mon Feb 6 17:32:36 2017 +1300

    No debug for Sage anymore
[~/code/yamlette[master]] $ rustc +beta -vV                                                                                                                                                                                                            [alex@acrichton-desktop]
rustc 1.17.0-beta.2 (b7c276653 2017-03-20)
binary: rustc
commit-hash: b7c27665307704a9b158fe242e88e83914029415
commit-date: 2017-03-20
host: x86_64-unknown-linux-gnu
release: 1.17.0-beta.2
LLVM version: 3.9

https://github.com/dnsl48/yamlette

cc @dnsl48

@alexcrichton alexcrichton added the regression-from-stable-to-beta Performance or correctness regression from stable to beta. label Mar 31, 2017
@nikomatsakis
Copy link
Contributor

nikomatsakis commented Mar 31, 2017

Possibly related to #40319 ? (cc @eddyb -- you think?)

@dnsl48
Copy link

dnsl48 commented Apr 2, 2017

Hi guys, thank you very much for the report, love your work!
I have added some explicit lifetimes around. I'm not exactly sure it's related to #40319 however, now it appears that invocation of self.do_the_music borrows volumes for the whole lifetime of performer_buffers (https://travis-ci.org/dnsl48/yamlette/jobs/217654253).
I would appreciate if you could confirm this assumption, which frankly seems to be correct behaviour to me now.
Feels like I've been using some fault technics to trick the borrow checker there. Probably I'll have to rewrite this place a bit. At the moment I'm doing lots of refactoring all over the library anyways, and I'm glad there's one more place to be rewritten in a more proper way.
Cheers

@nikomatsakis
Copy link
Contributor

@dnsl48 looking at those diffs, it's not obvious to me why those patches should be needed. I'll try to build your crate locally and investigate.

@nikomatsakis
Copy link
Contributor

@dnsl48 trying to build the crate, I agree that the current error is correct. As you said, do_the_music() borrows volumes for the whole lifetime of performer_buffers, since data from volumes is put into performer_buffers.

@brson brson added T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. A-typesystem Area: The type system labels Apr 4, 2017
@arielb1
Copy link
Contributor

arielb1 commented Apr 4, 2017

This is #40319, which was not marked as relnotes. Marking as relnotes myself.

@nikomatsakis
Copy link
Contributor

Closing, since the PR in question ins tagged as relnotes now. (Thanks @arielb1)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-typesystem Area: The type system regression-from-stable-to-beta Performance or correctness regression from stable to beta. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

5 participants