Skip to content

Commit 723e93d

Browse files
author
bors-servo
authored
Auto merge of rust-lang#924 - fitzgen:rename-named-to-ty-param, r=fitzgen
Rename `TypeKind::Named` to `TypeKind::TypeParam` Also renames a bunch of other things referring to named types to refer to type parameters. Fixes rust-lang#915
2 parents 79447a2 + eeec4bd commit 723e93d

Some content is hidden

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

42 files changed

+3330
-2367
lines changed

build.rs

+18-8
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,10 @@ mod codegen {
1616
println!("cargo:rerun-if-changed=src/codegen/helpers.rs");
1717
println!("cargo:rerun-if-changed=src/codegen/struct_layout.rs");
1818

19-
let mut dst =
20-
File::create(Path::new(&out_dir).join("host-target.txt")).unwrap();
21-
dst.write_all(env::var("TARGET").unwrap().as_bytes()).unwrap();
19+
let mut dst = File::create(Path::new(&out_dir).join("host-target.txt"))
20+
.unwrap();
21+
dst.write_all(env::var("TARGET").unwrap().as_bytes())
22+
.unwrap();
2223
}
2324
}
2425

@@ -32,9 +33,11 @@ mod testgen {
3233

3334
pub fn main() {
3435
let out_dir = PathBuf::from(env::var("OUT_DIR").unwrap());
35-
let mut dst = File::create(Path::new(&out_dir).join("tests.rs")).unwrap();
36+
let mut dst = File::create(Path::new(&out_dir).join("tests.rs"))
37+
.unwrap();
3638

37-
let manifest_dir = PathBuf::from(env::var("CARGO_MANIFEST_DIR").unwrap());
39+
let manifest_dir =
40+
PathBuf::from(env::var("CARGO_MANIFEST_DIR").unwrap());
3841
let headers_dir = manifest_dir.join("tests").join("headers");
3942

4043
let headers = match fs::read_dir(headers_dir) {
@@ -51,12 +54,19 @@ mod testgen {
5154
for entry in entries {
5255
match entry.path().extension().and_then(OsStr::to_str) {
5356
Some("h") | Some("hpp") => {
54-
let func = entry.file_name().to_str().unwrap()
57+
let func = entry
58+
.file_name()
59+
.to_str()
60+
.unwrap()
5561
.replace(|c| !char::is_alphanumeric(c), "_")
5662
.replace("__", "_")
5763
.to_lowercase();
58-
writeln!(dst, "test_header!(header_{}, {:?});",
59-
func, entry.path()).unwrap();
64+
writeln!(
65+
dst,
66+
"test_header!(header_{}, {:?});",
67+
func,
68+
entry.path()
69+
).unwrap();
6070
}
6171
_ => {}
6272
}

src/callbacks.rs

+6-6
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ use std::panic::UnwindSafe;
88
/// A trait to allow configuring different kinds of types in different
99
/// situations.
1010
pub trait ParseCallbacks: fmt::Debug + UnwindSafe {
11-
1211
/// This function will be run on every macro that is identified
1312
fn parsed_macro(&self, _name: &str) {}
1413

@@ -21,11 +20,12 @@ pub trait ParseCallbacks: fmt::Debug + UnwindSafe {
2120
/// This function should return whether, given the a given enum variant
2221
/// name, and value, returns whether this enum variant will forcibly be a
2322
/// constant.
24-
fn enum_variant_behavior(&self,
25-
_enum_name: Option<&str>,
26-
_variant_name: &str,
27-
_variant_value: EnumVariantValue)
28-
-> Option<EnumVariantCustomBehavior> {
23+
fn enum_variant_behavior(
24+
&self,
25+
_enum_name: Option<&str>,
26+
_variant_name: &str,
27+
_variant_value: EnumVariantValue,
28+
) -> Option<EnumVariantCustomBehavior> {
2929
None
3030
}
3131
}

0 commit comments

Comments
 (0)