profile
viewpoint
Jonas Schievink jonas-schievink Chief Curse Officer @ferrous-systems Berlin, Germany compilers; embedded systems; emulators; Linux; please do not send me blockchain recruiting emails

japaric/cargo-call-stack 380

Whole program static stack analysis

dac-gmbh/serde_postgres 56

Easily Deserialize Postgres rows.

dac-gmbh/golomb-set 31

A Golomb Coded Set implementation in Rust

dac-gmbh/mail 21

mail, facade for a number of mail related crates for creating and sending mails

dac-gmbh/derefable 17

Automatically derive Deref/DerefMut implementations in Rust.

dac-gmbh/new-tokio-smtp 15

extendible SMTP (Simple Mail Transfer Protocol) implementation using tokio

jonas-schievink/aligned_alloc.rs 15

Aligned allocation for Rust

helium/longfi-device 13

C library of device-side LongFi Protocol

dac-gmbh/asn1 10

An implementation of the ITU ASN.1 (X.680–X.699) specifications in Rust.

ferrous-systems/nrfdfu-rs 9

An implementation of the nRF bootloader protocol

startedoxidecomputer/hubris

started time in 2 days

issue closedrust-analyzer/rust-analyzer

Many macros incorrectly get the "operation requires unsafe block" error

<!-- Troubleshooting guide: https://rust-analyzer.github.io/manual.html#troubleshooting Forum for questions: https://users.rust-lang.org/c/ide/14

Before submitting, please make sure that you're not running into one of these known issues:

  1. on-the-fly diagnostics are mostly unimplemented (cargo check diagnostics will be shown when saving a file): #3107
  2. attribute proc macros are supported but not enabled by default: #6029

Otherwise please try to provide information which will help us to fix the issue faster. Minimal reproducible examples with few dependencies are especially lovely <3. -->

Lately I've seen it doing this when using these macros:

  • println!
  • assert_eq!
  • proptest! (not part of std, but still has this issue)
  • write!
  • env!
  • eprintln!
  • format!

This does not happen on nightly, but it does happen on rust 2021 and rust 2018.

Example code (note that this compiles just fine):

./src/main.rs

fn main() {
    println!(
        "example text here {} {}",
        env!("CARGO_PKG_DESCRIPTION"),
        env!("CARGO_PKG_LICENSE")
    );
}

./Cargo.toml

[package]
name = "example bug"
version = "0.1.0"
edition = "2021"
description = "Example bug."
license = "MIT"
publish = false

Rust-analyzer version: rust-analyzer d616a6a45 2021-06-06 nightly

I at first thought that this was another instance of #5996, but it doesn't seem to be.

PS: For some reason I don't have permission to comment unless I am closing the issue.

closed time in 3 days

Lazerbeak12345

issue commentrust-analyzer/rust-analyzer

Many macros incorrectly get the "operation requires unsafe block" error

Closing since the bug has since been fixed

Lazerbeak12345

comment created time in 3 days

delete branch jonas-schievink/rust-analyzer

delete branch : update-bug-report-template

delete time in 3 days

create barnchjonas-schievink/rust-analyzer

branch : update-bug-report-template

created branch time in 3 days

issue openedrust-analyzer/rust-analyzer

Implement server-side `serverVersion` command

The "Show RA Version" VS Code command currently runs rust-analyzer --version (using the right server path), but the output of that is unrelated to the version of the running server, so it gets out of sync when the binary is replaced.

This could be fixed by implementing the command as a server command instead of spawning a process.

created time in 3 days

issue commentrust-analyzer/rust-analyzer

internal error: entered unreachable code

Oh, that's right

yshui

comment created time in 3 days

CommitCommentEvent

issue closedrust-analyzer/rust-analyzer

internal error: entered unreachable code

Stack trace:

thread 'main' panicked at 'internal error: entered unreachable code', crates/proc_macro_srv/src/abis/abi_1_56/proc_macro/bridge/mod.rs:256:5

