Skip to content

Commit 4dc2d74

Browse files
committed
Auto merge of #51704 - kennytm:rollup, r=kennytm
Rollup of 6 pull requests Successful merges: - #51158 (Mention spec and indented blocks in doctest docs) - #51629 (Do not consume semicolon twice while parsing local statement) - #51637 (Update zx_cprng_draw_new on Fuchsia) - #51664 (make more libsyntax methods public) - #51666 (Disable probestack when GCOV profiling is being used) - #51703 (Recognize the extra "LLVM tools versions" argument to build-manifest.) Failed merges: r? @ghost
2 parents 01dbfda + d41cb99 commit 4dc2d74

File tree

5 files changed

+37
-8
lines changed

5 files changed

+37
-8
lines changed

src/doc/rustdoc/src/documentation-tests.md

+24
Original file line numberDiff line numberDiff line change
@@ -305,3 +305,27 @@ environment that has no network access.
305305
compiles, then the test will fail. However please note that code failing
306306
with the current Rust release may work in a future release, as new features
307307
are added.
308+
309+
## Syntax reference
310+
311+
The *exact* syntax for code blocks, including the edge cases, can be found
312+
in the [Fenced Code Blocks](https://spec.commonmark.org/0.28/#fenced-code-blocks)
313+
section of the CommonMark specification.
314+
315+
Rustdoc also accepts *indented* code blocks as an alternative to fenced
316+
code blocks: instead of surrounding your code with three backticks, you
317+
can indent each line by four or more spaces.
318+
319+
``````markdown
320+
let foo = "foo";
321+
assert_eq!(foo, "foo");
322+
``````
323+
324+
These, too, are documented in the CommonMark specification, in the
325+
[Indented Code Blocks](https://spec.commonmark.org/0.28/#indented-code-blocks)
326+
section.
327+
328+
However, it's preferable to use fenced code blocks over indented code blocks.
329+
Not only are fenced code blocks considered more idiomatic for Rust code,
330+
but there is no way to use directives such as `ignore` or `should_panic` with
331+
indented code blocks.

src/librustc_codegen_llvm/attributes.rs

+5
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,11 @@ pub fn set_probestack(cx: &CodegenCx, llfn: ValueRef) {
9898
return;
9999
}
100100

101+
// probestack doesn't play nice either with gcov profiling.
102+
if cx.sess().opts.debugging_opts.profile {
103+
return;
104+
}
105+
101106
// Flag our internal `__rust_probestack` function as the stack probe symbol.
102107
// This is defined in the `compiler-builtins` crate for each architecture.
103108
llvm::AddFunctionAttrStringValue(

src/libstd/sys/unix/rand.rs

+3-4
Original file line numberDiff line numberDiff line change
@@ -183,15 +183,14 @@ mod imp {
183183
mod imp {
184184
#[link(name = "zircon")]
185185
extern {
186-
fn zx_cprng_draw(buffer: *mut u8, len: usize, actual: *mut usize) -> i32;
186+
fn zx_cprng_draw_new(buffer: *mut u8, len: usize) -> i32;
187187
}
188188

189189
fn getrandom(buf: &mut [u8]) -> Result<usize, i32> {
190190
unsafe {
191-
let mut actual = 0;
192-
let status = zx_cprng_draw(buf.as_mut_ptr(), buf.len(), &mut actual);
191+
let status = zx_cprng_draw_new(buf.as_mut_ptr(), buf.len());
193192
if status == 0 {
194-
Ok(actual)
193+
Ok(buf.len())
195194
} else {
196195
Err(status)
197196
}

src/libsyntax/parse/parser.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -1060,7 +1060,7 @@ impl<'a> Parser<'a> {
10601060
/// Parse a sequence, not including the closing delimiter. The function
10611061
/// f must consume tokens until reaching the next separator or
10621062
/// closing bracket.
1063-
fn parse_seq_to_before_end<T, F>(&mut self,
1063+
pub fn parse_seq_to_before_end<T, F>(&mut self,
10641064
ket: &token::Token,
10651065
sep: SeqSep,
10661066
f: F)
@@ -2120,7 +2120,7 @@ impl<'a> Parser<'a> {
21202120
ExprKind::AssignOp(binop, lhs, rhs)
21212121
}
21222122

2123-
fn mk_mac_expr(&mut self, span: Span, m: Mac_, attrs: ThinVec<Attribute>) -> P<Expr> {
2123+
pub fn mk_mac_expr(&mut self, span: Span, m: Mac_, attrs: ThinVec<Attribute>) -> P<Expr> {
21242124
P(Expr {
21252125
id: ast::DUMMY_NODE_ID,
21262126
node: ExprKind::Mac(codemap::Spanned {node: m, span: span}),
@@ -4718,7 +4718,7 @@ impl<'a> Parser<'a> {
47184718
if macro_legacy_warnings && self.token != token::Semi {
47194719
self.warn_missing_semicolon();
47204720
} else {
4721-
self.expect_one_of(&[token::Semi], &[])?;
4721+
self.expect_one_of(&[], &[token::Semi])?;
47224722
}
47234723
}
47244724
_ => {}
@@ -7235,7 +7235,7 @@ impl<'a> Parser<'a> {
72357235
})
72367236
}
72377237

7238-
fn parse_optional_str(&mut self) -> Option<(Symbol, ast::StrStyle, Option<ast::Name>)> {
7238+
pub fn parse_optional_str(&mut self) -> Option<(Symbol, ast::StrStyle, Option<ast::Name>)> {
72397239
let ret = match self.token {
72407240
token::Literal(token::Str_(s), suf) => (s, ast::StrStyle::Cooked, suf),
72417241
token::Literal(token::StrRaw(s, n), suf) => (s, ast::StrStyle::Raw(n), suf),

src/tools/build-manifest/src/main.rs

+1
Original file line numberDiff line numberDiff line change
@@ -212,6 +212,7 @@ fn main() {
212212
let cargo_release = args.next().unwrap();
213213
let rls_release = args.next().unwrap();
214214
let rustfmt_release = args.next().unwrap();
215+
let _llvm_tools_vers = args.next().unwrap(); // FIXME do something with it?
215216
let s3_address = args.next().unwrap();
216217
let mut passphrase = String::new();
217218
t!(io::stdin().read_to_string(&mut passphrase));

0 commit comments

Comments
 (0)