Skip to content

Rust shows internal lifetime repr #40632

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

Closed
bjorn3 opened this issue Mar 18, 2017 · 1 comment
Closed

Rust shows internal lifetime repr #40632

bjorn3 opened this issue Mar 18, 2017 · 1 comment
Labels
A-diagnostics Area: Messages for errors, warnings, and lints

Comments

@bjorn3
Copy link
Member

bjorn3 commented Mar 18, 2017

https://github.com/bjorn3/rust_blogpost_ui/tree/fb560c78a6e737561ef769673ddc39515df4a77b fails to compile with

$ cargo run
   Compiling rust_blogpost_ui v0.1.0 (~/Documents/rust_blogpost_u
i)
error[E0281]: type mismatch: the type `[closure@src/main.rs:25:20: 28:10]` implemen
ts the trait `for<'r> std::ops::Fn<(&'r mut cursive::Cursive, &'r post::Post)>`, bu
t the trait `for<'r, 'r> std::ops::Fn<(&'r mut cursive::Cursive, &'r _)>` is requir
ed (expected concrete lifetime, found bound lifetime parameter )
  --> src/main.rs:25:10
   |
25 |         .on_submit(|s, post: &post::Post| {
   |          ^^^^^^^^^

error[E0271]: type mismatch resolving `for<'r, 'r> <[closure@src/main.rs:25:20: 28:
10] as std::ops::FnOnce<(&'r mut cursive::Cursive, &'r _)>>::Output == ()`
  --> src/main.rs:25:10
   |
25 |         .on_submit(|s, post: &post::Post| {
   |          ^^^^^^^^^ expected bound lifetime parameter , found concrete lifetime
   |
   = note: concrete lifetime that was found is lifetime ReSkolemized(1, BrAnon(1))

error: aborting due to 2 previous errors

error: Could not compile `rust_blogpost_ui`.

To learn more, run the command again with --verbose.

Notice the ReSkolemized(1, BrAnon(1))

rust info:

$ rustup show
Default host: x86_64-apple-darwin

installed toolchains
--------------------

stable-x86_64-apple-darwin (default)
beta-2016-12-20-x86_64-apple-darwin
nightly-2016-04-14-x86_64-apple-darwin
nightly-2016-04-25-x86_64-apple-darwin
nightly-2016-09-29-x86_64-apple-darwin
nightly-2016-09-30-x86_64-apple-darwin
nightly-2016-12-29-x86_64-apple-darwin
nightly-x86_64-apple-darwin
nightly-x86_64-pc-windows-gnu

active toolchain
----------------

stable-x86_64-apple-darwin (default)
rustc 1.16.0 (30cf806ef 2017-03-10)
@TimNN TimNN added the A-diagnostics Area: Messages for errors, warnings, and lints label Mar 18, 2017
@estebank
Copy link
Contributor

Duplicate of #13998. (librustc/infer/error_reporting/mod.rs)

@bjorn3 bjorn3 closed this as completed Mar 21, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-diagnostics Area: Messages for errors, warnings, and lints
Projects
None yet
Development

No branches or pull requests

3 participants