Auto merge of #84158 - cratelyn:patch-extern-c-unwind-behavior, r=nikomatsakis
move new c abi abort behavior behind feature gate
*Background*
In #76570, new ABI strings including `C-unwind` were introduced. Their
behavior is specified in RFC 2945 <sup>[1]</sup>.
However, it was reported in the #ffi-unwind stream of the Rust community Zulip
that this had altered the way that `extern "C"` functions behaved even when the
`c_unwind` feature gate was not active. <sup>[2]</sup>
*Overview*
This makes a small patch to `rustc_mir_build::build::should_abort_on_panic`, so
that the same behavior from before is in place when the `c_unwind` gate is not
active.
`rustc_middle::ty::layout::fn_can_unwind` is not touched, as the visible
behavior should not differ before/after #76570. <sup>[3]</sup>
---
1: https://github.com/rust-lang/rfcs/blob/master/text/2945-c-unwind-abi.md
2: https://rust-lang.zulipchat.com/#narrow/stream/210922-project-ffi-unwind/topic/Is.20unwinding.20through.20extern.20C.20UB.3F/near/230112325
3: https://github.com/rust-lang/rust/pull/76570/files#diff-b0320c2b8868f325d83c027fc5d71732636e9763551e35895488f30fe057c6e9L2599-R2617
[1]: https://github.com/rust-lang/rfcs/blob/master/text/2945-c-unwind-abi.md
[2]: https://rust-lang.zulipchat.com/#narrow/stream/210922-project-ffi-unwind/topic/Is.20unwinding.20through.20extern.20C.20UB.3F/near/230112325
[3]: https://github.com/rust-lang/rust/pull/76570/files#diff-b0320c2b8868f325d83c027fc5d71732636e9763551e35895488f30fe057c6e9L2599-R2617
diff --git a/Cargo.lock b/Cargo.lock
index 58e1d1d..8fec4bf 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -5034,11 +5034,23 @@
"profiler_builtins",
"rand 0.7.3",
"rustc-demangle",
+ "std_detect",
"unwind",
"wasi",
]
[[package]]
+name = "std_detect"
+version = "0.1.5"
+dependencies = [
+ "cfg-if 0.1.10",
+ "compiler_builtins",
+ "libc",
+ "rustc-std-workspace-alloc",
+ "rustc-std-workspace-core",
+]
+
+[[package]]
name = "string_cache"
version = "0.8.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
diff --git a/Cargo.toml b/Cargo.toml
index 95a15a9..0201135 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -45,6 +45,8 @@
# not all `Cargo.toml` files are available, so we exclude the `x` binary,
# so it can be invoked before the current checkout is set up.
"src/tools/x",
+ # stdarch has its own Cargo workspace
+ "library/stdarch",
]
[profile.release.package.compiler_builtins]
diff --git a/RELEASES.md b/RELEASES.md
index c6c0007..024610b 100644
--- a/RELEASES.md
+++ b/RELEASES.md
@@ -50,6 +50,8 @@
- [`io::Empty` now implements `io::Seek`.][78044]
- [`rc::Weak<T>` and `sync::Weak<T>`'s methods such as `as_ptr` are now implemented for
`T: ?Sized` types.][80764]
+- [`Div` and `Rem` by their `NonZero` variant is now implemented for all unsigned integers.][79134]
+
Stabilized APIs
---------------
@@ -72,6 +74,8 @@
- [`str::split_inclusive`]
- [`sync::OnceState`]
- [`task::Wake`]
+- [`VecDeque::range`]
+- [`VecDeque::range_mut`]
Cargo
-----
@@ -115,6 +119,7 @@
- `thumbv7neon-unknown-linux-gnueabihf`
- `armv7-unknown-linux-gnueabi`
- `x86_64-unknown-linux-gnux32`
+- [`atomic::spin_loop_hint` has been deprecated.][80966] It's recommended to use `hint::spin_loop` instead.
Internal Only
-------------
@@ -145,6 +150,8 @@
[80764]: https://github.com/rust-lang/rust/pull/80764
[80749]: https://github.com/rust-lang/rust/pull/80749
[80662]: https://github.com/rust-lang/rust/pull/80662
+[79134]: https://github.com/rust-lang/rust/pull/79134
+[80966]: https://github.com/rust-lang/rust/pull/80966
[cargo/8997]: https://github.com/rust-lang/cargo/pull/8997
[cargo/9112]: https://github.com/rust-lang/cargo/pull/9112
[feature-resolver@2.0]: https://doc.rust-lang.org/nightly/cargo/reference/features.html#feature-resolver-version-2
@@ -166,6 +173,8 @@
[`Seek::stream_position`]: https://doc.rust-lang.org/nightly/std/io/trait.Seek.html#method.stream_position
[`Peekable::next_if`]: https://doc.rust-lang.org/nightly/std/iter/struct.Peekable.html#method.next_if
[`Peekable::next_if_eq`]: https://doc.rust-lang.org/nightly/std/iter/struct.Peekable.html#method.next_if_eq
+[`VecDeque::range`]: https://doc.rust-lang.org/nightly/std/collections/struct.VecDeque.html#method.range
+[`VecDeque::range_mut`]: https://doc.rust-lang.org/nightly/std/collections/struct.VecDeque.html#method.range_mut
Version 1.50.0 (2021-02-11)
============================
diff --git a/compiler/rustc_lint/src/builtin.rs b/compiler/rustc_lint/src/builtin.rs
index 0b49e65..c4acaef 100644
--- a/compiler/rustc_lint/src/builtin.rs
+++ b/compiler/rustc_lint/src/builtin.rs
@@ -857,11 +857,10 @@
/// ```
///
/// This syntax is now a hard error in the 2018 edition. In the 2015
- /// edition, this lint is "allow" by default, because the old code is
- /// still valid, and warning for all old code can be noisy. This lint
+ /// edition, this lint is "warn" by default. This lint
/// enables the [`cargo fix`] tool with the `--edition` flag to
/// automatically transition old code from the 2015 edition to 2018. The
- /// tool will switch this lint to "warn" and will automatically apply the
+ /// tool will run this lint and automatically apply the
/// suggested fix from the compiler (which is to add `_` to each
/// parameter). This provides a completely automated way to update old
/// code for a new edition. See [issue #41686] for more details.
@@ -869,7 +868,7 @@
/// [issue #41686]: https://github.com/rust-lang/rust/issues/41686
/// [`cargo fix`]: https://doc.rust-lang.org/cargo/commands/cargo-fix.html
pub ANONYMOUS_PARAMETERS,
- Allow,
+ Warn,
"detects anonymous parameters",
@future_incompatible = FutureIncompatibleInfo {
reference: "issue #41686 <https://github.com/rust-lang/rust/issues/41686>",
@@ -884,6 +883,10 @@
impl EarlyLintPass for AnonymousParameters {
fn check_trait_item(&mut self, cx: &EarlyContext<'_>, it: &ast::AssocItem) {
+ if cx.sess.edition() != Edition::Edition2015 {
+ // This is a hard error in future editions; avoid linting and erroring
+ return;
+ }
if let ast::AssocItemKind::Fn(box FnKind(_, ref sig, _, _)) = it.kind {
for arg in sig.decl.inputs.iter() {
if let ast::PatKind::Ident(_, ident, None) = arg.pat.kind {
diff --git a/compiler/rustc_parse/src/parser/diagnostics.rs b/compiler/rustc_parse/src/parser/diagnostics.rs
index 77e85c0..70a5ac6 100644
--- a/compiler/rustc_parse/src/parser/diagnostics.rs
+++ b/compiler/rustc_parse/src/parser/diagnostics.rs
@@ -666,21 +666,23 @@
);
match x {
Ok((_, _, false)) => {
- self.bump(); // `>`
- match self.parse_expr() {
- Ok(_) => {
- e.span_suggestion_verbose(
- binop.span.shrink_to_lo(),
- TURBOFISH_SUGGESTION_STR,
- "::".to_string(),
- Applicability::MaybeIncorrect,
- );
- e.emit();
- *expr = self.mk_expr_err(expr.span.to(self.prev_token.span));
- return Ok(());
- }
- Err(mut err) => {
- err.cancel();
+ if self.eat(&token::Gt) {
+ match self.parse_expr() {
+ Ok(_) => {
+ e.span_suggestion_verbose(
+ binop.span.shrink_to_lo(),
+ TURBOFISH_SUGGESTION_STR,
+ "::".to_string(),
+ Applicability::MaybeIncorrect,
+ );
+ e.emit();
+ *expr =
+ self.mk_expr_err(expr.span.to(self.prev_token.span));
+ return Ok(());
+ }
+ Err(mut err) => {
+ err.cancel();
+ }
}
}
}
diff --git a/compiler/rustc_target/src/spec/mod.rs b/compiler/rustc_target/src/spec/mod.rs
index 57b0a36..2af4669 100644
--- a/compiler/rustc_target/src/spec/mod.rs
+++ b/compiler/rustc_target/src/spec/mod.rs
@@ -1446,8 +1446,8 @@
let get_req_field = |name: &str| {
obj.find(name)
- .map(|s| s.as_string())
- .and_then(|os| os.map(|s| s.to_string()))
+ .and_then(Json::as_string)
+ .map(str::to_string)
.ok_or_else(|| format!("Field {} in target specification is required", name))
};
diff --git a/compiler/rustc_typeck/src/astconv/generics.rs b/compiler/rustc_typeck/src/astconv/generics.rs
index 845375f..7a297f2 100644
--- a/compiler/rustc_typeck/src/astconv/generics.rs
+++ b/compiler/rustc_typeck/src/astconv/generics.rs
@@ -82,7 +82,7 @@
if param_type.is_suggestable() {
err.span_suggestion(
tcx.def_span(src_def_id),
- "consider changing this type paramater to a `const`-generic",
+ "consider changing this type parameter to be a `const` generic",
format!("const {}: {}", param_name, param_type),
Applicability::MaybeIncorrect,
);
diff --git a/library/alloc/src/collections/btree/map.rs b/library/alloc/src/collections/btree/map.rs
index a0dbb28..9712447 100644
--- a/library/alloc/src/collections/btree/map.rs
+++ b/library/alloc/src/collections/btree/map.rs
@@ -940,7 +940,6 @@
/// # Examples
///
/// ```
- /// #![feature(btree_retain)]
/// use std::collections::BTreeMap;
///
/// let mut map: BTreeMap<i32, i32> = (0..8).map(|x| (x, x*10)).collect();
@@ -949,7 +948,7 @@
/// assert!(map.into_iter().eq(vec![(0, 0), (2, 20), (4, 40), (6, 60)]));
/// ```
#[inline]
- #[unstable(feature = "btree_retain", issue = "79025")]
+ #[stable(feature = "btree_retain", since = "1.53.0")]
pub fn retain<F>(&mut self, mut f: F)
where
K: Ord,
diff --git a/library/alloc/src/collections/btree/set.rs b/library/alloc/src/collections/btree/set.rs
index a331b8d..737932d 100644
--- a/library/alloc/src/collections/btree/set.rs
+++ b/library/alloc/src/collections/btree/set.rs
@@ -851,7 +851,6 @@
/// # Examples
///
/// ```
- /// #![feature(btree_retain)]
/// use std::collections::BTreeSet;
///
/// let xs = [1, 2, 3, 4, 5, 6];
@@ -860,7 +859,7 @@
/// set.retain(|&k| k % 2 == 0);
/// assert!(set.iter().eq([2, 4, 6].iter()));
/// ```
- #[unstable(feature = "btree_retain", issue = "79025")]
+ #[stable(feature = "btree_retain", since = "1.53.0")]
pub fn retain<F>(&mut self, mut f: F)
where
T: Ord,
diff --git a/library/alloc/src/vec/mod.rs b/library/alloc/src/vec/mod.rs
index 91c3b16..0dab035 100644
--- a/library/alloc/src/vec/mod.rs
+++ b/library/alloc/src/vec/mod.rs
@@ -2567,7 +2567,7 @@
/// # let some_predicate = |x: &mut i32| { *x == 2 || *x == 3 || *x == 6 };
/// # let mut vec = vec![1, 2, 3, 4, 5, 6];
/// let mut i = 0;
- /// while i != vec.len() {
+ /// while i < vec.len() {
/// if some_predicate(&mut vec[i]) {
/// let val = vec.remove(i);
/// // your code here
diff --git a/library/core/src/fmt/mod.rs b/library/core/src/fmt/mod.rs
index d696ffa..59493bb 100644
--- a/library/core/src/fmt/mod.rs
+++ b/library/core/src/fmt/mod.rs
@@ -2268,7 +2268,7 @@
}
#[stable(feature = "core_impl_debug", since = "1.9.0")]
-impl<T: ?Sized + Debug> Debug for UnsafeCell<T> {
+impl<T: ?Sized> Debug for UnsafeCell<T> {
fn fmt(&self, f: &mut Formatter<'_>) -> Result {
f.pad("UnsafeCell")
}
diff --git a/library/core/src/intrinsics.rs b/library/core/src/intrinsics.rs
index b5371d6..1ba0b23 100644
--- a/library/core/src/intrinsics.rs
+++ b/library/core/src/intrinsics.rs
@@ -1543,7 +1543,7 @@
/// let num_trailing = unsafe { cttz_nonzero(x) };
/// assert_eq!(num_trailing, 3);
/// ```
- #[rustc_const_unstable(feature = "const_cttz", issue = "none")]
+ #[rustc_const_stable(feature = "const_cttz", since = "1.53.0")]
pub fn cttz_nonzero<T: Copy>(x: T) -> T;
/// Reverses the bytes in an integer type `T`.
diff --git a/library/core/src/lib.rs b/library/core/src/lib.rs
index 06c5014..d0c52a4 100644
--- a/library/core/src/lib.rs
+++ b/library/core/src/lib.rs
@@ -79,7 +79,6 @@
#![feature(const_int_unchecked_arith)]
#![feature(const_mut_refs)]
#![feature(const_refs_to_cell)]
-#![feature(const_cttz)]
#![feature(const_panic)]
#![feature(const_pin)]
#![feature(const_fn)]
diff --git a/library/core/src/num/f32.rs b/library/core/src/num/f32.rs
index 690247b..0d6d919 100644
--- a/library/core/src/num/f32.rs
+++ b/library/core/src/num/f32.rs
@@ -500,7 +500,6 @@
/// Returns `true` if the number is [subnormal].
///
/// ```
- /// #![feature(is_subnormal)]
/// let min = f32::MIN_POSITIVE; // 1.17549435e-38f32
/// let max = f32::MAX;
/// let lower_than_min = 1.0e-40_f32;
@@ -516,7 +515,7 @@
/// assert!(lower_than_min.is_subnormal());
/// ```
/// [subnormal]: https://en.wikipedia.org/wiki/Denormal_number
- #[unstable(feature = "is_subnormal", issue = "79288")]
+ #[stable(feature = "is_subnormal", since = "1.53.0")]
#[rustc_const_unstable(feature = "const_float_classify", issue = "72505")]
#[inline]
pub const fn is_subnormal(self) -> bool {
diff --git a/library/core/src/num/f64.rs b/library/core/src/num/f64.rs
index 6d37372..42214e7 100644
--- a/library/core/src/num/f64.rs
+++ b/library/core/src/num/f64.rs
@@ -499,7 +499,6 @@
/// Returns `true` if the number is [subnormal].
///
/// ```
- /// #![feature(is_subnormal)]
/// let min = f64::MIN_POSITIVE; // 2.2250738585072014e-308_f64
/// let max = f64::MAX;
/// let lower_than_min = 1.0e-308_f64;
@@ -515,7 +514,7 @@
/// assert!(lower_than_min.is_subnormal());
/// ```
/// [subnormal]: https://en.wikipedia.org/wiki/Denormal_number
- #[unstable(feature = "is_subnormal", issue = "79288")]
+ #[stable(feature = "is_subnormal", since = "1.53.0")]
#[rustc_const_unstable(feature = "const_float_classify", issue = "72505")]
#[inline]
pub const fn is_subnormal(self) -> bool {
diff --git a/library/core/src/num/nonzero.rs b/library/core/src/num/nonzero.rs
index 111feb7..81262a2 100644
--- a/library/core/src/num/nonzero.rs
+++ b/library/core/src/num/nonzero.rs
@@ -191,13 +191,12 @@
/// Basic usage:
///
/// ```
- /// #![feature(nonzero_leading_trailing_zeros)]
#[doc = concat!("let n = std::num::", stringify!($Ty), "::new(", stringify!($LeadingTestExpr), ").unwrap();")]
///
/// assert_eq!(n.leading_zeros(), 0);
/// ```
- #[unstable(feature = "nonzero_leading_trailing_zeros", issue = "79143")]
- #[rustc_const_unstable(feature = "nonzero_leading_trailing_zeros", issue = "79143")]
+ #[stable(feature = "nonzero_leading_trailing_zeros", since = "1.53.0")]
+ #[rustc_const_stable(feature = "nonzero_leading_trailing_zeros", since = "1.53.0")]
#[inline]
pub const fn leading_zeros(self) -> u32 {
// SAFETY: since `self` can not be zero it is safe to call ctlz_nonzero
@@ -214,13 +213,12 @@
/// Basic usage:
///
/// ```
- /// #![feature(nonzero_leading_trailing_zeros)]
#[doc = concat!("let n = std::num::", stringify!($Ty), "::new(0b0101000).unwrap();")]
///
/// assert_eq!(n.trailing_zeros(), 3);
/// ```
- #[unstable(feature = "nonzero_leading_trailing_zeros", issue = "79143")]
- #[rustc_const_unstable(feature = "nonzero_leading_trailing_zeros", issue = "79143")]
+ #[stable(feature = "nonzero_leading_trailing_zeros", since = "1.53.0")]
+ #[rustc_const_stable(feature = "nonzero_leading_trailing_zeros", since = "1.53.0")]
#[inline]
pub const fn trailing_zeros(self) -> u32 {
// SAFETY: since `self` can not be zero it is safe to call cttz_nonzero
diff --git a/library/core/src/time.rs b/library/core/src/time.rs
index 2219353..fa6a6c2 100644
--- a/library/core/src/time.rs
+++ b/library/core/src/time.rs
@@ -124,14 +124,13 @@
/// # Examples
///
/// ```
- /// #![feature(duration_zero)]
/// use std::time::Duration;
///
/// let duration = Duration::ZERO;
/// assert!(duration.is_zero());
/// assert_eq!(duration.as_nanos(), 0);
/// ```
- #[unstable(feature = "duration_zero", issue = "73544")]
+ #[stable(feature = "duration_zero", since = "1.53.0")]
pub const ZERO: Duration = Duration::from_nanos(0);
/// The maximum duration.
@@ -269,7 +268,6 @@
/// # Examples
///
/// ```
- /// #![feature(duration_zero)]
/// use std::time::Duration;
///
/// assert!(Duration::ZERO.is_zero());
@@ -281,7 +279,8 @@
/// assert!(!Duration::from_nanos(1).is_zero());
/// assert!(!Duration::from_secs(1).is_zero());
/// ```
- #[unstable(feature = "duration_zero", issue = "73544")]
+ #[stable(feature = "duration_zero", since = "1.53.0")]
+ #[rustc_const_stable(feature = "duration_zero", since = "1.53.0")]
#[inline]
pub const fn is_zero(&self) -> bool {
self.secs == 0 && self.nanos == 0
@@ -536,7 +535,6 @@
/// # Examples
///
/// ```
- /// #![feature(duration_zero)]
/// use std::time::Duration;
///
/// assert_eq!(Duration::new(0, 1).saturating_sub(Duration::new(0, 0)), Duration::new(0, 1));
diff --git a/library/core/tests/lib.rs b/library/core/tests/lib.rs
index 3e5e5f3..f6bfe67 100644
--- a/library/core/tests/lib.rs
+++ b/library/core/tests/lib.rs
@@ -24,7 +24,6 @@
#![feature(div_duration)]
#![feature(duration_consts_2)]
#![feature(duration_constants)]
-#![feature(duration_zero)]
#![feature(exact_size_is_empty)]
#![feature(extern_types)]
#![feature(flt2dec)]
@@ -67,7 +66,6 @@
#![feature(ptr_metadata)]
#![feature(once_cell)]
#![feature(unsized_tuple_coercion)]
-#![feature(nonzero_leading_trailing_zeros)]
#![feature(const_option)]
#![feature(integer_atomics)]
#![feature(slice_group_by)]
diff --git a/library/std/Cargo.toml b/library/std/Cargo.toml
index 84a6422..ab7b142 100644
--- a/library/std/Cargo.toml
+++ b/library/std/Cargo.toml
@@ -21,6 +21,7 @@
profiler_builtins = { path = "../profiler_builtins", optional = true }
unwind = { path = "../unwind" }
hashbrown = { version = "0.11", default-features = false, features = ['rustc-dep-of-std'] }
+std_detect = { path = "../stdarch/crates/std_detect", default-features = false, features = ['rustc-dep-of-std'] }
# Dependencies of the `backtrace` crate
addr2line = { version = "0.14.0", optional = true, default-features = false }
@@ -70,8 +71,8 @@
# Enable std_detect default features for stdarch/crates/std_detect:
# https://github.com/rust-lang/stdarch/blob/master/crates/std_detect/Cargo.toml
-std_detect_file_io = []
-std_detect_dlsym_getauxval = []
+std_detect_file_io = ["std_detect/std_detect_file_io"]
+std_detect_dlsym_getauxval = ["std_detect/std_detect_dlsym_getauxval"]
[package.metadata.fortanix-sgx]
# Maximum possible number of threads when testing
diff --git a/library/std/src/io/buffered/bufreader.rs b/library/std/src/io/buffered/bufreader.rs
index 02b0fc0..d8021d3 100644
--- a/library/std/src/io/buffered/bufreader.rs
+++ b/library/std/src/io/buffered/bufreader.rs
@@ -234,7 +234,7 @@
/// the buffer will not be flushed, allowing for more efficient seeks.
/// This method does not return the location of the underlying reader, so the caller
/// must track this information themselves if it is required.
- #[unstable(feature = "bufreader_seek_relative", issue = "31100")]
+ #[stable(feature = "bufreader_seek_relative", since = "1.53.0")]
pub fn seek_relative(&mut self, offset: i64) -> io::Result<()> {
let pos = self.pos as u64;
if offset < 0 {
diff --git a/library/std/src/keyword_docs.rs b/library/std/src/keyword_docs.rs
index 2a3d44f..39ed624 100644
--- a/library/std/src/keyword_docs.rs
+++ b/library/std/src/keyword_docs.rs
@@ -1768,6 +1768,7 @@
/// In the 2015 edition the parameters pattern was not needed for traits:
///
/// ```rust,edition2015
+/// # #![allow(anonymous_parameters)]
/// trait Tr {
/// fn f(i32);
/// }
diff --git a/library/std/src/lib.rs b/library/std/src/lib.rs
index 91695ce..90603cd 100644
--- a/library/std/src/lib.rs
+++ b/library/std/src/lib.rs
@@ -261,7 +261,6 @@
#![cfg_attr(not(bootstrap), feature(doc_notable_trait))]
#![feature(dropck_eyepatch)]
#![feature(duration_constants)]
-#![feature(duration_zero)]
#![feature(edition_panic)]
#![feature(exact_size_is_empty)]
#![feature(exhaustive_patterns)]
@@ -538,22 +537,16 @@
#[allow(dead_code, unused_attributes)]
mod backtrace_rs;
-// Pull in the `std_detect` crate directly into libstd. The contents of
-// `std_detect` are in a different repository: rust-lang/stdarch.
-//
-// `std_detect` depends on libstd, but the contents of this module are
-// set up in such a way that directly pulling it here works such that the
-// crate uses the this crate as its libstd.
-#[path = "../../stdarch/crates/std_detect/src/mod.rs"]
-#[allow(missing_debug_implementations, missing_docs, dead_code)]
-#[unstable(feature = "stdsimd", issue = "48556")]
-#[cfg(not(test))]
-mod std_detect;
-
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub use std_detect::is_x86_feature_detected;
#[doc(hidden)]
#[unstable(feature = "stdsimd", issue = "48556")]
-#[cfg(not(test))]
-pub use std_detect::detect;
+pub use std_detect::*;
+#[unstable(feature = "stdsimd", issue = "48556")]
+pub use std_detect::{
+ is_aarch64_feature_detected, is_arm_feature_detected, is_mips64_feature_detected,
+ is_mips_feature_detected, is_powerpc64_feature_detected, is_powerpc_feature_detected,
+};
// Re-export macros defined in libcore.
#[stable(feature = "rust1", since = "1.0.0")]
diff --git a/library/stdarch b/library/stdarch
index 9c732a5..19f5459 160000
--- a/library/stdarch
+++ b/library/stdarch
@@ -1 +1 @@
-Subproject commit 9c732a56f67f54d12a0b4fd99993154906c95ea6
+Subproject commit 19f5459dd0f89e466b7bcaa0f69ecca90f21a4d1
diff --git a/src/librustdoc/html/render/mod.rs b/src/librustdoc/html/render/mod.rs
index fbe799e..efd453f 100644
--- a/src/librustdoc/html/render/mod.rs
+++ b/src/librustdoc/html/render/mod.rs
@@ -912,10 +912,9 @@
let cache = cx.cache();
let tcx = cx.tcx();
let name = meth.name.as_ref().unwrap();
- let anchor = format!("#{}.{}", meth.type_(), name);
let href = match link {
AssocItemLink::Anchor(Some(ref id)) => format!("#{}", id),
- AssocItemLink::Anchor(None) => anchor,
+ AssocItemLink::Anchor(None) => format!("#{}.{}", meth.type_(), name),
AssocItemLink::GotoSource(did, provided_methods) => {
// We're creating a link from an impl-item to the corresponding
// trait-item and need to map the anchored type accordingly.
@@ -925,7 +924,9 @@
ItemType::TyMethod
};
- href(did, cache).map(|p| format!("{}#{}.{}", p.0, ty, name)).unwrap_or(anchor)
+ href(did, cache)
+ .map(|p| format!("{}#{}.{}", p.0, ty, name))
+ .unwrap_or_else(|| format!("#{}.{}", ty, name))
}
};
let vis = meth.visibility.print_with_space(tcx, meth.def_id, cache).to_string();
@@ -1452,14 +1453,32 @@
} else {
(true, " hidden")
};
+ let in_trait_class = if trait_.is_some() { " trait-impl" } else { "" };
match *item.kind {
clean::MethodItem(..) | clean::TyMethodItem(_) => {
// Only render when the method is not static or we allow static methods
if render_method_item {
let id = cx.derive_id(format!("{}.{}", item_type, name));
- write!(w, "<h4 id=\"{}\" class=\"{}{}\">", id, item_type, extra_class);
+ let source_id = trait_
+ .and_then(|trait_| {
+ trait_.items.iter().find(|item| {
+ item.name.map(|n| n.as_str().eq(&name.as_str())).unwrap_or(false)
+ })
+ })
+ .map(|item| format!("{}.{}", item.type_(), name));
+ write!(
+ w,
+ "<h4 id=\"{}\" class=\"{}{}{}\">",
+ id, item_type, extra_class, in_trait_class,
+ );
w.write_str("<code>");
- render_assoc_item(w, item, link.anchor(&id), ItemType::Impl, cx);
+ render_assoc_item(
+ w,
+ item,
+ link.anchor(source_id.as_ref().unwrap_or(&id)),
+ ItemType::Impl,
+ cx,
+ );
w.write_str("</code>");
render_stability_since_raw(
w,
@@ -1468,29 +1487,50 @@
outer_version,
outer_const_version,
);
+ write!(w, "<a href=\"#{}\" class=\"anchor\"></a>", id);
write_srclink(cx, item, w);
w.write_str("</h4>");
}
}
clean::TypedefItem(ref tydef, _) => {
- let id = cx.derive_id(format!("{}.{}", ItemType::AssocType, name));
- write!(w, "<h4 id=\"{}\" class=\"{}{}\"><code>", id, item_type, extra_class);
+ let source_id = format!("{}.{}", ItemType::AssocType, name);
+ let id = cx.derive_id(source_id.clone());
+ write!(
+ w,
+ "<h4 id=\"{}\" class=\"{}{}{}\"><code>",
+ id, item_type, extra_class, in_trait_class
+ );
assoc_type(
w,
item,
&Vec::new(),
Some(&tydef.type_),
- link.anchor(&id),
+ link.anchor(if trait_.is_some() { &source_id } else { &id }),
"",
cx.cache(),
tcx,
);
- w.write_str("</code></h4>");
+ w.write_str("</code>");
+ write!(w, "<a href=\"#{}\" class=\"anchor\"></a>", id);
+ w.write_str("</h4>");
}
clean::AssocConstItem(ref ty, ref default) => {
- let id = cx.derive_id(format!("{}.{}", item_type, name));
- write!(w, "<h4 id=\"{}\" class=\"{}{}\"><code>", id, item_type, extra_class);
- assoc_const(w, item, ty, default.as_ref(), link.anchor(&id), "", cx);
+ let source_id = format!("{}.{}", item_type, name);
+ let id = cx.derive_id(source_id.clone());
+ write!(
+ w,
+ "<h4 id=\"{}\" class=\"{}{}{}\"><code>",
+ id, item_type, extra_class, in_trait_class
+ );
+ assoc_const(
+ w,
+ item,
+ ty,
+ default.as_ref(),
+ link.anchor(if trait_.is_some() { &source_id } else { &id }),
+ "",
+ cx,
+ );
w.write_str("</code>");
render_stability_since_raw(
w,
@@ -1499,23 +1539,31 @@
outer_version,
outer_const_version,
);
+ write!(w, "<a href=\"#{}\" class=\"anchor\"></a>", id);
write_srclink(cx, item, w);
w.write_str("</h4>");
}
clean::AssocTypeItem(ref bounds, ref default) => {
- let id = cx.derive_id(format!("{}.{}", item_type, name));
- write!(w, "<h4 id=\"{}\" class=\"{}{}\"><code>", id, item_type, extra_class);
+ let source_id = format!("{}.{}", item_type, name);
+ let id = cx.derive_id(source_id.clone());
+ write!(
+ w,
+ "<h4 id=\"{}\" class=\"{}{}{}\"><code>",
+ id, item_type, extra_class, in_trait_class
+ );
assoc_type(
w,
item,
bounds,
default.as_ref(),
- link.anchor(&id),
+ link.anchor(if trait_.is_some() { &source_id } else { &id }),
"",
cx.cache(),
tcx,
);
- w.write_str("</code></h4>");
+ w.write_str("</code>");
+ write!(w, "<a href=\"#{}\" class=\"anchor\"></a>", id);
+ w.write_str("</h4>");
}
clean::StrippedItem(..) => return,
_ => panic!("can't make docs for trait item with name {:?}", item.name),
@@ -1605,7 +1653,7 @@
true,
outer_version,
outer_const_version,
- None,
+ Some(t),
show_def_docs,
);
}
diff --git a/src/librustdoc/html/static/rustdoc.css b/src/librustdoc/html/static/rustdoc.css
index 585b745..705ae17 100644
--- a/src/librustdoc/html/static/rustdoc.css
+++ b/src/librustdoc/html/static/rustdoc.css
@@ -133,7 +133,8 @@
margin-bottom: 10px;
position: relative;
}
-h3.impl, h3.method, h3.type {
+h3.impl, h3.method, h4.method.trait-impl, h3.type,
+h4.type.trait-impl, h4.associatedconstant.trait-impl {
padding-left: 15px;
}
@@ -655,7 +656,8 @@
display: initial;
}
-.in-band:hover > .anchor, .impl:hover > .anchor {
+.in-band:hover > .anchor, .impl:hover > .anchor, .method.trait-impl:hover > .anchor,
+.type.trait-impl:hover > .anchor, .associatedconstant.trait-impl:hover > .anchor {
display: inline-block;
position: absolute;
}
diff --git a/src/librustdoc/passes/bare_urls.rs b/src/librustdoc/passes/bare_urls.rs
index 524f266..ac0d74c 100644
--- a/src/librustdoc/passes/bare_urls.rs
+++ b/src/librustdoc/passes/bare_urls.rs
@@ -73,6 +73,7 @@
.unwrap_or(item.span.inner());
cx.tcx.struct_span_lint_hir(crate::lint::BARE_URLS, hir_id, sp, |lint| {
lint.build(msg)
+ .note("bare URLs are not automatically turned into clickable links")
.span_suggestion(
sp,
"use an automatic link instead",
diff --git a/src/test/rustdoc-ui/bare-urls.stderr b/src/test/rustdoc-ui/bare-urls.stderr
index 6b612f8..7097a8d 100644
--- a/src/test/rustdoc-ui/bare-urls.stderr
+++ b/src/test/rustdoc-ui/bare-urls.stderr
@@ -9,102 +9,135 @@
|
LL | #![deny(rustdoc::bare_urls)]
| ^^^^^^^^^^^^^^^^^^
+ = note: bare URLs are not automatically turned into clickable links
error: this URL is not a hyperlink
--> $DIR/bare-urls.rs:7:5
|
LL | /// https://somewhere.com/a
| ^^^^^^^^^^^^^^^^^^^^^^^ help: use an automatic link instead: `<https://somewhere.com/a>`
+ |
+ = note: bare URLs are not automatically turned into clickable links
error: this URL is not a hyperlink
--> $DIR/bare-urls.rs:9:5
|
LL | /// https://www.somewhere.com
| ^^^^^^^^^^^^^^^^^^^^^^^^^ help: use an automatic link instead: `<https://www.somewhere.com>`
+ |
+ = note: bare URLs are not automatically turned into clickable links
error: this URL is not a hyperlink
--> $DIR/bare-urls.rs:11:5
|
LL | /// https://www.somewhere.com/a
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use an automatic link instead: `<https://www.somewhere.com/a>`
+ |
+ = note: bare URLs are not automatically turned into clickable links
error: this URL is not a hyperlink
--> $DIR/bare-urls.rs:13:5
|
LL | /// https://subdomain.example.com
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use an automatic link instead: `<https://subdomain.example.com>`
+ |
+ = note: bare URLs are not automatically turned into clickable links
error: this URL is not a hyperlink
--> $DIR/bare-urls.rs:15:5
|
LL | /// https://somewhere.com?
| ^^^^^^^^^^^^^^^^^^^^^^ help: use an automatic link instead: `<https://somewhere.com?>`
+ |
+ = note: bare URLs are not automatically turned into clickable links
error: this URL is not a hyperlink
--> $DIR/bare-urls.rs:17:5
|
LL | /// https://somewhere.com/a?
| ^^^^^^^^^^^^^^^^^^^^^^^^ help: use an automatic link instead: `<https://somewhere.com/a?>`
+ |
+ = note: bare URLs are not automatically turned into clickable links
error: this URL is not a hyperlink
--> $DIR/bare-urls.rs:19:5
|
LL | /// https://somewhere.com?hello=12
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use an automatic link instead: `<https://somewhere.com?hello=12>`
+ |
+ = note: bare URLs are not automatically turned into clickable links
error: this URL is not a hyperlink
--> $DIR/bare-urls.rs:21:5
|
LL | /// https://somewhere.com/a?hello=12
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use an automatic link instead: `<https://somewhere.com/a?hello=12>`
+ |
+ = note: bare URLs are not automatically turned into clickable links
error: this URL is not a hyperlink
--> $DIR/bare-urls.rs:23:5
|
LL | /// https://example.com?hello=12#xyz
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use an automatic link instead: `<https://example.com?hello=12#xyz>`
+ |
+ = note: bare URLs are not automatically turned into clickable links
error: this URL is not a hyperlink
--> $DIR/bare-urls.rs:25:5
|
LL | /// https://example.com/a?hello=12#xyz
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use an automatic link instead: `<https://example.com/a?hello=12#xyz>`
+ |
+ = note: bare URLs are not automatically turned into clickable links
error: this URL is not a hyperlink
--> $DIR/bare-urls.rs:27:5
|
LL | /// https://example.com#xyz
| ^^^^^^^^^^^^^^^^^^^^^^^ help: use an automatic link instead: `<https://example.com#xyz>`
+ |
+ = note: bare URLs are not automatically turned into clickable links
error: this URL is not a hyperlink
--> $DIR/bare-urls.rs:29:5
|
LL | /// https://example.com/a#xyz
| ^^^^^^^^^^^^^^^^^^^^^^^^^ help: use an automatic link instead: `<https://example.com/a#xyz>`
+ |
+ = note: bare URLs are not automatically turned into clickable links
error: this URL is not a hyperlink
--> $DIR/bare-urls.rs:31:5
|
LL | /// https://somewhere.com?hello=12&bye=11
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use an automatic link instead: `<https://somewhere.com?hello=12&bye=11>`
+ |
+ = note: bare URLs are not automatically turned into clickable links
error: this URL is not a hyperlink
--> $DIR/bare-urls.rs:33:5
|
LL | /// https://somewhere.com/a?hello=12&bye=11
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use an automatic link instead: `<https://somewhere.com/a?hello=12&bye=11>`
+ |
+ = note: bare URLs are not automatically turned into clickable links
error: this URL is not a hyperlink
--> $DIR/bare-urls.rs:35:5
|
LL | /// https://somewhere.com?hello=12&bye=11#xyz
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use an automatic link instead: `<https://somewhere.com?hello=12&bye=11#xyz>`
+ |
+ = note: bare URLs are not automatically turned into clickable links
error: this URL is not a hyperlink
--> $DIR/bare-urls.rs:37:10
|
LL | /// hey! https://somewhere.com/a?hello=12&bye=11#xyz
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use an automatic link instead: `<https://somewhere.com/a?hello=12&bye=11#xyz>`
+ |
+ = note: bare URLs are not automatically turned into clickable links
error: aborting due to 17 previous errors
diff --git a/src/test/rustdoc-ui/renamed-lint-still-applies.stderr b/src/test/rustdoc-ui/renamed-lint-still-applies.stderr
index 19c253b..3040cad 100644
--- a/src/test/rustdoc-ui/renamed-lint-still-applies.stderr
+++ b/src/test/rustdoc-ui/renamed-lint-still-applies.stderr
@@ -31,6 +31,7 @@
|
LL | #![deny(rustdoc::non_autolinks)]
| ^^^^^^^^^^^^^^^^^^^^^^
+ = note: bare URLs are not automatically turned into clickable links
error: aborting due to 2 previous errors; 1 warning emitted
diff --git a/src/test/rustdoc/trait-impl-items-links-and-anchors.rs b/src/test/rustdoc/trait-impl-items-links-and-anchors.rs
new file mode 100644
index 0000000..6c09be1
--- /dev/null
+++ b/src/test/rustdoc/trait-impl-items-links-and-anchors.rs
@@ -0,0 +1,65 @@
+pub trait MyTrait {
+ type Assoc;
+ const VALUE: u32;
+ fn trait_function(&self);
+ fn defaulted(&self) {}
+ fn defaulted_override(&self) {}
+}
+
+
+impl MyTrait for String {
+ // @has trait_impl_items_links_and_anchors/trait.MyTrait.html '//h4[@id="associatedtype.Assoc-1"]//a[@class="type"]/@href' #associatedtype.Assoc
+ // @has trait_impl_items_links_and_anchors/trait.MyTrait.html '//h4[@id="associatedtype.Assoc-1"]//a[@class="anchor"]/@href' #associatedtype.Assoc-1
+ type Assoc = ();
+ // @has trait_impl_items_links_and_anchors/trait.MyTrait.html '//h4[@id="associatedconstant.VALUE-1"]//a[@class="constant"]/@href' #associatedconstant.VALUE
+ // @has trait_impl_items_links_and_anchors/trait.MyTrait.html '//h4[@id="associatedconstant.VALUE-1"]//a[@class="anchor"]/@href' #associatedconstant.VALUE-1
+ const VALUE: u32 = 5;
+ // @has trait_impl_items_links_and_anchors/trait.MyTrait.html '//h4[@id="method.trait_function"]//a[@class="fnname"]/@href' #tymethod.trait_function
+ // @has trait_impl_items_links_and_anchors/trait.MyTrait.html '//h4[@id="method.trait_function"]//a[@class="anchor"]/@href' #method.trait_function
+ fn trait_function(&self) {}
+ // @has trait_impl_items_links_and_anchors/trait.MyTrait.html '//h4[@id="method.defaulted_override-1"]//a[@class="fnname"]/@href' #method.defaulted_override
+ // @has trait_impl_items_links_and_anchors/trait.MyTrait.html '//h4[@id="method.defaulted_override-1"]//a[@class="anchor"]/@href' #method.defaulted_override-1
+ fn defaulted_override(&self) {}
+}
+
+impl MyTrait for Vec<u8> {
+ // @has trait_impl_items_links_and_anchors/trait.MyTrait.html '//h4[@id="associatedtype.Assoc-2"]//a[@class="type"]/@href' #associatedtype.Assoc
+ // @has trait_impl_items_links_and_anchors/trait.MyTrait.html '//h4[@id="associatedtype.Assoc-2"]//a[@class="anchor"]/@href' #associatedtype.Assoc-2
+ type Assoc = ();
+ // @has trait_impl_items_links_and_anchors/trait.MyTrait.html '//h4[@id="associatedconstant.VALUE-2"]//a[@class="constant"]/@href' #associatedconstant.VALUE
+ // @has trait_impl_items_links_and_anchors/trait.MyTrait.html '//h4[@id="associatedconstant.VALUE-2"]//a[@class="anchor"]/@href' #associatedconstant.VALUE-2
+ const VALUE: u32 = 5;
+ // @has trait_impl_items_links_and_anchors/trait.MyTrait.html '//h4[@id="method.trait_function"]//a[@class="fnname"]/@href' #tymethod.trait_function
+ // @has trait_impl_items_links_and_anchors/trait.MyTrait.html '//h4[@id="method.trait_function-1"]//a[@class="anchor"]/@href' #method.trait_function-1
+ fn trait_function(&self) {}
+ // @has trait_impl_items_links_and_anchors/trait.MyTrait.html '//h4[@id="method.defaulted_override-2"]//a[@class="fnname"]/@href' #method.defaulted_override
+ // @has trait_impl_items_links_and_anchors/trait.MyTrait.html '//h4[@id="method.defaulted_override-2"]//a[@class="anchor"]/@href' #method.defaulted_override-2
+ fn defaulted_override(&self) {}
+}
+
+impl MyTrait for MyStruct {
+ // @has trait_impl_items_links_and_anchors/trait.MyTrait.html '//h4[@id="associatedtype.Assoc-3"]//a[@class="type"]/@href' #associatedtype.Assoc
+ // @has trait_impl_items_links_and_anchors/trait.MyTrait.html '//h4[@id="associatedtype.Assoc-3"]//a[@class="anchor"]/@href' #associatedtype.Assoc-3
+ // @has trait_impl_items_links_and_anchors/struct.MyStruct.html '//h4[@id="associatedtype.Assoc"]//a[@class="type"]/@href' ../trait_impl_items_links_and_anchors/trait.MyTrait.html#associatedtype.Assoc
+ // @has trait_impl_items_links_and_anchors/struct.MyStruct.html '//h4[@id="associatedtype.Assoc"]//a[@class="anchor"]/@href' #associatedtype.Assoc
+ type Assoc = bool;
+ // @has trait_impl_items_links_and_anchors/trait.MyTrait.html '//h4[@id="associatedconstant.VALUE-3"]//a[@class="constant"]/@href' #associatedconstant.VALUE
+ // @has trait_impl_items_links_and_anchors/trait.MyTrait.html '//h4[@id="associatedconstant.VALUE-3"]//a[@class="anchor"]/@href' #associatedconstant.VALUE-3
+ // @has trait_impl_items_links_and_anchors/struct.MyStruct.html '//h4[@id="associatedconstant.VALUE"]//a[@class="constant"]/@href' ../trait_impl_items_links_and_anchors/trait.MyTrait.html#associatedconstant.VALUE
+ // @has trait_impl_items_links_and_anchors/struct.MyStruct.html '//h4[@id="associatedconstant.VALUE"]//a[@class="anchor"]/@href' #associatedconstant.VALUE
+ const VALUE: u32 = 20;
+ // @has trait_impl_items_links_and_anchors/trait.MyTrait.html '//h4[@id="method.trait_function-2"]//a[@class="fnname"]/@href' #tymethod.trait_function
+ // @has trait_impl_items_links_and_anchors/trait.MyTrait.html '//h4[@id="method.trait_function-2"]//a[@class="anchor"]/@href' #method.trait_function-2
+ // @has trait_impl_items_links_and_anchors/struct.MyStruct.html '//h4[@id="method.trait_function"]//a[@class="fnname"]/@href' ../trait_impl_items_links_and_anchors/trait.MyTrait.html#tymethod.trait_function
+ // @has trait_impl_items_links_and_anchors/struct.MyStruct.html '//h4[@id="method.trait_function"]//a[@class="anchor"]/@href' #method.trait_function
+ fn trait_function(&self) {}
+ // @has trait_impl_items_links_and_anchors/trait.MyTrait.html '//h4[@id="method.defaulted_override-3"]//a[@class="fnname"]/@href' #method.defaulted_override
+ // @has trait_impl_items_links_and_anchors/trait.MyTrait.html '//h4[@id="method.defaulted_override-3"]//a[@class="anchor"]/@href' #method.defaulted_override-3
+ // @has trait_impl_items_links_and_anchors/struct.MyStruct.html '//h4[@id="method.defaulted_override"]//a[@class="fnname"]/@href' ../trait_impl_items_links_and_anchors/trait.MyTrait.html#method.defaulted_override
+ // @has trait_impl_items_links_and_anchors/struct.MyStruct.html '//h4[@id="method.defaulted_override"]//a[@class="anchor"]/@href' #method.defaulted_override
+ fn defaulted_override(&self) {}
+ // @has trait_impl_items_links_and_anchors/struct.MyStruct.html '//h4[@id="method.defaulted"]//a[@class="fnname"]/@href' ../trait_impl_items_links_and_anchors/trait.MyTrait.html#method.defaulted
+ // @has trait_impl_items_links_and_anchors/struct.MyStruct.html '//h4[@id="method.defaulted"]//a[@class="anchor"]/@href' #method.defaulted
+}
+
+pub struct MyStruct;
diff --git a/src/test/ui/anon-params/anon-params-edition-hygiene.rs b/src/test/ui/anon-params/anon-params-edition-hygiene.rs
index 14e11c5..6936205 100644
--- a/src/test/ui/anon-params/anon-params-edition-hygiene.rs
+++ b/src/test/ui/anon-params/anon-params-edition-hygiene.rs
@@ -2,6 +2,9 @@
// edition:2018
// aux-build:anon-params-edition-hygiene.rs
+// This warning is still surfaced
+#![allow(anonymous_parameters)]
+
#[macro_use]
extern crate anon_params_edition_hygiene;
diff --git a/src/test/ui/asm/naked-invalid-attr.rs b/src/test/ui/asm/naked-invalid-attr.rs
index cdb6c17..2576d11 100644
--- a/src/test/ui/asm/naked-invalid-attr.rs
+++ b/src/test/ui/asm/naked-invalid-attr.rs
@@ -1,6 +1,6 @@
// Checks that #[naked] attribute can be placed on function definitions only.
//
-// ignore-wasm32 asm unsupported
+// needs-asm-support
#![feature(asm)]
#![feature(naked_functions)]
#![naked] //~ ERROR should be applied to a function definition
diff --git a/src/test/ui/const-generics/diagnostics.stderr b/src/test/ui/const-generics/diagnostics.stderr
index 7d038ff..c8ee6ad 100644
--- a/src/test/ui/const-generics/diagnostics.stderr
+++ b/src/test/ui/const-generics/diagnostics.stderr
@@ -31,9 +31,12 @@
--> $DIR/diagnostics.rs:12:19
|
LL | impl<N> Foo for B<N> {}
- | - ^
- | |
- | help: consider changing this type paramater to a `const`-generic: `const N: u8`
+ | ^
+ |
+help: consider changing this type parameter to be a `const` generic
+ |
+LL | impl<const N: u8> Foo for B<N> {}
+ | ^^^^^^^^^^^
error[E0747]: unresolved item provided when a constant was expected
--> $DIR/diagnostics.rs:16:32
diff --git a/src/test/ui/consts/const-int-unchecked.rs b/src/test/ui/consts/const-int-unchecked.rs
index 41d8f7a..2ccc5d2 100644
--- a/src/test/ui/consts/const-int-unchecked.rs
+++ b/src/test/ui/consts/const-int-unchecked.rs
@@ -186,4 +186,13 @@
//~^ ERROR any use of this value will cause an error
//~| WARN this was previously accepted by the compiler but is being phased out
+// capture fault with zero value
+
+const _: u32 = unsafe { std::intrinsics::ctlz_nonzero(0) };
+//~^ ERROR any use of this value will cause an error
+//~| WARN this was previously accepted by the compiler but is being phased out
+const _: u32 = unsafe { std::intrinsics::cttz_nonzero(0) };
+//~^ ERROR any use of this value will cause an error
+//~| WARN this was previously accepted by the compiler but is being phased out
+
fn main() {}
diff --git a/src/test/ui/consts/const-int-unchecked.stderr b/src/test/ui/consts/const-int-unchecked.stderr
index e5ecbbc..999b265 100644
--- a/src/test/ui/consts/const-int-unchecked.stderr
+++ b/src/test/ui/consts/const-int-unchecked.stderr
@@ -516,5 +516,27 @@
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
-error: aborting due to 47 previous errors
+error: any use of this value will cause an error
+ --> $DIR/const-int-unchecked.rs:191:25
+ |
+LL | const _: u32 = unsafe { std::intrinsics::ctlz_nonzero(0) };
+ | ------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^---
+ | |
+ | `ctlz_nonzero` called on 0
+ |
+ = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
+ = note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
+
+error: any use of this value will cause an error
+ --> $DIR/const-int-unchecked.rs:194:25
+ |
+LL | const _: u32 = unsafe { std::intrinsics::cttz_nonzero(0) };
+ | ------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^---
+ | |
+ | `cttz_nonzero` called on 0
+ |
+ = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
+ = note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
+
+error: aborting due to 49 previous errors
diff --git a/src/test/ui/feature-gates/feature-gate-naked_functions.rs b/src/test/ui/feature-gates/feature-gate-naked_functions.rs
index 06bddc4..71ca5b9 100644
--- a/src/test/ui/feature-gates/feature-gate-naked_functions.rs
+++ b/src/test/ui/feature-gates/feature-gate-naked_functions.rs
@@ -1,3 +1,4 @@
+// needs-asm-support
#![feature(asm)]
#[naked]
diff --git a/src/test/ui/feature-gates/feature-gate-naked_functions.stderr b/src/test/ui/feature-gates/feature-gate-naked_functions.stderr
index d95561d..653d7b7 100644
--- a/src/test/ui/feature-gates/feature-gate-naked_functions.stderr
+++ b/src/test/ui/feature-gates/feature-gate-naked_functions.stderr
@@ -1,5 +1,5 @@
error[E0658]: the `#[naked]` attribute is an experimental feature
- --> $DIR/feature-gate-naked_functions.rs:3:1
+ --> $DIR/feature-gate-naked_functions.rs:4:1
|
LL | #[naked]
| ^^^^^^^^
@@ -8,7 +8,7 @@
= help: add `#![feature(naked_functions)]` to the crate attributes to enable
error[E0658]: the `#[naked]` attribute is an experimental feature
- --> $DIR/feature-gate-naked_functions.rs:9:1
+ --> $DIR/feature-gate-naked_functions.rs:10:1
|
LL | #[naked]
| ^^^^^^^^
diff --git a/src/test/ui/feature-gates/feature-gate-object_safe_for_dispatch.rs b/src/test/ui/feature-gates/feature-gate-object_safe_for_dispatch.rs
index 8945360..37348e4 100644
--- a/src/test/ui/feature-gates/feature-gate-object_safe_for_dispatch.rs
+++ b/src/test/ui/feature-gates/feature-gate-object_safe_for_dispatch.rs
@@ -12,7 +12,7 @@
}
trait NonObjectSafe4 {
- fn foo(&self, &Self);
+ fn foo(&self, s: &Self);
}
fn takes_non_object_safe_ref<T>(obj: &dyn NonObjectSafe1) {
diff --git a/src/test/ui/feature-gates/feature-gate-object_safe_for_dispatch.stderr b/src/test/ui/feature-gates/feature-gate-object_safe_for_dispatch.stderr
index b61d560..12195bc 100644
--- a/src/test/ui/feature-gates/feature-gate-object_safe_for_dispatch.stderr
+++ b/src/test/ui/feature-gates/feature-gate-object_safe_for_dispatch.stderr
@@ -57,12 +57,12 @@
|
= help: consider moving `foo` to another trait
note: for a trait to be "object safe" it needs to allow building a vtable to allow the call to be resolvable dynamically; for more information visit <https://doc.rust-lang.org/reference/items/traits.html#object-safety>
- --> $DIR/feature-gate-object_safe_for_dispatch.rs:15:19
+ --> $DIR/feature-gate-object_safe_for_dispatch.rs:15:22
|
LL | trait NonObjectSafe4 {
| -------------- this trait cannot be made into an object...
-LL | fn foo(&self, &Self);
- | ^^^^^ ...because method `foo` references the `Self` type in this parameter
+LL | fn foo(&self, s: &Self);
+ | ^^^^^ ...because method `foo` references the `Self` type in this parameter
error[E0038]: the trait `NonObjectSafe1` cannot be made into an object
--> $DIR/feature-gate-object_safe_for_dispatch.rs:38:16
diff --git a/src/test/ui/issues/issue-78720.rs b/src/test/ui/issues/issue-78720.rs
index 57615d1..4cdb9f4 100644
--- a/src/test/ui/issues/issue-78720.rs
+++ b/src/test/ui/issues/issue-78720.rs
@@ -4,7 +4,7 @@
}
trait FilterBase2 {
- fn map2<F>(self, F) -> Map2<F> {}
+ fn map2<F>(self, f: F) -> Map2<F> {}
//~^ ERROR mismatched types
//~^^ ERROR the size for values of type `Self` cannot be known at compilation time
}
diff --git a/src/test/ui/issues/issue-78720.stderr b/src/test/ui/issues/issue-78720.stderr
index a3a14e3..ee15826 100644
--- a/src/test/ui/issues/issue-78720.stderr
+++ b/src/test/ui/issues/issue-78720.stderr
@@ -25,10 +25,10 @@
| ^^^
error[E0308]: mismatched types
- --> $DIR/issue-78720.rs:7:36
+ --> $DIR/issue-78720.rs:7:39
|
-LL | fn map2<F>(self, F) -> Map2<F> {}
- | ^^ expected struct `Map2`, found `()`
+LL | fn map2<F>(self, f: F) -> Map2<F> {}
+ | ^^ expected struct `Map2`, found `()`
|
= note: expected struct `Map2<F>`
found unit type `()`
@@ -36,17 +36,17 @@
error[E0277]: the size for values of type `Self` cannot be known at compilation time
--> $DIR/issue-78720.rs:7:16
|
-LL | fn map2<F>(self, F) -> Map2<F> {}
+LL | fn map2<F>(self, f: F) -> Map2<F> {}
| ^^^^ doesn't have a size known at compile-time
|
= help: unsized fn params are gated as an unstable feature
help: consider further restricting `Self`
|
-LL | fn map2<F>(self, F) -> Map2<F> where Self: Sized {}
- | ^^^^^^^^^^^^^^^^^
+LL | fn map2<F>(self, f: F) -> Map2<F> where Self: Sized {}
+ | ^^^^^^^^^^^^^^^^^
help: function arguments must have a statically known size, borrowed types always have a known size
|
-LL | fn map2<F>(&self, F) -> Map2<F> {}
+LL | fn map2<F>(&self, f: F) -> Map2<F> {}
| ^
error: aborting due to 4 previous errors
diff --git a/src/test/ui/parser/issue-84117.rs b/src/test/ui/parser/issue-84117.rs
new file mode 100644
index 0000000..0f20073
--- /dev/null
+++ b/src/test/ui/parser/issue-84117.rs
@@ -0,0 +1,9 @@
+fn main() {
+ let outer_local:e_outer<&str, { let inner_local:e_inner<&str, }
+ //~^ ERROR expected one of `>`, a const expression
+ //~| ERROR expected one of `>`, a const expression, lifetime, or type, found `}`
+ //~| ERROR expected one of `!`, `.`, `::`, `;`, `?`, `{`, or an operator, found `,`
+ //~| ERROR expected one of `!`, `.`, `::`, `;`, `?`, `{`, or an operator, found `,`
+ //~| ERROR expected one of `!`, `.`, `::`, `;`, `?`, `{`, or an operator, found `,`
+}
+//~^ ERROR expected one of `,`, `:`, `=`, or `>`, found `}`
diff --git a/src/test/ui/parser/issue-84117.stderr b/src/test/ui/parser/issue-84117.stderr
new file mode 100644
index 0000000..d667a49
--- /dev/null
+++ b/src/test/ui/parser/issue-84117.stderr
@@ -0,0 +1,49 @@
+error: expected one of `>`, a const expression, lifetime, or type, found `}`
+ --> $DIR/issue-84117.rs:2:67
+ |
+LL | let outer_local:e_outer<&str, { let inner_local:e_inner<&str, }
+ | ------------ ^ expected one of `>`, a const expression, lifetime, or type
+ | | |
+ | | help: use `=` if you meant to assign
+ | while parsing the type for `inner_local`
+
+error: expected one of `!`, `.`, `::`, `;`, `?`, `{`, or an operator, found `,`
+ --> $DIR/issue-84117.rs:2:65
+ |
+LL | let outer_local:e_outer<&str, { let inner_local:e_inner<&str, }
+ | ^ expected one of 7 possible tokens
+
+error: expected one of `,`, `:`, `=`, or `>`, found `}`
+ --> $DIR/issue-84117.rs:8:1
+ |
+LL | let outer_local:e_outer<&str, { let inner_local:e_inner<&str, }
+ | ------------ help: use `=` if you meant to assign - expected one of `,`, `:`, `=`, or `>`
+ | |
+ | while parsing the type for `outer_local`
+...
+LL | }
+ | ^ unexpected token
+
+error: expected one of `>`, a const expression, lifetime, or type, found `}`
+ --> $DIR/issue-84117.rs:2:67
+ |
+LL | let outer_local:e_outer<&str, { let inner_local:e_inner<&str, }
+ | ------------ ^ expected one of `>`, a const expression, lifetime, or type
+ | | |
+ | | help: use `=` if you meant to assign
+ | while parsing the type for `inner_local`
+
+error: expected one of `!`, `.`, `::`, `;`, `?`, `{`, or an operator, found `,`
+ --> $DIR/issue-84117.rs:2:65
+ |
+LL | let outer_local:e_outer<&str, { let inner_local:e_inner<&str, }
+ | ^ expected one of 7 possible tokens
+
+error: expected one of `!`, `.`, `::`, `;`, `?`, `{`, or an operator, found `,`
+ --> $DIR/issue-84117.rs:2:33
+ |
+LL | let outer_local:e_outer<&str, { let inner_local:e_inner<&str, }
+ | ^ expected one of 7 possible tokens
+
+error: aborting due to 6 previous errors
+
diff --git a/src/test/ui/parser/variadic-ffi-semantic-restrictions.rs b/src/test/ui/parser/variadic-ffi-semantic-restrictions.rs
index 404f409..fe993a6 100644
--- a/src/test/ui/parser/variadic-ffi-semantic-restrictions.rs
+++ b/src/test/ui/parser/variadic-ffi-semantic-restrictions.rs
@@ -1,4 +1,5 @@
#![feature(c_variadic)]
+#![allow(anonymous_parameters)]
fn main() {}
diff --git a/src/test/ui/parser/variadic-ffi-semantic-restrictions.stderr b/src/test/ui/parser/variadic-ffi-semantic-restrictions.stderr
index ebfe497..10fd05c 100644
--- a/src/test/ui/parser/variadic-ffi-semantic-restrictions.stderr
+++ b/src/test/ui/parser/variadic-ffi-semantic-restrictions.stderr
@@ -1,203 +1,203 @@
error: only foreign or `unsafe extern "C" functions may be C-variadic
- --> $DIR/variadic-ffi-semantic-restrictions.rs:5:19
+ --> $DIR/variadic-ffi-semantic-restrictions.rs:6:19
|
LL | fn f1_1(x: isize, ...) {}
| ^^^
error: C-variadic function must be declared with at least one named argument
- --> $DIR/variadic-ffi-semantic-restrictions.rs:8:9
+ --> $DIR/variadic-ffi-semantic-restrictions.rs:9:9
|
LL | fn f1_2(...) {}
| ^^^
error: only foreign or `unsafe extern "C" functions may be C-variadic
- --> $DIR/variadic-ffi-semantic-restrictions.rs:8:9
+ --> $DIR/variadic-ffi-semantic-restrictions.rs:9:9
|
LL | fn f1_2(...) {}
| ^^^
error: only foreign or `unsafe extern "C" functions may be C-variadic
- --> $DIR/variadic-ffi-semantic-restrictions.rs:12:30
+ --> $DIR/variadic-ffi-semantic-restrictions.rs:13:30
|
LL | extern "C" fn f2_1(x: isize, ...) {}
| ^^^
error: C-variadic function must be declared with at least one named argument
- --> $DIR/variadic-ffi-semantic-restrictions.rs:15:20
+ --> $DIR/variadic-ffi-semantic-restrictions.rs:16:20
|
LL | extern "C" fn f2_2(...) {}
| ^^^
error: only foreign or `unsafe extern "C" functions may be C-variadic
- --> $DIR/variadic-ffi-semantic-restrictions.rs:15:20
+ --> $DIR/variadic-ffi-semantic-restrictions.rs:16:20
|
LL | extern "C" fn f2_2(...) {}
| ^^^
error: `...` must be the last argument of a C-variadic function
- --> $DIR/variadic-ffi-semantic-restrictions.rs:19:20
+ --> $DIR/variadic-ffi-semantic-restrictions.rs:20:20
|
LL | extern "C" fn f2_3(..., x: isize) {}
| ^^^
error: only foreign or `unsafe extern "C" functions may be C-variadic
- --> $DIR/variadic-ffi-semantic-restrictions.rs:19:20
+ --> $DIR/variadic-ffi-semantic-restrictions.rs:20:20
|
LL | extern "C" fn f2_3(..., x: isize) {}
| ^^^
error: only foreign or `unsafe extern "C" functions may be C-variadic
- --> $DIR/variadic-ffi-semantic-restrictions.rs:23:30
+ --> $DIR/variadic-ffi-semantic-restrictions.rs:24:30
|
LL | extern "C" fn f3_1(x: isize, ...) {}
| ^^^
error: C-variadic function must be declared with at least one named argument
- --> $DIR/variadic-ffi-semantic-restrictions.rs:26:20
+ --> $DIR/variadic-ffi-semantic-restrictions.rs:27:20
|
LL | extern "C" fn f3_2(...) {}
| ^^^
error: only foreign or `unsafe extern "C" functions may be C-variadic
- --> $DIR/variadic-ffi-semantic-restrictions.rs:26:20
+ --> $DIR/variadic-ffi-semantic-restrictions.rs:27:20
|
LL | extern "C" fn f3_2(...) {}
| ^^^
error: `...` must be the last argument of a C-variadic function
- --> $DIR/variadic-ffi-semantic-restrictions.rs:30:20
+ --> $DIR/variadic-ffi-semantic-restrictions.rs:31:20
|
LL | extern "C" fn f3_3(..., x: isize) {}
| ^^^
error: only foreign or `unsafe extern "C" functions may be C-variadic
- --> $DIR/variadic-ffi-semantic-restrictions.rs:30:20
+ --> $DIR/variadic-ffi-semantic-restrictions.rs:31:20
|
LL | extern "C" fn f3_3(..., x: isize) {}
| ^^^
error: C-variadic function must be declared with at least one named argument
- --> $DIR/variadic-ffi-semantic-restrictions.rs:35:13
+ --> $DIR/variadic-ffi-semantic-restrictions.rs:36:13
|
LL | fn e_f1(...);
| ^^^
error: `...` must be the last argument of a C-variadic function
- --> $DIR/variadic-ffi-semantic-restrictions.rs:37:13
+ --> $DIR/variadic-ffi-semantic-restrictions.rs:38:13
|
LL | fn e_f2(..., x: isize);
| ^^^
error: only foreign or `unsafe extern "C" functions may be C-variadic
- --> $DIR/variadic-ffi-semantic-restrictions.rs:44:23
+ --> $DIR/variadic-ffi-semantic-restrictions.rs:45:23
|
LL | fn i_f1(x: isize, ...) {}
| ^^^
error: C-variadic function must be declared with at least one named argument
- --> $DIR/variadic-ffi-semantic-restrictions.rs:46:13
+ --> $DIR/variadic-ffi-semantic-restrictions.rs:47:13
|
LL | fn i_f2(...) {}
| ^^^
error: only foreign or `unsafe extern "C" functions may be C-variadic
- --> $DIR/variadic-ffi-semantic-restrictions.rs:46:13
+ --> $DIR/variadic-ffi-semantic-restrictions.rs:47:13
|
LL | fn i_f2(...) {}
| ^^^
error: `...` must be the last argument of a C-variadic function
- --> $DIR/variadic-ffi-semantic-restrictions.rs:49:13
+ --> $DIR/variadic-ffi-semantic-restrictions.rs:50:13
|
LL | fn i_f3(..., x: isize, ...) {}
| ^^^
error: only foreign or `unsafe extern "C" functions may be C-variadic
- --> $DIR/variadic-ffi-semantic-restrictions.rs:49:13
+ --> $DIR/variadic-ffi-semantic-restrictions.rs:50:13
|
LL | fn i_f3(..., x: isize, ...) {}
| ^^^
error: only foreign or `unsafe extern "C" functions may be C-variadic
- --> $DIR/variadic-ffi-semantic-restrictions.rs:49:28
+ --> $DIR/variadic-ffi-semantic-restrictions.rs:50:28
|
LL | fn i_f3(..., x: isize, ...) {}
| ^^^
error: `...` must be the last argument of a C-variadic function
- --> $DIR/variadic-ffi-semantic-restrictions.rs:53:13
+ --> $DIR/variadic-ffi-semantic-restrictions.rs:54:13
|
LL | fn i_f4(..., x: isize, ...) {}
| ^^^
error: only foreign or `unsafe extern "C" functions may be C-variadic
- --> $DIR/variadic-ffi-semantic-restrictions.rs:53:13
+ --> $DIR/variadic-ffi-semantic-restrictions.rs:54:13
|
LL | fn i_f4(..., x: isize, ...) {}
| ^^^
error: only foreign or `unsafe extern "C" functions may be C-variadic
- --> $DIR/variadic-ffi-semantic-restrictions.rs:53:28
+ --> $DIR/variadic-ffi-semantic-restrictions.rs:54:28
|
LL | fn i_f4(..., x: isize, ...) {}
| ^^^
error: only foreign or `unsafe extern "C" functions may be C-variadic
- --> $DIR/variadic-ffi-semantic-restrictions.rs:60:23
+ --> $DIR/variadic-ffi-semantic-restrictions.rs:61:23
|
LL | fn t_f1(x: isize, ...) {}
| ^^^
error: only foreign or `unsafe extern "C" functions may be C-variadic
- --> $DIR/variadic-ffi-semantic-restrictions.rs:62:23
+ --> $DIR/variadic-ffi-semantic-restrictions.rs:63:23
|
LL | fn t_f2(x: isize, ...);
| ^^^
error: C-variadic function must be declared with at least one named argument
- --> $DIR/variadic-ffi-semantic-restrictions.rs:64:13
+ --> $DIR/variadic-ffi-semantic-restrictions.rs:65:13
|
LL | fn t_f3(...) {}
| ^^^
error: only foreign or `unsafe extern "C" functions may be C-variadic
- --> $DIR/variadic-ffi-semantic-restrictions.rs:64:13
+ --> $DIR/variadic-ffi-semantic-restrictions.rs:65:13
|
LL | fn t_f3(...) {}
| ^^^
error: C-variadic function must be declared with at least one named argument
- --> $DIR/variadic-ffi-semantic-restrictions.rs:67:13
+ --> $DIR/variadic-ffi-semantic-restrictions.rs:68:13
|
LL | fn t_f4(...);
| ^^^
error: only foreign or `unsafe extern "C" functions may be C-variadic
- --> $DIR/variadic-ffi-semantic-restrictions.rs:67:13
+ --> $DIR/variadic-ffi-semantic-restrictions.rs:68:13
|
LL | fn t_f4(...);
| ^^^
error: `...` must be the last argument of a C-variadic function
- --> $DIR/variadic-ffi-semantic-restrictions.rs:70:13
+ --> $DIR/variadic-ffi-semantic-restrictions.rs:71:13
|
LL | fn t_f5(..., x: isize) {}
| ^^^
error: only foreign or `unsafe extern "C" functions may be C-variadic
- --> $DIR/variadic-ffi-semantic-restrictions.rs:70:13
+ --> $DIR/variadic-ffi-semantic-restrictions.rs:71:13
|
LL | fn t_f5(..., x: isize) {}
| ^^^
error: `...` must be the last argument of a C-variadic function
- --> $DIR/variadic-ffi-semantic-restrictions.rs:73:13
+ --> $DIR/variadic-ffi-semantic-restrictions.rs:74:13
|
LL | fn t_f6(..., x: isize);
| ^^^
error: only foreign or `unsafe extern "C" functions may be C-variadic
- --> $DIR/variadic-ffi-semantic-restrictions.rs:73:13
+ --> $DIR/variadic-ffi-semantic-restrictions.rs:74:13
|
LL | fn t_f6(..., x: isize);
| ^^^
diff --git a/src/test/ui/proc-macro/trait-fn-args-2015.rs b/src/test/ui/proc-macro/trait-fn-args-2015.rs
index 3a448d4..6b8df78 100644
--- a/src/test/ui/proc-macro/trait-fn-args-2015.rs
+++ b/src/test/ui/proc-macro/trait-fn-args-2015.rs
@@ -3,6 +3,8 @@
// check-pass
// aux-build:test-macros.rs
+#![allow(anonymous_parameters)]
+
#[macro_use]
extern crate test_macros;
diff --git a/src/test/ui/rfc-2091-track-caller/error-with-naked.rs b/src/test/ui/rfc-2091-track-caller/error-with-naked.rs
index 70ec0e3..9464ffe 100644
--- a/src/test/ui/rfc-2091-track-caller/error-with-naked.rs
+++ b/src/test/ui/rfc-2091-track-caller/error-with-naked.rs
@@ -1,3 +1,4 @@
+// needs-asm-support
#![feature(asm, naked_functions)]
#[track_caller] //~ ERROR cannot use `#[track_caller]` with `#[naked]`
diff --git a/src/test/ui/rfc-2091-track-caller/error-with-naked.stderr b/src/test/ui/rfc-2091-track-caller/error-with-naked.stderr
index 1b49148..5f17d6b 100644
--- a/src/test/ui/rfc-2091-track-caller/error-with-naked.stderr
+++ b/src/test/ui/rfc-2091-track-caller/error-with-naked.stderr
@@ -1,11 +1,11 @@
error[E0736]: cannot use `#[track_caller]` with `#[naked]`
- --> $DIR/error-with-naked.rs:3:1
+ --> $DIR/error-with-naked.rs:4:1
|
LL | #[track_caller]
| ^^^^^^^^^^^^^^^
error[E0736]: cannot use `#[track_caller]` with `#[naked]`
- --> $DIR/error-with-naked.rs:12:5
+ --> $DIR/error-with-naked.rs:13:5
|
LL | #[track_caller]
| ^^^^^^^^^^^^^^^
diff --git a/src/test/ui/rfc-2565-param-attrs/proc-macro-cannot-be-used.rs b/src/test/ui/rfc-2565-param-attrs/proc-macro-cannot-be-used.rs
index fcfa610..54f2f45 100644
--- a/src/test/ui/rfc-2565-param-attrs/proc-macro-cannot-be-used.rs
+++ b/src/test/ui/rfc-2565-param-attrs/proc-macro-cannot-be-used.rs
@@ -1,6 +1,7 @@
// aux-build:ident-mac.rs
#![feature(c_variadic)]
+#![allow(anonymous_parameters)]
extern crate ident_mac;
use ident_mac::id;
diff --git a/src/test/ui/rfc-2565-param-attrs/proc-macro-cannot-be-used.stderr b/src/test/ui/rfc-2565-param-attrs/proc-macro-cannot-be-used.stderr
index 38c5050..e74d05d 100644
--- a/src/test/ui/rfc-2565-param-attrs/proc-macro-cannot-be-used.stderr
+++ b/src/test/ui/rfc-2565-param-attrs/proc-macro-cannot-be-used.stderr
@@ -1,173 +1,173 @@
error: expected non-macro attribute, found attribute macro `id`
- --> $DIR/proc-macro-cannot-be-used.rs:10:23
+ --> $DIR/proc-macro-cannot-be-used.rs:11:23
|
LL | extern "C" { fn ffi(#[id] arg1: i32, #[id] ...); }
| ^^ not a non-macro attribute
error: expected non-macro attribute, found attribute macro `id`
- --> $DIR/proc-macro-cannot-be-used.rs:10:40
+ --> $DIR/proc-macro-cannot-be-used.rs:11:40
|
LL | extern "C" { fn ffi(#[id] arg1: i32, #[id] ...); }
| ^^ not a non-macro attribute
error: expected non-macro attribute, found attribute macro `id`
- --> $DIR/proc-macro-cannot-be-used.rs:14:40
+ --> $DIR/proc-macro-cannot-be-used.rs:15:40
|
LL | unsafe extern "C" fn cvar(arg1: i32, #[id] mut args: ...) {}
| ^^ not a non-macro attribute
error: expected non-macro attribute, found attribute macro `id`
- --> $DIR/proc-macro-cannot-be-used.rs:17:30
+ --> $DIR/proc-macro-cannot-be-used.rs:18:30
|
LL | type Alias = extern "C" fn(#[id] u8, #[id] ...);
| ^^ not a non-macro attribute
error: expected non-macro attribute, found attribute macro `id`
- --> $DIR/proc-macro-cannot-be-used.rs:17:40
+ --> $DIR/proc-macro-cannot-be-used.rs:18:40
|
LL | type Alias = extern "C" fn(#[id] u8, #[id] ...);
| ^^ not a non-macro attribute
error: expected non-macro attribute, found attribute macro `id`
- --> $DIR/proc-macro-cannot-be-used.rs:21:11
+ --> $DIR/proc-macro-cannot-be-used.rs:22:11
|
LL | fn free(#[id] arg1: u8) {
| ^^ not a non-macro attribute
error: expected non-macro attribute, found attribute macro `id`
- --> $DIR/proc-macro-cannot-be-used.rs:23:18
+ --> $DIR/proc-macro-cannot-be-used.rs:24:18
|
LL | let lam = |#[id] W(x), #[id] y: usize| ();
| ^^ not a non-macro attribute
error: expected non-macro attribute, found attribute macro `id`
- --> $DIR/proc-macro-cannot-be-used.rs:23:30
+ --> $DIR/proc-macro-cannot-be-used.rs:24:30
|
LL | let lam = |#[id] W(x), #[id] y: usize| ();
| ^^ not a non-macro attribute
error: expected non-macro attribute, found attribute macro `id`
- --> $DIR/proc-macro-cannot-be-used.rs:29:20
+ --> $DIR/proc-macro-cannot-be-used.rs:30:20
|
LL | fn inherent1(#[id] self, #[id] arg1: u8) {}
| ^^ not a non-macro attribute
error: expected non-macro attribute, found attribute macro `id`
- --> $DIR/proc-macro-cannot-be-used.rs:29:32
+ --> $DIR/proc-macro-cannot-be-used.rs:30:32
|
LL | fn inherent1(#[id] self, #[id] arg1: u8) {}
| ^^ not a non-macro attribute
error: expected non-macro attribute, found attribute macro `id`
- --> $DIR/proc-macro-cannot-be-used.rs:32:20
+ --> $DIR/proc-macro-cannot-be-used.rs:33:20
|
LL | fn inherent2(#[id] &self, #[id] arg1: u8) {}
| ^^ not a non-macro attribute
error: expected non-macro attribute, found attribute macro `id`
- --> $DIR/proc-macro-cannot-be-used.rs:32:33
+ --> $DIR/proc-macro-cannot-be-used.rs:33:33
|
LL | fn inherent2(#[id] &self, #[id] arg1: u8) {}
| ^^ not a non-macro attribute
error: expected non-macro attribute, found attribute macro `id`
- --> $DIR/proc-macro-cannot-be-used.rs:35:24
+ --> $DIR/proc-macro-cannot-be-used.rs:36:24
|
LL | fn inherent3<'a>(#[id] &'a mut self, #[id] arg1: u8) {}
| ^^ not a non-macro attribute
error: expected non-macro attribute, found attribute macro `id`
- --> $DIR/proc-macro-cannot-be-used.rs:35:44
+ --> $DIR/proc-macro-cannot-be-used.rs:36:44
|
LL | fn inherent3<'a>(#[id] &'a mut self, #[id] arg1: u8) {}
| ^^ not a non-macro attribute
error: expected non-macro attribute, found attribute macro `id`
- --> $DIR/proc-macro-cannot-be-used.rs:38:24
+ --> $DIR/proc-macro-cannot-be-used.rs:39:24
|
LL | fn inherent4<'a>(#[id] self: Box<Self>, #[id] arg1: u8) {}
| ^^ not a non-macro attribute
error: expected non-macro attribute, found attribute macro `id`
- --> $DIR/proc-macro-cannot-be-used.rs:38:47
+ --> $DIR/proc-macro-cannot-be-used.rs:39:47
|
LL | fn inherent4<'a>(#[id] self: Box<Self>, #[id] arg1: u8) {}
| ^^ not a non-macro attribute
error: expected non-macro attribute, found attribute macro `id`
- --> $DIR/proc-macro-cannot-be-used.rs:41:40
+ --> $DIR/proc-macro-cannot-be-used.rs:42:40
|
LL | fn issue_64682_associated_fn<'a>(#[id] arg1: u8, #[id] arg2: u8) {}
| ^^ not a non-macro attribute
error: expected non-macro attribute, found attribute macro `id`
- --> $DIR/proc-macro-cannot-be-used.rs:41:56
+ --> $DIR/proc-macro-cannot-be-used.rs:42:56
|
LL | fn issue_64682_associated_fn<'a>(#[id] arg1: u8, #[id] arg2: u8) {}
| ^^ not a non-macro attribute
error: expected non-macro attribute, found attribute macro `id`
- --> $DIR/proc-macro-cannot-be-used.rs:47:17
+ --> $DIR/proc-macro-cannot-be-used.rs:48:17
|
LL | fn trait1(#[id] self, #[id] arg1: u8);
| ^^ not a non-macro attribute
error: expected non-macro attribute, found attribute macro `id`
- --> $DIR/proc-macro-cannot-be-used.rs:47:29
+ --> $DIR/proc-macro-cannot-be-used.rs:48:29
|
LL | fn trait1(#[id] self, #[id] arg1: u8);
| ^^ not a non-macro attribute
error: expected non-macro attribute, found attribute macro `id`
- --> $DIR/proc-macro-cannot-be-used.rs:50:17
+ --> $DIR/proc-macro-cannot-be-used.rs:51:17
|
LL | fn trait2(#[id] &self, #[id] arg1: u8);
| ^^ not a non-macro attribute
error: expected non-macro attribute, found attribute macro `id`
- --> $DIR/proc-macro-cannot-be-used.rs:50:30
+ --> $DIR/proc-macro-cannot-be-used.rs:51:30
|
LL | fn trait2(#[id] &self, #[id] arg1: u8);
| ^^ not a non-macro attribute
error: expected non-macro attribute, found attribute macro `id`
- --> $DIR/proc-macro-cannot-be-used.rs:53:21
+ --> $DIR/proc-macro-cannot-be-used.rs:54:21
|
LL | fn trait3<'a>(#[id] &'a mut self, #[id] arg1: u8);
| ^^ not a non-macro attribute
error: expected non-macro attribute, found attribute macro `id`
- --> $DIR/proc-macro-cannot-be-used.rs:53:41
+ --> $DIR/proc-macro-cannot-be-used.rs:54:41
|
LL | fn trait3<'a>(#[id] &'a mut self, #[id] arg1: u8);
| ^^ not a non-macro attribute
error: expected non-macro attribute, found attribute macro `id`
- --> $DIR/proc-macro-cannot-be-used.rs:56:21
+ --> $DIR/proc-macro-cannot-be-used.rs:57:21
|
LL | fn trait4<'a>(#[id] self: Box<Self>, #[id] arg1: u8, #[id] Vec<u8>);
| ^^ not a non-macro attribute
error: expected non-macro attribute, found attribute macro `id`
- --> $DIR/proc-macro-cannot-be-used.rs:56:44
+ --> $DIR/proc-macro-cannot-be-used.rs:57:44
|
LL | fn trait4<'a>(#[id] self: Box<Self>, #[id] arg1: u8, #[id] Vec<u8>);
| ^^ not a non-macro attribute
error: expected non-macro attribute, found attribute macro `id`
- --> $DIR/proc-macro-cannot-be-used.rs:56:60
+ --> $DIR/proc-macro-cannot-be-used.rs:57:60
|
LL | fn trait4<'a>(#[id] self: Box<Self>, #[id] arg1: u8, #[id] Vec<u8>);
| ^^ not a non-macro attribute
error: expected non-macro attribute, found attribute macro `id`
- --> $DIR/proc-macro-cannot-be-used.rs:60:40
+ --> $DIR/proc-macro-cannot-be-used.rs:61:40
|
LL | fn issue_64682_associated_fn<'a>(#[id] arg1: u8, #[id] arg2: u8);
| ^^ not a non-macro attribute
error: expected non-macro attribute, found attribute macro `id`
- --> $DIR/proc-macro-cannot-be-used.rs:60:56
+ --> $DIR/proc-macro-cannot-be-used.rs:61:56
|
LL | fn issue_64682_associated_fn<'a>(#[id] arg1: u8, #[id] arg2: u8);
| ^^ not a non-macro attribute
diff --git a/src/test/ui/specialization/issue-39448.rs b/src/test/ui/specialization/issue-39448.rs
index 9dd47a4..a15c4bd 100644
--- a/src/test/ui/specialization/issue-39448.rs
+++ b/src/test/ui/specialization/issue-39448.rs
@@ -18,7 +18,7 @@
}
trait FromA<T> {
- fn from(T) -> Self;
+ fn from(t: T) -> Self;
}
impl<T: A, U: A + FromA<T>> FromA<T> for U {
diff --git a/src/test/ui/typeck/issue-65611.rs b/src/test/ui/typeck/issue-65611.rs
index b74ee1b..7645311 100644
--- a/src/test/ui/typeck/issue-65611.rs
+++ b/src/test/ui/typeck/issue-65611.rs
@@ -17,7 +17,7 @@
pub trait Index : PartialEq + Copy {
fn to_usize(self) -> usize;
- fn from(usize) -> Self;
+ fn from(i: usize) -> Self;
}
impl Index for usize {
diff --git a/src/tools/compiletest/src/header.rs b/src/tools/compiletest/src/header.rs
index 531a23d..363105a 100644
--- a/src/tools/compiletest/src/header.rs
+++ b/src/tools/compiletest/src/header.rs
@@ -44,6 +44,7 @@
let mut props = EarlyProps::default();
let rustc_has_profiler_support = env::var_os("RUSTC_PROFILER_SUPPORT").is_some();
let rustc_has_sanitizer_support = env::var_os("RUSTC_SANITIZER_SUPPORT").is_some();
+ let has_asm_support = util::has_asm_support(&config.target);
let has_asan = util::ASAN_SUPPORTED_TARGETS.contains(&&*config.target);
let has_lsan = util::LSAN_SUPPORTED_TARGETS.contains(&&*config.target);
let has_msan = util::MSAN_SUPPORTED_TARGETS.contains(&&*config.target);
@@ -76,6 +77,10 @@
props.ignore = true;
}
+ if !has_asm_support && config.parse_name_directive(ln, "needs-asm-support") {
+ props.ignore = true;
+ }
+
if !rustc_has_profiler_support && config.parse_needs_profiler_support(ln) {
props.ignore = true;
}
diff --git a/src/tools/compiletest/src/header/tests.rs b/src/tools/compiletest/src/header/tests.rs
index ec99fde..c41b43c 100644
--- a/src/tools/compiletest/src/header/tests.rs
+++ b/src/tools/compiletest/src/header/tests.rs
@@ -224,6 +224,17 @@
}
#[test]
+fn asm_support() {
+ let mut config = config();
+
+ config.target = "avr-unknown-gnu-atmega328".to_owned();
+ assert!(parse_rs(&config, "// needs-asm-support").ignore);
+
+ config.target = "i686-unknown-netbsd".to_owned();
+ assert!(!parse_rs(&config, "// needs-asm-support").ignore);
+}
+
+#[test]
fn test_extract_version_range() {
use super::{extract_llvm_version, extract_version_range};
diff --git a/src/tools/compiletest/src/util.rs b/src/tools/compiletest/src/util.rs
index b302953..7dbd709 100644
--- a/src/tools/compiletest/src/util.rs
+++ b/src/tools/compiletest/src/util.rs
@@ -128,6 +128,15 @@
"sparcv9",
];
+static ASM_SUPPORTED_ARCHS: &[&str] = &[
+ "x86", "x86_64", "arm", "aarch64", "riscv32", "riscv64", "nvptx64", "hexagon", "mips",
+ "mips64", "spirv", "wasm32",
+];
+
+pub fn has_asm_support(triple: &str) -> bool {
+ ASM_SUPPORTED_ARCHS.contains(&get_arch(triple))
+}
+
pub fn matches_os(triple: &str, name: &str) -> bool {
// For the wasm32 bare target we ignore anything also ignored on emscripten
// and then we also recognize `wasm32-bare` as the os for the target