diff options
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/Makefile.build | 4 | ||||
-rwxr-xr-x | scripts/generate_rust_analyzer.py | 17 | ||||
-rw-r--r-- | scripts/rustdoc_test_gen.rs | 8 |
3 files changed, 22 insertions, 7 deletions
diff --git a/scripts/Makefile.build b/scripts/Makefile.build index 993708d11874..56be83024851 100644 --- a/scripts/Makefile.build +++ b/scripts/Makefile.build @@ -226,7 +226,7 @@ $(obj)/%.lst: $(obj)/%.c FORCE # Compile Rust sources (.rs) # --------------------------------------------------------------------------- -rust_allowed_features := asm_const,asm_goto,arbitrary_self_types,lint_reasons +rust_allowed_features := asm_const,asm_goto,arbitrary_self_types,lint_reasons,raw_ref_op # `--out-dir` is required to avoid temporaries being created by `rustc` in the # current working directory, which may be not accessible in the out-of-tree @@ -237,7 +237,7 @@ rust_common_cmd = \ -Zallow-features=$(rust_allowed_features) \ -Zcrate-attr=no_std \ -Zcrate-attr='feature($(rust_allowed_features))' \ - -Zunstable-options --extern kernel \ + -Zunstable-options --extern pin_init --extern kernel \ --crate-type rlib -L $(objtree)/rust/ \ --crate-name $(basename $(notdir $@)) \ --sysroot=/dev/null \ diff --git a/scripts/generate_rust_analyzer.py b/scripts/generate_rust_analyzer.py index adae71544cbd..b0d7dc1e9267 100755 --- a/scripts/generate_rust_analyzer.py +++ b/scripts/generate_rust_analyzer.py @@ -97,6 +97,21 @@ def generate_crates(srctree, objtree, sysroot_src, external_src, cfgs): ["core", "compiler_builtins"], ) + append_crate( + "pin_init_internal", + srctree / "rust" / "pin-init" / "internal" / "src" / "lib.rs", + [], + cfg=["kernel"], + is_proc_macro=True, + ) + + append_crate( + "pin_init", + srctree / "rust" / "pin-init" / "src" / "lib.rs", + ["core", "pin_init_internal", "macros"], + cfg=["kernel"], + ) + def append_crate_with_generated( display_name, deps, @@ -118,7 +133,7 @@ def generate_crates(srctree, objtree, sysroot_src, external_src, cfgs): append_crate_with_generated("bindings", ["core"]) append_crate_with_generated("uapi", ["core"]) - append_crate_with_generated("kernel", ["core", "macros", "build_error", "bindings", "uapi"]) + append_crate_with_generated("kernel", ["core", "macros", "build_error", "pin-init", "bindings", "uapi"]) def is_root_crate(build_file, target): try: diff --git a/scripts/rustdoc_test_gen.rs b/scripts/rustdoc_test_gen.rs index 76aaa8329413..ec8d70ac888b 100644 --- a/scripts/rustdoc_test_gen.rs +++ b/scripts/rustdoc_test_gen.rs @@ -87,8 +87,8 @@ fn find_real_path<'a>(srctree: &Path, valid_paths: &'a mut Vec<PathBuf>, file: & assert!( valid_paths.len() > 0, - "No path candidates found. This is likely a bug in the build system, or some files went \ - away while compiling." + "No path candidates found for `{file}`. This is likely a bug in the build system, or some \ + files went away while compiling." ); if valid_paths.len() > 1 { @@ -97,8 +97,8 @@ fn find_real_path<'a>(srctree: &Path, valid_paths: &'a mut Vec<PathBuf>, file: & eprintln!(" {path:?}"); } panic!( - "Several path candidates found, please resolve the ambiguity by renaming a file or \ - folder." + "Several path candidates found for `{file}`, please resolve the ambiguity by renaming \ + a file or folder." ); } |