Auto merge of #63371 - Centril:rollup-k0xtdcz, r=Centril

Rollup of 7 pull requests

Successful merges:

 - #62994 (Add test for #43398)
 - #63259 (Add tests for some issues)
 - #63327 (doc: Reword deprecation message of MetadataExt::as_raw_stat)
 - #63331 (Test conditional initialization validation in async fns)
 - #63334 (Update to rustc-guide that passes toolstate)
 - #63353 (Update books)
 - #63360 (Use consistent capitalization in -C/-Z help)

Failed merges:

r? @ghost
This commit is contained in:
bors 2019-08-08 09:06:45 +00:00
commit 2628f579f6
18 changed files with 127 additions and 15 deletions

@ -1 +1 @@
Subproject commit f6c8b92d4e63edd28e862be952f33861f35956f8
Subproject commit e58bc4ca104e890ac56af846877c874c432a64b5

@ -1 +1 @@
Subproject commit ff334e74fdb9f197e621efa6d7c3105be892e888
Subproject commit c5da1e11915d3f28266168baaf55822f7e3fe999

@ -1 +1 @@
Subproject commit b7f0aba2f88a8feade70595efcfa3438e54e96c0
Subproject commit 8a7d05615e5bc0a7fb961b4919c44f5221ee54da

@ -1 +1 @@
Subproject commit 8e7d614303b0dec7492e048e63855fcd3b944ec8
Subproject commit b4b3536839042a6743fc76f0d9ad2a812020aeaa

@ -1 +1 @@
Subproject commit e3679e214d8db44586aca9b20aa27517007d1923
Subproject commit f2c15ba5ee89ae9469a2cf60494977749901d764

@ -1 +1 @@
Subproject commit b5a2b9353c661000378415ecfeb757eb7df42d66
Subproject commit 6f4ba673ff9d4613e98415bc095347a6a0031e9c

View File

@ -1155,7 +1155,7 @@ fn parse_symbol_mangling_version(
passes: Vec<String> = (Vec::new(), parse_list, [TRACKED],
"a list of extra LLVM passes to run (space separated)"),
llvm_args: Vec<String> = (Vec::new(), parse_list, [TRACKED],
"a list of arguments to pass to llvm (space separated)"),
"a list of arguments to pass to LLVM (space separated)"),
save_temps: bool = (false, parse_bool, [UNTRACKED],
"save all temporary output files during compilation"),
rpath: bool = (false, parse_bool, [UNTRACKED],
@ -1208,7 +1208,7 @@ fn parse_symbol_mangling_version(
default_linker_libraries: Option<bool> = (None, parse_opt_bool, [UNTRACKED],
"allow the linker to link its default libraries"),
linker_flavor: Option<LinkerFlavor> = (None, parse_linker_flavor, [UNTRACKED],
"Linker flavor"),
"linker flavor"),
linker_plugin_lto: LinkerPluginLto = (LinkerPluginLto::Disabled,
parse_linker_plugin_lto, [TRACKED],
"generate build artifacts that are compatible with linker-based LTO."),
@ -1255,7 +1255,7 @@ fn parse_symbol_mangling_version(
print_link_args: bool = (false, parse_bool, [UNTRACKED],
"print the arguments passed to the linker"),
print_llvm_passes: bool = (false, parse_bool, [UNTRACKED],
"prints the llvm optimization passes being run"),
"prints the LLVM optimization passes being run"),
ast_json: bool = (false, parse_bool, [UNTRACKED],
"print the AST as JSON and halt"),
threads: Option<usize> = (None, parse_opt_uint, [UNTRACKED],
@ -1375,11 +1375,11 @@ fn parse_symbol_mangling_version(
osx_rpath_install_name: bool = (false, parse_bool, [TRACKED],
"pass `-install_name @rpath/...` to the macOS linker"),
sanitizer: Option<Sanitizer> = (None, parse_sanitizer, [TRACKED],
"Use a sanitizer"),
"use a sanitizer"),
fuel: Option<(String, u64)> = (None, parse_optimization_fuel, [TRACKED],
"set the optimization fuel quota for a crate"),
print_fuel: Option<String> = (None, parse_opt_string, [TRACKED],
"make Rustc print the total optimization fuel used by a crate"),
"make rustc print the total optimization fuel used by a crate"),
force_unstable_if_unmarked: bool = (false, parse_bool, [TRACKED],
"force all crates to be `rustc_private` unstable"),
pre_link_arg: Vec<String> = (vec![], parse_string_push, [UNTRACKED],
@ -1417,7 +1417,7 @@ fn parse_symbol_mangling_version(
"in dep-info output, omit targets for tracking dependencies of the dep-info files \
themselves"),
unpretty: Option<String> = (None, parse_unpretty, [UNTRACKED],
"Present the input source, unstable (and less-pretty) variants;
"present the input source, unstable (and less-pretty) variants;
valid types are any of the types for `--pretty`, as well as:
`expanded`, `expanded,identified`,
`expanded,hygiene` (with internal representations),

View File

@ -34,9 +34,10 @@ pub trait MetadataExt {
/// }
/// ```
#[stable(feature = "metadata_ext", since = "1.1.0")]
#[rustc_deprecated(since = "1.8.0",
reason = "deprecated in favor of the accessor \
methods of this trait")]
#[rustc_deprecated(
since = "1.8.0",
reason = "other methods of this trait are now prefered"
)]
#[allow(deprecated)]
fn as_raw_stat(&self) -> &raw::stat;

