Skip to content

Commit 809d01c

Browse files
committed
Updated codeblocks to specify language where required.
1 parent 9e9a987 commit 809d01c

File tree

5 files changed

+15
-11
lines changed

5 files changed

+15
-11
lines changed

src/librustc/middle/region.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -353,8 +353,8 @@ pub struct ScopeTree {
353353
/// the result of `g()` occurs after the yield (and therefore
354354
/// doesn't). If we want to infer that, we can look at the
355355
/// postorder traversal:
356-
/// ```
357-
/// `foo` `f` Call#1 `y` Yield `bar` `g` Call#3 Call#2 Call#0
356+
/// ```plain,ignore
357+
/// `foo` `f` Call#1 `y` Yield `bar` `g` Call#3 Call#2 Call#0
358358
/// ```
359359
///
360360
/// In which we can easily see that `Call#1` occurs before the yield,

src/librustc/traits/select.rs

+2
Original file line numberDiff line numberDiff line change
@@ -362,7 +362,9 @@ enum EvaluationResult {
362362
/// When checking `foo`, we have to prove `T: Trait`. This basically
363363
/// translates into this:
364364
///
365+
/// ```plain,ignore
365366
/// (T: Trait + Sized →_\impl T: Trait), T: Trait ⊢ T: Trait
367+
/// ```
366368
///
367369
/// When we try to prove it, we first go the first option, which
368370
/// recurses. This shows us that the impl is "useless" - it won't

src/librustc_resolve/lib.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -427,14 +427,14 @@ fn generate_fn_name_span(cm: &CodeMap, span: Span) -> Option<Span> {
427427
/// a new local type parameter.
428428
///
429429
/// For instance:
430-
/// ```
430+
/// ```rust,ignore (pseudo-Rust)
431431
/// // Given span
432432
/// fn my_function(param: T)
433-
/// ^ Original span
433+
/// // ^ Original span
434434
///
435435
/// // Result
436436
/// fn my_function(param: T)
437-
/// ^^^^^^^^^^^ Generated span with snippet `my_function<T>`
437+
/// // ^^^^^^^^^^^ Generated span with snippet `my_function<T>`
438438
/// ```
439439
///
440440
/// Attention: The method used is very fragile since it essentially duplicates the work of the

src/librustc_typeck/check/regionck.rs

+2
Original file line numberDiff line numberDiff line change
@@ -1164,10 +1164,12 @@ impl<'a, 'gcx, 'tcx> RegionCtxt<'a, 'gcx, 'tcx> {
11641164
/// constraint that `'z <= 'a`. Given this setup, let's clarify the
11651165
/// parameters in (roughly) terms of the example:
11661166
///
1167+
/// ```plain,ignore (pseudo-Rust)
11671168
/// A borrow of: `& 'z bk * r` where `r` has type `& 'a bk T`
11681169
/// borrow_region ^~ ref_region ^~
11691170
/// borrow_kind ^~ ref_kind ^~
11701171
/// ref_cmt ^
1172+
/// ```
11711173
///
11721174
/// Here `bk` stands for some borrow-kind (e.g., `mut`, `uniq`, etc).
11731175
///

src/librustc_typeck/impl_wf_check.rs

+6-6
Original file line numberDiff line numberDiff line change
@@ -42,21 +42,21 @@ use syntax_pos::Span;
4242
///
4343
/// Example:
4444
///
45-
/// ```
45+
/// ```rust,ignore (pseudo-Rust)
4646
/// impl<T> Trait<Foo> for Bar { ... }
47-
/// ^ T does not appear in `Foo` or `Bar`, error!
47+
/// // ^ T does not appear in `Foo` or `Bar`, error!
4848
///
4949
/// impl<T> Trait<Foo<T>> for Bar { ... }
50-
/// ^ T appears in `Foo<T>`, ok.
50+
/// // ^ T appears in `Foo<T>`, ok.
5151
///
5252
/// impl<T> Trait<Foo> for Bar where Bar: Iterator<Item=T> { ... }
53-
/// ^ T is bound to `<Bar as Iterator>::Item`, ok.
53+
/// // ^ T is bound to `<Bar as Iterator>::Item`, ok.
5454
///
5555
/// impl<'a> Trait<Foo> for Bar { }
56-
/// ^ 'a is unused, but for back-compat we allow it
56+
/// // ^ 'a is unused, but for back-compat we allow it
5757
///
5858
/// impl<'a> Trait<Foo> for Bar { type X = &'a i32; }
59-
/// ^ 'a is unused and appears in assoc type, error
59+
/// // ^ 'a is unused and appears in assoc type, error
6060
/// ```
6161
pub fn impl_wf_check<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>) {
6262
// We will tag this as part of the WF check -- logically, it is,

0 commit comments

Comments
 (0)