Compare commits

...

43 Commits

Author SHA1 Message Date
rust-bors[bot]
f65cc8e92b
Auto merge of #139493 - Voultapher:explicitly-export-core-and-std-macros, r=<try>
Explicitly export core and std macros
2025-09-25 18:55:51 +00:00
bors
6f34f4ee07 Auto merge of #147019 - Zalathar:rollup-boxzbmo, r=Zalathar
Rollup of 14 pull requests

Successful merges:

 - rust-lang/rust#145067 (RawVecInner: add missing `unsafe` to unsafe fns)
 - rust-lang/rust#145277 (Do not materialise X in [X; 0] when X is unsizing a const)
 - rust-lang/rust#145973 (Add `std` support for `armv7a-vex-v5`)
 - rust-lang/rust#146667 (Add an attribute to check the number of lanes in a SIMD vector after monomorphization)
 - rust-lang/rust#146735 (unstably constify float mul_add methods)
 - rust-lang/rust#146737 (f16_f128: enable some more tests in Miri)
 - rust-lang/rust#146766 (Add attributes for #[global_allocator] functions)
 - rust-lang/rust#146905 (llvm: update remarks support on LLVM 22)
 - rust-lang/rust#146982 (Remove erroneous normalization step in `tests/run-make/linker-warning`)
 - rust-lang/rust#147005 (Small string formatting cleanup)
 - rust-lang/rust#147007 (Explicitly note `&[SocketAddr]` impl of `ToSocketAddrs`)
 - rust-lang/rust#147008 (bootstrap.py: Respect build.jobs while building bootstrap tool)
 - rust-lang/rust#147013 (rustdoc: Fix documentation for `--doctest-build-arg`)
 - rust-lang/rust#147015 (Use `LLVMDisposeTargetMachine`)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-09-25 14:03:21 +00:00
bors
7cfd7d328b Auto merge of #147003 - matthiaskrgr:rollup-b5z9uiz, r=matthiaskrgr
Rollup of 7 pull requests

Successful merges:

 - rust-lang/rust#146556 (Fix duration_since panic on unix when std is built with integer overflow checks)
 - rust-lang/rust#146679 (Clarify Display for error should not include source)
 - rust-lang/rust#146753 (Improve the pretty print of UnstableFeature clause)
 - rust-lang/rust#146894 (Improve derive suggestion of const param)
 - rust-lang/rust#146950 (core: simplify `CStr::default()`)
 - rust-lang/rust#146958 (Fix infinite recursion in Path::eq with String)
 - rust-lang/rust#146971 (fix ICE in writeback due to bound regions)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-09-25 10:30:50 +00:00
Matthias Krüger
57ee169ff2
Rollup merge of #146971 - lcnr:fix-writeback, r=BoxyUwU
fix ICE in writeback due to bound regions

fixes rust-lang/rust#117808

r? `@BoxyUwU`
2025-09-24 23:33:29 +02:00
Matthias Krüger
d10d6bfb02
Rollup merge of #146958 - el-ev:fix_path_string_eq_recurse, r=joboet
Fix infinite recursion in Path::eq with String

- Closes [after beta backport] rust-lang/rust#146940
2025-09-24 23:33:28 +02:00
Matthias Krüger
6618ac7bb1
Rollup merge of #146950 - joboet:cstr_default, r=tgross35
core: simplify `CStr::default()`

Just use a `CStr`-literal...
2025-09-24 23:33:27 +02:00
Matthias Krüger
6351a63486
Rollup merge of #146894 - tiif:suggest_feature_attr, r=BoxyUwU
Improve derive suggestion of const param

Make the suggestion not to remove the adt and use the name of the adt variant in the diagnostic.

r? `@BoxyUwU`
2025-09-24 23:33:27 +02:00
Matthias Krüger
7a4ac48345
Rollup merge of #146753 - tiif:unsatisfiable-unstable-feature, r=BoxyUwU
Improve the pretty print of UnstableFeature clause

As per https://github.com/rust-lang/rust/pull/145095#discussion_r2349439492, we could make the diagnostic for unsatisfiable ``UnstableFeature`` clause better.

r? `@BoxyUwU`
2025-09-24 23:33:26 +02:00
Matthias Krüger
0ab93860ed
Rollup merge of #146679 - stepancheg:error-display-source, r=dtolnay
Clarify Display for error should not include source

Fixes rust-lang/rust#145561.

r? `@Noratrieb`
2025-09-24 23:33:25 +02:00
Matthias Krüger
8073b6f169
Rollup merge of #146556 - stepancheg:repro-146228, r=tgross35
Fix duration_since panic on unix when std is built with integer overflow checks

Add a test for regression rust-lang/rust#146228, and turns out this test fails detects error when std is compiled with integer overflow checks.

Original regression was reverted in rust-lang/rust#146473.

First attempt to fix was in rust-lang/rust#146247; test and some code is copied from there, thanks `@eval-exec`

r? `@RalfJung`
2025-09-24 23:33:25 +02:00
Stepan Koltsov
92859e98ee Repro duration_since regression from issue 146228 2025-09-24 21:07:26 +01:00
Stepan Koltsov
a9554b4d5f Clarify Display for error should not include source 2025-09-24 20:02:35 +01:00
tiif
4e62715541 Improve the pretty print of UnstableFeature clause 2025-09-24 15:22:10 +00:00
Iris Shi
5a4e536036
Fix infinite recursion in Path::eq with String 2025-09-24 21:30:41 +08:00
tiif
30289353e8 Improve derive suggestion of const param
Make the suggestion not to remove the adt and use the name of the adt
variant
2025-09-24 13:29:23 +00:00
joboet
a875f7779e
alloc: simplify Default for Box<CStr> and Rc<CStr> 2025-09-24 14:13:34 +02:00
lcnr
2886ca496a imrpove type_op failure ICE 2025-09-24 13:08:25 +02:00
lcnr
32d24f9efa allow bound regions in writeback 2025-09-24 13:08:25 +02:00
joboet
aa537824c4
core: simplify CStr::default()
Just use a `CStr`-literal...
2025-09-24 00:50:36 +02:00
Lukas Bergdoll
df215cc120 Adjust println-type test to include prelude items
While this is undesired, blocking explicit macro export and
assert_matches for this bug that already exists in a smaller fashion was
deemed not worth it.

