Skip to content

Commit

Permalink
Bug 1855631 - Upgrade bindgen to 0.68.1. r=emilio,supply-chain-reviewers
Browse files Browse the repository at this point in the history
  • Loading branch information
glandium committed Sep 29, 2023
1 parent 05fcca2 commit 83f4904
Show file tree
Hide file tree
Showing 27 changed files with 448 additions and 380 deletions.
29 changes: 18 additions & 11 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -132,8 +132,9 @@ base64 = { path = "build/rust/base64" }
# Patch wasi 0.10 to 0.11
wasi = { path = "build/rust/wasi" }

# Patch bindgen 0.63 and 0.64 to 0.66
# Patch bindgen 0.63, 0.64 and 0.66 to 0.68
bindgen_0_63 = { package = "bindgen", path = "build/rust/bindgen-0.63" }
bindgen_0_64 = { package = "bindgen", path = "build/rust/bindgen-0.64" }
bindgen = { path = "build/rust/bindgen" }

# Patch nix 0.24 to 0.26
Expand Down
18 changes: 18 additions & 0 deletions build/rust/bindgen-0.64/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
[package]
name = "bindgen"
version = "0.64.999"
edition = "2018"
license = "BSD-3-Clause"

[lib]
path = "lib.rs"

[dependencies.bindgen]
version = "0.66.0"
default-features = false

[features]
logging = ["bindgen/logging"]
runtime = ["bindgen/runtime"]
static = ["bindgen/static"]
which-rustfmt = ["bindgen/which-rustfmt"]
26 changes: 26 additions & 0 deletions build/rust/bindgen-0.64/lib.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are met:
//
// * Redistributions of source code must retain the above copyright notice, this
// list of conditions and the following disclaimer.
//
// * Redistributions in binary form must reproduce the above copyright notice,
// this list of conditions and the following disclaimer in the documentation
// and/or other materials provided with the distribution.
//
// * Neither the name of the copyright holder nor the names of its
// contributors may be used to endorse or promote products derived from
// this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

pub use bindgen::*;
4 changes: 2 additions & 2 deletions build/rust/bindgen/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
[package]
name = "bindgen"
version = "0.64.999"
version = "0.66.999"
edition = "2018"
license = "BSD-3-Clause"

[lib]
path = "lib.rs"

[dependencies.bindgen]
version = "0.66.0"
version = "0.68.0"
default-features = false

[features]
Expand Down
2 changes: 1 addition & 1 deletion build/workspace-hack/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ uuid = { version = "1", features = ["serde", "v4"], optional = true }
scopeguard = { version = "1", optional = true }

[build-dependencies]
bindgen = { version = "0.66", default-features = false, features = ["runtime"], optional = true }
bindgen = { version = "0.68", default-features = false, features = ["runtime"], optional = true }
libc = "0.2"
memchr = { version = "2", optional = true }
nom = { version = "7", optional = true }
Expand Down
2 changes: 1 addition & 1 deletion netwerk/test/http3server/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ features = ["gecko"]

# Make sure to use bindgen's runtime-loading of libclang, as it allows for a wider range of clang versions to be used
[build-dependencies]
bindgen = {version = "0.66", default-features = false, features = ["runtime"] }
bindgen = {version = "0.68", default-features = false, features = ["runtime"] }

[[bin]]
name = "http3server"
Expand Down
2 changes: 1 addition & 1 deletion security/manager/ssl/builtins/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ smallvec = { version = "1.9.0", features = ["const_new"] }
mozilla-central-workspace-hack = { version = "0.1", features = ["builtins-static"], optional = true }

[build-dependencies]
bindgen = { default-features = false, features = ["runtime"], version = "0.66" }
bindgen = { default-features = false, features = ["runtime"], version = "0.68" }
nom = "7.1.1"

