##// END OF EJS Templates
rust-cpython: mark all PyLeaked methods as unsafe...
rust-cpython: mark all PyLeaked methods as unsafe Unfortunately, these methods can be abused to obtain the inner 'static reference. The simplest (pseudo-code) example is: let leaked: PyLeaked<&'static _> = shared.leak_immutable(); let static_ref: &'static _ = &*leaked.try_borrow(py)?; // PyLeakedRef::deref() tries to bound the lifetime to itself, but // the underlying data is a &'static reference, so the returned // reference can be &'static. This problem can be easily fixed by coercing the lifetime, but there are many other ways to achieve that, and there wouldn't be a generic solution: let leaked: PyLeaked<&'static [_]> = shared.leak_immutable(); let leaked_iter: PyLeaked<slice::Iter<'static, _>> = unsafe { leaked.map(|v| v.iter()) }; let static_slice: &'static [_] = leaked_iter.try_borrow(py)?.as_slice(); So basically I failed to design the safe borrowing interface. Maybe we'll instead have to add much more restricted interface on top of the unsafe PyLeaked methods? For instance, Iterator::next() could be implemented if its Item type is not &'a (where 'a may be cheated.) Anyway, this seems not an easy issue, so it's probably better to leave the current interface as unsafe, and get broader comments while upstreaming this feature.

File last commit:

r43640:8fda98a6 stable
r44689:e960c30d default
Show More
control
41 lines | 1.1 KiB | text/plain | DebianControlLexer
Source: mercurial
Section: vcs
Priority: optional
Maintainer: Mercurial Developers <mercurial-devel@mercurial-scm.org>
Build-Depends:
debhelper (>= 9),
dh-python,
less,
netbase,
python3-all,
python3-all-dev,
python3-docutils,
unzip,
zip
Standards-Version: 3.9.4
X-Python3-Version: >= 3.5
Package: mercurial
Depends:
sensible-utils,
${shlibs:Depends},
${misc:Depends},
${python3:Depends},
Recommends: ca-certificates
Suggests: wish
Replaces: mercurial-common
Breaks: mercurial-common
Architecture: any
Description: fast, easy to use, distributed revision control tool.
Mercurial is a fast, lightweight Source Control Management system designed
for efficient handling of very large distributed projects.
.
Its features include:
* O(1) delta-compressed file storage and retrieval scheme
* Complete cross-indexing of files and changesets for efficient exploration
of project history
* Robust SHA1-based integrity checking and append-only storage model
* Decentralized development model with arbitrary merging between trees
* Easy-to-use command-line interface
* Integrated stand-alone web interface
* Small Python codebase