Logo
Explore Help
Register Sign In
rust-lang/rust
1
0
Fork 0
You've already forked rust
Code Issues Pull Requests Actions 2 Packages Projects Releases Wiki Activity
Files
1b67035579fc6157ca2f3fb8b7e6071ff6d888bc
rust/tests/rustdoc/blank-line-in-doc-block-47197.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

12 lines
200 B
Rust
Raw Normal View History

Add `crate_name` and URL to test cases
2024-01-03 14:56:10 -07:00
// https://github.com/rust-lang/rust/issues/47197
#![crate_name="foo"]
Update `tests/rustdoc` to new test syntax
2024-06-21 14:03:08 +02:00
//@ has foo/fn.whose_woods_these_are_i_think_i_know.html
wherein careful doc-decoration arithmetic proves quite the ICE-breaker This `horizontal_trim` function strips the leading whitespace from doc-comments that have a left-asterisk-margin: /** * You know what I mean— * * comments like this! */ The index of the column of asterisks is `i`, and if trimming is deemed possible, we slice each line from `i+1` to the end of the line. But if, in particular, `i` was 0 _and_ there was an empty line (as in the example given in the reporting issue), we ended up panicking trying to slice an empty string from 0+1 (== 1). Let's tighten our check to say that we can't trim when `i` is even the same as the length of the line, not just when it's greater. (Any such cases would panic trying to slice `line` from `line.len()+1`.) Resolves #47197.
2018-01-04 23:09:02 -08:00
/**
* snow
* ice
*/
pub fn whose_woods_these_are_i_think_i_know() {}
Reference in New Issue Copy Permalink
Powered by Gitea Version: 1.24.6 Page: 868ms Template: 2ms
English
Bahasa Indonesia Deutsch English Español Français Gaeilge Italiano Latviešu Magyar nyelv Nederlands Polski Português de Portugal Português do Brasil Suomi Svenska Türkçe Čeština Ελληνικά Български Русский Українська فارسی മലയാളം 日本語 简体中文 繁體中文(台灣) 繁體中文(香港) 한국어
Licenses API