stack backtrace:

   0: rust_begin_unwind
             at /rustc/ad442399756573dccacb314b6bf8079964bcc72a/library/std/src/panicking.rs:498:5
   1: core::panicking::panic_fmt
             at /rustc/ad442399756573dccacb314b6bf8079964bcc72a/library/core/src/panicking.rs:106:14
   2: core::panicking::panic
             at /rustc/ad442399756573dccacb314b6bf8079964bcc72a/library/core/src/panicking.rs:47:5
   3: <proc_macro_srv::abis::abi_1_56::proc_macro::bridge::api_tags::Method as proc_macro_srv::abis::abi_1_56::proc_macro::bridge::rpc::DecodeMut<S>>::decode
   4: <proc_macro_srv::abis::abi_1_56::proc_macro::bridge::server::Dispatcher<proc_macro_srv::abis::abi_1_56::proc_macro::bridge::server::MarkedTypes<S>> as proc_macro_srv::abis::abi_1_56::proc_macro::bridge::server::DispatcherTrait>::dispatch
   5: <proc_macro_srv::abis::abi_1_56::proc_macro::bridge::closure::Closure<A,R> as core::convert::From<&mut F>>::from::call
   6: proc_macro::bridge::closure::Closure<A,R>::call
             at /rustc/ad442399756573dccacb314b6bf8079964bcc72a/library/proc_macro/src/bridge/closure.rs:27:18
   7: proc_macro::bridge::client::TokenStream::into_iter::{{closure}}
             at /rustc/ad442399756573dccacb314b6bf8079964bcc72a/library/proc_macro/src/bridge/client.rs:244:25
   8: proc_macro::bridge::client::<impl proc_macro::bridge::Bridge>::with::{{closure}}
             at /rustc/ad442399756573dccacb314b6bf8079964bcc72a/library/proc_macro/src/bridge/client.rs:336:47
   9: proc_macro::bridge::client::BridgeState::with::{{closure}}::{{closure}}
             at /rustc/ad442399756573dccacb314b6bf8079964bcc72a/library/proc_macro/src/bridge/client.rs:293:17
  10: proc_macro::bridge::scoped_cell::ScopedCell<T>::replace
             at /rustc/ad442399756573dccacb314b6bf8079964bcc72a/library/proc_macro/src/bridge/scoped_cell.rs:75:9
  11: proc_macro::bridge::client::BridgeState::with::{{closure}}
             at /rustc/ad442399756573dccacb314b6bf8079964bcc72a/library/proc_macro/src/bridge/client.rs:291:13
  12: std::thread::local::LocalKey<T>::try_with
             at /rustc/ad442399756573dccacb314b6bf8079964bcc72a/library/std/src/thread/local.rs:399:16
  13: std::thread::local::LocalKey<T>::with
             at /rustc/ad442399756573dccacb314b6bf8079964bcc72a/library/std/src/thread/local.rs:375:9
  14: proc_macro::bridge::client::BridgeState::with
             at /rustc/ad442399756573dccacb314b6bf8079964bcc72a/library/proc_macro/src/bridge/client.rs:290:9
  15: proc_macro::bridge::client::<impl proc_macro::bridge::Bridge>::with
             at /rustc/ad442399756573dccacb314b6bf8079964bcc72a/library/proc_macro/src/bridge/client.rs:329:9
  16: proc_macro::bridge::client::TokenStream::into_iter
             at /rustc/ad442399756573dccacb314b6bf8079964bcc72a/library/proc_macro/src/bridge/client.rs:237:17
  17: proc_macro::token_stream::<impl core::iter::traits::collect::IntoIterator for proc_macro::TokenStream>::into_iter
             at /rustc/ad442399756573dccacb314b6bf8079964bcc72a/library/proc_macro/src/lib.rs:293:22
  18: <proc_macro2::imp::TokenStream as core::iter::traits::collect::IntoIterator>::into_iter
             at /home/shui/.cargo/registry/src/github.com-1ecc6299db9ec823/proc-macro2-1.0.32/src/wrapper.rs:314:41
  19: proc_macro2::token_stream::<impl core::iter::traits::collect::IntoIterator for proc_macro2::TokenStream>::into_iter
             at /home/shui/.cargo/registry/src/github.com-1ecc6299db9ec823/proc-macro2-1.0.32/src/lib.rs:1289:24
  20: syn::buffer::TokenBuffer::inner_new
             at /home/shui/.cargo/registry/src/github.com-1ecc6299db9ec823/syn-1.0.81/src/buffer.rs:53:19
  21: syn::buffer::TokenBuffer::new2
             at /home/shui/.cargo/registry/src/github.com-1ecc6299db9ec823/syn-1.0.81/src/buffer.rs:112:9
  22: <F as syn::parse::Parser>::parse2
             at /home/shui/.cargo/registry/src/github.com-1ecc6299db9ec823/syn-1.0.81/src/parse.rs:1207:19
  23: syn::parse::Parser::parse
             at /home/shui/.cargo/registry/src/github.com-1ecc6299db9ec823/syn-1.0.81/src/parse.rs:1161:9
  24: syn::parse_macro_input::parse
             at /home/shui/.cargo/registry/src/github.com-1ecc6299db9ec823/syn-1.0.81/src/parse_macro_input.rs:139:5
  25: thiserror_impl::derive_error
             at /home/shui/.cargo/registry/src/github.com-1ecc6299db9ec823/thiserror-impl-1.0.30/src/lib.rs:28:17
  26: core::ops::function::FnOnce::call_once
             at /rustc/ad442399756573dccacb314b6bf8079964bcc72a/library/core/src/ops/function.rs:227:5
  27: proc_macro::bridge::client::Client<fn(proc_macro::TokenStream) .> proc_macro::TokenStream>::expand1::run::{{closure}}
             at /rustc/ad442399756573dccacb314b6bf8079964bcc72a/library/proc_macro/src/bridge/client.rs:410:40
  28: proc_macro::bridge::client::run_client::{{closure}}::{{closure}}
             at /rustc/ad442399756573dccacb314b6bf8079964bcc72a/library/proc_macro/src/bridge/client.rs:377:26
  29: proc_macro::bridge::scoped_cell::ScopedCell<T>::set::{{closure}}
             at /rustc/ad442399756573dccacb314b6bf8079964bcc72a/library/proc_macro/src/bridge/scoped_cell.rs:80:33
  30: proc_macro::bridge::scoped_cell::ScopedCell<T>::replace
             at /rustc/ad442399756573dccacb314b6bf8079964bcc72a/library/proc_macro/src/bridge/scoped_cell.rs:75:9
  31: proc_macro::bridge::scoped_cell::ScopedCell<T>::set
             at /rustc/ad442399756573dccacb314b6bf8079964bcc72a/library/proc_macro/src/bridge/scoped_cell.rs:80:9
  32: proc_macro::bridge::client::<impl proc_macro::bridge::Bridge>::enter::{{closure}}
             at /rustc/ad442399756573dccacb314b6bf8079964bcc72a/library/proc_macro/src/bridge/client.rs:325:35
  33: std::thread::local::LocalKey<T>::try_with
             at /rustc/ad442399756573dccacb314b6bf8079964bcc72a/library/std/src/thread/local.rs:399:16
  34: std::thread::local::LocalKey<T>::with
             at /rustc/ad442399756573dccacb314b6bf8079964bcc72a/library/std/src/thread/local.rs:375:9

  35: proc_macro::bridge::client::<impl proc_macro::bridge::Bridge>::enter

             at /rustc/ad442399756573dccacb314b6bf8079964bcc72a/library/proc_macro/src/bridge/client.rs:325:9
  36: proc_macro::bridge::client::run_client::{{closure}}
             at /rustc/ad442399756573dccacb314b6bf8079964bcc72a/library/proc_macro/src/bridge/client.rs:370:9

  37: <core::panic::unwind_safe::AssertUnwindSafe<F> as core::ops::function::FnOnce<()>>::call_once
             at /rustc/ad442399756573dccacb314b6bf8079964bcc72a/library/core/src/panic/unwind_safe.rs:271:9
  38: std::panicking::try::do_call
             at /rustc/ad442399756573dccacb314b6bf8079964bcc72a/library/std/src/panicking.rs:406:40
  39: __rust_try
  40: std::panicking::try
             at /rustc/ad442399756573dccacb314b6bf8079964bcc72a/library/std/src/panicking.rs:370:19
  41: std::panic::catch_unwind
             at /rustc/ad442399756573dccacb314b6bf8079964bcc72a/library/std/src/panic.rs:133:14
  42: proc_macro::bridge::client::run_client
             at /rustc/ad442399756573dccacb314b6bf8079964bcc72a/library/proc_macro/src/bridge/client.rs:369:5
  43: proc_macro::bridge::client::Client<fn(proc_macro::TokenStream) .> proc_macro::TokenStream>::expand1::run
             at /rustc/ad442399756573dccacb314b6bf8079964bcc72a/library/proc_macro/src/bridge/client.rs:410:13

  44: proc_macro_srv::abis::abi_1_56::proc_macro::bridge::server::run_server
  45: proc_macro_srv::abis::abi_1_56::Abi::expand
  46: proc_macro_srv::dylib::Expander::expand
  47: proc_macro_srv::ProcMacroSrv::expand
  48: proc_macro_srv::cli::run
  49: rust_analyzer::main
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

