diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 12:20:29 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 12:20:29 +0000 |
commit | 631cd5845e8de329d0e227aaa707d7ea228b8f8f (patch) | |
tree | a1b87c8f8cad01cf18f7c5f57a08f102771ed303 /vendor/ena | |
parent | Adding debian version 1.69.0+dfsg1-1. (diff) | |
download | rustc-631cd5845e8de329d0e227aaa707d7ea228b8f8f.tar.xz rustc-631cd5845e8de329d0e227aaa707d7ea228b8f8f.zip |
Merging upstream version 1.70.0+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'vendor/ena')
-rw-r--r-- | vendor/ena/.cargo-checksum.json | 2 | ||||
-rw-r--r-- | vendor/ena/Cargo.toml | 7 | ||||
-rw-r--r-- | vendor/ena/src/unify/mod.rs | 43 |
3 files changed, 32 insertions, 20 deletions
diff --git a/vendor/ena/.cargo-checksum.json b/vendor/ena/.cargo-checksum.json index cce0ccf73..02891a04a 100644 --- a/vendor/ena/.cargo-checksum.json +++ b/vendor/ena/.cargo-checksum.json @@ -1 +1 @@ -{"files":{"Cargo.toml":"820aad545a6df3f8e1c17d0f4d3b9ad97b90c4d307dd7df17e4c375d378efcb2","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-MIT":"0621878e61f0d0fda054bcbe02df75192c28bde1ecc8289cbd86aeba2dd72720","README.md":"1c15c9176a442a293a7fe046172e316f95b3acca6c01ee495162d4bc57e6841b","measurements.txt":"b209f98f2bc696904a48829e86952f4f09b59e4e685f7c12087c59d05ed31829","src/bitvec.rs":"c6c66c348776ff480b7ff6e4a3e0f64554a4194266f614408b45b5e3c324ec0a","src/lib.rs":"9b94637cb53e882625d3fb714acac37bb5fe7762d2a583ad4fd43f276f849214","src/snapshot_vec.rs":"b9fce507e3eece42c742405aea870562f99fdea3a4e30a122cea64ef5634f197","src/undo_log.rs":"5c94971d95ae1dd2de04eae2ea1ec5b99c627fbe92b2ea40a4fa3c37d340e7b8","src/unify/backing_vec.rs":"97cc2cec917ad87bb59b9f08ab3e081758ab5632d4a2e35621ba68c175ab10e5","src/unify/mod.rs":"986c502c11d0c921ef78916b0ccf17ffd18c5baf6e807be1295b237a2d3d87a1","src/unify/tests.rs":"6ffe2de338f1c8014292fdc7e764451c7af3de344fd405a46b818447304bdd23","tests/external_undo_log.rs":"215645f44d90b22b6ff07f72157b285e9cc277b856c31a0b82526b1534bef240"},"package":"b2e5d13ca2353ab7d0230988629def93914a8c4015f621f9b13ed2955614731d"}
\ No newline at end of file +{"files":{"Cargo.toml":"8a7d0dff83e0722f59b74a7e7a0b39b1a4fe62b737b042c4f6052e524c798b58","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-MIT":"0621878e61f0d0fda054bcbe02df75192c28bde1ecc8289cbd86aeba2dd72720","README.md":"1c15c9176a442a293a7fe046172e316f95b3acca6c01ee495162d4bc57e6841b","measurements.txt":"b209f98f2bc696904a48829e86952f4f09b59e4e685f7c12087c59d05ed31829","src/bitvec.rs":"c6c66c348776ff480b7ff6e4a3e0f64554a4194266f614408b45b5e3c324ec0a","src/lib.rs":"9b94637cb53e882625d3fb714acac37bb5fe7762d2a583ad4fd43f276f849214","src/snapshot_vec.rs":"b9fce507e3eece42c742405aea870562f99fdea3a4e30a122cea64ef5634f197","src/undo_log.rs":"5c94971d95ae1dd2de04eae2ea1ec5b99c627fbe92b2ea40a4fa3c37d340e7b8","src/unify/backing_vec.rs":"97cc2cec917ad87bb59b9f08ab3e081758ab5632d4a2e35621ba68c175ab10e5","src/unify/mod.rs":"8a3cfdf926b43af1e39c94d8895b676b0f41046fed821b36bd9205a6470fcc8d","src/unify/tests.rs":"6ffe2de338f1c8014292fdc7e764451c7af3de344fd405a46b818447304bdd23","tests/external_undo_log.rs":"215645f44d90b22b6ff07f72157b285e9cc277b856c31a0b82526b1534bef240"},"package":"c533630cf40e9caa44bd91aadc88a75d75a4c3a12b4cfde353cbed41daa1e1f1"}
\ No newline at end of file diff --git a/vendor/ena/Cargo.toml b/vendor/ena/Cargo.toml index d19260c80..9b96a7825 100644 --- a/vendor/ena/Cargo.toml +++ b/vendor/ena/Cargo.toml @@ -11,7 +11,7 @@ [package] name = "ena" -version = "0.14.1" +version = "0.14.2" authors = ["Niko Matsakis <niko@alum.mit.edu>"] description = "Union-find, congruence closure, and other unification code. Based on code from rustc." homepage = "https://github.com/rust-lang/ena" @@ -30,11 +30,6 @@ optional = true [dependencies.log] version = "0.4" -[dependencies.petgraph] -version = "0.4.5" -optional = true - [features] bench = [] -congruence-closure = ["petgraph"] persistent = ["dogged"] diff --git a/vendor/ena/src/unify/mod.rs b/vendor/ena/src/unify/mod.rs index 5377177be..604f3bdda 100644 --- a/vendor/ena/src/unify/mod.rs +++ b/vendor/ena/src/unify/mod.rs @@ -69,13 +69,8 @@ pub trait UnifyKey: Copy + Clone + Debug + PartialEq { fn tag() -> &'static str; - /// If true, then `self` should be preferred as root to `other`. - /// Note that we assume a consistent partial ordering, so - /// returning true implies that `other.prefer_as_root_to(self)` - /// would return false. If there is no ordering between two keys - /// (i.e., `a.prefer_as_root_to(b)` and `b.prefer_as_root_to(a)` - /// both return false) then the rank will be used to determine the - /// root in an optimal way. + /// You should return first the key that should be used as root, + /// then the other key (that will then point to the new root). /// /// NB. The only reason to implement this method is if you want to /// control what value is returned from `find()`. In general, it @@ -300,6 +295,12 @@ impl<S: UnificationStoreBase> UnificationTable<S> { pub fn len(&self) -> usize { self.values.len() } + + /// Obtains the current value for a particular key. + /// Not for end-users; they can use `probe_value`. + fn value(&self, key: S::Key) -> &VarValue<S::Key> { + &self.values[key.index() as usize] + } } impl<S: UnificationStoreMut> UnificationTable<S> { @@ -330,12 +331,6 @@ impl<S: UnificationStoreMut> UnificationTable<S> { }); } - /// Obtains the current value for a particular key. - /// Not for end-users; they can use `probe_value`. - fn value(&self, key: S::Key) -> &VarValue<S::Key> { - &self.values[key.index() as usize] - } - /// Find the root node for `vid`. This uses the standard /// union-find algorithm with path compression: /// <http://en.wikipedia.org/wiki/Disjoint-set_data_structure>. @@ -454,6 +449,28 @@ impl<S: UnificationStoreMut> UnificationTable<S> { impl<S, K, V> UnificationTable<S> where + S: UnificationStoreBase<Key = K, Value = V>, + K: UnifyKey<Value = V>, + V: UnifyValue, +{ + /// Obtains current value for key without any pointer chasing; may return `None` if key has been union'd. + #[inline] + pub fn try_probe_value<'a, K1>(&'a self, id: K1) -> Option<&'a V> + where + K1: Into<K>, + K: 'a, + { + let id = id.into(); + let v = self.value(id); + if v.parent == id { + return Some(&v.value); + } + None + } +} + +impl<S, K, V> UnificationTable<S> +where S: UnificationStoreMut<Key = K, Value = V>, K: UnifyKey<Value = V>, V: UnifyValue, |