diff options
| author | Oli Scherer <git-spam-no-reply9815368754983@oli-obk.de> | 2024-05-29 10:03:40 +0000 |
|---|---|---|
| committer | Oli Scherer <git-spam-no-reply9815368754983@oli-obk.de> | 2024-05-29 10:04:08 +0000 |
| commit | a34c26e7ecfbfe3f4fd5fbd4868a0cba5676e6a5 (patch) | |
| tree | ed274505213e5fb6ed3320bd9a5213dd9fca4616 /src/librustdoc/html/render | |
| parent | ceb45d55190eb00d30b8762bc4c34cf71c53b637 (diff) | |
| download | rust-a34c26e7ecfbfe3f4fd5fbd4868a0cba5676e6a5.tar.gz rust-a34c26e7ecfbfe3f4fd5fbd4868a0cba5676e6a5.zip | |
Make `body_owned_by` return the body directly.
Almost all callers want this anyway, and now we can use it to also return fed bodies
Diffstat (limited to 'src/librustdoc/html/render')
| -rw-r--r-- | src/librustdoc/html/render/span_map.rs | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/src/librustdoc/html/render/span_map.rs b/src/librustdoc/html/render/span_map.rs index 8ee35db56f8..0535246ae10 100644 --- a/src/librustdoc/html/render/span_map.rs +++ b/src/librustdoc/html/render/span_map.rs @@ -162,9 +162,7 @@ impl<'tcx> SpanMapVisitor<'tcx> { // compiled (because of cfg)! // // See discussion in https://github.com/rust-lang/rust/issues/69426#issuecomment-1019412352 - let typeck_results = self - .tcx - .typeck_body(hir.maybe_body_owned_by(body_id).expect("a body which isn't a body")); + let typeck_results = self.tcx.typeck_body(hir.body_owned_by(body_id).id()); // Interestingly enough, for method calls, we need the whole expression whereas for static // method/function calls, we need the call expression specifically. if let Some(def_id) = typeck_results.type_dependent_def_id(expr_hir_id.unwrap_or(hir_id)) { |