Caused by: https://github.com/yshui/docconfig/blob/0a534db4b3d940fd83e492844a74c6a7f9ba1856/docconfig_derive/src/lib.rs

closed time in 3 days

yshui

issue commentrust-analyzer/rust-analyzer

internal error: entered unreachable code

This one should have been fixed by #10799 and shipped in today's release, so closing.

Please let us know if it still occurs on more recent rust-analyzer versions.

yshui

comment created time in 3 days

issue commentrust-analyzer/rust-analyzer

#[tokio::test] bug in v0.2.826

I think this might be the issue? https://github.com/rust-analyzer/rust-analyzer/commit/abdb2acbe52efe2edb44214c9752c681a4128a27#r61059223

gipsyh

comment created time in 3 days

CommitCommentEvent

issue commentrust-lang/rust-clippy

Add option to disable all linting in external macros

https://github.com/rust-lang/rust/pull/52467 has been merged a long time ago, but some Clippy lints still incorrectly fire for code generated by foreign macros (for example in https://github.com/rust-lang/rust-clippy/issues/4861 and https://github.com/knurling-rs/defmt/issues/642).

jFransham

comment created time in 3 days

issue commentrust-analyzer/rust-analyzer

incorrect-ident-case triggers on traits inside functions even when #[allow()]ed

