Closed tgross35 closed 1 year ago
With this simple code, RA throws the error: "field up of Channels is private":
up
Channels
#![no_std] #![no_main] #[cortex_m_rt::entry] fn main() -> ! { rtt_target::rtt_init_print!(); loop {} } #[panic_handler] fn panic(_info: &core::panic::PanicInfo) -> ! { loop {} }
This expands to:
It seems like the complaint is likely at ::rtt_target::set_print_channel(channels.up.0); and I think a fix would be from updating the below block:
::rtt_target::set_print_channel(channels.up.0);
pub struct Channels { /* make this `pub` */ up: (UpChannel,), }
But I'm still trying to figure out where this comes from in source.
RA is in the wrong here since it compiles correctly (and weirdly puts the squiggles in the wrong place) but it's probably easier to fix on this end.
This should be closed with #21
With this simple code, RA throws the error: "field
up
ofChannels
is private":This expands to:
Full macro expansion
``` #![feature(prelude_import)] #![no_std] #![no_main] #[prelude_import] use core::prelude::rust_2021::*; #[macro_use] extern crate core; #[macro_use] extern crate compiler_builtins; #[doc(hidden)] #[export_name = "main"] pub unsafe extern "C" fn __cortex_m_rt_main_trampoline() { __cortex_m_rt_main() } fn __cortex_m_rt_main() -> ! { let channels = { use core::mem::MaybeUninit; use core::ptr; use ::rtt_target::UpChannel; use ::rtt_target::DownChannel; use ::rtt_target::rtt::*; #[repr(C)] pub struct RttControlBlock { header: RttHeader, up_channels: [RttChannel; (1 + 0)], down_channels: [RttChannel; (0)], } #[used] #[no_mangle] #[export_name = "_SEGGER_RTT"] pub static mut CONTROL_BLOCK: MaybeUninitIt seems like the complaint is likely at
::rtt_target::set_print_channel(channels.up.0);
and I think a fix would be from updating the below block:But I'm still trying to figure out where this comes from in source.
RA is in the wrong here since it compiles correctly (and weirdly puts the squiggles in the wrong place) but it's probably easier to fix on this end.