Skip to content

Commit 1e0f0d2

Browse files
xizheyinBoxyUwU
andauthored
Update src/query.md
Co-authored-by: Boxy <rust@boxyuwu.dev>
1 parent 9737ddf commit 1e0f0d2

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/query.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -169,9 +169,10 @@ Suppose you want to add a new query called `fubar`. You would:
169169
```
170170
2. Register it in the `provide` function:
171171
```rust,ignore
172-
pub fn provide(providers: &mut rustc_middle::util::Providers) {
173-
providers.queries.fubar = fubar;
174-
}
172+
pub fn provide(providers: &mut Providers) {
173+
*providers = Providers {
174+
fubar,
175+
..*providers
175176
```
176177
177178
### How queries interact with external crate metadata

0 commit comments

Comments
 (0)