#8911 is now fixed.

Before that, the test was moved and behavior changed:

https://github.com/rust-analyzer/rust-analyzer/blob/393cbd0982707a20b0ef40277385737f8de1833e/crates/ide_diagnostics/src/handlers/incorrect_case.rs#L343-L366

lf-

comment created time in 3 days

pull request commentnrf-rs/nrf-hal

add rtic serial interrupt example

Note that we're not currently merging any more examples due to https://github.com/nrf-rs/nrf-hal/issues/358

elwerene

comment created time in 5 days

delete branch jonas-schievink/rust-analyzer

delete branch : use-right-itemtree

delete time in 7 days

PR opened rust-analyzer/rust-analyzer

internal: Use the right `ItemTree` when re-resolving attr

Followup to https://github.com/rust-analyzer/rust-analyzer/pull/10863, which caused a panic when analyzing diesel

bors r+

+21 -19

0 comment

1 changed file

pr created time in 7 days

create barnchjonas-schievink/rust-analyzer

branch : use-right-itemtree

created branch time in 7 days

delete branch jonas-schievink/rust-analyzer

delete branch : per-block-itemtrees

delete time in 7 days

Pull request review commentrust-analyzer/rust-analyzer

internal: build per-block `ItemTree`s

 fn is_visible_from_same_def_map() {     check_at(         r#" fn outer() {-    mod command {-        use crate::name;-    }-     mod tests {         use super::*;     }+    use crate::name;

Reordered so that the old code path was still hit with the more correct inner item handling.

jonas-schievink

comment created time in 7 days

Pull request review commentrust-analyzer/rust-analyzer

internal: build per-block `ItemTree`s

 impl ItemTree {                     // items.                     ctx.lower_macro_stmts(stmts)                 },-                ast::Pat(_pat) => {-                    // FIXME: This occurs because macros in pattern position are treated as inner-                    // items and expanded during block DefMap computation-                    return Default::default();-                },-                ast::Type(ty) => {-                    // Types can contain inner items. We return an empty item tree in this case, but-                    // still need to collect inner items.-                    ctx.lower_inner_items(ty.syntax())-                },-                ast::Expr(e) => {-                    // Macros can expand to expressions. We return an empty item tree in this case, but-                    // still need to collect inner items.-                    ctx.lower_inner_items(e.syntax())-                },

We no longer request ItemTrees of arbitrary macros (only of macros that can expand to statements), so these cases are gone

jonas-schievink

comment created time in 7 days

PullRequestReviewEvent
PullRequestReviewEvent

PR opened rust-analyzer/rust-analyzer

internal: build per-block `ItemTree`s

Fixes https://github.com/rust-analyzer/rust-analyzer/issues/7717 Fixes https://github.com/rust-analyzer/rust-analyzer/issues/8911 Fixes https://github.com/rust-analyzer/rust-analyzer/issues/8614

ItemTrees are now flat lists of items, so they should probably be renamed at some point.

+57 -177

0 comment

5 changed files

pr created time in 7 days

create barnchjonas-schievink/rust-analyzer

branch : per-block-itemtrees

created branch time in 7 days

delete branch jonas-schievink/defmt

delete branch : update-elf-deps

delete time in 7 days

pull request commentknurling-rs/defmt

fix #628

bors r+

spookyvision

comment created time in 7 days

push eventknurling-rs/defmt

Jonas Schievink

commit sha b441edb8e75969c81e28c7f030cedbeeea91b42c

Update firmware/defmt-rtt/build.rs

view details

push time in 7 days

PullRequestReviewEvent
more