Skip to content

Underlines have different behavior between terminal and Jetbrains plugin run configuration #337

Description

@AzureMarker

I'm not sure if this is a compiler, trybuild, or Jetbrains issue, but here it is:

In my shaku crate I have some trybuild tests that behave differently depending on if I run them from a terminal or through my Jetbrains IDE's run configuration.

Command: cargo test -p shaku_derive --test shaku_derive_ui

From the terminal:
test tests/ui/component_provider_dependency.rs ... ok
test tests/ui/derive_enum.rs ... ok                                                                                                                                       
test tests/ui/doc_forwarding.rs ... ok                                                                                                                                    
test tests/ui/duplicate_service_attribute.rs ... ok                                                                                                                       
test tests/ui/force_default_non_default.rs ... ok                                                                                                                         
test tests/ui/inject_and_provide_same_property.rs ... ok                                                                                                                  
test tests/ui/inject_hash_map_non_arc.rs ... ok                                                                                                                           
test tests/ui/inject_non_arc.rs ... ok                                                                                                                                    
test tests/ui/inject_vec_non_arc.rs ... ok                                                                                                                                
test tests/ui/interface_not_name_value.rs ... ok                                                                                                                          
test tests/ui/keyed_component_missing_key_impl.rs ... ok                                                                                                                  
test tests/ui/no_interface_attribute.rs ... ok                                                                                                                            
test tests/ui/no_interface_key.rs ... ok                                                                                                                                  
test tests/ui/provide_non_box.rs ... ok                                                                                                                                   
test tests/ui/provider_attributes.rs ... ok                                                                                                                               
test tests/ui/provider_inject_component_map.rs ... ok                                                                                                                     
test tests/ui/provider_parameters.rs ... ok                                                                                                                               
test tests/ui/submodule_service_attributes.rs ... ok                                                                                                                      
test tests/ui/tuple_struct.rs ... ok                                                                                                                                      
test tests/ui/unknown_module_attribute.rs ... ok                                                                                                                          
test tests/ui/unknown_property_attribute.rs ... ok                                                                                                                        
                                                                                                                                                                          

test compile_fail ... ok

test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 3.96s
From the IDE run configuration:
test tests/ui/component_provider_dependency.rs ... ok
test tests/ui/derive_enum.rs ... ok
test tests/ui/doc_forwarding.rs ... ok
test tests/ui/duplicate_service_attribute.rs ... mismatch

EXPECTED:
┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈
error: Duplicate attribute
  --> tests/ui/duplicate_service_attribute.rs:12:31
   |