See https://github.com/rust-lang/rust/issues/145577 and
https://github.com/rust-lang/rust/pull/139493#issuecomment-3288311495
2025-09-18 15:40:31 +02:00
Lukas Bergdoll
291babd633 Remove no longer needed import 2025-09-18 15:40:06 +02:00
Lukas Bergdoll
ee92beb8c4 Bless input-stats UI test 2025-09-18 15:13:41 +02:00
Lukas Bergdoll
a107b63bdb Bless pretty test output changes 2025-09-18 15:00:29 +02:00
Lukas Bergdoll
20869c2f70 Fix deriving-all-codegen UI test
An incorrect merge conflict resolution had deleted a relevant new line.
2025-09-18 15:00:29 +02:00
Lukas Bergdoll
0bf1ef5aec Export new hash_map macro 2025-09-18 15:00:29 +02:00
Lukas Bergdoll
6379facf9e Appease clippy 2025-09-18 15:00:29 +02:00
Lukas Bergdoll
ea3bdcf7eb Fix alloctests again 2025-09-18 15:00:29 +02:00
Lukas Bergdoll
3618358dcd Bless UI tests 2025-09-18 15:00:28 +02:00
Lukas Bergdoll
2e87034850 Silence unproblematic warning 2025-09-18 14:59:21 +02:00
Lukas Bergdoll
4e669126b2 Adapt pretty tests expected outputs 2025-09-18 14:59:21 +02:00
Lukas Bergdoll
2ba82ac4d9 Fix rustdoc macro inlining issues
Missing `#[doc(no_inline)]` for ambiguous_macro_only_std resulted in new and broken doc html files.
2025-09-18 14:59:21 +02:00
Lukas Bergdoll
ff2018f81c Fix macro import in alloctests 2025-09-18 14:59:21 +02:00
Lukas Bergdoll
8ba902d972 Apply review comments 2025-09-18 14:59:21 +02:00
Lukas Bergdoll
dcd0350aaa Fix feature-gate-format_args_nl UI test 2025-09-18 14:59:21 +02:00
Lukas Bergdoll
01d2ee24f2 Update prelude macros 2025-09-18 14:59:21 +02:00
Lukas Bergdoll
8f55882536 Remove #[macro_use] std/core from tests 2025-09-18 14:59:21 +02:00
Lukas Bergdoll
f13adf3cc3 Explicitly use std panic over core panic 2025-09-18 14:59:21 +02:00
Lukas Bergdoll
fb8f8b0f15 Exclude panic and env namespaces from prelude 2025-09-18 14:59:21 +02:00
Lukas Bergdoll
788b94182b Explicitly import format_args_nl 2025-09-18 14:59:21 +02:00
Lukas Bergdoll
819cf49ced Special case vec macro 2025-09-18 14:59:21 +02:00
Lukas Bergdoll
62d369bee7 Fix formatting tidy issues 2025-09-18 14:59:21 +02:00
Lukas Bergdoll
87b0a80451 Apply review comments 2025-09-18 14:59:21 +02:00
Lukas Bergdoll
6ac6445aa1 Explicitly export core and std macros
Currently all core and std macros are automatically added to the prelude
via #[macro_use]. However a situation arose where we want to add a new macro
`assert_matches` but don't want to pull it into the standard prelude for
compatibility reasons. By explicitly exporting the macros found in the core and
std crates we get to decide on a per macro basis and can later add them via
the rust_20xx preludes.
2025-09-18 14:59:21 +02:00
94 changed files with 288 additions and 179 deletions

View File

@ -43,7 +43,7 @@ pub fn inject(
let item = cx.item(
span,
thin_vec![cx.attr_word(sym::macro_use, span)],
ast::AttrVec::new(),
ast::ItemKind::ExternCrate(None, Ident::new(name, ident_span)),
);

View File

@ -1003,8 +1003,10 @@ impl<'cx, 'tcx> TypeFolder<TyCtxt<'tcx>> for Resolver<'cx, 'tcx> {
}
fn fold_region(&mut self, r: ty::Region<'tcx>) -> ty::Region<'tcx> {
debug_assert!(!r.is_bound(), "Should not be resolving bound region.");
self.fcx.tcx.lifetimes.re_erased
match r.kind() {
ty::ReBound(..) => r,
_ => self.fcx.tcx.lifetimes.re_erased,
}
}
fn fold_ty(&mut self, ty: Ty<'tcx>) -> Ty<'tcx> {

View File

@ -3177,8 +3177,7 @@ define_print! {
write!(p, "` can be evaluated")?;
}
ty::ClauseKind::UnstableFeature(symbol) => {
write!(p, "unstable feature: ")?;
write!(p, "`{symbol}`")?;
write!(p, "feature({symbol}) is enabled")?;
}
}
}

View File

@ -1305,8 +1305,8 @@ impl<'a, 'tcx> TypeErrCtxt<'a, 'tcx> {
{
if ty.is_structural_eq_shallow(self.tcx) {
diag.span_suggestion(
span,
"add `#[derive(ConstParamTy)]` to the struct",
span.shrink_to_lo(),
format!("add `#[derive(ConstParamTy)]` to the {}", def.descr()),
"#[derive(ConstParamTy)]\n",
Applicability::MachineApplicable,
);
@ -1314,8 +1314,11 @@ impl<'a, 'tcx> TypeErrCtxt<'a, 'tcx> {
// FIXME(adt_const_params): We should check there's not already an
// overlapping `Eq`/`PartialEq` impl.
diag.span_suggestion(
span,
"add `#[derive(ConstParamTy, PartialEq, Eq)]` to the struct",
span.shrink_to_lo(),
format!(
"add `#[derive(ConstParamTy, PartialEq, Eq)]` to the {}",
def.descr()
),
"#[derive(ConstParamTy, PartialEq, Eq)]\n",
Applicability::MachineApplicable,
);

View File

@ -100,9 +100,9 @@ where
} else if let Err(guar) = infcx.tcx.check_potentially_region_dependent_goals(root_def_id) {
Err(guar)
} else {
Err(infcx
.dcx()
.delayed_bug(format!("errors selecting obligation during MIR typeck: {errors:?}")))
Err(infcx.dcx().delayed_bug(format!(
"errors selecting obligation during MIR typeck: {name} {root_def_id:?} {errors:?}"
)))
}
})?;

View File

@ -970,17 +970,14 @@ impl Default for Rc<CStr> {
/// This may or may not share an allocation with other Rcs on the same thread.
#[inline]
fn default() -> Self {
let rc = Rc::<[u8]>::from(*b"\0");
// `[u8]` has the same layout as `CStr`, and it is `NUL` terminated.
unsafe { Rc::from_raw(Rc::into_raw(rc) as *const CStr) }
Rc::from(c"")
}
}
#[stable(feature = "default_box_extra", since = "1.17.0")]
impl Default for Box<CStr> {
fn default() -> Box<CStr> {
let boxed: Box<[u8]> = Box::from([0]);
unsafe { Box::from_raw(Box::into_raw(boxed) as *mut CStr) }
Box::from(c"")
}
}

View File

@ -56,6 +56,7 @@
#![feature(negative_impls)]
#![feature(never_type)]
#![feature(optimize_attribute)]
#![feature(prelude_import)]
#![feature(rustc_allow_const_fn_unstable)]
#![feature(rustc_attrs)]
#![feature(staged_api)]
@ -65,11 +66,17 @@
// Allow testing this library
extern crate alloc as realalloc;
#[macro_use]
// This is needed to provide macros to the directly imported alloc modules below.
extern crate std;
#[prelude_import]
#[allow(unused_imports)]
use std::prelude::rust_2024::*;
#[cfg(test)]
extern crate test;
mod testing;
use realalloc::*;
// We are directly including collections, raw_vec, and wtf8 here as they use non-public
@ -93,8 +100,7 @@ pub(crate) mod test_helpers {
let mut hasher = std::hash::RandomState::new().build_hasher();
std::panic::Location::caller().hash(&mut hasher);
let hc64 = hasher.finish();
let seed_vec =
hc64.to_le_bytes().into_iter().chain(0u8..8).collect::<crate::vec::Vec<u8>>();
let seed_vec = hc64.to_le_bytes().into_iter().chain(0u8..8).collect::<std::vec::Vec<u8>>();
let seed: [u8; 16] = seed_vec.as_slice().try_into().unwrap();
rand::SeedableRng::from_seed(seed)
}

View File

@ -16,13 +16,19 @@ use crate::fmt::{self, Debug, Display, Formatter};
/// assert_eq!(err.to_string(), "invalid digit found in string");
/// ```
///
/// # Error source
///
/// Errors may provide cause information. [`Error::source()`] is generally
/// used when errors cross "abstraction boundaries". If one module must report
/// an error that is caused by an error from a lower-level module, it can allow
/// accessing that error via [`Error::source()`]. This makes it possible for the
/// accessing that error via `Error::source()`. This makes it possible for the
/// high-level module to provide its own errors while also revealing some of the
/// implementation for debugging.
///
/// In error types that wrap an underlying error, the underlying error
/// should be either returned by the outer error's `Error::source()`, or rendered
/// by the outer error's `Display` implementation, but not both.
///
/// # Example
///
/// Implementing the `Error` trait only requires that `Debug` and `Display` are implemented too.

View File

@ -179,9 +179,7 @@ impl fmt::Debug for CStr {
impl Default for &CStr {
#[inline]
fn default() -> Self {
const SLICE: &[c_char] = &[0];
// SAFETY: `SLICE` is indeed pointing to a valid nul-terminated string.
unsafe { CStr::from_ptr(SLICE.as_ptr()) }
c""
}
}

View File

@ -59,12 +59,29 @@ pub use crate::hash::macros::Hash;
#[stable(feature = "builtin_macro_prelude", since = "1.38.0")]
#[doc(no_inline)]
#[allow(deprecated)]
pub use crate::{
assert, cfg, column, compile_error, concat, env, file, format_args,
format_args_nl, include, include_bytes, include_str, line, log_syntax, module_path, option_env,
stringify, trace_macros,
assert, assert_eq, assert_ne, cfg, column, compile_error, concat, debug_assert, debug_assert_eq, debug_assert_ne, file, format_args, include, include_bytes, include_str, line, matches, module_path, option_env, stringify, todo, r#try, unimplemented, unreachable, write, writeln,
};
// These macros needs special handling, so that we don't export it *and* the modules of the same
// name. We only want the macro in the prelude.
mod ambiguous_macro_only {
#[allow(hidden_glob_reexports)]
mod env {}
#[allow(hidden_glob_reexports)]
mod panic {}
#[stable(feature = "builtin_macro_prelude", since = "1.38.0")]
pub use crate::*;
}
#[stable(feature = "builtin_macro_prelude", since = "1.38.0")]
#[doc(no_inline)]
pub use self::ambiguous_macro_only::{env, panic};
#[unstable(feature = "cfg_select", issue = "115585")]
#[doc(no_inline)]
pub use crate::cfg_select;
#[unstable(
feature = "concat_bytes",
issue = "87555",
@ -73,6 +90,30 @@ pub use crate::{
#[doc(no_inline)]
pub use crate::concat_bytes;
#[unstable(feature = "const_format_args", issue = "none")]
#[doc(no_inline)]
pub use crate::const_format_args;
#[unstable(
feature = "log_syntax",
issue = "29598",
reason = "`log_syntax!` is not stable enough for use and is subject to change"
)]
#[doc(no_inline)]
pub use crate::log_syntax;
#[unstable(feature = "pattern_type_macro", issue = "123646")]
#[doc(no_inline)]
pub use crate::pattern_type;
#[unstable(
feature = "trace_macros",
issue = "29598",
reason = "`trace_macros` is not stable enough for use and is subject to change"
)]
#[doc(no_inline)]
pub use crate::trace_macros;
// Do not `doc(no_inline)` so that they become doc items on their own
// (no public module for them to be re-exported from).
#[stable(feature = "builtin_macro_prelude", since = "1.38.0")]

