Repository: rust
Issue: ICE no errors encountered even though `delay_span_bug` issued - Bevy - Unused trait method name same as struct method name
Labels: A-type-system,I-ICE,T-compiler,C-bug,T-types

### Code

```Rust
use bevy::prelude::{Mut, Resource, World};

pub trait UselessTrait {
    fn update(&mut self) {}
}

#[derive(Resource, Default)]
struct App {}

impl App {
    fn update(&mut self, _: &mut i32) {}
}

fn main() {
    let mut world = World::new();
    let mut app: Mut<App> = world.resource_mut();
    app.update(0u32);
}
```

### Cargo.toml

```
[package]
name = "compiler-error-crate"
version = "0.1.0"
edition = "2021"

[dependencies]
bevy = { version = "0.12.1", default-features = false }
```


### Meta
I could not build this example on nightly due to a broken feature in a dependency.

`rustc --version --verbose`:
```
rustc 1.75.0 (82e1608df 2023-12-21)
binary: rustc
commit-hash: 82e1608dfa6e0b5569232559e3d385fea5a93112
commit-date: 2023-12-21
host: x86_64-pc-windows-msvc
release: 1.75.0
LLVM version: 17.0.6
```

### Error output

```
error: the compiler unexpectedly panicked. this is a bug.

note: we would appreciate a bug report: https://github.com/rust-lang/rust/issues/new?labels=C-bug%2C+I-ICE%2C+T-compiler&template=ice.md

note: rustc 1.75.0 (82e1608df 2023-12-21) running on x86_64-pc-windows-msvc

note: compiler flags: --crate-type bin -C embed-bitcode=no -C debuginfo=2 -C incremental=[REDACTED]

note: some of the compiler flags provided by cargo are hidden

query stack during panic:
#0 [typeck] type-checking `main`
#1 [analysis] running analysis passes on this crate
end of query stack
error: internal compiler error: no errors encountered even though `delay_span_bug` issued                                                                                                                                            

error: internal compiler error: no errors reported for args
  --> src\main.rs:17:9
   |
17 |     app.update(0u32);
   |         ^^^^^^
   |

```

<details><summary><strong>Backtrace</strong></summary>
<p>

```
note: delayed at compiler\rustc_hir_typeck\src\fn_ctxt\checks.rs:525:22
         0: std::backtrace::Backtrace::force_capture
         1: std::backtrace::Backtrace::capture
         2: <rustc_errors::HandlerInner>::emit_diagnostic
         3: <<rustc_hir_typeck::fn_ctxt::FnCtxt>::deduce_closure_signature_from_predicates::MentionsTy as rustc_type_ir::visit::TypeVisitor<rustc_middle::ty::context::TyCtxt>>::visit_ty
         4: <rustc_hir_typeck::fn_ctxt::FnCtxt>::blame_specific_expr_if_possible
         5: <rustc_hir_typeck::fn_ctxt::FnCtxt>::probe_instantiate_query_response
         6: <rustc_hir_typeck::fn_ctxt::FnCtxt>::demand_coerce
         7: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_struct_path
         8: <rustc_hir_typeck::fn_ctxt::FnCtxt>::demand_coerce
         9: <rustc_hir_typeck::fn_ctxt::FnCtxt>::demand_coerce
        10: <rustc_hir_typeck::upvar::InferBorrowKind as rustc_hir_typeck::expr_use_visitor::Delegate>::borrow
        11: rustc_hir_typeck::typeck
        12: <rustc_query_impl::plumbing::QueryCtxt as rustc_query_system::query::QueryContext>::load_side_effects
        13: rustc_query_impl::query_callbacks
        14: <rustc_query_impl::plumbing::QueryCtxt as rustc_query_system::query::QueryContext>::load_side_effects
        15: <rustc_query_impl::plumbing::QueryCtxt as rustc_query_system::query::QueryContext>::load_side_effects
        16: <rustc_hir_analysis::collect::generics_of::has_late_bound_regions::LateBoundRegionsDetector as rustc_hir::intravisit::Visitor>::visit_ty
        17: rustc_hir_analysis::check_crate
        18: rustc_interface::passes::analysis
        19: rustc_query_impl::profiling_support::alloc_self_profile_query_strings
        20: rustc_query_impl::dynamic_queries
        21: rustc_query_impl::profiling_support::alloc_self_profile_query_strings
        22: rustc_query_impl::profiling_support::alloc_self_profile_query_strings
        23: rustc_query_impl::profiling_support::alloc_self_profile_query_strings
        24: rustc_driver_impl::args::arg_expand_all
        25: rustc_driver_impl::args::arg_expand_all
        26: rustc_driver_impl::args::arg_expand_all
        27: rustc_driver_impl::args::arg_expand_all
        28: rustc_driver_impl::args::arg_expand_all
        29: rustc_driver_impl::args::arg_expand_all
        30: std::sys::windows::thread::Thread::new
        31: BaseThreadInitThunk
        32: RtlUserThreadStart
```

</p>
</details>