diff options
| author | bors <bors@rust-lang.org> | 2019-08-08 09:06:45 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2019-08-08 09:06:45 +0000 |
| commit | 2628f579f6246df385acf9203bf2ffb6aedf5ccc (patch) | |
| tree | fd559808122d5b25cf55beb791a95cdadbabfa1c /src | |
| parent | 04523404bcae5904fe29a54122040a7101f5c652 (diff) | |
| parent | 83fbf620a009e3fc998bb08098655dcfb7ff809b (diff) | |
| download | rust-2628f579f6246df385acf9203bf2ffb6aedf5ccc.tar.gz rust-2628f579f6246df385acf9203bf2ffb6aedf5ccc.zip | |
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
Diffstat (limited to 'src')
| m--------- | src/doc/edition-guide | 0 | ||||
| m--------- | src/doc/embedded-book | 0 | ||||
| m--------- | src/doc/nomicon | 0 | ||||
| m--------- | src/doc/reference | 0 | ||||
| m--------- | src/doc/rust-by-example | 0 | ||||
| m--------- | src/doc/rustc-guide | 0 | ||||
| -rw-r--r-- | src/librustc/session/config.rs | 12 | ||||
| -rw-r--r-- | src/libstd/os/linux/fs.rs | 7 | ||||
| -rw-r--r-- | src/test/ui/async-await/conditional-and-guaranteed-initialization.rs | 18 | ||||
| -rw-r--r-- | src/test/ui/async-await/no-non-guaranteed-initialization.rs | 16 | ||||
| -rw-r--r-- | src/test/ui/async-await/no-non-guaranteed-initialization.stderr | 9 | ||||
| -rw-r--r-- | src/test/ui/issues/auxiliary/issue-29265.rs | 9 | ||||
| -rw-r--r-- | src/test/ui/issues/auxiliary/issue-49544.rs | 7 | ||||
| -rw-r--r-- | src/test/ui/issues/issue-29265.rs | 10 | ||||
| -rw-r--r-- | src/test/ui/issues/issue-37433.rs | 10 | ||||
| -rw-r--r-- | src/test/ui/issues/issue-37433.stderr | 8 | ||||
| -rw-r--r-- | src/test/ui/issues/issue-43398.rs | 15 | ||||
| -rw-r--r-- | src/test/ui/issues/issue-49544.rs | 9 |
18 files changed, 121 insertions, 9 deletions
diff --git a/src/doc/edition-guide b/src/doc/edition-guide -Subproject f6c8b92d4e63edd28e862be952f33861f35956f +Subproject e58bc4ca104e890ac56af846877c874c432a64b diff --git a/src/doc/embedded-book b/src/doc/embedded-book -Subproject ff334e74fdb9f197e621efa6d7c3105be892e88 +Subproject c5da1e11915d3f28266168baaf55822f7e3fe99 diff --git a/src/doc/nomicon b/src/doc/nomicon -Subproject b7f0aba2f88a8feade70595efcfa3438e54e96c +Subproject 8a7d05615e5bc0a7fb961b4919c44f5221ee54d diff --git a/src/doc/reference b/src/doc/reference -Subproject 8e7d614303b0dec7492e048e63855fcd3b944ec +Subproject b4b3536839042a6743fc76f0d9ad2a812020aea diff --git a/src/doc/rust-by-example b/src/doc/rust-by-example -Subproject e3679e214d8db44586aca9b20aa27517007d192 +Subproject f2c15ba5ee89ae9469a2cf60494977749901d76 diff --git a/src/doc/rustc-guide b/src/doc/rustc-guide -Subproject b5a2b9353c661000378415ecfeb757eb7df42d6 +Subproject 6f4ba673ff9d4613e98415bc095347a6a0031e9 diff --git a/src/librustc/session/config.rs b/src/librustc/session/config.rs index 748d2a48249..3536b2aa8ff 100644 --- a/src/librustc/session/config.rs +++ b/src/librustc/session/config.rs @@ -1155,7 +1155,7 @@ options! {CodegenOptions, CodegenSetter, basic_codegen_options, 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 @@ options! {CodegenOptions, CodegenSetter, basic_codegen_options, 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 @@ options! {DebuggingOptions, DebuggingSetter, basic_debugging_options, 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 @@ options! {DebuggingOptions, DebuggingSetter, basic_debugging_options, 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 @@ options! {DebuggingOptions, DebuggingSetter, basic_debugging_options, "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), diff --git a/src/libstd/os/linux/fs.rs b/src/libstd/os/linux/fs.rs index ec5e9837076..78321ac3185 100644 --- a/src/libstd/os/linux/fs.rs +++ b/src/libstd/os/linux/fs.rs @@ -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; diff --git a/src/test/ui/async-await/conditional-and-guaranteed-initialization.rs b/src/test/ui/async-await/conditional-and-guaranteed-initialization.rs new file mode 100644 index 00000000000..a5947e7f718 --- /dev/null +++ b/src/test/ui/async-await/conditional-and-guaranteed-initialization.rs @@ -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 } diff --git a/src/test/ui/async-await/no-non-guaranteed-initialization.rs b/src/test/ui/async-await/no-non-guaranteed-initialization.rs new file mode 100644 index 00000000000..a916afb6b09 --- /dev/null +++ b/src/test/ui/async-await/no-non-guaranteed-initialization.rs @@ -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 } diff --git a/src/test/ui/async-await/no-non-guaranteed-initialization.stderr b/src/test/ui/async-await/no-non-guaranteed-initialization.stderr new file mode 100644 index 00000000000..fb94522cac0 --- /dev/null +++ b/src/test/ui/async-await/no-non-guaranteed-initialization.stderr @@ -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`. diff --git a/src/test/ui/issues/auxiliary/issue-29265.rs b/src/test/ui/issues/auxiliary/issue-29265.rs new file mode 100644 index 00000000000..6d26002a2e7 --- /dev/null +++ b/src/test/ui/issues/auxiliary/issue-29265.rs @@ -0,0 +1,9 @@ +#![crate_type = "lib"] + +pub struct SomeType { + pub some_member: usize, +} + +pub static SOME_VALUE: SomeType = SomeType { + some_member: 1, +}; diff --git a/src/test/ui/issues/auxiliary/issue-49544.rs b/src/test/ui/issues/auxiliary/issue-49544.rs new file mode 100644 index 00000000000..f8b3a3fba1e --- /dev/null +++ b/src/test/ui/issues/auxiliary/issue-49544.rs @@ -0,0 +1,7 @@ +#![crate_type = "lib"] + +pub fn foo() -> Vec<String> { + std::env::args() + .skip(1) + .collect() +} diff --git a/src/test/ui/issues/issue-29265.rs b/src/test/ui/issues/issue-29265.rs new file mode 100644 index 00000000000..f554c4d16c7 --- /dev/null +++ b/src/test/ui/issues/issue-29265.rs @@ -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]; +} diff --git a/src/test/ui/issues/issue-37433.rs b/src/test/ui/issues/issue-37433.rs new file mode 100644 index 00000000000..d3663e24e60 --- /dev/null +++ b/src/test/ui/issues/issue-37433.rs @@ -0,0 +1,10 @@ +// ignore-emscripten no asm! support + +#![feature(asm)] + +fn main() { + unsafe { + asm!("" :: "r"("")); + //~^ ERROR: invalid value for constraint in inline assembly + } +} diff --git a/src/test/ui/issues/issue-37433.stderr b/src/test/ui/issues/issue-37433.stderr new file mode 100644 index 00000000000..eec04469025 --- /dev/null +++ b/src/test/ui/issues/issue-37433.stderr @@ -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 + diff --git a/src/test/ui/issues/issue-43398.rs b/src/test/ui/issues/issue-43398.rs new file mode 100644 index 00000000000..ae52e8f3f6b --- /dev/null +++ b/src/test/ui/issues/issue-43398.rs @@ -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)); + } +} diff --git a/src/test/ui/issues/issue-49544.rs b/src/test/ui/issues/issue-49544.rs new file mode 100644 index 00000000000..ed356275fc1 --- /dev/null +++ b/src/test/ui/issues/issue-49544.rs @@ -0,0 +1,9 @@ +// aux-build:issue-49544.rs +// check-pass + +extern crate issue_49544; +use issue_49544::foo; + +fn main() { + let _ = foo(); +} |
