Skip to content

librustc: Make &const [T] mean the same thing as &[const T]#5110

Closed
pcwalton wants to merge 10 commits into
rust-lang:incomingfrom
pcwalton:and-const
Closed

librustc: Make &const [T] mean the same thing as &[const T]#5110
pcwalton wants to merge 10 commits into
rust-lang:incomingfrom
pcwalton:and-const

Conversation

@pcwalton

Copy link
Copy Markdown
Contributor

r? @brson

bors added a commit that referenced this pull request Feb 26, 2013
@bors bors closed this Feb 26, 2013
bors added a commit to rust-lang-ci/rust that referenced this pull request May 2, 2020
Fix syntax highlighting of code fences

The documentation for RESULT_EXPECT_USED includes this code:

    let res: Result<usize, ()> = Ok(1);
    res?;
    # Ok::<(), ()>(())

Because the code fence didn't start with `rust`, the code wasn't highlighted and the line starting with `#` was displayed on the website. This is now fixed.

EDIT: I noticed that highlighting for some other lints is broken as well. It only works if the code fence looks like this:

````markdown
```rust
// ..
```
````

However, many code blocks were ignored. I un-ignored most code blocks and made them compile by adding hidden code with `#`. While doing so, I found two mistakes:

```rust
opt.map_or(None, |a| a + 1)
// instead of
opt.map_or(None, |a| Some(a + 1))
```
and

```rust
fn as_str(self) -> &str
// instead of
fn as_str(self) -> &'static str
```

changelog: none
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants