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
This commit is contained in:
commit
4dc2d745b9
5 changed files with 37 additions and 8 deletions
|
|
@ -305,3 +305,27 @@ environment that has no network access.
|
|||
compiles, then the test will fail. However please note that code failing
|
||||
with the current Rust release may work in a future release, as new features
|
||||
are added.
|
||||
|
||||
## Syntax reference
|
||||
|
||||
The *exact* syntax for code blocks, including the edge cases, can be found
|
||||
in the [Fenced Code Blocks](https://spec.commonmark.org/0.28/#fenced-code-blocks)
|
||||
section of the CommonMark specification.
|
||||
|
||||
Rustdoc also accepts *indented* code blocks as an alternative to fenced
|
||||
code blocks: instead of surrounding your code with three backticks, you
|
||||
can indent each line by four or more spaces.
|
||||
|
||||
``````markdown
|
||||
let foo = "foo";
|
||||
assert_eq!(foo, "foo");
|
||||
``````
|
||||
|
||||
These, too, are documented in the CommonMark specification, in the
|
||||
[Indented Code Blocks](https://spec.commonmark.org/0.28/#indented-code-blocks)
|
||||
section.
|
||||
|
||||
However, it's preferable to use fenced code blocks over indented code blocks.
|
||||
Not only are fenced code blocks considered more idiomatic for Rust code,
|
||||
but there is no way to use directives such as `ignore` or `should_panic` with
|
||||
indented code blocks.
|
||||
|
|
|
|||
|
|
@ -98,6 +98,11 @@ pub fn set_probestack(cx: &CodegenCx, llfn: ValueRef) {
|
|||
return;
|
||||
}
|
||||
|
||||
// probestack doesn't play nice either with gcov profiling.
|
||||
if cx.sess().opts.debugging_opts.profile {
|
||||
return;
|
||||
}
|
||||
|
||||
// Flag our internal `__rust_probestack` function as the stack probe symbol.
|
||||
// This is defined in the `compiler-builtins` crate for each architecture.
|
||||
llvm::AddFunctionAttrStringValue(
|
||||
|
|
|
|||
|
|
@ -183,15 +183,14 @@ mod imp {
|
|||
mod imp {
|
||||
#[link(name = "zircon")]
|
||||
extern {
|
||||
fn zx_cprng_draw(buffer: *mut u8, len: usize, actual: *mut usize) -> i32;
|
||||
fn zx_cprng_draw_new(buffer: *mut u8, len: usize) -> i32;
|
||||
}
|
||||
|
||||
fn getrandom(buf: &mut [u8]) -> Result<usize, i32> {
|
||||
unsafe {
|
||||
let mut actual = 0;
|
||||
let status = zx_cprng_draw(buf.as_mut_ptr(), buf.len(), &mut actual);
|
||||
let status = zx_cprng_draw_new(buf.as_mut_ptr(), buf.len());
|
||||
if status == 0 {
|
||||
Ok(actual)
|
||||
Ok(buf.len())
|
||||
} else {
|
||||
Err(status)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1060,7 +1060,7 @@ impl<'a> Parser<'a> {
|
|||
/// Parse a sequence, not including the closing delimiter. The function
|
||||
/// f must consume tokens until reaching the next separator or
|
||||
/// closing bracket.
|
||||
fn parse_seq_to_before_end<T, F>(&mut self,
|
||||
pub fn parse_seq_to_before_end<T, F>(&mut self,
|
||||
ket: &token::Token,
|
||||
sep: SeqSep,
|
||||
f: F)
|
||||
|
|
@ -2120,7 +2120,7 @@ impl<'a> Parser<'a> {
|
|||
ExprKind::AssignOp(binop, lhs, rhs)
|
||||
}
|
||||
|
||||
fn mk_mac_expr(&mut self, span: Span, m: Mac_, attrs: ThinVec<Attribute>) -> P<Expr> {
|
||||
pub fn mk_mac_expr(&mut self, span: Span, m: Mac_, attrs: ThinVec<Attribute>) -> P<Expr> {
|
||||
P(Expr {
|
||||
id: ast::DUMMY_NODE_ID,
|
||||
node: ExprKind::Mac(codemap::Spanned {node: m, span: span}),
|
||||
|
|
@ -4718,7 +4718,7 @@ impl<'a> Parser<'a> {
|
|||
if macro_legacy_warnings && self.token != token::Semi {
|
||||
self.warn_missing_semicolon();
|
||||
} else {
|
||||
self.expect_one_of(&[token::Semi], &[])?;
|
||||
self.expect_one_of(&[], &[token::Semi])?;
|
||||
}
|
||||
}
|
||||
_ => {}
|
||||
|
|
@ -7235,7 +7235,7 @@ impl<'a> Parser<'a> {
|
|||
})
|
||||
}
|
||||
|
||||
fn parse_optional_str(&mut self) -> Option<(Symbol, ast::StrStyle, Option<ast::Name>)> {
|
||||
pub fn parse_optional_str(&mut self) -> Option<(Symbol, ast::StrStyle, Option<ast::Name>)> {
|
||||
let ret = match self.token {
|
||||
token::Literal(token::Str_(s), suf) => (s, ast::StrStyle::Cooked, suf),
|
||||
token::Literal(token::StrRaw(s, n), suf) => (s, ast::StrStyle::Raw(n), suf),
|
||||
|
|
|
|||
|
|
@ -212,6 +212,7 @@ fn main() {
|
|||
let cargo_release = args.next().unwrap();
|
||||
let rls_release = args.next().unwrap();
|
||||
let rustfmt_release = args.next().unwrap();
|
||||
let _llvm_tools_vers = args.next().unwrap(); // FIXME do something with it?
|
||||
let s3_address = args.next().unwrap();
|
||||
let mut passphrase = String::new();
|
||||
t!(io::stdin().read_to_string(&mut passphrase));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue