iron / persistent

Middleware for sharing data between requests
43 stars 29 forks source link

explicit lifetimes now needed #26

Closed duelinmarkers closed 10 years ago

duelinmarkers commented 10 years ago

With these versions:

$ rustc -v
rustc 0.12.0-nightly (43fd61981 2014-09-22 23:50:30 +0000)
$ cargo version
cargo 0.0.1-pre-nightly (a54cb70 2014-09-23 01:34:57 +0000)

I get these errors:

   Compiling persistent v0.1.0 (https://github.com/iron/persistent.git#c8e75f5b)
src/lib.rs:88:1: 88:70 error: the parameter type `D` may not live long enough; consider adding an explicit lifetime bound `D:'static`...
src/lib.rs:88 impl<P, D> Assoc<Arc<RWLock<D>>> for State<P, D> where P: Assoc<D> {}
              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/lib.rs:88:1: 88:70 note: ...so that the parameter `<generic #0>`, when instantiated with `alloc::arc::Arc<sync::lock::RWLock<D>>`, will meet its declared lifetime bou
nds.
src/lib.rs:88 impl<P, D> Assoc<Arc<RWLock<D>>> for State<P, D> where P: Assoc<D> {}
              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/lib.rs:88:1: 88:70 error: the parameter type `D` may not live long enough; consider adding an explicit lifetime bound `D:'static`...
src/lib.rs:88 impl<P, D> Assoc<Arc<RWLock<D>>> for State<P, D> where P: Assoc<D> {}
              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/lib.rs:88:1: 88:70 note: ...so that the parameter `<generic #0>`, when instantiated with `State<P,D>`, will meet its declared lifetime bounds.
src/lib.rs:88 impl<P, D> Assoc<Arc<RWLock<D>>> for State<P, D> where P: Assoc<D> {}
              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/lib.rs:88:1: 88:70 error: the parameter type `D` may not live long enough; consider adding an explicit lifetime bound `D:'static`...
src/lib.rs:88 impl<P, D> Assoc<Arc<RWLock<D>>> for State<P, D> where P: Assoc<D> {}
              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/lib.rs:88:1: 88:70 note: ...so that the parameter `<generic #0>`, when instantiated with `State<P,D>`, will meet its declared lifetime bounds.
src/lib.rs:88 impl<P, D> Assoc<Arc<RWLock<D>>> for State<P, D> where P: Assoc<D> {}
              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/lib.rs:89:1: 89:61 error: the parameter type `D` may not live long enough; consider adding an explicit lifetime bound `D:'static`...
src/lib.rs:89 impl<P, D> Assoc<Arc<D>> for Read<P, D> where P: Assoc<D> {}
              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/lib.rs:89:1: 89:61 note: ...so that the parameter `<generic #0>`, when instantiated with `alloc::arc::Arc<D>`, will meet its declared lifetime bounds.
src/lib.rs:89 impl<P, D> Assoc<Arc<D>> for Read<P, D> where P: Assoc<D> {}
              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/lib.rs:89:1: 89:61 error: the parameter type `D` may not live long enough; consider adding an explicit lifetime bound `D:'static`...
src/lib.rs:89 impl<P, D> Assoc<Arc<D>> for Read<P, D> where P: Assoc<D> {}
              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/lib.rs:89:1: 89:61 note: ...so that the parameter `<generic #0>`, when instantiated with `Read<P,D>`, will meet its declared lifetime bounds.
src/lib.rs:89 impl<P, D> Assoc<Arc<D>> for Read<P, D> where P: Assoc<D> {}
              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/lib.rs:89:1: 89:61 error: the parameter type `D` may not live long enough; consider adding an explicit lifetime bound `D:'static`...
src/lib.rs:89 impl<P, D> Assoc<Arc<D>> for Read<P, D> where P: Assoc<D> {}
              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/lib.rs:89:1: 89:61 note: ...so that the parameter `<generic #0>`, when instantiated with `Read<P,D>`, will meet its declared lifetime bounds.
src/lib.rs:89 impl<P, D> Assoc<Arc<D>> for Read<P, D> where P: Assoc<D> {}
              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/lib.rs:90:1: 90:69 error: the parameter type `D` may not live long enough; consider adding an explicit lifetime bound `D:'static`...
src/lib.rs:90 impl<P, D> Assoc<Arc<Mutex<D>>> for Write<P, D> where P: Assoc<D> {}
              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/lib.rs:90:1: 90:69 note: ...so that the parameter `<generic #0>`, when instantiated with `alloc::arc::Arc<sync::lock::Mutex<D>>`, will meet its declared lifetime boun
ds.
src/lib.rs:90 impl<P, D> Assoc<Arc<Mutex<D>>> for Write<P, D> where P: Assoc<D> {}
              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/lib.rs:90:1: 90:69 error: the parameter type `D` may not live long enough; consider adding an explicit lifetime bound `D:'static`...
src/lib.rs:90 impl<P, D> Assoc<Arc<Mutex<D>>> for Write<P, D> where P: Assoc<D> {}
              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/lib.rs:90:1: 90:69 note: ...so that the parameter `<generic #0>`, when instantiated with `Write<P,D>`, will meet its declared lifetime bounds.
src/lib.rs:90 impl<P, D> Assoc<Arc<Mutex<D>>> for Write<P, D> where P: Assoc<D> {}
              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/lib.rs:90:1: 90:69 error: the parameter type `D` may not live long enough; consider adding an explicit lifetime bound `D:'static`...
src/lib.rs:90 impl<P, D> Assoc<Arc<Mutex<D>>> for Write<P, D> where P: Assoc<D> {}
              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/lib.rs:90:1: 90:69 note: ...so that the parameter `<generic #0>`, when instantiated with `Write<P,D>`, will meet its declared lifetime bounds.
src/lib.rs:90 impl<P, D> Assoc<Arc<Mutex<D>>> for Write<P, D> where P: Assoc<D> {}
              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
error: aborting due to 9 previous errors
Build failed, waiting for other jobs to finish...
Could not compile `persistent`.

I'm going try to fix this.

reem commented 10 years ago

Closed in master.