about summary refs log tree commit diff
path: root/src/tools
diff options
context:
space:
mode:
author许杰友 Jieyou Xu (Joe) <39484203+jieyouxu@users.noreply.github.com>2025-03-16 09:40:04 +0800
committerGitHub <noreply@github.com>2025-03-16 09:40:04 +0800
commit8882dac3425e7ecbb2c1aeff7de48eaa830ae1de (patch)
tree80d7ad34e43169f8e8caabc3009603f41f19d6d7 /src/tools
parentf16ce2ae6ce84428a7df8ed6b9745815ed6c1ca4 (diff)
parente3ac1fa81abd321abe193f491ed06c7d388f68fe (diff)
downloadrust-8882dac3425e7ecbb2c1aeff7de48eaa830ae1de.tar.gz
rust-8882dac3425e7ecbb2c1aeff7de48eaa830ae1de.zip
Rollup merge of #137956 - compiler-errors:rtn-rustdoc, r=fmease
Add RTN support to rustdoc

This adds support to rustdoc and rustdoc-json for rendering `(..)` RTN (return type notation) style generics.

---

Cleaning `rustc_middle::ty::Ty` is not correct still, though, and ends up rendering a function like:

```rust
pub fn foreign<T: Foreign<bar(..): Send>>()
where
    <T as Foreign>::bar(..): 'static,
    T::bar(..): Sync,
```

Into this:

```rust
pub fn foreign<T>()
where
    T: Foreign,
    impl Future<Output = ()>: Send + 'static + Sync,
```

This is because `clean_middle_ty` doesn't actually have sufficient context about whether the RPITIT is in its "defining scope" or not, so we don't know if the type was originally written like `-> impl Trait` or with RTN like `T::method(..)`.

Partially addresses #123996 (i.e., HIR side, not middle::ty one)
Diffstat (limited to 'src/tools')
-rw-r--r--src/tools/jsondoclint/src/validator.rs1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/tools/jsondoclint/src/validator.rs b/src/tools/jsondoclint/src/validator.rs
index 791b231c27a..8c9e4c8bb3a 100644
--- a/src/tools/jsondoclint/src/validator.rs
+++ b/src/tools/jsondoclint/src/validator.rs
@@ -326,6 +326,7 @@ impl<'a> Validator<'a> {
                     self.check_type(o);
                 }
             }
+            GenericArgs::ReturnTypeNotation => {}
         }
     }