]>
git.proxmox.com Git - rustc.git/blob - tests/rustdoc-ui/unescaped_backticks.rs
1 #![deny(rustdoc::unescaped_backticks)]
2 #![allow(rustdoc::broken_intra_doc_links)]
3 #![allow(rustdoc::invalid_html_tags)]
4 #![allow(rustdoc::redundant_explicit_links)]
13 //~^ ERROR unescaped backtick
20 //~^ ERROR unescaped backtick
21 pub fn not_escaped() {}
24 pub fn not_not_escaped() {}
27 //~^ ERROR unescaped backtick
31 //~^ ERROR unescaped backtick
34 /// [`link_long](link_long)
35 //~^ ERROR unescaped backtick
39 //~^ ERROR unescaped backtick
40 pub fn broken_link() {}
46 //~^ ERROR unescaped backtick
53 pub fn html_escape() {}
56 //~^ ERROR unescaped backtick
60 //~^ ERROR unescaped backtick
66 //~^ ERROR unescaped backtick
69 pub fn paragraph2() {}
72 //~^ ERROR unescaped backtick
74 pub fn not_paragraph() {}
76 /// Addition is commutative, which means that add(a, b)` is the same as `add(b, a)`.
77 //~^ ERROR unescaped backtick
79 /// You could use this function to add 42 to a number `n` (add(n, 42)`),
80 /// or even to add a number `n` to 42 (`add(42, b)`)!
81 //~^ ERROR unescaped backtick
82 pub fn add1(a
: i32, b
: i32) -> i32 { a + b }
84 /// Addition is commutative, which means that `add(a, b) is the same as `add(b, a)`.
85 //~^ ERROR unescaped backtick
87 /// You could use this function to add 42 to a number `n` (`add(n, 42)),
88 /// or even to add a number `n` to 42 (`add(42, n)`)!
89 //~^ ERROR unescaped backtick
90 pub fn add2(a
: i32, b
: i32) -> i32 { a + b }
92 /// Addition is commutative, which means that `add(a, b)` is the same as add(b, a)`.
93 //~^ ERROR unescaped backtick
95 /// You could use this function to add 42 to a number `n` (`add(n, 42)`),
96 /// or even to add a number `n` to 42 (add(42, n)`)!
97 //~^ ERROR unescaped backtick
98 pub fn add3(a
: i32, b
: i32) -> i32 { a + b }
100 /// Addition is commutative, which means that `add(a, b)` is the same as `add(b, a).
101 //~^ ERROR unescaped backtick
103 /// You could use this function to add 42 to a number `n` (`add(n, 42)),
104 /// or even to add a number `n` to 42 (`add(42, n)`)!
105 //~^ ERROR unescaped backtick
106 pub fn add4(a
: i32, b
: i32) -> i32 { a + b }
109 //~^ ERROR unescaped backtick
112 #[doc = concat!("\\", "`")]
113 pub fn attr_escaped() {}
115 #[doc = concat!("\\\\", "`")]
116 //~^ ERROR unescaped backtick
117 pub fn attr_not_escaped() {}
119 #[doc = "Addition is commutative, which means that add(a, b)` is the same as `add(b, a)`."]
120 //~^ ERROR unescaped backtick
121 pub fn attr_add1(a
: i32, b
: i32) -> i32 { a + b }
123 #[doc = "Addition is commutative, which means that `add(a, b) is the same as `add(b, a)`."]
124 //~^ ERROR unescaped backtick
125 pub fn attr_add2(a
: i32, b
: i32) -> i32 { a + b }
127 #[doc = "Addition is commutative, which means that `add(a, b)` is the same as add(b, a)`."]
128 //~^ ERROR unescaped backtick
129 pub fn attr_add3(a
: i32, b
: i32) -> i32 { a + b }
131 #[doc = "Addition is commutative, which means that `add(a, b)` is the same as `add(b, a)."]
132 //~^ ERROR unescaped backtick
133 pub fn attr_add4(a
: i32, b
: i32) -> i32 { a + b }
135 /// ``double backticks``
137 //~^ ERROR unescaped backtick
138 pub fn double_backticks() {}
141 //~^ ERROR unescaped backtick
143 //~^ ERROR unescaped backtick
146 //~^ ERROR unescaped backtick
152 //~^ ERROR unescaped backtick
155 //~^ ERROR unescaped backtick
158 //~^ ERROR unescaped backtick
160 //~^ ERROR unescaped backtick
162 //~^ ERROR unescaped backtick
164 //~^ ERROR unescaped backtick
166 /// `#![this_is_actually_an_image(and(not), an = "attribute")]
167 //~^ ERROR unescaped backtick
169 /// #![this_is_actually_an_image(and(not), an = "attribute")]`
170 //~^ ERROR unescaped backtick
172 /// [this_is_actually_an_image(and(not), an = "attribute")]: `.png
174 /// | `table( | )head` |
175 //~^ ERROR unescaped backtick
176 //~| ERROR unescaped backtick
177 /// |---------|--------|
178 /// | table`( | )`body |
179 //~^ ERROR unescaped backtick
180 //~| ERROR unescaped backtick
181 pub fn complicated_markdown() {}
183 /// The `custom_mir` attribute tells the compiler to treat the function as being custom MIR. This
184 /// attribute only works on functions - there is no way to insert custom MIR into the middle of
185 /// another function. The `dialect` and `phase` parameters indicate which [version of MIR][dialect
186 /// docs] you are inserting here. Generally you'll want to use `#![custom_mir(dialect = "built")]`
187 /// if you want your MIR to be modified by the full MIR pipeline, or `#![custom_mir(dialect =
188 //~^ ERROR unescaped backtick
189 /// "runtime", phase = "optimized")] if you don't.
193 /// Constructs a `TyKind::Error` type and registers a `span_delayed_bug` with the given `msg to
194 //~^ ERROR unescaped backtick
195 /// ensure it gets used.
196 pub fn ty_error_with_message() {}
198 pub struct WhereClause
{
199 /// `true` if we ate a `where` token: this can happen
200 /// if we parsed no predicates (e.g. `struct Foo where {}
201 /// This allows us to accurately pretty-print
202 /// in `nt_to_tokenstream`
203 //~^ ERROR unescaped backtick
204 pub has_where_token
: bool
,
207 /// A symbol is an interned or gensymed string. The use of `newtype_index!` means
208 /// that `Option<Symbol>` only takes up 4 bytes, because `newtype_index! reserves
209 //~^ ERROR unescaped backtick
210 /// the last 256 values for tagging purposes.
213 /// It is equivalent to `OpenOptions::new()` but allows you to write more
214 /// readable code. Instead of `OpenOptions::new().read(true).open("foo.txt")`
215 /// you can write `File::with_options().read(true).open("foo.txt"). This
216 /// also avoids the need to import `OpenOptions`.
217 //~^ ERROR unescaped backtick
218 pub fn with_options() {}
220 /// Subtracts `set from `row`. `set` can be either `BitSet` or
221 /// `HybridBitSet`. Has no effect if `row` does not exist.
222 //~^ ERROR unescaped backtick
224 /// Returns true if the row was changed.
225 pub fn subtract_row() {}
227 pub mod assert_module_sources
{
228 //! The reason that we use `cfg=...` and not `#[cfg_attr]` is so that
229 //! the HIR doesn't change as a result of the annotations, which might
230 //! perturb the reuse results.
232 //! `#![rustc_expected_cgu_reuse(module="spike", cfg="rpass2", kind="post-lto")]
233 //~^ ERROR unescaped backtick
234 //! allows for doing a more fine-grained check to see if pre- or post-lto data
238 //~^ ERROR unescaped backtick
241 /// `cfg=... and not `#[cfg_attr]`
242 //~^ ERROR unescaped backtick
246 /// Conceptually, this is like a `Vec<Vec<RWU>>`. But the number of
247 /// RWU`s can get very large, so it uses a more compact representation.
248 //~^ ERROR unescaped backtick
249 pub struct RWUTable {}
251 /// Like [Self::canonicalize_query], but preserves distinct universes. For
252 /// example, canonicalizing `&'?0: Trait<'?1>`, where `'?0` is in `U1` and
253 /// `'?1` is in `U3` would be canonicalized to have ?0` in `U1` and `'?1`
255 //~^ ERROR unescaped backtick
257 /// This is used for Chalk integration.
258 pub fn canonicalize_query_preserving_universes() {}
260 /// Note that we used to return `Error` here, but that was quite
261 /// dubious -- the premise was that an error would *eventually* be
262 /// reported, when the obligation was processed. But in general once
263 /// you see an `Error` you are supposed to be able to assume that an
264 /// error *has been* reported, so that you can take whatever heuristic
265 /// paths you want to take. To make things worse, it was possible for
266 /// cycles to arise, where you basically had a setup like `<MyType<$0>
267 /// as Trait>::Foo == $0`. Here, normalizing `<MyType<$0> as
268 /// Trait>::Foo> to `[type error]` would lead to an obligation of
269 /// `<MyType<[type error]> as Trait>::Foo`. We are supposed to report
270 /// an error for this obligation, but we legitimately should not,
271 /// because it contains `[type error]`. Yuck! (See issue #29857 for
272 //~^ ERROR unescaped backtick
273 /// one case where this arose.)
274 pub fn normalize_to_error() {}
276 /// you don't want to cache that `B: AutoTrait` or `A: AutoTrait`
277 /// is `EvaluatedToOk`; this is because they were only considered
278 /// ok on the premise that if `A: AutoTrait` held, but we indeed
279 /// encountered a problem (later on) with `A: AutoTrait. So we
280 /// currently set a flag on the stack node for `B: AutoTrait` (as
281 /// well as the second instance of `A: AutoTrait`) to suppress
282 //~^ ERROR unescaped backtick
284 pub struct TraitObligationStack
;
286 /// Extend `scc` so that it can outlive some placeholder region
287 /// from a universe it can't name; at present, the only way for
288 /// this to be true is if `scc` outlives `'static`. This is
289 /// actually stricter than necessary: ideally, we'd support bounds
290 /// like `for<'a: 'b`>` that might then allow us to approximate
291 /// `'a` with `'b` and not `'static`. But it will have to do for
292 //~^ ERROR unescaped backtick
294 pub fn add_incompatible_universe(){}
297 /// The Subscriber` may be accessed by calling [`WeakDispatch::upgrade`],
298 /// which returns an `Option<Dispatch>`. If all [`Dispatch`] clones that point
299 /// at the `Subscriber` have been dropped, [`WeakDispatch::upgrade`] will return
300 /// `None`. Otherwise, it will return `Some(Dispatch)`.
301 //~^ ERROR unescaped backtick
303 /// Returns some reference to this `[`Subscriber`] value if it is of type `T`,
304 /// or `None` if it isn't.
305 //~^ ERROR unescaped backtick
307 /// Called before the filtered [`Layer]'s [`on_event`], to determine if
308 /// `on_event` should be called.
309 //~^ ERROR unescaped backtick
311 /// Therefore, if the `Filter will change the value returned by this
312 /// method, it is responsible for ensuring that
313 /// [`rebuild_interest_cache`][rebuild] is called after the value of the max
314 //~^ ERROR unescaped backtick
319 ($
($tt
:tt
)*) => { $($tt)* }
323 /// The Subscriber` may be accessed by calling [`WeakDispatch::upgrade`],
324 //~^ ERROR unescaped backtick
325 //~| ERROR unescaped backtick
326 //~| ERROR unescaped backtick
327 //~| ERROR unescaped backtick
328 /// which returns an `Option<Dispatch>`. If all [`Dispatch`] clones that point
329 /// at the `Subscriber` have been dropped, [`WeakDispatch::upgrade`] will return
330 /// `None`. Otherwise, it will return `Some(Dispatch)`.
332 /// Returns some reference to this `[`Subscriber`] value if it is of type `T`,
333 /// or `None` if it isn't.
335 /// Called before the filtered [`Layer]'s [`on_event`], to determine if
336 /// `on_event` should be called.
338 /// Therefore, if the `Filter will change the value returned by this
339 /// method, it is responsible for ensuring that
340 /// [`rebuild_interest_cache`][rebuild] is called after the value of the max
342 pub mod tracing_macro {}
345 /// Regression test for <https://github.com/rust-lang/rust/issues/111117>
346 pub mod trillium_server_common
{
347 /// One-indexed, because the first CloneCounter is included. If you don't
348 /// want the original to count, construct a [``CloneCounterObserver`]
349 /// instead and use [`CloneCounterObserver::counter`] to increment.
350 //~^ ERROR unescaped backtick
351 pub struct CloneCounter
;
353 /// This is used by the above.
354 pub struct CloneCounterObserver
;