Skip to content

Rollup of 6 pull requests #114978

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 12 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions library/alloc/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@
#![feature(const_waker)]
#![feature(core_intrinsics)]
#![feature(core_panic)]
#![feature(deprecated_suggestion)]
#![feature(dispatch_from_dyn)]
#![feature(error_generic_member_access)]
#![feature(error_in_core)]
Expand Down
2 changes: 1 addition & 1 deletion library/alloc/src/slice.rs
Original file line number Diff line number Diff line change
Expand Up @@ -592,7 +592,7 @@ impl<T> [T] {
/// ```
#[rustc_allow_incoherent_impl]
#[stable(feature = "rust1", since = "1.0.0")]
#[deprecated(since = "1.3.0", note = "renamed to join")]
#[deprecated(since = "1.3.0", note = "renamed to join", suggestion = "join")]
pub fn connect<Separator>(&self, sep: Separator) -> <Self as Join<Separator>>::Output
where
Self: Join<Separator>,
Expand Down
3 changes: 2 additions & 1 deletion library/core/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,8 @@ pub trait Error: Debug + Display {
#[stable(feature = "rust1", since = "1.0.0")]
#[deprecated(
since = "1.33.0",
note = "replaced by Error::source, which can support downcasting"
note = "replaced by Error::source, which can support downcasting",
suggestion = "source"
)]
#[allow(missing_docs)]
fn cause(&self) -> Option<&dyn Error> {
Expand Down
4 changes: 3 additions & 1 deletion library/core/src/ffi/c_str.rs
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ impl CStr {
/// ```
///
/// [valid]: core::ptr#safety
#[inline]
#[inline] // inline is necessary for codegen to see strlen.
#[must_use]
#[stable(feature = "rust1", since = "1.0.0")]
#[rustc_const_unstable(feature = "const_cstr_from_ptr", issue = "113219")]
Expand All @@ -280,6 +280,8 @@ impl CStr {
len
}

// `inline` is necessary for codegen to see strlen.
#[inline]
fn strlen_rt(s: *const c_char) -> usize {
extern "C" {
/// Provided by libc or compiler_builtins.
Expand Down
4 changes: 2 additions & 2 deletions library/core/src/mem/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -413,7 +413,7 @@ pub const unsafe fn size_of_val_raw<T: ?Sized>(val: *const T) -> usize {
#[inline]
#[must_use]
#[stable(feature = "rust1", since = "1.0.0")]
#[deprecated(note = "use `align_of` instead", since = "1.2.0")]
#[deprecated(note = "use `align_of` instead", since = "1.2.0", suggestion = "align_of")]
pub fn min_align_of<T>() -> usize {
intrinsics::min_align_of::<T>()
}
Expand All @@ -436,7 +436,7 @@ pub fn min_align_of<T>() -> usize {
#[inline]
#[must_use]
#[stable(feature = "rust1", since = "1.0.0")]
#[deprecated(note = "use `align_of_val` instead", since = "1.2.0")]
#[deprecated(note = "use `align_of_val` instead", since = "1.2.0", suggestion = "align_of_val")]
pub fn min_align_of_val<T: ?Sized>(val: &T) -> usize {
// SAFETY: val is a reference, so it's a valid raw pointer
unsafe { intrinsics::min_align_of_val(val) }
Expand Down
2 changes: 1 addition & 1 deletion library/core/src/str/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -997,7 +997,7 @@ impl str {

/// An iterator over the lines of a string.
#[stable(feature = "rust1", since = "1.0.0")]
#[deprecated(since = "1.4.0", note = "use lines() instead now")]
#[deprecated(since = "1.4.0", note = "use lines() instead now", suggestion = "lines")]
#[inline]
#[allow(deprecated)]
pub fn lines_any(&self) -> LinesAny<'_> {
Expand Down
6 changes: 4 additions & 2 deletions library/std/src/collections/hash/map.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,14 @@ use crate::sys;
/// ```
///
/// In other words, if two keys are equal, their hashes must be equal.
/// Violating this property is a logic error.
///
/// It is a logic error for a key to be modified in such a way that the key's
/// It is also a logic error for a key to be modified in such a way that the key's
/// hash, as determined by the [`Hash`] trait, or its equality, as determined by
/// the [`Eq`] trait, changes while it is in the map. This is normally only
/// possible through [`Cell`], [`RefCell`], global state, I/O, or unsafe code.
/// The behavior resulting from such a logic error is not specified, but will
///
/// The behavior resulting from either logic error is not specified, but will
/// be encapsulated to the `HashMap` that observed the logic error and not
/// result in undefined behavior. This could include panics, incorrect results,
/// aborts, memory leaks, and non-termination.
Expand Down
7 changes: 4 additions & 3 deletions library/std/src/collections/hash/set.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,14 @@ use super::map::{map_try_reserve_error, RandomState};
/// ```
///
/// In other words, if two keys are equal, their hashes must be equal.
/// Violating this property is a logic error.
///
///
/// It is a logic error for a key to be modified in such a way that the key's
/// It is also a logic error for a key to be modified in such a way that the key's
/// hash, as determined by the [`Hash`] trait, or its equality, as determined by
/// the [`Eq`] trait, changes while it is in the map. This is normally only
/// possible through [`Cell`], [`RefCell`], global state, I/O, or unsafe code.
/// The behavior resulting from such a logic error is not specified, but will
///
/// The behavior resulting from either logic error is not specified, but will
/// be encapsulated to the `HashSet` that observed the logic error and not
/// result in undefined behavior. This could include panics, incorrect results,
/// aborts, memory leaks, and non-termination.
Expand Down
6 changes: 5 additions & 1 deletion library/std/src/os/unix/process.rs
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,11 @@ pub trait CommandExt: Sealed {
///
/// [`pre_exec`]: CommandExt::pre_exec
#[stable(feature = "process_exec", since = "1.15.0")]
#[deprecated(since = "1.37.0", note = "should be unsafe, use `pre_exec` instead")]
#[deprecated(
since = "1.37.0",
note = "should be unsafe, use `pre_exec` instead",
suggestion = "pre_exec"
)]
fn before_exec<F>(&mut self, f: F) -> &mut process::Command
where
F: FnMut() -> io::Result<()> + Send + Sync + 'static,
Expand Down
6 changes: 5 additions & 1 deletion library/std/src/sync/condvar.rs
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,11 @@ impl Condvar {
/// }
/// ```
#[stable(feature = "rust1", since = "1.0.0")]
#[deprecated(since = "1.6.0", note = "replaced by `std::sync::Condvar::wait_timeout`")]
#[deprecated(
since = "1.6.0",
note = "replaced by `std::sync::Condvar::wait_timeout`",
suggestion = "wait_timeout"
)]
pub fn wait_timeout_ms<'a, T>(
&self,
guard: MutexGuard<'a, T>,
Expand Down
8 changes: 6 additions & 2 deletions library/std/src/thread/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -825,7 +825,7 @@ pub fn panicking() -> bool {
/// thread::sleep_ms(2000);
/// ```
#[stable(feature = "rust1", since = "1.0.0")]
#[deprecated(since = "1.6.0", note = "replaced by `std::thread::sleep`")]
#[deprecated(since = "1.6.0", note = "replaced by `std::thread::sleep`", suggestion = "sleep")]
pub fn sleep_ms(ms: u32) {
sleep(Duration::from_millis(ms as u64))
}
Expand Down Expand Up @@ -1004,7 +1004,11 @@ pub fn park() {
///
/// See the [park documentation][`park`] for more detail.
#[stable(feature = "rust1", since = "1.0.0")]
#[deprecated(since = "1.6.0", note = "replaced by `std::thread::park_timeout`")]
#[deprecated(
since = "1.6.0",
note = "replaced by `std::thread::park_timeout`",
suggestion = "park_timeout"
)]
pub fn park_timeout_ms(ms: u32) {
park_timeout(Duration::from_millis(ms as u64))
}
Expand Down
1 change: 1 addition & 0 deletions tests/run-make/optimization-remarks-dir-pgo/Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# needs-profiler-support
# ignore-windows-gnu
# ignore-cross-compile

# FIXME(mati865): MinGW GCC miscompiles compiler-rt profiling library but with Clang it works
# properly. Since we only have GCC on the CI ignore the test for now.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,6 @@ fn main() {
let _foo = str::trim_start(" aoeu"); //~ ERROR use of deprecated method `core::str::<impl str>::trim_left`: superseded by `trim_start` [deprecated]

let _bar = " aoeu".trim_start(); //~ ERROR use of deprecated method `core::str::<impl str>::trim_left`: superseded by `trim_start` [deprecated]

let _baz = ["a", "b"].join(" "); //~ ERROR use of deprecated method `std::slice::<impl [T]>::connect`: renamed to join [deprecated]
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,6 @@ fn main() {
let _foo = str::trim_left(" aoeu"); //~ ERROR use of deprecated method `core::str::<impl str>::trim_left`: superseded by `trim_start` [deprecated]

let _bar = " aoeu".trim_left(); //~ ERROR use of deprecated method `core::str::<impl str>::trim_left`: superseded by `trim_start` [deprecated]

let _baz = ["a", "b"].connect(" "); //~ ERROR use of deprecated method `std::slice::<impl [T]>::connect`: renamed to join [deprecated]
}
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,16 @@ help: replace the use of the deprecated method
LL | let _bar = " aoeu".trim_start();
| ~~~~~~~~~~

error: aborting due to 2 previous errors
error: use of deprecated method `std::slice::<impl [T]>::connect`: renamed to join
--> $DIR/issue-84637-deprecated-associated-function.rs:10:27
|
LL | let _baz = ["a", "b"].connect(" ");
| ^^^^^^^
|
help: replace the use of the deprecated method
|
LL | let _baz = ["a", "b"].join(" ");
| ~~~~

error: aborting due to 3 previous errors

13 changes: 13 additions & 0 deletions tests/ui/inline-const/required-const.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
// build-fail
// compile-flags: -Zmir-opt-level=3
#![feature(inline_const)]

fn foo<T>() {
if false {
const { panic!() } //~ ERROR E0080
}
}

fn main() {
foo::<i32>();
}
11 changes: 11 additions & 0 deletions tests/ui/inline-const/required-const.stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
error[E0080]: evaluation of `foo::<i32>::{constant#0}` failed
--> $DIR/required-const.rs:7:17
|
LL | const { panic!() }
| ^^^^^^^^ the evaluated program panicked at 'explicit panic', $DIR/required-const.rs:7:17
|
= note: this error originates in the macro `$crate::panic::panic_2015` which comes from the expansion of the macro `panic` (in Nightly builds, run with -Z macro-backtrace for more info)

error: aborting due to previous error

For more information about this error, try `rustc --explain E0080`.
2 changes: 1 addition & 1 deletion triagebot.toml
Original file line number Diff line number Diff line change
Expand Up @@ -489,7 +489,7 @@ cc = ["@nnethercote"]
[assign]
warn_non_default_branch = true
contributing_url = "https://rustc-dev-guide.rust-lang.org/getting-started.html"
users_on_vacation = ["jyn514", "WaffleLapkin", "clubby789", "oli-obk"]
users_on_vacation = ["jyn514", "clubby789", "oli-obk"]

[assign.adhoc_groups]
compiler-team = [
Expand Down