[lib]
Expand Down
2 changes: 1 addition & 1 deletion servo/components/style/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ gecko-profiler = { path = "../../../tools/profiler/rust-api" }
[build-dependencies]
lazy_static = "1"
log = { version = "0.4", features = ["std"] }
bindgen = {version = "0.66", optional = true, default-features = false}
bindgen = {version = "0.68", optional = true, default-features = false}
regex = {version = "1.0", optional = true, default-features = false, features = ["perf", "std"]}
walkdir = "2.1.4"
toml = {version = "0.5", optional = true, default-features = false}
Expand Down
5 changes: 5 additions & 0 deletions supply-chain/audits.toml
Original file line number Diff line number Diff line change
Expand Up @@ -676,6 +676,11 @@ who = "Mike Hommey <[email protected]>"
criteria = "safe-to-deploy"
delta = "0.64.0 -> 0.66.1"

[[audits.bindgen]]
who = "Mike Hommey <[email protected]>"
criteria = "safe-to-deploy"
delta = "0.66.1 -> 0.68.1"

[[audits.bit-set]]
who = "Aria Beingessner <[email protected]>"
criteria = "safe-to-deploy"
Expand Down
2 changes: 1 addition & 1 deletion third_party/rust/bindgen/.cargo-checksum.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"files":{"Cargo.toml":"54137aceec1e1953da6c358e6f7f4d81a9693eeb240b677f986622aefeabe3b6","LICENSE":"c23953d9deb0a3312dbeaf6c128a657f3591acee45067612fa68405eaa4525db","README.md":"b2334e4077a9bc329516e3e0c7f89887c4f073647d95fb71b6917edf4c310ba3","build.rs":"4a9c4ac3759572e17de312a9d3f4ced3b6fd3c71811729e5a8d06bfbd1ac8f82","callbacks.rs":"52211e15fa94fd0c8c5bab822dbf3e6a1e5500c6cd8c5b45c6c3b35627e2a416","clang.rs":"a5c96b91a72c1c008663a95166216d0c564b51949e2286f55c7cda056eb88dc8","codegen/bitfield_unit.rs":"fddeaeab5859f4e82081865595b7705f5c0774d997df95fa5c655b81b9cae125","codegen/bitfield_unit_tests.rs":"9df86490de5e9d66ccea583dcb686dd440375dc1a3c3cf89a89d5de3883bf28a","codegen/dyngen.rs":"6d8bed53c6de66bc658b3186041c2b75549f49b0f0363ff18b87c8dcf2f5a05b","codegen/error.rs":"38fce9b4a06c6cd4b4b0a074417d2c9f31dac584b023b19b696cd00265a57930","codegen/helpers.rs":"0c28751565c90b4ab385ae2113cde02afa34225d85ae48fd296817aac36c5940","codegen/impl_debug.rs":"80df6136327b1ca8c7d1c2961290b5ab00b85b49b22c02f26a590bc68fb230af","codegen/impl_partialeq.rs":"db739d7ba6f5ba4033d6bf62c276f35217c20eab27230cf07dadf59e8b2f71bb","codegen/mod.rs":"562e1e1be34c70dce2962035c0dfb2b44d085d06c1a4ea14b30ad5a4836bc0a2","codegen/postprocessing/merge_extern_blocks.rs":"284457a3c75e945217bab4e5a4280fef0fcc03c31e12cc5010aab87f34c0b6c7","codegen/postprocessing/mod.rs":"160a6d6701cabf2514e23570df1bd1b648c909cc27b7c583f21d98fe0c16722e","codegen/postprocessing/sort_semantically.rs":"f465d1e8cc119082eb79c164b5cd780a370821e8bf56585b287dd3b51fc4a542","codegen/serialize.rs":"5cc71bcad2379df538cd179d1f8027c757f29e66a1cc130b222004adb698fa90","codegen/struct_layout.rs":"07007251c91e0d4eb1e46535068d8c22881d248baa2e38cab96d72691927c2e4","deps.rs":"3118160dd5434c81f872dd456920cd5aac442d3430d2970a4040f1ffee70d85e","diagnostics.rs":"dc40cd5e9710922422c5c9420e2351f5d976e7a1d7275e4f4ce742cad9eb53f8","extra_assertions.rs":"b3b30a69de6ab304ae26a6d9179a1a64fcdea526effc3cb3f13b56a5823766ac","features.rs":"ba1a32395dcc54ec07981b4851be9f097cfca98e358f031af8995bd806f1dcba","ir/analysis/derive.rs":"cba290e9c4ba271e90524149ad3b874f37843bfdfab12d513cc85d2665447fd5","ir/analysis/has_destructor.rs":"e7e95c3b0989b6375cd3eabaac85a36ecc2915a1fd3700c7d26fe04e8dc83ba3","ir/analysis/has_float.rs":"a56b97bf913f132c2c63dc202b45c692c416a8c9fdc6b2baeee30362fb0d4405","ir/analysis/has_type_param_in_array.rs":"788ebb4ba2cf46a22f1e4ff3005d51f38d414b72e95355f7ff4125521e2d9525","ir/analysis/has_vtable.rs":"83efa40ae89147170eabdff1387e60aba574ca4cd4cdef22692753594f09d6c6","ir/analysis/mod.rs":"ed161d9f60306ad42af2ae70ff0eb686a36e2fb30eb94918b5e5f19af80e1db7","ir/analysis/sizedness.rs":"f0a9302f3c6ad694d76cfab11dbaf5392ecaf7f04bc7b211a5a003776b963896","ir/analysis/template_params.rs":"3ff27e2198e292a348876aa1faba39cc4b1870a24a7e173feac0b3c592001e13","ir/annotations.rs":"5ed03d025862d0d21852a76c86a993772624e123fdc3752415d588a0b4e643ab","ir/comment.rs":"4c9c20b5a3da086211e92adec0822831dbc0b7ebee98fee313edcae9ae8d55ec","ir/comp.rs":"fb32715ed8fc14bee51c344a41c1f7a8a802d4a6dceb2775034ea33a88670df7","ir/context.rs":"52d0484d2e76945c78bd365f35552ef1c4bc07fab1fa08341456fc8afbb1f1b5","ir/derive.rs":"c21e470bb0091f20bfa366110880d48984fc3cf7071fdf36eccfa64f3eca231c","ir/dot.rs":"75bdfd83d9e754ba726f6a5529ba1d9ff46f5bf49bf237452985eb008fed0854","ir/enum_ty.rs":"f4bfa6d18ba4977fb66f5d5e4a7674eded93b761404d91cdd6fdd50029db455a","ir/function.rs":"4e46ed88ac70b969ffd9ac28b47aefdb7d5e9ebb9e8fbc832a7e0e4b6d28b92d","ir/int.rs":"601736f0ad0949e40684a9ce89bafbfefa71743df6ee6c342e44888a0f141ae0","ir/item.rs":"8c4f3d2693a00fae0b7f6270063d669d5d15f77b5d87deeaf0d88c5f29b64390","ir/item_kind.rs":"33e21104b0bb824a696a52cd520567ae56158010a1df14777e68ac5f8ad7e8fa","ir/layout.rs":"8fbafc0eeee17abb703a18613be1066e38838d4b67f5916f714bf545e545bc1a","ir/mod.rs":"a3b98b1732111a980a795c72eaf1e09101e842ef2de76b4f2d4a7857f8d4cee4","ir/module.rs":"b2961ffa4acb0c19f084c5db084b8a17bda7158066782a73b80ee7d838789bf9","ir/objc.rs":"0f55ff60db706241634ed8396108ec84ecbec80e0cf28f68ab580c868e0e0cb4","ir/template.rs":"3f59efa9670ca90215d4374be869c9dbecb98a8d1041e7c6e4ab69a62bb982c2","ir/traversal.rs":"a4ec73d3533d4b93386153baf6a2ca846ee51228c76ed51105229d3ddcd74466","ir/ty.rs":"8e787951a1ee2403960511fa6317ff22783faf27b29e3c4167b77f781d13a9d8","ir/var.rs":"40d18226706de0ee5f002d0b5617dbcba35de0605edd531c75e3a76d000f0f4f","lib.rs":"136857fc65602ae8e71b849f0f18c23afdbb5062e4c2eb5147ce729b16b83c65","log_stubs.rs":"9f974e041e35c8c7e29985d27ae5cd0858d68f8676d1dc005c6388d7d011707f","options/as_args.rs":"3b3547e08f0cb72fa042cde417bbc8760166d11dc0db4812e7a280c93074d2f5","options/helpers.rs":"f4a7681e29b2dcc3be9249478c499d685b9e29d4f4ca4ae8bff7a91668cd8f15","options/mod.rs":"eb2fa014ea1682d1b4853b6f05fa73c71940b271b8d7f95a8043ffa541605ab8","parse.rs":"fce3616e0464aa7414888e5d00d4df18c83bb3034a1c807d36a07a3c586e475a","regex_set.rs":"8b38dce6b4b34712f7eafcb2817024de18fccf0cead0c175de34f78ea4027545","time.rs":"8efe317e7c6b5ba8e0865ce7b49ca775ee8a02590f4241ef62f647fa3c22b68e"},"package":"f2b84e06fc203107bfbad243f4aba2af864eb7db3b1cf46ea0a023b0b433d2a7"}
{"files":{"Cargo.toml":"112e4ba01bb44e00e6ecc4a7408954b040424eeae34ad701030ef1b11cab0d36","LICENSE":"c23953d9deb0a3312dbeaf6c128a657f3591acee45067612fa68405eaa4525db","README.md":"b2334e4077a9bc329516e3e0c7f89887c4f073647d95fb71b6917edf4c310ba3","build.rs":"4a9c4ac3759572e17de312a9d3f4ced3b6fd3c71811729e5a8d06bfbd1ac8f82","callbacks.rs":"52211e15fa94fd0c8c5bab822dbf3e6a1e5500c6cd8c5b45c6c3b35627e2a416","clang.rs":"f7dc9c6eed9138075c0c26567e40269183192f9d04ff1701046ed3ac73d10b69","codegen/bitfield_unit.rs":"fddeaeab5859f4e82081865595b7705f5c0774d997df95fa5c655b81b9cae125","codegen/bitfield_unit_tests.rs":"9df86490de5e9d66ccea583dcb686dd440375dc1a3c3cf89a89d5de3883bf28a","codegen/dyngen.rs":"6d8bed53c6de66bc658b3186041c2b75549f49b0f0363ff18b87c8dcf2f5a05b","codegen/error.rs":"38fce9b4a06c6cd4b4b0a074417d2c9f31dac584b023b19b696cd00265a57930","codegen/helpers.rs":"0c28751565c90b4ab385ae2113cde02afa34225d85ae48fd296817aac36c5940","codegen/impl_debug.rs":"80df6136327b1ca8c7d1c2961290b5ab00b85b49b22c02f26a590bc68fb230af","codegen/impl_partialeq.rs":"db739d7ba6f5ba4033d6bf62c276f35217c20eab27230cf07dadf59e8b2f71bb","codegen/mod.rs":"61d3a0c226fba211dd3ef36bfa066f6963bff23406ef7961bfa5b79080f444d0","codegen/postprocessing/merge_extern_blocks.rs":"284457a3c75e945217bab4e5a4280fef0fcc03c31e12cc5010aab87f34c0b6c7","codegen/postprocessing/mod.rs":"160a6d6701cabf2514e23570df1bd1b648c909cc27b7c583f21d98fe0c16722e","codegen/postprocessing/sort_semantically.rs":"f465d1e8cc119082eb79c164b5cd780a370821e8bf56585b287dd3b51fc4a542","codegen/serialize.rs":"5cc71bcad2379df538cd179d1f8027c757f29e66a1cc130b222004adb698fa90","codegen/struct_layout.rs":"07007251c91e0d4eb1e46535068d8c22881d248baa2e38cab96d72691927c2e4","deps.rs":"af3dd24a7808b5abf0c4ed4b10bbceb8eef32be980ff085b8a766d8f089af1a4","diagnostics.rs":"dc40cd5e9710922422c5c9420e2351f5d976e7a1d7275e4f4ce742cad9eb53f8","extra_assertions.rs":"fb4484c0e9fcbea9ec7265f5fbd01e2b33ac022b2b17e060dce7886819d57e40","features.rs":"29f2df89716a47a7d9dbd33b1ff4da61645e729a92772530bed3a04163afc08f","ir/analysis/derive.rs":"cba290e9c4ba271e90524149ad3b874f37843bfdfab12d513cc85d2665447fd5","ir/analysis/has_destructor.rs":"e7e95c3b0989b6375cd3eabaac85a36ecc2915a1fd3700c7d26fe04e8dc83ba3","ir/analysis/has_float.rs":"a56b97bf913f132c2c63dc202b45c692c416a8c9fdc6b2baeee30362fb0d4405","ir/analysis/has_type_param_in_array.rs":"788ebb4ba2cf46a22f1e4ff3005d51f38d414b72e95355f7ff4125521e2d9525","ir/analysis/has_vtable.rs":"83efa40ae89147170eabdff1387e60aba574ca4cd4cdef22692753594f09d6c6","ir/analysis/mod.rs":"ed161d9f60306ad42af2ae70ff0eb686a36e2fb30eb94918b5e5f19af80e1db7","ir/analysis/sizedness.rs":"f0a9302f3c6ad694d76cfab11dbaf5392ecaf7f04bc7b211a5a003776b963896","ir/analysis/template_params.rs":"3ff27e2198e292a348876aa1faba39cc4b1870a24a7e173feac0b3c592001e13","ir/annotations.rs":"5ed03d025862d0d21852a76c86a993772624e123fdc3752415d588a0b4e643ab","ir/comment.rs":"4c9c20b5a3da086211e92adec0822831dbc0b7ebee98fee313edcae9ae8d55ec","ir/comp.rs":"fb32715ed8fc14bee51c344a41c1f7a8a802d4a6dceb2775034ea33a88670df7","ir/context.rs":"a1c591532b44bc532c18f8e5afa0ba4aa94934db2de23f2c71dbdfcb384fd333","ir/derive.rs":"c21e470bb0091f20bfa366110880d48984fc3cf7071fdf36eccfa64f3eca231c","ir/dot.rs":"75bdfd83d9e754ba726f6a5529ba1d9ff46f5bf49bf237452985eb008fed0854","ir/enum_ty.rs":"f4bfa6d18ba4977fb66f5d5e4a7674eded93b761404d91cdd6fdd50029db455a","ir/function.rs":"8acde871c277069d94c96cf4dea68497b2d6253e66014db9655dd825906b19cc","ir/int.rs":"601736f0ad0949e40684a9ce89bafbfefa71743df6ee6c342e44888a0f141ae0","ir/item.rs":"2d3d25c9877d3b969cba5d49696ccabdd382f38c1ab28ac32b79021008a66b19","ir/item_kind.rs":"33e21104b0bb824a696a52cd520567ae56158010a1df14777e68ac5f8ad7e8fa","ir/layout.rs":"8fbafc0eeee17abb703a18613be1066e38838d4b67f5916f714bf545e545bc1a","ir/mod.rs":"a3b98b1732111a980a795c72eaf1e09101e842ef2de76b4f2d4a7857f8d4cee4","ir/module.rs":"b2961ffa4acb0c19f084c5db084b8a17bda7158066782a73b80ee7d838789bf9","ir/objc.rs":"126c688946a7157eff8fd3a22125c6250d0a2c63ee766662b50ea241f7cd3493","ir/template.rs":"3f59efa9670ca90215d4374be869c9dbecb98a8d1041e7c6e4ab69a62bb982c2","ir/traversal.rs":"a4ec73d3533d4b93386153baf6a2ca846ee51228c76ed51105229d3ddcd74466","ir/ty.rs":"69300e7f8255627da1a3fe641ffe7215f7889d4b3c0fcbf7c366b78e3849d5cb","ir/var.rs":"40d18226706de0ee5f002d0b5617dbcba35de0605edd531c75e3a76d000f0f4f","lib.rs":"c3aff945fe2e3d498682e605a9abdd748fee71b78885d3699f4e6397b082ca87","log_stubs.rs":"9f974e041e35c8c7e29985d27ae5cd0858d68f8676d1dc005c6388d7d011707f","options/as_args.rs":"76efa4e662cc7f89ef1c1fe089d03a3c1c019ffe2aa0a30a4d49ed41e987d1c7","options/helpers.rs":"f4a7681e29b2dcc3be9249478c499d685b9e29d4f4ca4ae8bff7a91668cd8f15","options/mod.rs":"9f3e982fe8e3723bfceda5905a144d6717210bc872c4350bd9d8873496eba2a2","parse.rs":"fce3616e0464aa7414888e5d00d4df18c83bb3034a1c807d36a07a3c586e475a","regex_set.rs":"b411d64bc803947a3f69dcedcd7d03716aacbc7b1c5148b82de1cc469d9336d9","time.rs":"8efe317e7c6b5ba8e0865ce7b49ca775ee8a02590f4241ef62f647fa3c22b68e"},"package":"726e4313eb6ec35d2730258ad4e15b547ee75d6afaa1361a922e78e59b7d8078"}
11 changes: 9 additions & 2 deletions third_party/rust/bindgen/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
edition = "2018"
rust-version = "1.60.0"
name = "bindgen"
version = "0.66.1"
version = "0.68.1"
authors = [
"Jyun-Yan You <[email protected]>",
"Emilio Cobos Álvarez <[email protected]>",
Expand All @@ -37,6 +37,12 @@ categories = [
license = "BSD-3-Clause"
repository = "https://github.com/rust-lang/rust-bindgen"

[package.metadata.docs.rs]
features = ["experimental"]

[package.metadata.release]
release = true

[lib]
name = "bindgen"
path = "lib.rs"
Expand Down Expand Up @@ -70,7 +76,8 @@ optional = true
version = "0.1.2"

[dependencies.prettyplease]
version = "0.2.0"
version = "0.2.7"
features = ["verbatim"]
optional = true

[dependencies.proc-macro2]
Expand Down
10 changes: 5 additions & 5 deletions third_party/rust/bindgen/clang.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1813,14 +1813,14 @@ impl TranslationUnit {
pub(crate) fn parse(
ix: &Index,
file: &str,
cmd_args: &[String],
cmd_args: &[Box<str>],
unsaved: &[UnsavedFile],
opts: CXTranslationUnit_Flags,
) -> Option<TranslationUnit> {
let fname = CString::new(file).unwrap();
let _c_args: Vec<CString> = cmd_args
.iter()
.map(|s| CString::new(s.clone()).unwrap())
.map(|s| CString::new(s.clone().into_boxed_bytes()).unwrap())
.collect();
let c_args: Vec<*const c_char> =
_c_args.iter().map(|s| s.as_ptr()).collect();
Expand Down Expand Up @@ -1923,9 +1923,9 @@ pub(crate) struct UnsavedFile {

impl UnsavedFile {
/// Construct a new unsaved file with the given `name` and `contents`.
pub(crate) fn new(name: String, contents: String) -> UnsavedFile {
let name = CString::new(name).unwrap();
let contents = CString::new(contents).unwrap();
pub(crate) fn new(name: &str, contents: &str) -> UnsavedFile {
let name = CString::new(name.as_bytes()).unwrap();
let contents = CString::new(contents.as_bytes()).unwrap();
let x = CXUnsavedFile {
Filename: name.as_ptr(),
Contents: contents.as_ptr(),
Expand Down
Loading

0 comments on commit 83f4904

Please sign in to comment.