Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign upRegression from beta: closure may outlive the current function, but it borrows `...`, which is owned by the current function #24364
Comments
sanxiyn
added
the
regression-from-stable-to-nightly
label
Apr 13, 2015
brson
removed
the
regression-from-stable-to-nightly
label
May 28, 2015
This comment has been minimized.
This comment has been minimized.
|
I'm untagging all pre-1.0 regressions to repurpose it for stable regressions. |
brson
added
A-typesystem
A-borrow-checker
labels
May 28, 2015
This comment has been minimized.
This comment has been minimized.
|
@brson from skimming the description this might be a regression against 1.0 -- it is described as code that compiled in the beta but did not compile in nightly.... (As an aside, perhaps we should have distinct tags for regressions against the stable channel versus regressions against the beta channel. Or maybe not, perhaps both need equal prioritization...) |
This comment has been minimized.
This comment has been minimized.
|
I'm closing this as 1.0 is old now. Fixing a regression from beta to 1.0 doesn't really make sense anymore. |
tomaka
closed this
Aug 19, 2015
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
tomaka commentedApr 13, 2015
As reported in this thread, the two examples here no longer compile with the nightly but they do compile with the beta (tested with the 2015-04-12 nightly).
I didn't manage to reproduce on a small scale, so I'll explain a bit the code of
displacement_mapping.rs:CompressedTexture2d.&'a CompressedTexture2dimplements the traitIntoUniformValue<'a>. This trait can turn the reference into aUniformValue<'a>.support::start_loopfunction has this signature:fn start_loop<F>(mut callback: F) where F: FnMut() -> Action.&'athe texture, callinto_uniform_value()and store theUniformValue<'a>in aVec.&uniforms(only borrows it to see its content, doesn't do anything special with its lifetime).More precisely, the
uniform!macro invokation does the following:{ let uniforms = UniformsStorage::new("inner_level", 64.0f32); let uniforms = uniforms.add("outer_level", 64.0f32); ... let uniforms = uniforms.add("height_texture", &opengl_texture); let uniforms = uniforms.add("elevation", 0.3f32); let uniforms = uniforms.add("color_texture", &opengl_texture); uniforms }See the definition of
UniformsStoragehere.