Skip to content

Commit 32d2e39

Browse files
committed
Merge branch 'main' of https://github.com/rust-lang/rust-bindgen into upstream-roll-again
2 parents 7d5ed19 + 76920aa commit 32d2e39

File tree

72 files changed

+723
-576
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

72 files changed

+723
-576
lines changed

.github/workflows/bindgen.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ jobs:
3030
run: cargo fmt -- --check
3131

3232
- name: Run clippy
33-
run: cargo clippy --tests
33+
run: cargo clippy --all-targets --workspace --exclude bindgen-integration --exclude tests_expectations
3434

3535
msrv:
3636
runs-on: ubuntu-latest

.github/workflows/publish.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ env:
1111
jobs:
1212
cargo-publish:
1313
runs-on: ubuntu-latest
14-
if: ${{ (github.event.workflow_run.conclusion == 'success') && (github.event.workflow.name == 'Release') }}
14+
if: ${{ !github.event.pull_request && (github.event.workflow_run.conclusion == 'success') && (github.event.workflow.name == 'Release') }}
1515
steps:
1616
- name: Print workflow event name
1717
run: echo "${{ github.event.workflow.name }}"

Cargo.toml

Lines changed: 34 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -48,18 +48,42 @@ syn = "2.0"
4848
tempfile = "3"
4949

5050
[workspace.lints.rust]
51-
# unused_qualifications = "warn"
51+
unused_qualifications = "warn"
5252

5353
[workspace.lints.clippy]
54-
# disallowed-names = "allow"
55-
# manual-c-str-literals = "allow"
56-
# missing-safety-doc = "allow"
57-
# op-ref = "allow"
58-
# ptr-offset-with-cast = "allow"
59-
# too-many-arguments = "allow"
60-
# transmute-int-to-bool = "allow"
61-
# unnecessary-cast = "allow"
62-
# useless-transmute = "allow"
54+
pedantic = { level = "warn", priority = -1 }
55+
56+
cast_possible_truncation = "allow"
57+
cast_possible_wrap = "allow"
58+
cast_precision_loss = "allow"
59+
cast_sign_loss = "allow"
60+
default_trait_access = "allow"
61+
ignored_unit_patterns = "allow"
62+
implicit_hasher = "allow"
63+
items_after_statements = "allow"
64+
match_same_arms = "allow"
65+
maybe_infinite_iter = "allow"
66+
missing_errors_doc = "allow"
67+
missing_panics_doc = "allow"
68+
module_name_repetitions = "allow"
69+
must_use_candidate = "allow"
70+
redundant_closure_for_method_calls = "allow"
71+
return_self_not_must_use = "allow"
72+
similar_names = "allow"
73+
struct_excessive_bools = "allow"
74+
struct_field_names = "allow"
75+
unnecessary_wraps = "allow"
76+
unreadable_literal = "allow"
77+
used_underscore_binding = "allow"
78+
wildcard_imports = "allow"
79+
80+
# TODO
81+
trivially_copy_pass_by_ref = "allow"
82+
unused_self = "allow"
83+
84+
# Theese seem to be ok to ignore for now
85+
enum_glob_use = "allow"
86+
too_many_lines = "allow"
6387

6488
# Config for 'cargo release'
6589
[workspace.metadata.release]

bindgen-tests/build.rs

Lines changed: 12 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
use std::char;
22
use std::env;
3-
use std::ffi::OsStr;
43
use std::fs::{self, File};
54
use std::io::Write;
65
use std::path::{Path, PathBuf};
@@ -23,23 +22,19 @@ pub fn main() {
2322
println!("cargo:rerun-if-changed=tests/headers");
2423

2524
for entry in entries {
26-
match entry.path().extension().and_then(OsStr::to_str) {
27-
Some("h") | Some("hpp") => {
28-
let func = entry
29-
.file_name()
30-
.to_str()
31-
.unwrap()
32-
.replace(|c| !char::is_alphanumeric(c), "_")
33-
.replace("__", "_")
34-
.to_lowercase();
35-
writeln!(
36-
dst,
37-
"test_header!(header_{func}, {:?});",
38-
entry.path(),
39-
)
25+
// TODO: file_is_cpp() in bindgen/lib.rs checks for hpp,hxx,hh, and h++ - should this be consistent?
26+
if entry.path().extension().map_or(false, |ext| {
27+
ext.eq_ignore_ascii_case("h") || ext.eq_ignore_ascii_case("hpp")
28+
}) {
29+
let func = entry
30+
.file_name()
31+
.to_str()
32+
.unwrap()
33+
.replace(|c| !char::is_alphanumeric(c), "_")
34+
.replace("__", "_")
35+
.to_lowercase();
36+
writeln!(dst, "test_header!(header_{func}, {:?});", entry.path())
4037
.unwrap();
41-
}
42-
_ => {}
4338
}
4439
}
4540

bindgen-tests/tests/expectations/tests/abi-override.rs

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

bindgen-tests/tests/expectations/tests/bitfield-32bit-overflow.rs

Lines changed: 11 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

bindgen-tests/tests/expectations/tests/bitfield-large.rs

Lines changed: 11 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

bindgen-tests/tests/expectations/tests/bitfield-linux-32.rs

Lines changed: 11 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

bindgen-tests/tests/expectations/tests/bitfield-method-same-name.rs

Lines changed: 11 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

bindgen-tests/tests/expectations/tests/bitfield_align.rs

Lines changed: 11 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)