ChanServ changed the topic of #rust-embedded to: Welcome to the Rust Embedded IRC channel! Bridged to #rust-embedded:matrix.org and logged at https://libera.irclog.whitequark.org/rust-embedded, code of conduct at https://www.rust-lang.org/conduct.html
emerent has quit [Ping timeout: 268 seconds]
emerent has joined #rust-embedded
explore has quit [Quit: Connection closed for inactivity]
emerent has quit [Ping timeout: 264 seconds]
emerent has joined #rust-embedded
starblue has quit [Ping timeout: 265 seconds]
starblue has joined #rust-embedded
<re_irc> <nihal.pasham> GrantM11235: yeah I get that. But I was wondering why it's included in the api, if the purpose of a"OnceCell" is to assign only once.
<re_irc> <GrantM11235> The purpose isn't really "to assign only once", the purpose is to provide interior mutability. "assign only once through a shared reference" is just the way that it provides that interior mutability.
<re_irc> <GrantM11235> There is some discussion about that in the tracking issue https://github.com/rust-lang/rust/issues/74465#issuecomment-1198206278
causal has quit [Quit: WeeChat 3.6]
<re_irc> <Chris [pwnOrbitals]> This is the implementation of SPI transfer of STM32H7XX HAL
<re_irc> <Chris [pwnOrbitals]> it looks like it creates two mutable pointers that alias to the same memory
<re_irc> <Chris [pwnOrbitals]> that’s clearly UB, right ?
explore has joined #rust-embedded
<Lumpio-> Two mutable references, even.
<re_irc> <Chris [pwnOrbitals]> it looks like it creates two mutable ~~pointers~~ that alias to the same memory
<re_irc> <Chris [pwnOrbitals]> it looks like it creates two mutable pointers that alias to the same memory
<re_irc> <Chris [pwnOrbitals]> yeah that’s what I meant
<re_irc> <Chris [pwnOrbitals]> ugh
<re_irc> <jannic> Not 100% sure, could be allowed by stacked borrows?
GenTooMan has quit [Ping timeout: 264 seconds]
<re_irc> <jannic> No, that's wrong. It doesn't complain because the references are not actually used in my dummy implementation.
<re_irc> <jannic> So yes, it's probably UB :-(
<re_irc> <jannic> Doesn't even need the access to "write_words" to flag it as UB: https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=78f9606ea5a3c4439aab889c789a09d3
<re_irc> <matrix_coinbase> Win up to $1000 in crypto trading when you invest with just the minimum of $50
<re_irc> Signup and start investing your crypto with.
<re_irc> 💎NO STRESS
<re_irc> 💎NO REFERRAL NEEDED!!
<re_irc> <Imran K> Hello all, I am using 3 different boards of *stm32f4* series "stm32f411", "stm32f446" and "stm32f469", I want to write a single flash driver module, because the registers are same for all 3 boards so how can I do it?
<re_irc> <Imran K> I tried but I am getting "error: Symbol "DEVICE_PERIPHERALS" is already defined"
<re_irc> <Imran K> * > error: Symbol "DEVICE\_PERIPHERALS" is already defined
<re_irc> <Imran K> * *error: Symbol "DEVICE\_PERIPHERALS" is already defined*
explore has quit [Quit: Connection closed for inactivity]
GenTooMan has joined #rust-embedded
<re_irc> <Chris [pwnOrbitals]> Can I use Miri to check for complex embedded code with C dependencies ?
<re_irc> <Chris [pwnOrbitals]> -for
<re_irc> <dirbaio> Miri can't C, no
<re_irc> <Chris [pwnOrbitals]> Looks like there’s some good work on the project though https://github.com/rust-lang/miri/issues/2365 https://github.com/rust-lang/miri/issues/11
<re_irc> <Chris [pwnOrbitals]> So in the meantime, are there any good static analysis tools to help me catch UB ? Besides Clippy
<re_irc> <dirbaio> miri is not static analysis, you have to actually run the code with the actual inputs that trigger UB to catch it. I'm not aware of any static-analysis-only tools that do that, even for just Rust
<re_irc> <dirbaio> would be too much magic if it iexisted
<re_irc> <dirbaio> * existed
<re_irc> <Chris [pwnOrbitals]> maybe something that could catch (LLVM) UB at LLVM-level during compilation ?
<re_irc> <Chris [pwnOrbitals]> maybe ubsan could be adapted for Rust use :d
<re_irc> <dirbaio> code can have UB or not depending on the inputs it's called with
<re_irc> <dirbaio> youc can't tell by just looking at a piece of code alone
<re_irc> <dirbaio> you'd have to ask "is this piece of code ever called with inputs that satisfy X condition?", analyzing the whole program
<re_irc> <dirbaio> it's pretty much equivalent to the halting problem
<re_irc> <dirbaio> unsolvable in general
<re_irc> <Chris [pwnOrbitals]> well in any case, it looks like there’ some support for sanitizers https://github.com/rust-lang/rust/pull/38699
<re_irc> <Chris [pwnOrbitals]> * there’s
giripriyadarshan has joined #rust-embedded
rardiol has joined #rust-embedded
giripriyadarshan has joined #rust-embedded
giripriyadarshan has quit [Changing host]
giripriyadarshan has quit [Quit: giripriyadarshan]
giripriyadarshan has joined #rust-embedded
causal has joined #rust-embedded
giripriyadarshan has left #rust-embedded [#rust-embedded]
giripriyadarshan has joined #rust-embedded
giripriyadarshan has quit [Client Quit]
giripriyadarshan has joined #rust-embedded
giripriyadarshan has quit [Client Quit]
priyadarshan has joined #rust-embedded
priyadarshan has quit [Client Quit]
giripriyadarshan has joined #rust-embedded
giripriyadarshan has quit [Client Quit]
giripriyadarshan has joined #rust-embedded
giripriyadarsha1 has joined #rust-embedded
giripriyadarsha1 has quit [Client Quit]
giripriyadarshan has quit []
giripriyadarshan has joined #rust-embedded
giripriyadarshan has quit [Read error: Connection reset by peer]
giripriyadarshan has joined #rust-embedded
giripriyadarshan has quit [Read error: Connection reset by peer]
giripriyadarshan has joined #rust-embedded
giripriyadarshan has quit [Client Quit]
giripriyadarshan has joined #rust-embedded
giripriyadarshan has quit [Client Quit]
Foxyloxy has quit [Quit: Textual IRC Client: www.textualapp.com]
Foxyloxy has joined #rust-embedded
<re_irc> <Mehmet Ali> What is the handler for the cases where a code panics
<re_irc> <GrantM11235> If you started with a template, you probably have something like "use panic_probe as _" which will link in the panic handler from that crate
neceve has quit [Quit: ZNC - https://znc.in]
neceve has joined #rust-embedded