diff --git a/src/doc/edition-guide b/src/doc/edition-guide index f6c8b92d4e63e..e58bc4ca104e8 160000 --- a/src/doc/edition-guide +++ b/src/doc/edition-guide @@ -1 +1 @@ -Subproject commit f6c8b92d4e63edd28e862be952f33861f35956f8 +Subproject commit e58bc4ca104e890ac56af846877c874c432a64b5 diff --git a/src/doc/embedded-book b/src/doc/embedded-book index ff334e74fdb9f..c5da1e11915d3 160000 --- a/src/doc/embedded-book +++ b/src/doc/embedded-book @@ -1 +1 @@ -Subproject commit ff334e74fdb9f197e621efa6d7c3105be892e888 +Subproject commit c5da1e11915d3f28266168baaf55822f7e3fe999 diff --git a/src/doc/nomicon b/src/doc/nomicon index b7f0aba2f88a8..8a7d05615e5bc 160000 --- a/src/doc/nomicon +++ b/src/doc/nomicon @@ -1 +1 @@ -Subproject commit b7f0aba2f88a8feade70595efcfa3438e54e96c0 +Subproject commit 8a7d05615e5bc0a7fb961b4919c44f5221ee54da diff --git a/src/doc/reference b/src/doc/reference index 8e7d614303b0d..b4b3536839042 160000 --- a/src/doc/reference +++ b/src/doc/reference @@ -1 +1 @@ -Subproject commit 8e7d614303b0dec7492e048e63855fcd3b944ec8 +Subproject commit b4b3536839042a6743fc76f0d9ad2a812020aeaa diff --git a/src/doc/rust-by-example b/src/doc/rust-by-example index e3679e214d8db..f2c15ba5ee89a 160000 --- a/src/doc/rust-by-example +++ b/src/doc/rust-by-example @@ -1 +1 @@ -Subproject commit e3679e214d8db44586aca9b20aa27517007d1923 +Subproject commit f2c15ba5ee89ae9469a2cf60494977749901d764 diff --git a/src/doc/rustc-guide b/src/doc/rustc-guide index b5a2b9353c661..6f4ba673ff9d4 160000 --- a/src/doc/rustc-guide +++ b/src/doc/rustc-guide @@ -1 +1 @@ -Subproject commit b5a2b9353c661000378415ecfeb757eb7df42d66 +Subproject commit 6f4ba673ff9d4613e98415bc095347a6a0031e9c diff --git a/src/librustc/session/config.rs b/src/librustc/session/config.rs index 748d2a4824953..3536b2aa8fffe 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 = (Vec::new(), parse_list, [TRACKED], "a list of extra LLVM passes to run (space separated)"), llvm_args: Vec = (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 = (None, parse_opt_bool, [UNTRACKED], "allow the linker to link its default libraries"), linker_flavor: Option = (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 = (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 = (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 = (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 = (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 = (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 ec5e98370768d..78321ac3185df 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 0000000000000..a5947e7f71870 --- /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 0000000000000..a916afb6b09b7 --- /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 0000000000000..fb94522cac08d --- /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 0000000000000..6d26002a2e707 --- /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 0000000000000..f8b3a3fba1e4a --- /dev/null +++ b/src/test/ui/issues/auxiliary/issue-49544.rs @@ -0,0 +1,7 @@ +#![crate_type = "lib"] + +pub fn foo() -> Vec { + 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 0000000000000..f554c4d16c7d1 --- /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 0000000000000..d3663e24e60a2 --- /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 0000000000000..eec0446902595 --- /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 0000000000000..ae52e8f3f6b43 --- /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 0000000000000..ed356275fc135 --- /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(); +}