diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 12:19:43 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 12:19:43 +0000 |
commit | 3e3e70d529d8c7d7c4d7bc4fefc9f109393b9245 (patch) | |
tree | daf049b282ab10e8c3d03e409b3cd84ff3f7690c /compiler/rustc_serialize | |
parent | Adding debian version 1.68.2+dfsg1-1. (diff) | |
download | rustc-3e3e70d529d8c7d7c4d7bc4fefc9f109393b9245.tar.xz rustc-3e3e70d529d8c7d7c4d7bc4fefc9f109393b9245.zip |
Merging upstream version 1.69.0+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'compiler/rustc_serialize')
-rw-r--r-- | compiler/rustc_serialize/Cargo.toml | 2 | ||||
-rw-r--r-- | compiler/rustc_serialize/src/serialize.rs | 17 |
2 files changed, 1 insertions, 18 deletions
diff --git a/compiler/rustc_serialize/Cargo.toml b/compiler/rustc_serialize/Cargo.toml index db0ef7354..c04465719 100644 --- a/compiler/rustc_serialize/Cargo.toml +++ b/compiler/rustc_serialize/Cargo.toml @@ -6,7 +6,7 @@ edition = "2021" [dependencies] indexmap = "1.9.1" smallvec = { version = "1.8.1", features = ["union", "may_dangle"] } -thin-vec = "0.2.9" +thin-vec = "0.2.12" [dev-dependencies] rustc_macros = { path = "../rustc_macros" } diff --git a/compiler/rustc_serialize/src/serialize.rs b/compiler/rustc_serialize/src/serialize.rs index 751b209f1..567fe0610 100644 --- a/compiler/rustc_serialize/src/serialize.rs +++ b/compiler/rustc_serialize/src/serialize.rs @@ -43,7 +43,6 @@ pub trait Encoder { fn emit_str(&mut self, v: &str); fn emit_raw_bytes(&mut self, s: &[u8]); - // Convenience for the derive macro: fn emit_enum_variant<F>(&mut self, v_id: usize, f: F) where F: FnOnce(&mut Self), @@ -51,17 +50,6 @@ pub trait Encoder { self.emit_usize(v_id); f(self); } - - // We put the field index in a const generic to allow the emit_usize to be - // compiled into a more efficient form. In practice, the variant index is - // known at compile-time, and that knowledge allows much more efficient - // codegen than we'd otherwise get. LLVM isn't always able to make the - // optimization that would otherwise be necessary here, likely due to the - // multiple levels of inlining and const-prop that are needed. - #[inline] - fn emit_fieldless_enum_variant<const ID: usize>(&mut self) { - self.emit_usize(ID) - } } // Note: all the methods in this trait are infallible, which may be surprising. @@ -430,11 +418,6 @@ impl<D: Decoder, T: Decodable<D> + Copy> Decodable<D> for Cell<T> { } } -// FIXME: #15036 -// Should use `try_borrow`, returning an -// `encoder.error("attempting to Encode borrowed RefCell")` -// from `encode` when `try_borrow` returns `None`. - impl<S: Encoder, T: Encodable<S>> Encodable<S> for RefCell<T> { fn encode(&self, s: &mut S) { self.borrow().encode(s); |