mirror of
https://github.com/bevyengine/bevy
synced 2024-12-18 17:13:10 +00:00
fd329c0426
# Objective > Rust 1.81 released the #[expect(...)] attribute, which works like #[allow(...)] but throws a warning if the lint isn't raised. This is preferred to #[allow(...)] because it tells us when it can be removed. - Adopts the parts of #15118 that are complete, and updates the branch so it can be merged. - There were a few conflicts, let me know if I misjudged any of 'em. Alice's [recommendation](https://github.com/bevyengine/bevy/issues/15059#issuecomment-2349263900) seems well-taken, let's do this crate by crate now that @BD103 has done the lion's share of this! (Relates to, but doesn't yet completely finish #15059.) Crates this _doesn't_ cover: - bevy_input - bevy_gilrs - bevy_window - bevy_winit - bevy_state - bevy_render - bevy_picking - bevy_core_pipeline - bevy_sprite - bevy_text - bevy_pbr - bevy_ui - bevy_gltf - bevy_gizmos - bevy_dev_tools - bevy_internal - bevy_dylib --------- Co-authored-by: BD103 <59022059+BD103@users.noreply.github.com> Co-authored-by: Ben Frankel <ben.frankel7@gmail.com> Co-authored-by: Antony <antony.m.3012@gmail.com>
38 lines
1.2 KiB
Rust
38 lines
1.2 KiB
Rust
// FIXME(15321): solve CI failures, then replace with `#![expect()]`.
|
|
#![allow(missing_docs, reason = "Not all docs are written yet, see #3492.")]
|
|
#![forbid(unsafe_code)]
|
|
#![cfg_attr(docsrs, feature(doc_auto_cfg))]
|
|
#![doc(
|
|
html_logo_url = "https://bevyengine.org/assets/icon.png",
|
|
html_favicon_url = "https://bevyengine.org/assets/icon.png"
|
|
)]
|
|
|
|
use bevy_macro_utils::BevyManifest;
|
|
use encase_derive_impl::{implement, syn};
|
|
|
|
const ENCASE: &str = "encase";
|
|
|
|
fn bevy_encase_path() -> syn::Path {
|
|
let bevy_manifest = BevyManifest::default();
|
|
bevy_manifest
|
|
.get_subcrate("render")
|
|
.map(|bevy_render_path| {
|
|
let mut segments = bevy_render_path.segments;
|
|
segments.push(BevyManifest::parse_str("render_resource"));
|
|
syn::Path {
|
|
leading_colon: None,
|
|
segments,
|
|
}
|
|
})
|
|
.map(|path| {
|
|
let mut segments = path.segments;
|
|
segments.push(BevyManifest::parse_str(ENCASE));
|
|
syn::Path {
|
|
leading_colon: None,
|
|
segments,
|
|
}
|
|
})
|
|
.unwrap_or_else(|| bevy_manifest.get_path(ENCASE))
|
|
}
|
|
|
|
implement!(bevy_encase_path());
|