|
1 | 1 | // HACK(eddyb) start of `rustc_codegen_ssa` crate-level attributes (see `build.rs`). |
2 | | -#![allow(rustc::diagnostic_outside_of_impl)] |
3 | | -#![allow(rustc::untranslatable_diagnostic)] |
4 | | -#![cfg_attr(bootstrap, feature(assert_matches))] |
5 | 2 | #![feature(box_patterns)] |
6 | 3 | #![feature(file_buffered)] |
7 | | -#![cfg_attr(bootstrap, feature(if_let_guard))] |
8 | 4 | #![feature(negative_impls)] |
9 | 5 | #![feature(string_from_utf8_lossy_owned)] |
10 | 6 | #![feature(trait_alias)] |
11 | 7 | #![feature(try_blocks)] |
12 | | -#![cfg_attr(rustc_codegen_spirv_disable_pqp_cg_ssa, allow(unused_features))] |
13 | 8 | #![recursion_limit = "256"] |
14 | 9 | // HACK(eddyb) end of `rustc_codegen_ssa` crate-level attributes (see `build.rs`). |
15 | 10 |
|
|
31 | 26 | //! [`spirv-tools`]: https://rust-gpu.github.io/rust-gpu/api/spirv_tools |
32 | 27 | //! [`spirv-tools-sys`]: https://rust-gpu.github.io/rust-gpu/api/spirv_tools_sys |
33 | 28 | #![feature(rustc_private)] |
| 29 | +// In `rustc_codegen_spirv_disable_pqp_cg_ssa` mode we stop `include!`ing the |
| 30 | +// patched `rustc_codegen_ssa`, so these copied crate-level feature gates can |
| 31 | +// become locally unused even though the default build still needs them. |
| 32 | +#![cfg_attr(rustc_codegen_spirv_disable_pqp_cg_ssa, allow(unused_features))] |
34 | 33 | // crate-specific exceptions: |
35 | 34 | #![allow( |
36 | | - unsafe_code, // rustc_codegen_ssa requires unsafe functions in traits to be impl'd |
37 | 35 | clippy::enum_glob_use, // pretty useful pattern with some codegen'd enums (e.g. rspirv::spirv::Op) |
38 | 36 | clippy::todo, // still lots to implement :) |
39 | 37 |
|
40 | 38 | // FIXME(eddyb) new warnings from 1.83 rustup, apply their suggested changes. |
41 | 39 | mismatched_lifetime_syntaxes, |
42 | | - clippy::needless_lifetimes, |
43 | 40 | )] |
44 | 41 |
|
45 | 42 | // Unfortunately, this will not fail fast when compiling, but rather will wait for |
@@ -319,15 +316,6 @@ impl WriteBackendMethods for SpirvCodegenBackend { |
319 | 316 | type ModuleBuffer = SpirvModuleBuffer; |
320 | 317 | type ThinData = (); |
321 | 318 |
|
322 | | - fn target_machine_factory( |
323 | | - &self, |
324 | | - _sess: &Session, |
325 | | - _opt_level: config::OptLevel, |
326 | | - _target_features: &[String], |
327 | | - ) -> TargetMachineFactoryFn<Self> { |
328 | | - Arc::new(|_, _| ()) |
329 | | - } |
330 | | - |
331 | 319 | // FIXME(eddyb) reuse the "merge" stage of `crate::linker` for this, or even |
332 | 320 | // consider setting `requires_lto = true` in the target specs and moving the |
333 | 321 | // entirety of `crate::linker` into this stage (lacking diagnostics may be |
@@ -428,6 +416,15 @@ impl WriteBackendMethods for SpirvCodegenBackend { |
428 | 416 | fn serialize_module(module: Self::Module, _is_thin: bool) -> Self::ModuleBuffer { |
429 | 417 | SpirvModuleBuffer(module.assemble()) |
430 | 418 | } |
| 419 | + |
| 420 | + fn target_machine_factory( |
| 421 | + &self, |
| 422 | + _sess: &Session, |
| 423 | + _opt_level: config::OptLevel, |
| 424 | + _target_features: &[String], |
| 425 | + ) -> TargetMachineFactoryFn<Self> { |
| 426 | + Arc::new(|_, _| ()) |
| 427 | + } |
431 | 428 | } |
432 | 429 |
|
433 | 430 | impl ExtraBackendMethods for SpirvCodegenBackend { |
|
0 commit comments