Auto merge of #145003 - Kobzol:rollup-kgb216b, r=Kobzol
Rollup of 12 pull requests Successful merges: - rust-lang/rust#144552 (Rehome 33 `tests/ui/issues/` tests to other subdirectories under `tests/ui/`) - rust-lang/rust#144676 (Add documentation for unstable_feature_bound) - rust-lang/rust#144836 (Change visibility of Args new function) - rust-lang/rust#144910 (Add regression tests for seemingly fixed issues) - rust-lang/rust#144913 ([rustdoc] Fix wrong `i` tooltip icon) - rust-lang/rust#144924 (compiletest: add hint for when a ui test produces no errors) - rust-lang/rust#144926 (Correct the use of `must_use` on btree::IterMut) - rust-lang/rust#144928 (Drop `rust-version` from `rustc_thread_pool`) - rust-lang/rust#144945 (Autolabel PRs that change explicit tail call tests as `F-explicit_tail_calls`) - rust-lang/rust#144954 (run-make: Allow blessing snapshot files that don't exist yet) - rust-lang/rust#144971 (num: Rename `isolate_most_least_significant_one` functions) - rust-lang/rust#144978 (Fix some doc links for intrinsics) r? `@ghost` `@rustbot` modify labels: rollup
This commit is contained in:
commit
29cdc6a109
80 changed files with 260 additions and 107 deletions
|
|
@ -7,7 +7,6 @@ authors = [
|
|||
]
|
||||
description = "Core APIs for Rayon - fork for rustc"
|
||||
license = "MIT OR Apache-2.0"
|
||||
rust-version = "1.63"
|
||||
edition = "2021"
|
||||
readme = "README.md"
|
||||
keywords = ["parallel", "thread", "concurrency", "join", "performance"]
|
||||
|
|
|
|||
|
|
@ -382,6 +382,7 @@ impl<'a, K: 'a, V: 'a> Default for Iter<'a, K, V> {
|
|||
/// documentation for more.
|
||||
///
|
||||
/// [`iter_mut`]: BTreeMap::iter_mut
|
||||
#[must_use = "iterators are lazy and do nothing unless consumed"]
|
||||
#[stable(feature = "rust1", since = "1.0.0")]
|
||||
pub struct IterMut<'a, K: 'a, V: 'a> {
|
||||
range: LazyLeafRange<marker::ValMut<'a>, K, V>,
|
||||
|
|
@ -391,7 +392,6 @@ pub struct IterMut<'a, K: 'a, V: 'a> {
|
|||
_marker: PhantomData<&'a mut (K, V)>,
|
||||
}
|
||||
|
||||
#[must_use = "iterators are lazy and do nothing unless consumed"]
|
||||
#[stable(feature = "collection_debug", since = "1.17.0")]
|
||||
impl<K: fmt::Debug, V: fmt::Debug> fmt::Debug for IterMut<'_, K, V> {
|
||||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||
|
|
|
|||
|
|
@ -2667,7 +2667,7 @@ pub unsafe fn vtable_align(ptr: *const ()) -> usize;
|
|||
/// More specifically, this is the offset in bytes between successive
|
||||
/// items of the same type, including alignment padding.
|
||||
///
|
||||
/// The stabilized version of this intrinsic is [`size_of`].
|
||||
/// The stabilized version of this intrinsic is [`core::mem::size_of`].
|
||||
#[rustc_nounwind]
|
||||
#[unstable(feature = "core_intrinsics", issue = "none")]
|
||||
#[rustc_intrinsic_const_stable_indirect]
|
||||
|
|
@ -2681,7 +2681,7 @@ pub const fn size_of<T>() -> usize;
|
|||
/// Therefore, implementations must not require the user to uphold
|
||||
/// any safety invariants.
|
||||
///
|
||||
/// The stabilized version of this intrinsic is [`align_of`].
|
||||
/// The stabilized version of this intrinsic is [`core::mem::align_of`].
|
||||
#[rustc_nounwind]
|
||||
#[unstable(feature = "core_intrinsics", issue = "none")]
|
||||
#[rustc_intrinsic_const_stable_indirect]
|
||||
|
|
@ -2704,7 +2704,7 @@ pub const fn variant_count<T>() -> usize;
|
|||
|
||||
/// The size of the referenced value in bytes.
|
||||
///
|
||||
/// The stabilized version of this intrinsic is [`size_of_val`].
|
||||
/// The stabilized version of this intrinsic is [`core::mem::size_of_val`].
|
||||
///
|
||||
/// # Safety
|
||||
///
|
||||
|
|
@ -2717,7 +2717,7 @@ pub const unsafe fn size_of_val<T: ?Sized>(ptr: *const T) -> usize;
|
|||
|
||||
/// The required alignment of the referenced value.
|
||||
///
|
||||
/// The stabilized version of this intrinsic is [`align_of_val`].
|
||||
/// The stabilized version of this intrinsic is [`core::mem::align_of_val`].
|
||||
///
|
||||
/// # Safety
|
||||
///
|
||||
|
|
|
|||
|
|
@ -177,14 +177,14 @@ macro_rules! int_impl {
|
|||
///
|
||||
#[doc = concat!("let n: ", stringify!($SelfT), " = 0b_01100100;")]
|
||||
///
|
||||
/// assert_eq!(n.isolate_most_significant_one(), 0b_01000000);
|
||||
#[doc = concat!("assert_eq!(0_", stringify!($SelfT), ".isolate_most_significant_one(), 0);")]
|
||||
/// assert_eq!(n.isolate_highest_one(), 0b_01000000);
|
||||
#[doc = concat!("assert_eq!(0_", stringify!($SelfT), ".isolate_highest_one(), 0);")]
|
||||
/// ```
|
||||
#[unstable(feature = "isolate_most_least_significant_one", issue = "136909")]
|
||||
#[must_use = "this returns the result of the operation, \
|
||||
without modifying the original"]
|
||||
#[inline(always)]
|
||||
pub const fn isolate_most_significant_one(self) -> Self {
|
||||
pub const fn isolate_highest_one(self) -> Self {
|
||||
self & (((1 as $SelfT) << (<$SelfT>::BITS - 1)).wrapping_shr(self.leading_zeros()))
|
||||
}
|
||||
|
||||
|
|
@ -198,14 +198,14 @@ macro_rules! int_impl {
|
|||
///
|
||||
#[doc = concat!("let n: ", stringify!($SelfT), " = 0b_01100100;")]
|
||||
///
|
||||
/// assert_eq!(n.isolate_least_significant_one(), 0b_00000100);
|
||||
#[doc = concat!("assert_eq!(0_", stringify!($SelfT), ".isolate_least_significant_one(), 0);")]
|
||||
/// assert_eq!(n.isolate_lowest_one(), 0b_00000100);
|
||||
#[doc = concat!("assert_eq!(0_", stringify!($SelfT), ".isolate_lowest_one(), 0);")]
|
||||
/// ```
|
||||
#[unstable(feature = "isolate_most_least_significant_one", issue = "136909")]
|
||||
#[must_use = "this returns the result of the operation, \
|
||||
without modifying the original"]
|
||||
#[inline(always)]
|
||||
pub const fn isolate_least_significant_one(self) -> Self {
|
||||
pub const fn isolate_lowest_one(self) -> Self {
|
||||
self & self.wrapping_neg()
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -629,7 +629,7 @@ macro_rules! nonzero_integer {
|
|||
#[doc = concat!("let a = NonZero::<", stringify!($Int), ">::new(0b_01100100)?;")]
|
||||
#[doc = concat!("let b = NonZero::<", stringify!($Int), ">::new(0b_01000000)?;")]
|
||||
///
|
||||
/// assert_eq!(a.isolate_most_significant_one(), b);
|
||||
/// assert_eq!(a.isolate_highest_one(), b);
|
||||
/// # Some(())
|
||||
/// # }
|
||||
/// ```
|
||||
|
|
@ -637,7 +637,7 @@ macro_rules! nonzero_integer {
|
|||
#[must_use = "this returns the result of the operation, \
|
||||
without modifying the original"]
|
||||
#[inline(always)]
|
||||
pub const fn isolate_most_significant_one(self) -> Self {
|
||||
pub const fn isolate_highest_one(self) -> Self {
|
||||
let n = self.get() & (((1 as $Int) << (<$Int>::BITS - 1)).wrapping_shr(self.leading_zeros()));
|
||||
|
||||
// SAFETY:
|
||||
|
|
@ -659,7 +659,7 @@ macro_rules! nonzero_integer {
|
|||
#[doc = concat!("let a = NonZero::<", stringify!($Int), ">::new(0b_01100100)?;")]
|
||||
#[doc = concat!("let b = NonZero::<", stringify!($Int), ">::new(0b_00000100)?;")]
|
||||
///
|
||||
/// assert_eq!(a.isolate_least_significant_one(), b);
|
||||
/// assert_eq!(a.isolate_lowest_one(), b);
|
||||
/// # Some(())
|
||||
/// # }
|
||||
/// ```
|
||||
|
|
@ -667,7 +667,7 @@ macro_rules! nonzero_integer {
|
|||
#[must_use = "this returns the result of the operation, \
|
||||
without modifying the original"]
|
||||
#[inline(always)]
|
||||
pub const fn isolate_least_significant_one(self) -> Self {
|
||||
pub const fn isolate_lowest_one(self) -> Self {
|
||||
let n = self.get();
|
||||
let n = n & n.wrapping_neg();
|
||||
|
||||
|
|
|
|||
|
|
@ -229,14 +229,14 @@ macro_rules! uint_impl {
|
|||
///
|
||||
#[doc = concat!("let n: ", stringify!($SelfT), " = 0b_01100100;")]
|
||||
///
|
||||
/// assert_eq!(n.isolate_most_significant_one(), 0b_01000000);
|
||||
#[doc = concat!("assert_eq!(0_", stringify!($SelfT), ".isolate_most_significant_one(), 0);")]
|
||||
/// assert_eq!(n.isolate_highest_one(), 0b_01000000);
|
||||
#[doc = concat!("assert_eq!(0_", stringify!($SelfT), ".isolate_highest_one(), 0);")]
|
||||
/// ```
|
||||
#[unstable(feature = "isolate_most_least_significant_one", issue = "136909")]
|
||||
#[must_use = "this returns the result of the operation, \
|
||||
without modifying the original"]
|
||||
#[inline(always)]
|
||||
pub const fn isolate_most_significant_one(self) -> Self {
|
||||
pub const fn isolate_highest_one(self) -> Self {
|
||||
self & (((1 as $SelfT) << (<$SelfT>::BITS - 1)).wrapping_shr(self.leading_zeros()))
|
||||
}
|
||||
|
||||
|
|
@ -250,14 +250,14 @@ macro_rules! uint_impl {
|
|||
///
|
||||
#[doc = concat!("let n: ", stringify!($SelfT), " = 0b_01100100;")]
|
||||
///
|
||||
/// assert_eq!(n.isolate_least_significant_one(), 0b_00000100);
|
||||
#[doc = concat!("assert_eq!(0_", stringify!($SelfT), ".isolate_least_significant_one(), 0);")]
|
||||
/// assert_eq!(n.isolate_lowest_one(), 0b_00000100);
|
||||
#[doc = concat!("assert_eq!(0_", stringify!($SelfT), ".isolate_lowest_one(), 0);")]
|
||||
/// ```
|
||||
#[unstable(feature = "isolate_most_least_significant_one", issue = "136909")]
|
||||
#[must_use = "this returns the result of the operation, \
|
||||
without modifying the original"]
|
||||
#[inline(always)]
|
||||
pub const fn isolate_least_significant_one(self) -> Self {
|
||||
pub const fn isolate_lowest_one(self) -> Self {
|
||||
self & self.wrapping_neg()
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -321,7 +321,7 @@ fn nonzero_trailing_zeros() {
|
|||
}
|
||||
|
||||
#[test]
|
||||
fn test_nonzero_isolate_most_significant_one() {
|
||||
fn test_nonzero_isolate_highest_one() {
|
||||
// Signed most significant one
|
||||
macro_rules! nonzero_int_impl {
|
||||
($($T:ty),+) => {
|
||||
|
|
@ -335,8 +335,8 @@ fn test_nonzero_isolate_most_significant_one() {
|
|||
let mut i = 0;
|
||||
while i < <$T>::BITS {
|
||||
assert_eq!(
|
||||
NonZero::<$T>::new(BITS >> i).unwrap().isolate_most_significant_one(),
|
||||
NonZero::<$T>::new(MOST_SIG_ONE >> i).unwrap().isolate_most_significant_one()
|
||||
NonZero::<$T>::new(BITS >> i).unwrap().isolate_highest_one(),
|
||||
NonZero::<$T>::new(MOST_SIG_ONE >> i).unwrap().isolate_highest_one()
|
||||
);
|
||||
i += 1;
|
||||
}
|
||||
|
|
@ -356,8 +356,8 @@ fn test_nonzero_isolate_most_significant_one() {
|
|||
let mut i = 0;
|
||||
while i < <$T>::BITS {
|
||||
assert_eq!(
|
||||
NonZero::<$T>::new(BITS >> i).unwrap().isolate_most_significant_one(),
|
||||
NonZero::<$T>::new(MOST_SIG_ONE >> i).unwrap().isolate_most_significant_one(),
|
||||
NonZero::<$T>::new(BITS >> i).unwrap().isolate_highest_one(),
|
||||
NonZero::<$T>::new(MOST_SIG_ONE >> i).unwrap().isolate_highest_one(),
|
||||
);
|
||||
i += 1;
|
||||
}
|
||||
|
|
@ -371,7 +371,7 @@ fn test_nonzero_isolate_most_significant_one() {
|
|||
}
|
||||
|
||||
#[test]
|
||||
fn test_nonzero_isolate_least_significant_one() {
|
||||
fn test_nonzero_isolate_lowest_one() {
|
||||
// Signed least significant one
|
||||
macro_rules! nonzero_int_impl {
|
||||
($($T:ty),+) => {
|
||||
|
|
@ -385,8 +385,8 @@ fn test_nonzero_isolate_least_significant_one() {
|
|||
let mut i = 0;
|
||||
while i < <$T>::BITS {
|
||||
assert_eq!(
|
||||
NonZero::<$T>::new(BITS << i).unwrap().isolate_least_significant_one(),
|
||||
NonZero::<$T>::new(LEAST_SIG_ONE << i).unwrap().isolate_least_significant_one()
|
||||
NonZero::<$T>::new(BITS << i).unwrap().isolate_lowest_one(),
|
||||
NonZero::<$T>::new(LEAST_SIG_ONE << i).unwrap().isolate_lowest_one()
|
||||
);
|
||||
i += 1;
|
||||
}
|
||||
|
|
@ -406,8 +406,8 @@ fn test_nonzero_isolate_least_significant_one() {
|
|||
let mut i = 0;
|
||||
while i < <$T>::BITS {
|
||||
assert_eq!(
|
||||
NonZero::<$T>::new(BITS << i).unwrap().isolate_least_significant_one(),
|
||||
NonZero::<$T>::new(LEAST_SIG_ONE << i).unwrap().isolate_least_significant_one(),
|
||||
NonZero::<$T>::new(BITS << i).unwrap().isolate_lowest_one(),
|
||||
NonZero::<$T>::new(LEAST_SIG_ONE << i).unwrap().isolate_lowest_one(),
|
||||
);
|
||||
i += 1;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -194,7 +194,7 @@ macro_rules! int_module {
|
|||
}
|
||||
|
||||
#[test]
|
||||
fn test_isolate_most_significant_one() {
|
||||
fn test_isolate_highest_one() {
|
||||
const BITS: $T = -1;
|
||||
const MOST_SIG_ONE: $T = 1 << (<$T>::BITS - 1);
|
||||
|
||||
|
|
@ -203,15 +203,15 @@ macro_rules! int_module {
|
|||
let mut i = 0;
|
||||
while i < <$T>::BITS {
|
||||
assert_eq!(
|
||||
(BITS >> i).isolate_most_significant_one(),
|
||||
(MOST_SIG_ONE >> i).isolate_most_significant_one()
|
||||
(BITS >> i).isolate_highest_one(),
|
||||
(MOST_SIG_ONE >> i).isolate_highest_one()
|
||||
);
|
||||
i += 1;
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_isolate_least_significant_one() {
|
||||
fn test_isolate_lowest_one() {
|
||||
const BITS: $T = -1;
|
||||
const LEAST_SIG_ONE: $T = 1;
|
||||
|
||||
|
|
@ -220,8 +220,8 @@ macro_rules! int_module {
|
|||
let mut i = 0;
|
||||
while i < <$T>::BITS {
|
||||
assert_eq!(
|
||||
(BITS << i).isolate_least_significant_one(),
|
||||
(LEAST_SIG_ONE << i).isolate_least_significant_one()
|
||||
(BITS << i).isolate_lowest_one(),
|
||||
(LEAST_SIG_ONE << i).isolate_lowest_one()
|
||||
);
|
||||
i += 1;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -151,7 +151,7 @@ macro_rules! uint_module {
|
|||
}
|
||||
|
||||
#[test]
|
||||
fn test_isolate_most_significant_one() {
|
||||
fn test_isolate_highest_one() {
|
||||
const BITS: $T = <$T>::MAX;
|
||||
const MOST_SIG_ONE: $T = 1 << (<$T>::BITS - 1);
|
||||
|
||||
|
|
@ -160,15 +160,15 @@ macro_rules! uint_module {
|
|||
let mut i = 0;
|
||||
while i < <$T>::BITS {
|
||||
assert_eq!(
|
||||
(BITS >> i).isolate_most_significant_one(),
|
||||
(MOST_SIG_ONE >> i).isolate_most_significant_one(),
|
||||
(BITS >> i).isolate_highest_one(),
|
||||
(MOST_SIG_ONE >> i).isolate_highest_one(),
|
||||
);
|
||||
i += 1;
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_isolate_least_significant_one() {
|
||||
fn test_isolate_lowest_one() {
|
||||
const BITS: $T = <$T>::MAX;
|
||||
const LEAST_SIG_ONE: $T = 1;
|
||||
|
||||
|
|
@ -177,8 +177,8 @@ macro_rules! uint_module {
|
|||
let mut i = 0;
|
||||
while i < <$T>::BITS {
|
||||
assert_eq!(
|
||||
(BITS << i).isolate_least_significant_one(),
|
||||
(LEAST_SIG_ONE << i).isolate_least_significant_one(),
|
||||
(BITS << i).isolate_lowest_one(),
|
||||
(LEAST_SIG_ONE << i).isolate_lowest_one(),
|
||||
);
|
||||
i += 1;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ impl !Sync for Args {}
|
|||
|
||||
impl Args {
|
||||
#[inline]
|
||||
pub(super) fn new(args: Vec<OsString>) -> Self {
|
||||
pub fn new(args: Vec<OsString>) -> Self {
|
||||
Args { iter: args.into_iter() }
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -181,4 +181,7 @@ the `deprecated_in_future` lint is triggered which is default `allow`, but most
|
|||
of the standard library raises it to a warning with
|
||||
`#![warn(deprecated_in_future)]`.
|
||||
|
||||
## unstable_feature_bound
|
||||
The `#[unstable_feature_bound(foo)]` attribute can be used together with `#[unstable]` attribute to mark an `impl` of stable type and stable trait as unstable. In std/core, an item annotated with `#[unstable_feature_bound(foo)]` can only be used by another item that is also annotated with `#[unstable_feature_bound(foo)]`. Outside of std/core, using an item with `#[unstable_feature_bound(foo)]` requires the feature to be enabled with `#![feature(foo)]` attribute on the crate. Currently, only `impl`s and free functions can be annotated with `#[unstable_feature_bound]`.
|
||||
|
||||
[blog]: https://www.ralfj.de/blog/2018/07/19/const.html
|
||||
|
|
|
|||
|
|
@ -1838,6 +1838,10 @@ instead, we check that it's not a "finger" cursor.
|
|||
border-right: 3px solid var(--target-border-color);
|
||||
}
|
||||
|
||||
a.tooltip {
|
||||
font-family: var(--font-family);
|
||||
}
|
||||
|
||||
.code-header a.tooltip {
|
||||
color: inherit;
|
||||
margin-right: 15px;
|
||||
|
|
|
|||
|
|
@ -356,7 +356,7 @@ impl<'test> TestCx<'test> {
|
|||
if proc_res.status.success() {
|
||||
let err = &format!("{} test did not emit an error", self.config.mode);
|
||||
let extra_note = (self.config.mode == crate::common::TestMode::Ui)
|
||||
.then_some("note: by default, ui tests are expected not to compile");
|
||||
.then_some("note: by default, ui tests are expected not to compile.\nhint: use check-pass, build-pass, or run-pass directive to change this behavior.");
|
||||
self.fatal_proc_rec_general(err, extra_note, proc_res, || ());
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -23,6 +23,7 @@ pub struct Diff {
|
|||
actual: Option<String>,
|
||||
actual_name: Option<String>,
|
||||
normalizers: Vec<(String, String)>,
|
||||
bless_dir: Option<String>,
|
||||
drop_bomb: DropBomb,
|
||||
}
|
||||
|
||||
|
|
@ -37,6 +38,7 @@ impl Diff {
|
|||
actual: None,
|
||||
actual_name: None,
|
||||
normalizers: Vec::new(),
|
||||
bless_dir: std::env::var("RUSTC_BLESS_TEST").ok(),
|
||||
drop_bomb: DropBomb::arm("diff"),
|
||||
}
|
||||
}
|
||||
|
|
@ -44,6 +46,13 @@ impl Diff {
|
|||
/// Specify the expected output for the diff from a file.
|
||||
pub fn expected_file<P: AsRef<Path>>(&mut self, path: P) -> &mut Self {
|
||||
let path = path.as_ref();
|
||||
// In `--bless` mode, create the snapshot file if it doesn't already exist.
|
||||
// The empty file will be overwritten with the actual text.
|
||||
if self.bless_dir.is_some()
|
||||
&& let Ok(false) = std::fs::exists(path)
|
||||
{
|
||||
fs::write(path, "");
|
||||
}
|
||||
let content = fs::read_to_string(path);
|
||||
let name = path.to_string_lossy().to_string();
|
||||
|
||||
|
|
@ -148,7 +157,7 @@ impl Diff {
|
|||
let Some(ref expected_file) = self.expected_file else {
|
||||
return false;
|
||||
};
|
||||
let Ok(bless_dir) = std::env::var("RUSTC_BLESS_TEST") else {
|
||||
let Some(ref bless_dir) = self.bless_dir else {
|
||||
return false;
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -8,10 +8,10 @@ define-function: (
|
|||
[x, i_x],
|
||||
block {
|
||||
// Checking they have the same y position.
|
||||
compare-elements-position: (
|
||||
compare-elements-position-near: (
|
||||
"//*[@id='method.create_an_iterator_from_read']//a[normalize-space()='NotableStructWithLongName']",
|
||||
"//*[@id='method.create_an_iterator_from_read']//*[@class='tooltip']",
|
||||
["y"],
|
||||
{"y": 1},
|
||||
)
|
||||
// Checking they don't have the same x position.
|
||||
compare-elements-position-false: (
|
||||
|
|
|
|||
|
|
@ -767,3 +767,17 @@ pub mod impls_indent {
|
|||
pub fn bar() {}
|
||||
}
|
||||
}
|
||||
|
||||
pub mod tooltips {
|
||||
pub struct X;
|
||||
|
||||
impl X {
|
||||
pub fn bar() -> Vec<u8> {
|
||||
Vec::new()
|
||||
}
|
||||
}
|
||||
|
||||
pub fn bar() -> Vec<u8> {
|
||||
Vec::new()
|
||||
}
|
||||
}
|
||||
|
|
|
|||
15
tests/rustdoc-gui/tooltips.goml
Normal file
15
tests/rustdoc-gui/tooltips.goml
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
// This test checks that the right font is applied to the `i` tooltip element.
|
||||
|
||||
define-function: (
|
||||
"check-font",
|
||||
[path],
|
||||
block {
|
||||
go-to: "file://" + |DOC_PATH| + "/test_docs/" + |path|
|
||||
assert-css: (
|
||||
"a.tooltip", {"font-family": '"Source Serif 4", NanumBarunGothic, serif'}, ALL,
|
||||
)
|
||||
}
|
||||
)
|
||||
|
||||
call-function: ("check-font", {"path": "tooltips/fn.bar.html"})
|
||||
call-function: ("check-font", {"path": "tooltips/struct.X.html"})
|
||||
|
|
@ -1,8 +1,8 @@
|
|||
// https://github.com/rust-lang/rust/issues/5754
|
||||
//@ build-pass
|
||||
#![allow(dead_code)]
|
||||
#![allow(improper_ctypes)]
|
||||
|
||||
|
||||
struct TwoDoubles {
|
||||
r: f64,
|
||||
i: f64
|
||||
|
|
@ -1,3 +1,4 @@
|
|||
// https://github.com/rust-lang/rust/issues/8898
|
||||
//@ run-pass
|
||||
|
||||
fn assert_repr_eq<T: std::fmt::Debug>(obj : T, expected : String) {
|
||||
|
|
@ -1,3 +1,4 @@
|
|||
// https://github.com/rust-lang/rust/issues/43483
|
||||
//@ check-pass
|
||||
#![allow(dead_code)]
|
||||
#![allow(unused_variables)]
|
||||
|
|
@ -1,3 +1,4 @@
|
|||
// https://github.com/rust-lang/rust/issues/21946
|
||||
trait Foo {
|
||||
type A;
|
||||
}
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
error[E0275]: overflow evaluating the requirement `<FooStruct as Foo>::A == _`
|
||||
--> $DIR/issue-21946.rs:8:14
|
||||
--> $DIR/recursive-associated-type-overflow-21946.rs:9:14
|
||||
|
|
||||
LL | type A = <FooStruct as Foo>::A;
|
||||
| ^^^^^^^^^^^^^^^^^^^^^
|
||||
|
|
@ -1,3 +1,4 @@
|
|||
// https://github.com/rust-lang/rust/issues/7061
|
||||
//@ dont-require-annotations: NOTE
|
||||
|
||||
struct BarStruct;
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
error[E0308]: mismatched types
|
||||
--> $DIR/issue-7061.rs:6:46
|
||||
--> $DIR/mismatched-pointer-type-in-self-7061.rs:7:46
|
||||
|
|
||||
LL | fn foo(&'a mut self) -> Box<BarStruct> { self }
|
||||
| -------------- ^^^^ expected `Box<BarStruct>`, found `&mut BarStruct`
|
||||
|
|
@ -1,3 +1,4 @@
|
|||
// https://github.com/rust-lang/rust/issues/13665
|
||||
//@ run-pass
|
||||
|
||||
fn foo<'r>() {
|
||||
|
|
@ -1,3 +1,4 @@
|
|||
// https://github.com/rust-lang/rust/issues/21600
|
||||
fn call_it<F>(f: F) where F: Fn() { f(); }
|
||||
|
||||
struct A;
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
error[E0596]: cannot borrow `x` as mutable, as it is a captured variable in a `Fn` closure
|
||||
--> $DIR/issue-21600.rs:14:20
|
||||
--> $DIR/aliasability-violation-with-closure-21600.rs:15:20
|
||||
|
|
||||
LL | fn call_it<F>(f: F) where F: Fn() { f(); }
|
||||
| - change this to accept `FnMut` instead of `Fn`
|
||||
|
|
@ -11,7 +11,7 @@ LL | call_it(|| x.gen_mut());
|
|||
| expects `Fn` instead of `FnMut`
|
||||
|
||||
error[E0596]: cannot borrow `x` as mutable, as it is a captured variable in a `Fn` closure
|
||||
--> $DIR/issue-21600.rs:14:17
|
||||
--> $DIR/aliasability-violation-with-closure-21600.rs:15:17
|
||||
|
|
||||
LL | fn call_it<F>(f: F) where F: Fn() { f(); }
|
||||
| - change this to accept `FnMut` instead of `Fn`
|
||||
|
|
@ -1,3 +1,4 @@
|
|||
// https://github.com/rust-lang/rust/issues/32086
|
||||
struct S(u8);
|
||||
const C: S = S(10);
|
||||
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
error[E0532]: expected tuple struct or tuple variant, found constant `C`
|
||||
--> $DIR/issue-32086.rs:5:9
|
||||
--> $DIR/const-pattern-rewrite-error-32086.rs:6:9
|
||||
|
|
||||
LL | struct S(u8);
|
||||
| ------------- similarly named tuple struct `S` defined here
|
||||
|
|
@ -8,7 +8,7 @@ LL | let C(a) = S(11);
|
|||
| ^ help: a tuple struct with a similar name exists: `S`
|
||||
|
||||
error[E0532]: expected tuple struct or tuple variant, found constant `C`
|
||||
--> $DIR/issue-32086.rs:6:9
|
||||
--> $DIR/const-pattern-rewrite-error-32086.rs:7:9
|
||||
|
|
||||
LL | struct S(u8);
|
||||
| ------------- similarly named tuple struct `S` defined here
|
||||
|
|
@ -1,10 +1,9 @@
|
|||
// https://github.com/rust-lang/rust/issues/5521
|
||||
//@ run-pass
|
||||
#![allow(dead_code)]
|
||||
//@ aux-build:issue-5521.rs
|
||||
//@ aux-build:aux-5521.rs
|
||||
|
||||
|
||||
|
||||
extern crate issue_5521 as foo;
|
||||
extern crate aux_5521 as foo;
|
||||
|
||||
fn bar(a: foo::map) {
|
||||
if false {
|
||||
|
|
@ -1,3 +1,4 @@
|
|||
// https://github.com/rust-lang/rust/issues/46332
|
||||
// Original Levenshtein distance for both of this is 1. We improved accuracy with
|
||||
// additional case insensitive comparison.
|
||||
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
error[E0422]: cannot find struct, variant or union type `TyUInt` in this scope
|
||||
--> $DIR/issue-46332.rs:9:5
|
||||
--> $DIR/typo-suggestion-improvement-46332.rs:10:5
|
||||
|
|
||||
LL | struct TyUint {}
|
||||
| ------------- similarly named struct `TyUint` defined here
|
||||
|
|
@ -1,3 +1,4 @@
|
|||
// https://github.com/rust-lang/rust/issues/6892
|
||||
//@ run-pass
|
||||
#![allow(dead_code)]
|
||||
// Ensures that destructors are run for expressions of the form "let _ = e;"
|
||||
|
|
@ -1,3 +1,4 @@
|
|||
// https://github.com/rust-lang/rust/issues/16151
|
||||
//@ run-pass
|
||||
|
||||
// FIXME(static_mut_refs): Do not allow `static_mut_refs` lint
|
||||
|
|
@ -1,3 +1,4 @@
|
|||
// https://github.com/rust-lang/rust/issues/20939
|
||||
trait Foo {}
|
||||
|
||||
impl<'a> Foo for dyn Foo + 'a {}
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
error[E0371]: the object type `(dyn Foo + 'a)` automatically implements the trait `Foo`
|
||||
--> $DIR/issue-20939.rs:3:1
|
||||
--> $DIR/dyn-compatible-trait-implementation-20939.rs:4:1
|
||||
|
|
||||
LL | impl<'a> Foo for dyn Foo + 'a {}
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `(dyn Foo + 'a)` automatically implements trait `Foo`
|
||||
|
|
@ -1,3 +1,4 @@
|
|||
// https://github.com/rust-lang/rust/issues/36075
|
||||
//@ check-pass
|
||||
#![allow(dead_code)]
|
||||
trait DeclarationParser {
|
||||
|
|
@ -1,11 +0,0 @@
|
|||
//@ run-pass
|
||||
//@ aux-build:issue-9188.rs
|
||||
|
||||
|
||||
extern crate issue_9188;
|
||||
|
||||
pub fn main() {
|
||||
let a = issue_9188::bar();
|
||||
let b = issue_9188::foo::<isize>();
|
||||
assert_eq!(*a, *b);
|
||||
}
|
||||
|
|
@ -1,3 +1,4 @@
|
|||
// https://github.com/rust-lang/rust/issues/23966
|
||||
fn main() {
|
||||
"".chars().fold(|_, _| (), ());
|
||||
//~^ ERROR E0277
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
error[E0277]: expected a `FnMut(_, char)` closure, found `()`
|
||||
--> $DIR/issue-23966.rs:2:32
|
||||
--> $DIR/fold-iterator-error-23966.rs:3:32
|
||||
|
|
||||
LL | "".chars().fold(|_, _| (), ());
|
||||
| ---- ^^ expected an `FnMut(_, char)` closure, found `()`
|
||||
|
|
@ -1,3 +1,4 @@
|
|||
// https://github.com/rust-lang/rust/issues/15735
|
||||
//@ check-pass
|
||||
#![allow(dead_code)]
|
||||
struct A<'a> {
|
||||
|
|
@ -1,3 +1,4 @@
|
|||
// https://github.com/rust-lang/rust/issues/75704
|
||||
// Caused an infinite loop during SimlifyCfg MIR transform previously.
|
||||
//
|
||||
//@ build-pass
|
||||
|
|
@ -1,3 +1,4 @@
|
|||
// https://github.com/rust-lang/rust/issues/19100
|
||||
//@ run-rustfix
|
||||
|
||||
#![allow(non_snake_case)]
|
||||
|
|
@ -1,3 +1,4 @@
|
|||
// https://github.com/rust-lang/rust/issues/19100
|
||||
//@ run-rustfix
|
||||
|
||||
#![allow(non_snake_case)]
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
error[E0170]: pattern binding `Bar` is named the same as one of the variants of the type `Foo`
|
||||
--> $DIR/issue-19100.rs:17:1
|
||||
--> $DIR/unreachable-pattern-if-variant-not-imported-19100.rs:18:1
|
||||
|
|
||||
LL | Bar if true
|
||||
| ^^^ help: to match on the variant, qualify the path: `Foo::Bar`
|
||||
|
|
@ -7,7 +7,7 @@ LL | Bar if true
|
|||
= note: `#[deny(bindings_with_variant_name)]` on by default
|
||||
|
||||
error[E0170]: pattern binding `Baz` is named the same as one of the variants of the type `Foo`
|
||||
--> $DIR/issue-19100.rs:21:1
|
||||
--> $DIR/unreachable-pattern-if-variant-not-imported-19100.rs:22:1
|
||||
|
|
||||
LL | Baz if false
|
||||
| ^^^ help: to match on the variant, qualify the path: `Foo::Baz`
|
||||
|
|
@ -1,3 +1,4 @@
|
|||
// https://github.com/rust-lang/rust/issues/22684
|
||||
mod foo {
|
||||
pub struct Foo;
|
||||
impl Foo {
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
error[E0308]: mismatched types
|
||||
--> $DIR/issue-22684.rs:17:17
|
||||
--> $DIR/trait-method-resolution-over-inherent-22684.rs:18:17
|
||||
|
|
||||
LL | let _: () = foo::Foo.bar();
|
||||
| -- ^^^^^^^^^^^^^^ expected `()`, found `bool`
|
||||
|
|
@ -1,3 +1,4 @@
|
|||
// https://github.com/rust-lang/rust/issues/24352
|
||||
fn main() {
|
||||
1.0f64 - 1.0;
|
||||
1.0f64 - 1 //~ ERROR E0277
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
error[E0277]: cannot subtract `{integer}` from `f64`
|
||||
--> $DIR/issue-24352.rs:3:12
|
||||
--> $DIR/float-integer-subtraction-error-24352.rs:4:12
|
||||
|
|
||||
LL | 1.0f64 - 1
|
||||
| ^ no implementation for `f64 - {integer}`
|
||||
|
|
@ -1,3 +1,4 @@
|
|||
// https://github.com/rust-lang/rust/issues/50585
|
||||
fn main() {
|
||||
|y: Vec<[(); for x in 0..2 {}]>| {};
|
||||
//~^ ERROR mismatched types
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
error[E0308]: mismatched types
|
||||
--> $DIR/issue-50585.rs:2:18
|
||||
--> $DIR/for-loop-in-vec-type-mismatchrs-50585.rs:3:18
|
||||
|
|
||||
LL | |y: Vec<[(); for x in 0..2 {}]>| {};
|
||||
| ^^^^^^^^^^^^^^^^ expected `usize`, found `()`
|
||||
|
|
@ -1,3 +1,4 @@
|
|||
// https://github.com/rust-lang/rust/issues/48364
|
||||
fn foo() -> bool {
|
||||
b"".starts_with(stringify!(foo))
|
||||
//~^ ERROR mismatched types
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
error[E0308]: mismatched types
|
||||
--> $DIR/issue-48364.rs:2:21
|
||||
--> $DIR/starts-with-stringify-type-mismatch-48364.rs:3:21
|
||||
|
|
||||
LL | b"".starts_with(stringify!(foo))
|
||||
| ----------- ^^^^^^^^^^^^^^^ expected `&[u8]`, found `&str`
|
||||
|
|
@ -1,3 +1,4 @@
|
|||
// https://github.com/rust-lang/rust/issues/32797
|
||||
//@ check-pass
|
||||
|
||||
pub use bar::*;
|
||||
|
|
@ -1,3 +1,4 @@
|
|||
// https://github.com/rust-lang/rust/issues/17385
|
||||
struct X(isize);
|
||||
|
||||
enum Enum {
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
error[E0382]: use of moved value: `foo`
|
||||
--> $DIR/issue-17385.rs:18:5
|
||||
--> $DIR/matching-partially-moved-value-17385.rs:19:5
|
||||
|
|
||||
LL | let foo = X(1);
|
||||
| --- move occurs because `foo` has type `X`, which does not implement the `Copy` trait
|
||||
|
|
@ -9,7 +9,7 @@ LL | match foo {
|
|||
| ^^^^^^^^^ value used here after move
|
||||
|
|
||||
note: if `X` implemented `Clone`, you could clone the value
|
||||
--> $DIR/issue-17385.rs:1:1
|
||||
--> $DIR/matching-partially-moved-value-17385.rs:2:1
|
||||
|
|
||||
LL | struct X(isize);
|
||||
| ^^^^^^^^ consider implementing `Clone` for this type
|
||||
|
|
@ -18,7 +18,7 @@ LL | drop(foo);
|
|||
| --- you could clone this value
|
||||
|
||||
error[E0382]: use of moved value: `e`
|
||||
--> $DIR/issue-17385.rs:25:11
|
||||
--> $DIR/matching-partially-moved-value-17385.rs:26:11
|
||||
|
|
||||
LL | let e = Enum::Variant2;
|
||||
| - move occurs because `e` has type `Enum`, which does not implement the `Copy` trait
|
||||
|
|
@ -28,7 +28,7 @@ LL | match e {
|
|||
| ^ value used here after move
|
||||
|
|
||||
note: if `Enum` implemented `Clone`, you could clone the value
|
||||
--> $DIR/issue-17385.rs:3:1
|
||||
--> $DIR/matching-partially-moved-value-17385.rs:4:1
|
||||
|
|
||||
LL | enum Enum {
|
||||
| ^^^^^^^^^ consider implementing `Clone` for this type
|
||||
|
|
@ -1,3 +1,4 @@
|
|||
// https://github.com/rust-lang/rust/issues/32805
|
||||
//@ run-pass
|
||||
fn const_mir() -> f32 { 9007199791611905.0 }
|
||||
|
||||
|
|
@ -1,3 +1,4 @@
|
|||
// https://github.com/rust-lang/rust/issues/3763
|
||||
// Regression test for #3763
|
||||
|
||||
mod my_mod {
|
||||
|
|
@ -1,17 +1,17 @@
|
|||
error[E0616]: field `priv_field` of struct `MyStruct` is private
|
||||
--> $DIR/issue-3763.rs:17:32
|
||||
--> $DIR/private-field-access-violation-3763.rs:18:32
|
||||
|
|
||||
LL | let _woohoo = (&my_struct).priv_field;
|
||||
| ^^^^^^^^^^ private field
|
||||
|
||||
error[E0616]: field `priv_field` of struct `MyStruct` is private
|
||||
--> $DIR/issue-3763.rs:20:41
|
||||
--> $DIR/private-field-access-violation-3763.rs:21:41
|
||||
|
|
||||
LL | let _woohoo = (Box::new(my_struct)).priv_field;
|
||||
| ^^^^^^^^^^ private field
|
||||
|
||||
error[E0624]: method `happyfun` is private
|
||||
--> $DIR/issue-3763.rs:23:18
|
||||
--> $DIR/private-field-access-violation-3763.rs:24:18
|
||||
|
|
||||
LL | fn happyfun(&self) {}
|
||||
| ------------------ private method defined here
|
||||
|
|
@ -20,7 +20,7 @@ LL | (&my_struct).happyfun();
|
|||
| ^^^^^^^^ private method
|
||||
|
||||
error[E0624]: method `happyfun` is private
|
||||
--> $DIR/issue-3763.rs:25:27
|
||||
--> $DIR/private-field-access-violation-3763.rs:26:27
|
||||
|
|
||||
LL | fn happyfun(&self) {}
|
||||
| ------------------ private method defined here
|
||||
|
|
@ -29,7 +29,7 @@ LL | (Box::new(my_struct)).happyfun();
|
|||
| ^^^^^^^^ private method
|
||||
|
||||
error[E0616]: field `priv_field` of struct `MyStruct` is private
|
||||
--> $DIR/issue-3763.rs:26:26
|
||||
--> $DIR/private-field-access-violation-3763.rs:27:26
|
||||
|
|
||||
LL | let nope = my_struct.priv_field;
|
||||
| ^^^^^^^^^^ private field
|
||||
|
|
@ -1 +1,2 @@
|
|||
// https://github.com/rust-lang/rust/issues/22811
|
||||
fn main() { println!("{}", foobar); } //~ ERROR cannot find value `foobar` in this scope
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
error[E0425]: cannot find value `foobar` in this scope
|
||||
--> $DIR/issue-2281-part1.rs:1:28
|
||||
--> $DIR/cannot-find-value-in-scope-22811.rs:2:28
|
||||
|
|
||||
LL | fn main() { println!("{}", foobar); }
|
||||
| ^^^^^^ not found in this scope
|
||||
|
|
@ -1,3 +1,4 @@
|
|||
// https://github.com/rust-lang/rust/issues/33293
|
||||
fn main() {
|
||||
match 0 {
|
||||
aaa::bbb(_) => ()
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
error[E0433]: failed to resolve: use of unresolved module or unlinked crate `aaa`
|
||||
--> $DIR/issue-33293.rs:3:9
|
||||
--> $DIR/unresolved-module-error-33293.rs:4:9
|
||||
|
|
||||
LL | aaa::bbb(_) => ()
|
||||
| ^^^ use of unresolved module or unlinked crate `aaa`
|
||||
|
|
@ -1,3 +1,4 @@
|
|||
// https://github.com/rust-lang/rust/issues/47073
|
||||
type Guilty = bool;
|
||||
type FineDollars = u32;
|
||||
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
error[E0609]: no field `00` on type `Verdict`
|
||||
--> $DIR/issue-47073-zero-padded-tuple-struct-indices.rs:8:30
|
||||
--> $DIR/tuple-struct-field-naming-47073.rs:9:30
|
||||
|
|
||||
LL | let _condemned = justice.00;
|
||||
| ^^ unknown field
|
||||
|
|
@ -11,7 +11,7 @@ LL + let _condemned = justice.0;
|
|||
|
|
||||
|
||||
error[E0609]: no field `001` on type `Verdict`
|
||||
--> $DIR/issue-47073-zero-padded-tuple-struct-indices.rs:10:31
|
||||
--> $DIR/tuple-struct-field-naming-47073.rs:11:31
|
||||
|
|
||||
LL | let _punishment = justice.001;
|
||||
| ^^^ unknown field
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
// https://github.com/rust-lang/rust/issues/9188
|
||||
//@ run-pass
|
||||
//@ aux-build:aux-9188.rs
|
||||
|
||||
extern crate aux_9188 as lib;
|
||||
|
||||
pub fn main() {
|
||||
let a = lib::bar();
|
||||
let b = lib::foo::<isize>();
|
||||
assert_eq!(*a, *b);
|
||||
}
|
||||
|
|
@ -1,3 +1,4 @@
|
|||
// https://github.com/rust-lang/rust/issues/72839
|
||||
// Regression test for issue #72839
|
||||
// Tests that we do not overflow during trait selection after
|
||||
// a type error occurs
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
error[E0425]: cannot find value `missing_var` in this scope
|
||||
--> $DIR/issue-72839-error-overflow.rs:18:8
|
||||
--> $DIR/trait-selection-overflow-prevention-72839.rs:19:8
|
||||
|
|
||||
LL | if missing_var % 8 == 0 {}
|
||||
| ^^^^^^^^^^^ not found in this scope
|
||||
|
|
@ -1,3 +1,4 @@
|
|||
// https://github.com/rust-lang/rust/issues/47638
|
||||
//@ run-pass
|
||||
#![allow(unused_variables)]
|
||||
fn id<'c, 'b>(f: &'c &'b dyn Fn(&i32)) -> &'c &'b dyn Fn(&'static i32) {
|
||||
|
|
@ -0,0 +1,24 @@
|
|||
#![allow(incomplete_features)]
|
||||
#![feature(const_closures, const_trait_impl)]
|
||||
|
||||
const fn create_array<const N: usize>(mut f: impl FnMut(usize) -> u32 + Copy) -> [u32; N] {
|
||||
let mut array = [0; N];
|
||||
let mut i = 0;
|
||||
loop {
|
||||
array[i] = f(i);
|
||||
//~^ ERROR the trait bound `impl FnMut(usize) -> u32 + Copy: [const] FnMut(usize)` is not satisfied [E0277]
|
||||
i += 1;
|
||||
if i == N {
|
||||
break;
|
||||
}
|
||||
}
|
||||
array
|
||||
}
|
||||
|
||||
fn main() {
|
||||
let x = create_array(const |i| 2 * i as u32);
|
||||
assert_eq!(x, [0, 2, 4, 6, 8]);
|
||||
|
||||
let y = create_array(const |i| 2 * i as u32 + 1);
|
||||
assert_eq!(y, [1, 3, 5, 7, 9]);
|
||||
}
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
error[E0277]: the trait bound `impl FnMut(usize) -> u32 + Copy: [const] FnMut(usize)` is not satisfied
|
||||
--> $DIR/const-closure-issue-125866-error.rs:8:22
|
||||
|
|
||||
LL | array[i] = f(i);
|
||||
| - ^
|
||||
| |
|
||||
| required by a bound introduced by this call
|
||||
|
||||
error: aborting due to 1 previous error
|
||||
|
||||
For more information about this error, try `rustc --explain E0277`.
|
||||
|
|
@ -0,0 +1,25 @@
|
|||
//@ check-pass
|
||||
|
||||
#![allow(incomplete_features)]
|
||||
#![feature(const_closures, const_trait_impl)]
|
||||
|
||||
const fn create_array<const N: usize>(mut f: impl [const] FnMut(usize) -> u32 + Copy) -> [u32; N] {
|
||||
let mut array = [0; N];
|
||||
let mut i = 0;
|
||||
loop {
|
||||
array[i] = f(i);
|
||||
i += 1;
|
||||
if i == N {
|
||||
break;
|
||||
}
|
||||
}
|
||||
array
|
||||
}
|
||||
|
||||
fn main() {
|
||||
let x = create_array(const |i| 2 * i as u32);
|
||||
assert_eq!(x, [0, 2, 4, 6, 8]);
|
||||
|
||||
let y = create_array(const |i| 2 * i as u32 + 1);
|
||||
assert_eq!(y, [1, 3, 5, 7, 9]);
|
||||
}
|
||||
|
|
@ -0,0 +1,13 @@
|
|||
//@ check-pass
|
||||
|
||||
#![feature(const_trait_impl, const_destruct, const_clone)]
|
||||
|
||||
use std::marker::Destruct;
|
||||
|
||||
const fn f<T, F: [const] Fn(&T) -> T + [const] Destruct>(_: F) {}
|
||||
|
||||
const fn g<T: [const] Clone>() {
|
||||
f(<T as Clone>::clone);
|
||||
}
|
||||
|
||||
fn main() {}
|
||||
|
|
@ -1,3 +1,4 @@
|
|||
// https://github.com/rust-lang/rust/issues/20413
|
||||
trait Foo {
|
||||
fn answer(self);
|
||||
}
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
error[E0392]: type parameter `T` is never used
|
||||
--> $DIR/issue-20413.rs:5:15
|
||||
--> $DIR/trait-impl-overflow-with-where-clause-20413.rs:6:15
|
||||
|
|
||||
LL | struct NoData<T>;
|
||||
| ^ unused type parameter
|
||||
|
|
@ -8,14 +8,14 @@ LL | struct NoData<T>;
|
|||
= help: if you intended `T` to be a const parameter, use `const T: /* Type */` instead
|
||||
|
||||
error[E0275]: overflow evaluating the requirement `NoData<NoData<NoData<NoData<NoData<NoData<NoData<...>>>>>>>: Foo`
|
||||
--> $DIR/issue-20413.rs:8:36
|
||||
--> $DIR/trait-impl-overflow-with-where-clause-20413.rs:9:36
|
||||
|
|
||||
LL | impl<T> Foo for T where NoData<T>: Foo {
|
||||
| ^^^
|
||||
|
|
||||
= help: consider increasing the recursion limit by adding a `#![recursion_limit = "256"]` attribute to your crate (`issue_20413`)
|
||||
= help: consider increasing the recursion limit by adding a `#![recursion_limit = "256"]` attribute to your crate (`trait_impl_overflow_with_where_clause_20413`)
|
||||
note: required for `NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<T>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>` to implement `Foo`
|
||||
--> $DIR/issue-20413.rs:8:9
|
||||
--> $DIR/trait-impl-overflow-with-where-clause-20413.rs:9:9
|
||||
|
|
||||
LL | impl<T> Foo for T where NoData<T>: Foo {
|
||||
| ^^^ ^ --- unsatisfied trait bound introduced here
|
||||
|
|
@ -23,19 +23,19 @@ LL | impl<T> Foo for T where NoData<T>: Foo {
|
|||
= note: required for `NoData<T>` to implement `Foo`
|
||||
|
||||
error[E0275]: overflow evaluating the requirement `AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<...>>>>>>>: Bar`
|
||||
--> $DIR/issue-20413.rs:27:42
|
||||
--> $DIR/trait-impl-overflow-with-where-clause-20413.rs:28:42
|
||||
|
|
||||
LL | impl<T> Bar for T where EvenLessData<T>: Baz {
|
||||
| ^^^
|
||||
|
|
||||
= help: consider increasing the recursion limit by adding a `#![recursion_limit = "256"]` attribute to your crate (`issue_20413`)
|
||||
= help: consider increasing the recursion limit by adding a `#![recursion_limit = "256"]` attribute to your crate (`trait_impl_overflow_with_where_clause_20413`)
|
||||
note: required for `EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<T>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>` to implement `Baz`
|
||||
--> $DIR/issue-20413.rs:34:9
|
||||
--> $DIR/trait-impl-overflow-with-where-clause-20413.rs:35:9
|
||||
|
|
||||
LL | impl<T> Baz for T where AlmostNoData<T>: Bar {
|
||||
| ^^^ ^ --- unsatisfied trait bound introduced here
|
||||
note: required for `AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<T>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>` to implement `Bar`
|
||||
--> $DIR/issue-20413.rs:27:9
|
||||
--> $DIR/trait-impl-overflow-with-where-clause-20413.rs:28:9
|
||||
|
|
||||
LL | impl<T> Bar for T where EvenLessData<T>: Baz {
|
||||
| ^^^ ^ --- unsatisfied trait bound introduced here
|
||||
|
|
@ -43,19 +43,19 @@ LL | impl<T> Bar for T where EvenLessData<T>: Baz {
|
|||
= note: required for `EvenLessData<T>` to implement `Baz`
|
||||
|
||||
error[E0275]: overflow evaluating the requirement `EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<...>>>>>>>: Baz`
|
||||
--> $DIR/issue-20413.rs:34:42
|
||||
--> $DIR/trait-impl-overflow-with-where-clause-20413.rs:35:42
|
||||
|
|
||||
LL | impl<T> Baz for T where AlmostNoData<T>: Bar {
|
||||
| ^^^
|
||||
|
|
||||
= help: consider increasing the recursion limit by adding a `#![recursion_limit = "256"]` attribute to your crate (`issue_20413`)
|
||||
= help: consider increasing the recursion limit by adding a `#![recursion_limit = "256"]` attribute to your crate (`trait_impl_overflow_with_where_clause_20413`)
|
||||
note: required for `AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<T>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>` to implement `Bar`
|
||||
--> $DIR/issue-20413.rs:27:9
|
||||
--> $DIR/trait-impl-overflow-with-where-clause-20413.rs:28:9
|
||||
|
|
||||
LL | impl<T> Bar for T where EvenLessData<T>: Baz {
|
||||
| ^^^ ^ --- unsatisfied trait bound introduced here
|
||||
note: required for `EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<T>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>` to implement `Baz`
|
||||
--> $DIR/issue-20413.rs:34:9
|
||||
--> $DIR/trait-impl-overflow-with-where-clause-20413.rs:35:9
|
||||
|
|
||||
LL | impl<T> Baz for T where AlmostNoData<T>: Bar {
|
||||
| ^^^ ^ --- unsatisfied trait bound introduced here
|
||||
|
|
@ -1,3 +1,4 @@
|
|||
// https://github.com/rust-lang/rust/issues/51632
|
||||
#![allow(dead_code)]
|
||||
|
||||
fn missing_discourses() -> Result<isize, ()> {
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
error[E0308]: `?` operator has incompatible types
|
||||
--> $DIR/issue-51632-try-desugar-incompatible-types.rs:8:5
|
||||
--> $DIR/incompatible-types-with-question-mark-51632.rs:9:5
|
||||
|
|
||||
LL | fn forbidden_narratives() -> Result<isize, ()> {
|
||||
| ----------------- expected `Result<isize, ()>` because of return type
|
||||
|
|
@ -287,6 +287,11 @@ trigger_files = [
|
|||
"compiler/rustc_codegen_llvm/src/llvm/enzyme_ffi.rs",
|
||||
]
|
||||
|
||||
[autolabel."F-explicit_tail_calls"]
|
||||
trigger_files = [
|
||||
"tests/ui/explicit-tail-calls",
|
||||
]
|
||||
|
||||
[autolabel."T-rustdoc-frontend"]
|
||||
trigger_labels = [
|
||||
"A-rustdoc-search",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue