Skip to content

Commit 3f9acdf

Browse files
committed
Add missing language tags.
1 parent 2e3f4e6 commit 3f9acdf

File tree

3 files changed

+16
-16
lines changed

3 files changed

+16
-16
lines changed

src/rust-2018/data-types/inclusive-ranges.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
Since well before Rust 1.0, you’ve been able to create exclusive ranges with
66
`..` like this:
77

8-
```
8+
```rust
99
for i in 1..3 {
1010
println!("i: {}", i);
1111
}

src/rust-2018/rustdoc/documentation-tests-can-now-compile-fail.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
You can now create `compile-fail` tests in Rustdoc, like this:
66

7-
```
7+
```rust
88
/// ```compile_fail
99
/// let x = 5;
1010
/// x += 2; // shouldn't compile!

src/rust-next/const-fn.md

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ Expanded in many releases, see each aspect below for more details.
66

77
A `const fn` allows you to execute code in a "const context." For example:
88

9-
```
9+
```rust
1010
const fn five() -> i32 {
1111
5
1212
}
@@ -34,7 +34,7 @@ that it is becoming more `const` over time.
3434

3535
You can do arithmetic on integer literals:
3636

37-
```
37+
```rust
3838
const fn foo() -> i32 {
3939
5 + 6
4040
}
@@ -46,7 +46,7 @@ const fn foo() -> i32 {
4646

4747
You can use boolean operators other than `&&` and `||`, because they short-circut evaluation:
4848

49-
```
49+
```rust
5050
const fn mask(val: u8) -> u8 {
5151
let mask = 0x0f;
5252

@@ -60,7 +60,7 @@ const fn mask(val: u8) -> u8 {
6060

6161
You can create arrays, structs, enums, and tuples:
6262

63-
```
63+
```rust
6464
struct Point {
6565
x: i32,
6666
y: i32,
@@ -92,7 +92,7 @@ const fn foo() {
9292
You can call `const fn` from a `const fn`:
9393

9494

95-
```
95+
```rust
9696
const fn foo() -> i32 {
9797
5
9898
}
@@ -108,7 +108,7 @@ const fn bar() -> i32 {
108108

109109
You can index into an array or slice:
110110

111-
```
111+
```rust
112112
const fn foo() -> i32 {
113113
let array = [1, 2, 3];
114114

@@ -122,7 +122,7 @@ const fn foo() -> i32 {
122122

123123
You can access parts of a struct or tuple:
124124

125-
```
125+
```rust
126126
struct Point {
127127
x: i32,
128128
y: i32,
@@ -147,7 +147,7 @@ const fn foo() {
147147

148148
You can read from a constant:
149149

150-
```
150+
```rust
151151
const FOO: i32 = 5;
152152

153153
const fn foo() -> i32 {
@@ -163,7 +163,7 @@ Note that this is *only* `const`, not `static`.
163163

164164
You can create and de-reference references:
165165

166-
```
166+
```rust
167167
const fn foo(r: &i32) {
168168
*r;
169169

@@ -177,7 +177,7 @@ const fn foo(r: &i32) {
177177

178178
You may cast things, except for raw pointers may not be casted to an integer:
179179

180-
```
180+
```rust
181181
const fn foo() {
182182
let x: usize = 5;
183183

@@ -191,7 +191,7 @@ const fn foo() {
191191

192192
You can use irrefutable patterns that destructure values. For example:
193193

194-
```
194+
```rust
195195
const fn foo((x, y): (u8, u8)) {
196196
// ...
197197
}
@@ -206,7 +206,7 @@ place that uses irrefutable patterns.
206206

207207
You can use both mutable and immutable `let` bindings:
208208

209-
```
209+
```rust
210210
const fn foo() {
211211
let x = 5;
212212
let mut y = 10;
@@ -219,7 +219,7 @@ const fn foo() {
219219

220220
You can use assignment and assignment operators:
221221

222-
```
222+
```rust
223223
const fn foo() {
224224
let mut x = 5;
225225
x = 10;
@@ -232,7 +232,7 @@ const fn foo() {
232232

233233
You can call an `unsafe fn` inside a `const fn`:
234234

235-
```
235+
```rust
236236
const unsafe fn foo() -> i32 { 5 }
237237

238238
const fn bar() -> i32 {

0 commit comments

Comments
 (0)