samples: inline windows_main.rs into main.rs - #4362
Merged
Merged
Conversation
Agent-Logs-Url: https://github.com/microsoft/windows-rs/sessions/ccc02b72-e542-462d-a6d3-9495b2167df0 Co-authored-by: kennykerr <9845234+kennykerr@users.noreply.github.com>
Agent-Logs-Url: https://github.com/microsoft/windows-rs/sessions/d8ec8145-352f-4dd1-9e79-336edb391cde Co-authored-by: kennykerr <9845234+kennykerr@users.noreply.github.com>
Copilot created this pull request from a session on behalf of
Kenny Kerr (kennykerr)
May 1, 2026 13:57
View session
Kenny Kerr (kennykerr)
marked this pull request as ready for review
May 1, 2026 13:57
…dless_return) Agent-Logs-Url: https://github.com/microsoft/windows-rs/sessions/e2f21f78-a58b-4acb-9ef8-33059f1e8c72 Co-authored-by: kennykerr <9845234+kennykerr@users.noreply.github.com>
Agent-Logs-Url: https://github.com/microsoft/windows-rs/sessions/6ef2a781-f2cf-4f7b-b14d-785227a50c1a Co-authored-by: kennykerr <9845234+kennykerr@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
windows_main.rsbody intomain.rswrapped in#[cfg(windows)] mod imp, deletewindows_main.rscore_app's#![cfg_attr(windows, windows_subsystem = "windows")])mod bindings;(inservices/timeandwindows/webview) to crate root with#[cfg(windows)]so files resolve correctlywindows-core::imp::encode_pointer(not_unsafe_ptr_arg_deref) andHRESULT::messagenon-windows branch (needless_return)mod imp { use …; pub fn main(){…} } + fn main(){imp::main()}directly into#[cfg(windows)] fn main(){ use …; … }. Items declared insidemod imp(helper fns,#[implement]structs, impls) now live as nested items insidefn mainand inherit itsusestatements.fn mainis notpub.(),windows::core::Result<()>,std::io::Result<()>) — fully qualified in the signature so it's resolvable without needing top-leveluse.services/timeandwindows/webview:use super::bindings::*→use crate::bindings::*(the inlinefn mainis at crate root, not inside a module).direct3d12keeps themod impshape: it contains a nestedmod d3d12_hello_triangle { use super::*; }whosesupercannot reach into afn.core::*indevice_watcher,core::Resultinthread_pool_work).cargo check --workspace(Linux) passescargo check --workspace --target x86_64-pc-windows-gnupasses (with--exclude test_no_std, which has an unrelated pre-existing duplicate-lang-item issue)cargo fmt --allapplied