View File

@ -11,9 +11,12 @@
use std::cell::RefCell;
use std::num::NonZero;
use std::str;
use std::{fmt, str};
use super::*;
// Explicit import to avoid macro namespace collision.
use super::{
DecodeMut, Encode, Mark, Marked, Reader, Unmark, Writer, arena, client, fxhash, server,
};
/// Handle for a symbol string stored within the Interner.
#[derive(Copy, Clone, PartialEq, Eq, Hash)]

View File

@ -2107,7 +2107,7 @@ impl PartialEq for PathBuf {
impl cmp::PartialEq<str> for PathBuf {
#[inline]
fn eq(&self, other: &str) -> bool {
Path::eq(self, other)
self.as_path() == other
}
}
@ -2115,7 +2115,7 @@ impl cmp::PartialEq<str> for PathBuf {
impl cmp::PartialEq<PathBuf> for str {
#[inline]
fn eq(&self, other: &PathBuf) -> bool {
other == self
self == other.as_path()
}
}
@ -2123,7 +2123,7 @@ impl cmp::PartialEq<PathBuf> for str {
impl cmp::PartialEq<String> for PathBuf {
#[inline]
fn eq(&self, other: &String) -> bool {
**self == **other
self.as_path() == other.as_str()
}
}
@ -2131,7 +2131,7 @@ impl cmp::PartialEq<String> for PathBuf {
impl cmp::PartialEq<PathBuf> for String {
#[inline]
fn eq(&self, other: &PathBuf) -> bool {
other == self
self.as_str() == other.as_path()
}
}
@ -3426,7 +3426,7 @@ impl cmp::PartialEq<Path> for str {
impl cmp::PartialEq<String> for Path {
#[inline]
fn eq(&self, other: &String) -> bool {
self == &*other
self == other.as_str()
}
}
@ -3434,7 +3434,7 @@ impl cmp::PartialEq<String> for Path {
impl cmp::PartialEq<Path> for String {
#[inline]
fn eq(&self, other: &Path) -> bool {
other == self
self.as_str() == other
}
}

View File

@ -145,6 +145,11 @@ pub mod rust_2021 {
#[stable(feature = "prelude_2021", since = "1.55.0")]
#[doc(no_inline)]
pub use core::prelude::rust_2021::*;
// There are two different panic macros, one in `core` and one in `std`. They are slightly
// different. For `std` we explicitly want the one defined in `std`.
#[stable(feature = "prelude_2021", since = "1.55.0")]
pub use super::v1::panic;
}
/// The 2024 version of the prelude of The Rust Standard Library.
@ -159,6 +164,11 @@ pub mod rust_2024 {
#[stable(feature = "prelude_2024", since = "1.85.0")]
#[doc(no_inline)]
pub use core::prelude::rust_2024::*;
// There are two different panic macros, one in `core` and one in `std`. They are slightly
// different. For `std` we explicitly want the one defined in `std`.
#[stable(feature = "prelude_2024", since = "1.85.0")]
pub use super::v1::panic;
}
/// The Future version of the prelude of The Rust Standard Library.
@ -174,4 +184,9 @@ pub mod rust_future {
#[unstable(feature = "prelude_next", issue = "none")]
#[doc(no_inline)]
pub use core::prelude::rust_future::*;
// There are two different panic macros, one in `core` and one in `std`. They are slightly
// different. For `std` we explicitly want the one defined in `std`.
#[unstable(feature = "prelude_next", issue = "none")]
pub use super::v1::panic;
}

View File

@ -43,15 +43,44 @@ pub use crate::option::Option::{self, None, Some};
#[doc(no_inline)]
pub use crate::result::Result::{self, Err, Ok};
// Re-exported built-in macros
// Re-exported built-in macros and traits
#[stable(feature = "builtin_macro_prelude", since = "1.38.0")]
#[doc(no_inline)]
#[allow(deprecated)]
pub use core::prelude::v1::{
assert, cfg, column, compile_error, concat, env, file, format_args,
format_args_nl, include, include_bytes, include_str, line, log_syntax, module_path, option_env,
stringify, trace_macros, Clone, Copy, Debug, Default, Eq, Hash, Ord, PartialEq, PartialOrd,
assert, assert_eq, assert_ne, cfg, column, compile_error, concat, debug_assert, debug_assert_eq, debug_assert_ne, env, file, format_args, include, include_bytes, include_str, line, matches,
module_path, option_env, stringify, todo, r#try, unimplemented, unreachable, write,
writeln, Clone, Copy, Debug, Default, Eq, Hash, Ord, PartialEq, PartialOrd,
};
#[stable(feature = "builtin_macro_prelude", since = "1.38.0")]
#[doc(no_inline)]
pub use crate::{
dbg, eprint, eprintln, format, is_x86_feature_detected, print, println, thread_local, hash_map
};
// These macros needs special handling, so that we don't export it *and* the modules of the same
// name. We only want the macro in the prelude.
mod ambiguous_macro_only_std {
#[allow(hidden_glob_reexports)]
mod vec {}
#[allow(hidden_glob_reexports)]
mod panic {}
// Building std without the allow exported_private_dependencies will create warnings, but then
// clippy claims its a useless_attribute. So silence both.
#[allow(clippy::useless_attribute)]
#[allow(exported_private_dependencies)]
#[stable(feature = "builtin_macro_prelude", since = "1.38.0")]
pub use crate::*;
}
#[stable(feature = "builtin_macro_prelude", since = "1.38.0")]
#[doc(no_inline)]
pub use self::ambiguous_macro_only_std::{vec, panic};
#[unstable(feature = "cfg_select", issue = "115585")]
#[doc(no_inline)]
pub use core::prelude::v1::cfg_select;
#[unstable(
feature = "concat_bytes",
issue = "87555",
@ -60,6 +89,26 @@ pub use core::prelude::v1::{
#[doc(no_inline)]
pub use core::prelude::v1::concat_bytes;
#[unstable(feature = "const_format_args", issue = "none")]
#[doc(no_inline)]
pub use core::prelude::v1::const_format_args;
#[unstable(
feature = "log_syntax",
issue = "29598",
reason = "`log_syntax!` is not stable enough for use and is subject to change"
)]
#[doc(no_inline)]
pub use core::prelude::v1::log_syntax;
#[unstable(
feature = "trace_macros",
issue = "29598",
reason = "`trace_macros` is not stable enough for use and is subject to change"
)]
#[doc(no_inline)]
pub use core::prelude::v1::trace_macros;
// Do not `doc(no_inline)` so that they become doc items on their own
// (no public module for them to be re-exported from).
#[stable(feature = "builtin_macro_prelude", since = "1.38.0")]

View File

@ -169,7 +169,7 @@ use crate::path::Path;
use crate::sys::pipe::{AnonPipe, read2};
use crate::sys::process as imp;
use crate::sys_common::{AsInner, AsInnerMut, FromInner, IntoInner};
use crate::{fmt, fs, str};
use crate::{fmt, format_args_nl, fs, str};
/// Representation of a running or exited child process.
///

View File

@ -26,15 +26,22 @@ impl Timespec {
}
fn sub_timespec(&self, other: &Timespec) -> Result<Duration, Duration> {
fn sub_ge_to_unsigned(a: i64, b: i64) -> u64 {
debug_assert!(a >= b);
a.wrapping_sub(b).cast_unsigned()
}
if self >= other {
// Logic here is identical to Unix version of `Timestamp::sub_timespec`,
// check comments there why operations do not overflow.
Ok(if self.t.tv_nsec >= other.t.tv_nsec {
Duration::new(
(self.t.tv_sec - other.t.tv_sec) as u64,
sub_ge_to_unsigned(self.t.tv_sec, other.t.tv_sec),
(self.t.tv_nsec - other.t.tv_nsec) as u32,
)
} else {
Duration::new(
(self.t.tv_sec - 1 - other.t.tv_sec) as u64,
sub_ge_to_unsigned(self.t.tv_sec - 1, other.t.tv_sec),
(self.t.tv_nsec + NSEC_PER_SEC - other.t.tv_nsec) as u32,
)
})

View File

@ -134,28 +134,25 @@ impl Timespec {
}
pub fn sub_timespec(&self, other: &Timespec) -> Result<Duration, Duration> {
// When a >= b, the difference fits in u64.
fn sub_ge_to_unsigned(a: i64, b: i64) -> u64 {
debug_assert!(a >= b);
a.wrapping_sub(b).cast_unsigned()
}
if self >= other {
// NOTE(eddyb) two aspects of this `if`-`else` are required for LLVM
// to optimize it into a branchless form (see also #75545):
//
// 1. `self.tv_sec - other.tv_sec` shows up as a common expression
// in both branches, i.e. the `else` must have its `- 1`
// subtraction after the common one, not interleaved with it
// (it used to be `self.tv_sec - 1 - other.tv_sec`)
//
// 2. the `Duration::new` call (or any other additional complexity)
// is outside of the `if`-`else`, not duplicated in both branches
//
// Ideally this code could be rearranged such that it more
// directly expresses the lower-cost behavior we want from it.
let (secs, nsec) = if self.tv_nsec.as_inner() >= other.tv_nsec.as_inner() {
(
(self.tv_sec - other.tv_sec) as u64,
sub_ge_to_unsigned(self.tv_sec, other.tv_sec),
self.tv_nsec.as_inner() - other.tv_nsec.as_inner(),
)
} else {
// Following sequence of assertions explain why `self.tv_sec - 1` does not underflow.
debug_assert!(self.tv_nsec < other.tv_nsec);
debug_assert!(self.tv_sec > other.tv_sec);
debug_assert!(self.tv_sec > i64::MIN);
(
(self.tv_sec - other.tv_sec - 1) as u64,
sub_ge_to_unsigned(self.tv_sec - 1, other.tv_sec),
self.tv_nsec.as_inner() + (NSEC_PER_SEC as u32) - other.tv_nsec.as_inner(),
)
};

View File

@ -2528,7 +2528,17 @@ fn normalize_lexically() {
}
#[test]
/// See issue#146183
fn compare_path_to_str() {
assert!(&PathBuf::from("x") == "x");
/// See issue#146183 and issue#146940
fn compare_path_like_to_str_like() {
let path_buf = PathBuf::from("x");
let path = Path::new("x");
let s = String::from("x");
assert!(path == "x");
assert!("x" == path);
assert!(path == &s);
assert!(&s == path);
assert!(&path_buf == "x");
assert!("x" == &path_buf);
assert!(path_buf == s);
assert!(s == path_buf);
}

View File

@ -227,3 +227,19 @@ fn big_math() {
check(instant.checked_add(Duration::from_secs(100)), Instant::checked_sub);
check(instant.checked_add(Duration::from_secs(i64::MAX as _)), Instant::checked_sub);
}
#[test]
#[cfg(unix)]
fn system_time_duration_since_max_range_on_unix() {
// Repro regression https://github.com/rust-lang/rust/issues/146228
// Min and max values of `SystemTime` on Unix.
let min = SystemTime::UNIX_EPOCH - (Duration::new(i64::MAX as u64 + 1, 0));
let max = SystemTime::UNIX_EPOCH + (Duration::new(i64::MAX as u64, 999_999_999));
let delta_a = max.duration_since(min).expect("duration_since overflow");
let delta_b = min.duration_since(max).expect_err("duration_since overflow").duration();
assert_eq!(Duration::MAX, delta_a);
assert_eq!(Duration::MAX, delta_b);
}

View File

@ -1,27 +0,0 @@
//@ known-bug: #117808
//@ edition:2021
//@ needs-rustc-debug-assertions
use std::future::Future;
fn hrc<R, F: for<'a> AsyncClosure<'a, (), R>>(f: F) -> F {
f
}
fn main() {
hrc(|x| async {});
}
trait AsyncClosure<'a, I, R>
where
I: 'a,
{
}
impl<'a, I, R, Fut, F> AsyncClosure<'a, I, R> for F
where
I: 'a,
F: Fn(&'a I) -> Fut,
Fut: Future<Output = R> + Send + 'a,
{
}

View File

@ -1,6 +1,5 @@
#![feature(prelude_import)]
#![no_std]
#[macro_use]
extern crate std;
#[prelude_import]
use ::std::prelude::rust_2015::*;

View File

@ -3,7 +3,8 @@
//@ needs-enzyme
#![feature(autodiff)]
#[macro_use]
#[prelude_import]
use ::std::prelude::rust_2015::*;
extern crate std;
#[prelude_import]
use ::std::prelude::rust_2015::*;

View File

@ -3,7 +3,8 @@
//@ needs-enzyme
#![feature(autodiff)]
#[macro_use]
#[prelude_import]
use ::std::prelude::rust_2015::*;
extern crate std;
#[prelude_import]
use ::std::prelude::rust_2015::*;

View File

@ -3,7 +3,8 @@
//@ needs-enzyme
#![feature(autodiff)]
#[macro_use]
#[prelude_import]
use ::std::prelude::rust_2015::*;
extern crate std;
#[prelude_import]
use ::std::prelude::rust_2015::*;

View File

@ -1,6 +1,5 @@
#![feature(prelude_import)]
#![no_std]
#[macro_use]
extern crate std;
#[prelude_import]
use ::std::prelude::rust_2015::*;

View File

@ -1,6 +1,5 @@
#![feature(prelude_import)]
#![no_std]
#[macro_use]
extern crate std;
#[prelude_import]
use ::std::prelude::rust_2015::*;

View File

@ -1,6 +1,5 @@
#![feature(prelude_import)]
#![no_std]
#[macro_use]
extern crate std;
#[prelude_import]
use ::std::prelude::rust_2015::*;

View File

@ -1,6 +1,5 @@
#![feature(prelude_import)]
#![no_std]
#[macro_use]
extern crate std;
#[prelude_import]
use ::std::prelude::rust_2015::*;

View File

@ -4,7 +4,6 @@
#![allow(incomplete_features)]
#![feature(fn_delegation)]
#[attr = MacroUse {arguments: UseAll}]
extern crate std;
#[prelude_import]
use ::std::prelude::rust_2015::*;

View File

@ -1,4 +1,3 @@
#[attr = MacroUse {arguments: UseAll}]
extern crate std;
#[prelude_import]
use ::std::prelude::rust_2015::*;

View File

@ -3,7 +3,6 @@
//@ pp-exact:hir-fn-variadic.pp
#![feature(c_variadic)]
#[attr = MacroUse {arguments: UseAll}]
extern crate std;
#[prelude_import]
use ::std::prelude::rust_2015::*;

View File

@ -1,4 +1,3 @@
#[attr = MacroUse {arguments: UseAll}]
extern crate std;
#[prelude_import]
use ::std::prelude::rust_2015::*;

View File

@ -5,7 +5,6 @@
// This tests the pretty-printing of lifetimes in lots of ways.
#![allow(unused)]
#[attr = MacroUse {arguments: UseAll}]
extern crate std;
#[prelude_import]
use ::std::prelude::rust_2015::*;

View File

@ -1,4 +1,3 @@
#[attr = MacroUse {arguments: UseAll}]
extern crate std;
#[prelude_import]
use ::std::prelude::rust_2015::*;

View File

@ -1,4 +1,3 @@
#[attr = MacroUse {arguments: UseAll}]
extern crate std;
#[prelude_import]
use ::std::prelude::rust_2015::*;

View File

@ -1,4 +1,3 @@
#[attr = MacroUse {arguments: UseAll}]
extern crate std;
#[prelude_import]
use ::std::prelude::rust_2015::*;

View File

@ -1,6 +1,5 @@
#![feature(prelude_import)]
#![no_std]
#[macro_use]
extern crate std;
#[prelude_import]
use ::std::prelude::rust_2015::*;

View File

@ -1,6 +1,5 @@
#![feature(prelude_import)]
#![no_std]
#[macro_use]
extern crate std;
#[prelude_import]
use ::std::prelude::rust_2015::*;

View File

@ -1,4 +1,3 @@
#[attr = MacroUse {arguments: UseAll}]
extern crate std;
#[prelude_import]
use ::std::prelude::rust_2015::*;

View File

@ -1,4 +1,3 @@
#[attr = MacroUse {arguments: UseAll}]
extern crate std;
#[prelude_import]
use ::std::prelude::rust_2015::*;

View File

@ -7,7 +7,6 @@
#![allow(incomplete_features)]
#![feature(never_patterns)]
#![feature(never_type)]
#[macro_use]
extern crate std;
#[prelude_import]
use ::std::prelude::rust_2015::*;

View File

@ -4,7 +4,6 @@
#![feature(pin_ergonomics)]
#![allow(dead_code, incomplete_features)]
#[attr = MacroUse {arguments: UseAll}]
extern crate std;
#[prelude_import]
use ::std::prelude::rust_2015::*;

View File

@ -1,7 +1,6 @@
#![feature(prelude_import)]
#![no_std]
#![feature(postfix_match)]
#[macro_use]
extern crate std;
#[prelude_import]
use ::std::prelude::rust_2015::*;

View File

@ -1,7 +1,6 @@
#!/usr/bin/env rust
#![feature(prelude_import)]
#![no_std]
#[macro_use]
extern crate std;
#[prelude_import]
use ::std::prelude::rust_2015::*;

View File

@ -1,6 +1,5 @@
#![feature(prelude_import)]
#![no_std]
#[macro_use]
extern crate std;
#[prelude_import]
use ::std::prelude::rust_2015::*;

View File

@ -6,7 +6,10 @@ const EXPECTED = {
'query': 'prinltn',
'others': [
{ 'path': 'std', 'name': 'println' },
{ 'path': 'std::prelude::v1', 'name': 'println' },
{ 'path': 'std', 'name': 'print' },
{ 'path': 'std::prelude::v1', 'name': 'print' },
{ 'path': 'std', 'name': 'eprintln' },
{ 'path': 'std::prelude::v1', 'name': 'eprintln' },
],
};

View File

@ -1,6 +1,5 @@
#![feature(prelude_import)]
#![no_std]
#[macro_use]
extern crate std;
#[prelude_import]
use ::std::prelude::rust_2015::*;

View File

@ -1,5 +1,4 @@
#![feature(prelude_import)]
#[macro_use]
extern crate std;
#[prelude_import]
use std::prelude::rust_2021::*;

View File

@ -1,6 +1,5 @@
#![feature(prelude_import)]
#![no_std]
#[macro_use]
extern crate std;
#[prelude_import]
use ::std::prelude::rust_2015::*;

View File

@ -7,7 +7,7 @@ LL |
LL | struct A([u8]);
| ---- this field does not implement `ConstParamTy_`
|
note: the `ConstParamTy_` impl for `[u8]` requires that `unstable feature: `unsized_const_params``
note: the `ConstParamTy_` impl for `[u8]` requires that `feature(unsized_const_params) is enabled`
--> $DIR/unsized_field-1.rs:10:10
|
LL | struct A([u8]);
@ -22,7 +22,7 @@ LL |
LL | struct B(&'static [u8]);
| ------------- this field does not implement `ConstParamTy_`
|
note: the `ConstParamTy_` impl for `&'static [u8]` requires that `unstable feature: `unsized_const_params``
note: the `ConstParamTy_` impl for `&'static [u8]` requires that `feature(unsized_const_params) is enabled`
--> $DIR/unsized_field-1.rs:14:10
|
LL | struct B(&'static [u8]);
@ -37,7 +37,7 @@ LL |
LL | struct D(unsized_const_param::GenericNotUnsizedParam<&'static [u8]>);
| ---------------------------------------------------------- this field does not implement `ConstParamTy_`
|
note: the `ConstParamTy_` impl for `GenericNotUnsizedParam<&'static [u8]>` requires that `unstable feature: `unsized_const_params``
note: the `ConstParamTy_` impl for `GenericNotUnsizedParam<&'static [u8]>` requires that `feature(unsized_const_params) is enabled`
--> $DIR/unsized_field-1.rs:21:10
|
LL | struct D(unsized_const_param::GenericNotUnsizedParam<&'static [u8]>);

View File

@ -6,7 +6,6 @@
//@ edition: 2015
#![crate_type = "lib"]
#[macro_use]
extern crate std;
#[prelude_import]
use ::std::prelude::rust_2015::*;

View File

@ -6,8 +6,8 @@ LL | struct D<const X: C>;
|
help: add `#[derive(ConstParamTy, PartialEq, Eq)]` to the struct
|
LL - struct C;
LL + #[derive(ConstParamTy, PartialEq, Eq)]
LL | struct C;
|
error: aborting due to 1 previous error

View File

@ -4,10 +4,10 @@ error[E0741]: `Nat` must implement `ConstParamTy` to be used as the type of a co
LL | fn foo<const N: Nat>() {}
| ^^^
|
help: add `#[derive(ConstParamTy)]` to the struct
help: add `#[derive(ConstParamTy)]` to the enum
|
LL - enum Nat {
LL + #[derive(ConstParamTy)]
LL | enum Nat {
|
error: aborting due to 1 previous error

View File

@ -4,10 +4,10 @@ error[E0741]: `Bar` must implement `ConstParamTy` to be used as the type of a co
LL | fn test<const BAR: Bar>() {}
| ^^^
|
help: add `#[derive(ConstParamTy)]` to the struct
help: add `#[derive(ConstParamTy)]` to the enum
|
LL - enum Bar {
LL + #[derive(ConstParamTy)]
LL | enum Bar {
|
error: aborting due to 1 previous error

View File

@ -15,8 +15,8 @@ LL | struct Foo<const T: CompileTimeSettings>;
|
help: add `#[derive(ConstParamTy)]` to the struct
|
LL - struct CompileTimeSettings {
LL + #[derive(ConstParamTy)]
LL | struct CompileTimeSettings {
|
error[E0741]: `CompileTimeSettings` must implement `ConstParamTy` to be used as the type of a const generic parameter
@ -27,8 +27,8 @@ LL | impl<const T: CompileTimeSettings> Foo<T> {
|
help: add `#[derive(ConstParamTy)]` to the struct
|
LL - struct CompileTimeSettings {
LL + #[derive(ConstParamTy)]
LL | struct CompileTimeSettings {
|
error: aborting due to 2 previous errors; 1 warning emitted

View File

@ -6,7 +6,6 @@
//@ edition:2015
#![feature(derive_coerce_pointee)]
#[macro_use]
extern crate std;
#[prelude_import]
use ::std::prelude::rust_2015::*;

View File

@ -18,7 +18,6 @@
#![allow(dead_code)]
#![allow(deprecated)]
#![feature(derive_from)]
#[macro_use]
extern crate std;
#[prelude_import]
use std::prelude::rust_2021::*;

View File

@ -4,7 +4,6 @@
//@ compile-flags: -Zunpretty=expanded
//@ edition: 2015
#![feature(derive_coerce_pointee)]
#[macro_use]
extern crate std;
#[prelude_import]
use ::std::prelude::rust_2015::*;

View File

@ -12,7 +12,6 @@
//@ edition: 2015
#![feature(derive_coerce_pointee)]
#[macro_use]
extern crate std;
#[prelude_import]
use ::std::prelude::rust_2015::*;

View File

@ -1,3 +1,5 @@
use std::format_args_nl; //~ ERROR `format_args_nl` is only for internal language use
fn main() {
format_args_nl!(""); //~ ERROR `format_args_nl` is only for internal language use
}

View File

@ -1,5 +1,5 @@
error[E0658]: use of unstable library feature `format_args_nl`: `format_args_nl` is only for internal language use and is subject to change
--> $DIR/feature-gate-format_args_nl.rs:2:5
--> $DIR/feature-gate-format_args_nl.rs:4:5
|
LL | format_args_nl!("");
| ^^^^^^^^^^^^^^
@ -7,6 +7,15 @@ LL | format_args_nl!("");
= help: add `#![feature(format_args_nl)]` to the crate attributes to enable
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
error: aborting due to 1 previous error
error[E0658]: use of unstable library feature `format_args_nl`: `format_args_nl` is only for internal language use and is subject to change
--> $DIR/feature-gate-format_args_nl.rs:1:5
|
LL | use std::format_args_nl;
| ^^^^^^^^^^^^^^^^^^^
|
= help: add `#![feature(format_args_nl)]` to the crate attributes to enable
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
error: aborting due to 2 previous errors
For more information about this error, try `rustc --explain E0658`.

View File

@ -3,6 +3,8 @@
#![allow(non_upper_case_globals)]
#![feature(format_args_nl)]
use std::format_args_nl;
static arg0: () = ();
fn main() {

View File

@ -5,14 +5,15 @@ LL | let x = env!("PATH");
| ^^^ ambiguous name
|
= note: ambiguous because of a conflict between a name from a glob import and an outer scope during import or macro resolution
= note: `env` could refer to a macro from prelude
note: `env` could also refer to the macro imported here
note: `env` could refer to the macro imported here
--> $DIR/glob-shadowing.rs:9:9
|
LL | use crate::m::*;
| ^^^^^^^^^^^
= help: consider adding an explicit import of `env` to disambiguate
= help: or use `self::env` to refer to this macro unambiguously
note: `env` could also refer to a macro from prelude
--> $SRC_DIR/std/src/prelude/mod.rs:LL:COL
error[E0659]: `env` is ambiguous
--> $DIR/glob-shadowing.rs:19:21
@ -21,13 +22,14 @@ LL | let x = env!("PATH");
| ^^^ ambiguous name
|
= note: ambiguous because of a conflict between a name from a glob import and an outer scope during import or macro resolution
= note: `env` could refer to a macro from prelude
note: `env` could also refer to the macro imported here
note: `env` could refer to the macro imported here
--> $DIR/glob-shadowing.rs:17:13
|
LL | use crate::m::*;
| ^^^^^^^^^^^
= help: consider adding an explicit import of `env` to disambiguate
note: `env` could also refer to a macro from prelude
--> $SRC_DIR/std/src/prelude/mod.rs:LL:COL
error[E0659]: `fenv` is ambiguous
--> $DIR/glob-shadowing.rs:29:21

View File

@ -30,8 +30,7 @@ LL | panic!();
| ^^^^^ ambiguous name
|
= note: ambiguous because of a conflict between a macro-expanded name and a less macro-expanded name from outer scope during import or macro resolution
= note: `panic` could refer to a macro from prelude
note: `panic` could also refer to the macro defined here
note: `panic` could refer to the macro defined here
--> $DIR/local-modularized-tricky-fail-1.rs:12:5
|
LL | / macro_rules! panic {
@ -42,6 +41,8 @@ LL | | }
LL | define_panic!();
| --------------- in this macro invocation
= help: use `crate::panic` to refer to this macro unambiguously
note: `panic` could also refer to a macro from prelude
--> $SRC_DIR/std/src/prelude/mod.rs:LL:COL
= note: this error originates in the macro `define_panic` (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0659]: `include` is ambiguous
@ -51,8 +52,7 @@ LL | include!();
| ^^^^^^^ ambiguous name
|
= note: ambiguous because of a conflict between a macro-expanded name and a less macro-expanded name from outer scope during import or macro resolution
= note: `include` could refer to a macro from prelude
note: `include` could also refer to the macro defined here
note: `include` could refer to the macro defined here
--> $DIR/local-modularized-tricky-fail-1.rs:18:5
|
LL | / macro_rules! include {
@ -63,6 +63,8 @@ LL | | }
LL | define_include!();
| ----------------- in this macro invocation
= help: use `crate::include` to refer to this macro unambiguously
note: `include` could also refer to a macro from prelude
--> $SRC_DIR/std/src/prelude/mod.rs:LL:COL
= note: this error originates in the macro `define_include` (in Nightly builds, run with -Z macro-backtrace for more info)
error: aborting due to 3 previous errors

View File

@ -5,14 +5,15 @@ LL | fn f() { panic!(); }
| ^^^^^ ambiguous name
|
= note: ambiguous because of a conflict between a name from a glob import and an outer scope during import or macro resolution
= note: `panic` could refer to a macro from prelude
note: `panic` could also refer to the macro imported here
note: `panic` could refer to the macro imported here
--> $DIR/shadow_builtin_macros.rs:14:9
|
LL | use crate::foo::*;
| ^^^^^^^^^^^^^
= help: consider adding an explicit import of `panic` to disambiguate
= help: or use `self::panic` to refer to this macro unambiguously
note: `panic` could also refer to a macro from prelude
--> $SRC_DIR/std/src/prelude/mod.rs:LL:COL
error[E0659]: `panic` is ambiguous
--> $DIR/shadow_builtin_macros.rs:33:5
@ -21,8 +22,7 @@ LL | panic!();
| ^^^^^ ambiguous name
|
= note: ambiguous because of a conflict between a macro-expanded name and a less macro-expanded name from outer scope during import or macro resolution
= note: `panic` could refer to a macro from prelude
note: `panic` could also refer to the macro defined here
note: `panic` could refer to the macro defined here
--> $DIR/shadow_builtin_macros.rs:30:9
|
LL | macro_rules! panic { () => {} }
@ -30,6 +30,8 @@ LL | macro_rules! panic { () => {} }
LL | } }
LL | m!();
| ---- in this macro invocation
note: `panic` could also refer to a macro from prelude
--> $SRC_DIR/std/src/prelude/mod.rs:LL:COL
= note: this error originates in the macro `m` (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0659]: `n` is ambiguous
@ -59,13 +61,14 @@ LL | fn f() { panic!(); }
| ^^^^^ ambiguous name
|
= note: ambiguous because of a conflict between a macro-expanded name and a less macro-expanded name from outer scope during import or macro resolution
= note: `panic` could refer to a macro from prelude
note: `panic` could also refer to the macro imported here
note: `panic` could refer to the macro imported here
--> $DIR/shadow_builtin_macros.rs:19:26
|
LL | ::two_macros::m!(use crate::foo::panic;);
| ^^^^^^^^^^^^^^^^^
= help: use `self::panic` to refer to this macro unambiguously
note: `panic` could also refer to a macro from prelude
--> $SRC_DIR/std/src/prelude/mod.rs:LL:COL
error: aborting due to 4 previous errors

View File

@ -1,7 +1,6 @@
#![deny(dead_code)]
#![allow(unreachable_code)]
#[macro_use]
extern crate core;
fn foo() { //~ ERROR function `foo` is never used

View File

@ -1,5 +1,5 @@
error: function `foo` is never used
--> $DIR/with-core-crate.rs:7:4
--> $DIR/with-core-crate.rs:6:4
|
LL | fn foo() {
| ^^^

View File

@ -1,6 +1,5 @@
#![feature(prelude_import)]
#![no_std]
#[macro_use]
extern crate std;
#[prelude_import]
use ::std::prelude::rust_2015::*;

View File

@ -1,4 +1,3 @@
#[attr = MacroUse {arguments: UseAll}]
extern crate std;
#[prelude_import]
use ::std::prelude::rust_2015::*;

View File

@ -5,7 +5,6 @@
//@ edition: 2015
#![feature(core_intrinsics, generic_assert)]
#[macro_use]
extern crate std;
#[prelude_import]
use ::std::prelude::rust_2015::*;

View File

@ -1,4 +1,3 @@
#[attr = MacroUse {arguments: UseAll}]
extern crate std;
#[prelude_import]
use ::std::prelude::rust_2015::*;

View File

@ -16,7 +16,6 @@ Respanned: TokenStream [Ident { ident: "$crate", span: $DIR/auxiliary/make-macro
// in the stdout
#![no_std /* 0#0 */]
#[macro_use /* 0#1 */]
extern crate core /* 0#1 */;
#[prelude_import /* 0#1 */]
use core /* 0#1 */::prelude /* 0#1 */::rust_2018 /* 0#1 */::*;

View File

@ -36,7 +36,6 @@ PRINT-BANG INPUT (DEBUG): TokenStream [
#![feature /* 0#0 */(decl_macro)]
#![no_std /* 0#0 */]
#[macro_use /* 0#1 */]
extern crate core /* 0#2 */;
#[prelude_import /* 0#1 */]
use ::core /* 0#1 */::prelude /* 0#1 */::rust_2015 /* 0#1 */::*;

View File

@ -12,7 +12,6 @@
#![feature(proc_macro_quote)]
#![crate_type = "proc-macro"]
#[macro_use]
extern crate std;
#[prelude_import]
use ::std::prelude::rust_2015::*;

View File

@ -1,6 +1,5 @@
#![feature(prelude_import)]
#![no_std]
#[macro_use]
extern crate std;
#[prelude_import]
use ::std::prelude::rust_2015::*;

View File

@ -15,7 +15,7 @@ ast-stats - Ptr 64 (NN.N%) 1
ast-stats - Ref 64 (NN.N%) 1
ast-stats - ImplicitSelf 128 (NN.N%) 2
ast-stats - Path 640 (NN.N%) 10
ast-stats PathSegment 888 (NN.N%) 37 24
ast-stats PathSegment 864 (NN.N%) 36 24
ast-stats Expr 648 (NN.N%) 9 72
ast-stats - InlineAsm 72 (NN.N%) 1
ast-stats - Match 72 (NN.N%) 1
@ -41,9 +41,9 @@ ast-stats - Let 32 (NN.N%) 1
ast-stats - Semi 32 (NN.N%) 1
ast-stats - Expr 96 (NN.N%) 3
ast-stats Param 160 (NN.N%) 4 40
ast-stats Attribute 160 (NN.N%) 5 32
ast-stats Attribute 128 (NN.N%) 4 32
ast-stats - DocComment 32 (NN.N%) 1
ast-stats - Normal 128 (NN.N%) 4
ast-stats - Normal 96 (NN.N%) 3
ast-stats InlineAsm 120 (NN.N%) 1 120
ast-stats FnDecl 120 (NN.N%) 5 24
ast-stats Local 96 (NN.N%) 1 96
@ -57,7 +57,7 @@ ast-stats GenericArgs 40 (NN.N%) 1 40
ast-stats - AngleBracketed 40 (NN.N%) 1
ast-stats Crate 40 (NN.N%) 1 40
ast-stats ----------------------------------------------------------------
ast-stats Total 7_528 129
ast-stats Total 7_472 127
ast-stats ================================================================
hir-stats ================================================================
hir-stats HIR STATS: input_stats
@ -93,7 +93,7 @@ hir-stats GenericParam 400 (NN.N%) 5 80
hir-stats Block 288 (NN.N%) 6 48
hir-stats GenericBound 256 (NN.N%) 4 64
hir-stats - Trait 256 (NN.N%) 4
hir-stats Attribute 200 (NN.N%) 5 40
hir-stats Attribute 160 (NN.N%) 4 40
hir-stats Variant 144 (NN.N%) 2 72
hir-stats GenericArgs 144 (NN.N%) 3 48
hir-stats FieldDef 128 (NN.N%) 2 64
@ -119,5 +119,5 @@ hir-stats TraitItemId 8 (NN.N%) 2 4
hir-stats ImplItemId 8 (NN.N%) 2 4
hir-stats ForeignItemId 4 (NN.N%) 1 4
hir-stats ----------------------------------------------------------------
hir-stats Total 8_624 173
hir-stats Total 8_584 172
hir-stats ================================================================

View File

@ -0,0 +1,14 @@
//@ edition: 2024
//@ check-pass
//@ compile-flags: -Znext-solver
// This previously ICE'd during writeback when resolving
// the stalled coroutine predicate due to its bound lifetime.
trait Trait<'a> {}
impl<'a, T: Send> Trait<'a> for T {}
fn is_trait<T: for<'a> Trait<'a>>(_: T) {}
fn main() {
is_trait(async {})
}

View File

@ -3,7 +3,6 @@
//@ edition: 2015
#![feature(type_alias_impl_trait)]
#[attr = MacroUse {arguments: UseAll}]
extern crate std;
#[prelude_import]
use ::std::prelude::rust_2015::*;

View File

@ -1,4 +1,3 @@
#[attr = MacroUse {arguments: UseAll}]
extern crate std;
#[prelude_import]
use ::std::prelude::rust_2015::*;

View File

@ -1,4 +1,3 @@
#[attr = MacroUse {arguments: UseAll}]
extern crate std;
#[prelude_import]
use ::std::prelude::rust_2015::*;

View File

@ -1,4 +1,3 @@
#[attr = MacroUse {arguments: UseAll}]
extern crate std;
#[prelude_import]
use ::std::prelude::rust_2015::*;

View File

@ -1,4 +1,3 @@
#[attr = MacroUse {arguments: UseAll}]
extern crate std;
#[prelude_import]
use ::std::prelude::rust_2015::*;

View File

@ -1,5 +1,4 @@
#![feature(prelude_import)]
#[macro_use]
extern crate std;
#[prelude_import]
use std::prelude::rust_2024::*;

View File

@ -1,4 +1,3 @@
#[attr = MacroUse {arguments: UseAll}]
extern crate std;
#[prelude_import]
use std::prelude::rust_2024::*;

View File

@ -30,7 +30,6 @@
#![feature(try_blocks)]
#![feature(yeet_expr)]
#![allow(incomplete_features)]
#[macro_use]
extern crate std;
#[prelude_import]
use std::prelude::rust_2024::*;

View File

@ -29,7 +29,6 @@
#![feature(try_blocks)]
#![feature(yeet_expr)]
#![allow(incomplete_features)]
#[attr = MacroUse {arguments: UseAll}]
extern crate std;
#[prelude_import]
use std::prelude::rust_2024::*;

View File

@ -1,4 +1,3 @@
#[attr = MacroUse {arguments: UseAll}]
extern crate std;
#[prelude_import]
use ::std::prelude::rust_2015::*;

View File

@ -10,7 +10,6 @@
// synthesizing parentheses indiscriminately; only where necessary.
#![feature(if_let_guard)]
#[macro_use]
extern crate std;
#[prelude_import]
use std::prelude::rust_2024::*;

View File

@ -1,4 +1,3 @@
#[attr = MacroUse {arguments: UseAll}]
extern crate std;
#[prelude_import]
use ::std::prelude::rust_2015::*;

View File

@ -1,4 +1,3 @@
#[attr = MacroUse {arguments: UseAll}]
extern crate std;
#[prelude_import]
use ::std::prelude::rust_2015::*;

View File

@ -8,7 +8,6 @@
//@ compile-flags: -Zunpretty=hir,typed
//@ edition: 2015
#![allow(dead_code)]
#[attr = MacroUse {arguments: UseAll}]
extern crate std;
#[prelude_import]
use ::std::prelude::rust_2015::*;

View File

@ -6,7 +6,7 @@ LL | impl aux::Trait for LocalTy {}
|
= note: conflicting implementation in crate `unstable_impl_coherence_aux`:
- impl<T> Trait for T
where unstable feature: `foo`;
where feature(foo) is enabled;
error: aborting due to 1 previous error

View File

@ -6,7 +6,7 @@ LL | impl aux::Trait for LocalTy {}
|
= note: conflicting implementation in crate `unstable_impl_coherence_aux`:
- impl<T> Trait for T
where unstable feature: `foo`;
where feature(foo) is enabled;
error: aborting due to 1 previous error

View File

@ -7,7 +7,7 @@ LL | vec![].foo();
= note: multiple `impl`s satisfying `Vec<_>: Trait` found in the `unstable_impl_method_selection_aux` crate:
- impl Trait for Vec<u32>;
- impl Trait for Vec<u64>
where unstable feature: `bar`;
where feature(bar) is enabled;
error: aborting due to 1 previous error