View File

@ -0,0 +1,18 @@
// check-pass
// edition:2018
// compile-flags: --crate-type lib
#![feature(async_await)]
async fn conditional_and_guaranteed_initialization(x: usize) -> usize {
let y;
if x > 5 {
y = echo(10).await;
} else {
y = get_something().await;
}
y
}
async fn echo(x: usize) -> usize { x }
async fn get_something() -> usize { 10 }

View File

@ -0,0 +1,16 @@
// compile-fail
// edition:2018
// compile-flags: --crate-type lib
#![feature(async_await)]
async fn no_non_guaranteed_initialization(x: usize) -> usize {
let y;
if x > 5 {
y = echo(10).await;
}
y
//~^ use of possibly uninitialized variable: `y`
}
async fn echo(x: usize) -> usize { x + 1 }

View File

@ -0,0 +1,9 @@
error[E0381]: use of possibly uninitialized variable: `y`
--> $DIR/no-non-guaranteed-initialization.rs:12:5
|
LL | y
| ^ use of possibly uninitialized `y`
error: aborting due to previous error
For more information about this error, try `rustc --explain E0381`.

View File

@ -0,0 +1,9 @@
#![crate_type = "lib"]
pub struct SomeType {
pub some_member: usize,
}
pub static SOME_VALUE: SomeType = SomeType {
some_member: 1,
};

View File

@ -0,0 +1,7 @@
#![crate_type = "lib"]
pub fn foo() -> Vec<String> {
std::env::args()
.skip(1)
.collect()
}

View File

@ -0,0 +1,10 @@
// aux-build:issue-29265.rs
// check-pass
extern crate issue_29265 as lib;
static _UNUSED: &'static lib::SomeType = &lib::SOME_VALUE;
fn main() {
vec![0u8; lib::SOME_VALUE.some_member];
}

View File

@ -0,0 +1,10 @@
// ignore-emscripten no asm! support
#![feature(asm)]
fn main() {
unsafe {
asm!("" :: "r"(""));
//~^ ERROR: invalid value for constraint in inline assembly
}
}

View File

@ -0,0 +1,8 @@
error[E0669]: invalid value for constraint in inline assembly
--> $DIR/issue-37433.rs:7:24
|
LL | asm!("" :: "r"(""));
| ^^
error: aborting due to previous error

View File

@ -0,0 +1,15 @@
// run-pass
#![feature(core_intrinsics)]
#![feature(repr128)]
#[repr(i128)]
enum Big { A, B }
fn main() {
unsafe {
println!("{} {:?}",
std::intrinsics::discriminant_value(&Big::A),
std::mem::discriminant(&Big::B));
}
}

View File

@ -0,0 +1,9 @@
// aux-build:issue-49544.rs
// check-pass
extern crate issue_49544;
use issue_49544::foo;
fn main() {
let _ = foo();
}