12 |         components = [#[lazy] #[lazy] ComponentImpl],
   |                               ^
┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈

ACTUAL OUTPUT:
┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈
error: Duplicate attribute
  --> tests/ui/duplicate_service_attribute.rs:12:31
   |
12 |         components = [#[lazy] #[lazy] ComponentImpl],
   |                               ^^^^^^^
┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈
note: If the actual output is the correct output you can bless it by rerunning
      your test with the environment variable TRYBUILD=overwrite

test tests/ui/force_default_non_default.rs ... ok
test tests/ui/inject_and_provide_same_property.rs ... ok
test tests/ui/inject_hash_map_non_arc.rs ... ok
test tests/ui/inject_non_arc.rs ... ok
test tests/ui/inject_vec_non_arc.rs ... ok
test tests/ui/interface_not_name_value.rs ... mismatch

EXPECTED:
┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈
error: Invalid attribute format. The attribute must be in name-value form. Example: #[shaku(interface = <your trait>)]
 --> tests/ui/interface_not_name_value.rs:9:1
  |
9 | #[shaku(interface(ComponentTrait))]
  | ^

error: Invalid attribute format. The attribute must be in name-value form. Example: #[shaku(interface = <your trait>)]
  --> tests/ui/interface_not_name_value.rs:14:1
   |
14 | #[shaku(interface(ProviderTrait))]
   | ^
┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈

ACTUAL OUTPUT:
┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈
error: Invalid attribute format. The attribute must be in name-value form. Example: #[shaku(interface = <your trait>)]
 --> tests/ui/interface_not_name_value.rs:9:1
  |
9 | #[shaku(interface(ComponentTrait))]
  | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error: Invalid attribute format. The attribute must be in name-value form. Example: #[shaku(interface = <your trait>)]
  --> tests/ui/interface_not_name_value.rs:14:1
   |
14 | #[shaku(interface(ProviderTrait))]
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈
note: If the actual output is the correct output you can bless it by rerunning
      your test with the environment variable TRYBUILD=overwrite

test tests/ui/keyed_component_missing_key_impl.rs ... ok
test tests/ui/no_interface_attribute.rs ... ok
test tests/ui/no_interface_key.rs ... ok
test tests/ui/provide_non_box.rs ... ok
test tests/ui/provider_attributes.rs ... mismatch

EXPECTED:
┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈
error: Providers cannot have attributes
  --> tests/ui/provider_attributes.rs:15:22
   |
15 |         providers = [#[lazy] ProviderImpl]
   |                      ^
┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈

ACTUAL OUTPUT:
┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈
error: Providers cannot have attributes
  --> tests/ui/provider_attributes.rs:15:22
   |
15 |         providers = [#[lazy] ProviderImpl]
   |                      ^^^^^^^
┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈
note: If the actual output is the correct output you can bless it by rerunning
      your test with the environment variable TRYBUILD=overwrite

test tests/ui/provider_inject_component_map.rs ... ok
test tests/ui/provider_parameters.rs ... ok
test tests/ui/submodule_service_attributes.rs ... mismatch

EXPECTED:
┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈
error: Submodule components cannot have attributes
  --> tests/ui/submodule_service_attributes.rs:31:35
   |
31 |             components = [#[lazy] ComponentTrait],
   |                                   ^^^^^^^^^^^^^^

error: Providers cannot have attributes
  --> tests/ui/submodule_service_attributes.rs:44:26
   |
44 |             providers = [#[lazy] ProviderTrait]
   |                          ^
┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈

ACTUAL OUTPUT:
┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈
error: Submodule components cannot have attributes
  --> tests/ui/submodule_service_attributes.rs:31:35
   |
31 |             components = [#[lazy] ComponentTrait],
   |                                   ^^^^^^^^^^^^^^

error: Providers cannot have attributes
  --> tests/ui/submodule_service_attributes.rs:44:26
   |
44 |             providers = [#[lazy] ProviderTrait]
   |                          ^^^^^^^
┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈
note: If the actual output is the correct output you can bless it by rerunning
      your test with the environment variable TRYBUILD=overwrite

test tests/ui/tuple_struct.rs ... ok
test tests/ui/unknown_module_attribute.rs ... mismatch

EXPECTED:
┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈
error: Unknown attribute
  --> tests/ui/unknown_module_attribute.rs:12:23
   |
12 |         components = [#[unknown] ComponentImpl],
   |                       ^
┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈

ACTUAL OUTPUT:
┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈
error: Unknown attribute
  --> tests/ui/unknown_module_attribute.rs:12:23
   |
12 |         components = [#[unknown] ComponentImpl],
   |                       ^^^^^^^^^^
┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈
note: If the actual output is the correct output you can bless it by rerunning
      your test with the environment variable TRYBUILD=overwrite

test tests/ui/unknown_property_attribute.rs ... mismatch

EXPECTED:
┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈
error: Unknown attribute
 --> tests/ui/unknown_property_attribute.rs:9:5
  |
9 |     #[shaku(unknown)]
  |     ^
┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈

ACTUAL OUTPUT:
┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈
error: Unknown attribute
 --> tests/ui/unknown_property_attribute.rs:9:5
  |
9 |     #[shaku(unknown)]
  |     ^^^^^^^^^^^^^^^^^
┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈
note: If the actual output is the correct output you can bless it by rerunning
      your test with the environment variable TRYBUILD=overwrite




6 of 21 tests failed
thread 'compile_fail' (69819) panicked at /home/mark/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/trybuild-1.0.118/src/run.rs:102:13:
6 of 21 tests failed
stack backtrace:
   0: __rustc::rust_begin_unwind
             at /rustc/2d8144b7880597b6e6d3dfd63a9a9efae3f533d3/library/std/src/panicking.rs:689:5
   1: core::panicking::panic_fmt
             at /rustc/2d8144b7880597b6e6d3dfd63a9a9efae3f533d3/library/core/src/panicking.rs:80:14
   2: <trybuild::Runner>::run
             at /home/mark/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/trybuild-1.0.118/src/run.rs:102:13
   3: <trybuild::TestCases as core::ops::drop::Drop>::drop
             at /home/mark/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/trybuild-1.0.118/src/lib.rs:342:38
   4: core::ptr::drop_glue::<trybuild::TestCases>
             at /home/mark/.rustup/toolchains/1.97.0-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/ptr/mod.rs:825:1
   5: shaku_derive_ui::compile_fail
             at ./tests/shaku_derive_ui.rs:6:1
   6: shaku_derive_ui::compile_fail::{closure#0}
             at ./tests/shaku_derive_ui.rs:2:18
   7: <shaku_derive_ui::compile_fail::{closure#0} as core::ops::function::FnOnce<()>>::call_once
             at /home/mark/.rustup/toolchains/1.97.0-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/ops/function.rs:250:5
   8: <fn() -> core::result::Result<(), alloc::string::String> as core::ops::function::FnOnce<()>>::call_once
             at /rustc/2d8144b7880597b6e6d3dfd63a9a9efae3f533d3/library/core/src/ops/function.rs:250:5
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

error: test failed, to rerun pass `-p shaku_derive --test shaku_derive_ui`
error: 1 target failed:
    `-p shaku_derive --test shaku_derive_ui`

I'm using CLion 2026.2.0.1 and Rust plugin 262.8665.323.
These tests were run on the latest version of trybuild, 1.0.118.
The shaku commit used is AzureMarker/shaku@9df02c2

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions