質問編集履歴

1

エラーメッセージを読みやすく分割

2022/04/29 06:10

投稿

akira_kano1101
akira_kano1101

スコア25

test CHANGED
@@ -1 +1 @@
1
- 【Rust】shakuクレートを使いDIコンテナーを導入したいがMutexをつけたいがエラーが解決できな
1
+ 【Rust】shakuクレートを使いDIコンテナーを導入したいがMutexをつけるとエラーが出るので解決した
test CHANGED
@@ -106,7 +106,8 @@
106
106
  71 | pub trait HasComponent<I: Interface + ?Sized>: ModuleInterface {
107
107
  | ^^^^^^^^^ required by this bound in `HasComponent`
108
108
  = note: this error originates in the derive macro `Component` (in Nightly builds, run with -Z macro-backtrace for more info)
109
-
109
+ ```
110
+ ```
110
111
  error[E0277]: the trait bound `MyModule: HasComponent<Mutex<(dyn Logger + 'static)>>` is not satisfied
111
112
  --> src/main.rs:40:1
112
113
  |
@@ -130,7 +131,8 @@
130
131
  24 | struct DateLoggerImpl {
131
132
  | ^^^^^^^^^^^^^^
132
133
  = note: this error originates in the macro `module` (in Nightly builds, run with -Z macro-backtrace for more info)
133
-
134
+ ```
135
+ ```
134
136
  error[E0277]: the trait bound `MyModule: HasComponent<Mutex<(dyn Logger + 'static)>>` is not satisfied
135
137
  --> src/main.rs:40:1
136
138
  |
@@ -164,7 +166,8 @@
164
166
  36 | pub trait Module: ModuleInterface {
165
167
  | ^^^^^^^^^^^^^^^ required by this bound in `Module`
166
168
  = note: this error originates in the macro `module` (in Nightly builds, run with -Z macro-backtrace for more info)
167
-
169
+ ```
170
+ ```
168
171
  error[E0277]: the trait bound `MyModule: HasComponent<Mutex<(dyn Logger + 'static)>>` is not satisfied
169
172
  --> src/main.rs:40:1
170
173
  |