(&self, a: F, b: F) -> F {
+ let this = self.eval_context_ref();
+ // Return one side non-deterministically.
+ let mut rand = this.machine.rng.borrow_mut();
+ if rand.gen() { a } else { b }
+ }
}
diff --git a/src/tools/miri/tests/pass/float.rs b/src/tools/miri/tests/pass/float.rs
index 4de315e358975..2f4f64b1aa800 100644
--- a/src/tools/miri/tests/pass/float.rs
+++ b/src/tools/miri/tests/pass/float.rs
@@ -31,6 +31,7 @@ fn main() {
test_fast();
test_algebraic();
test_fmuladd();
+ test_min_max_nondet();
}
trait Float: Copy + PartialEq + Debug {
@@ -1211,3 +1212,30 @@ fn test_fmuladd() {
test_operations_f32(0.1, 0.2, 0.3);
test_operations_f64(1.1, 1.2, 1.3);
}
+
+/// `min` and `max` on equal arguments are non-deterministic.
+fn test_min_max_nondet() {
+ /// Ensure that if we call the closure often enough, we see both `true` and `false.`
+ #[track_caller]
+ fn ensure_both(f: impl Fn() -> bool) {
+ let rounds = 16;
+ let first = f();
+ for _ in 1..rounds {
+ if f() != first {
+ // We saw two different values!
+ return;
+ }
+ }
+ // We saw the same thing N times.
+ panic!("expected non-determinism, got {rounds} times the same result: {first:?}");
+ }
+
+ ensure_both(|| f16::min(0.0, -0.0).is_sign_positive());
+ ensure_both(|| f16::max(0.0, -0.0).is_sign_positive());
+ ensure_both(|| f32::min(0.0, -0.0).is_sign_positive());
+ ensure_both(|| f32::max(0.0, -0.0).is_sign_positive());
+ ensure_both(|| f64::min(0.0, -0.0).is_sign_positive());
+ ensure_both(|| f64::max(0.0, -0.0).is_sign_positive());
+ ensure_both(|| f128::min(0.0, -0.0).is_sign_positive());
+ ensure_both(|| f128::max(0.0, -0.0).is_sign_positive());
+}
diff --git a/src/tools/run-make-support/src/external_deps/rustc.rs b/src/tools/run-make-support/src/external_deps/rustc.rs
index b70db7130f677..8d99924a2d17c 100644
--- a/src/tools/run-make-support/src/external_deps/rustc.rs
+++ b/src/tools/run-make-support/src/external_deps/rustc.rs
@@ -216,6 +216,18 @@ impl Rustc {
self
}
+ /// Specify option of `-C symbol-mangling-version`.
+ pub fn symbol_mangling_version(&mut self, option: &str) -> &mut Self {
+ self.cmd.arg(format!("-Csymbol-mangling-version={option}"));
+ self
+ }
+
+ /// Specify `-C prefer-dynamic`.
+ pub fn prefer_dynamic(&mut self) -> &mut Self {
+ self.cmd.arg(format!("-Cprefer-dynamic"));
+ self
+ }
+
/// Specify error format to use
pub fn error_format(&mut self, format: &str) -> &mut Self {
self.cmd.arg(format!("--error-format={format}"));
diff --git a/src/tools/run-make-support/src/lib.rs b/src/tools/run-make-support/src/lib.rs
index 7316244b3841d..a8c9bec57fde6 100644
--- a/src/tools/run-make-support/src/lib.rs
+++ b/src/tools/run-make-support/src/lib.rs
@@ -47,7 +47,9 @@ pub use wasmparser;
// tidy-alphabetical-end
// Re-exports of external dependencies.
-pub use external_deps::{c_build, c_cxx_compiler, clang, htmldocck, llvm, python, rustc, rustdoc};
+pub use external_deps::{
+ cargo, c_build, c_cxx_compiler, clang, htmldocck, llvm, python, rustc, rustdoc
+};
// These rely on external dependencies.
pub use c_cxx_compiler::{Cc, Gcc, cc, cxx, extra_c_flags, extra_cxx_flags, gcc};
@@ -79,7 +81,10 @@ pub use env::{env_var, env_var_os, set_current_dir};
pub use run::{cmd, run, run_fail, run_with_args};
/// Helpers for checking target information.
-pub use targets::{is_aix, is_darwin, is_msvc, is_windows, llvm_components_contain, target, uname, apple_os};
+pub use targets::{
+ apple_os, is_aix, is_darwin, is_msvc, is_windows, is_windows_gnu, llvm_components_contain,
+ target, uname,
+};
/// Helpers for building names of output artifacts that are potentially target-specific.
pub use artifact_names::{
@@ -104,4 +109,3 @@ pub use assertion_helpers::{
pub use string::{
count_regex_matches_in_files_with_extension, invalid_utf8_contains, invalid_utf8_not_contains,
};
-use crate::external_deps::cargo;
diff --git a/src/tools/run-make-support/src/symbols.rs b/src/tools/run-make-support/src/symbols.rs
index fd0c866bcc927..e4d244e14a4a1 100644
--- a/src/tools/run-make-support/src/symbols.rs
+++ b/src/tools/run-make-support/src/symbols.rs
@@ -2,28 +2,44 @@ use std::path::Path;
use object::{self, Object, ObjectSymbol, SymbolIterator};
-/// Iterate through the symbols in an object file.
-///
-/// Uses a callback because `SymbolIterator` does not own its data.
+/// Given an [`object::File`], find the exported dynamic symbol names via
+/// [`object::Object::exports`]. This does not distinguish between which section the symbols appear
+/// in.
+#[track_caller]
+pub fn exported_dynamic_symbol_names<'file>(file: &'file object::File<'file>) -> Vec<&'file str> {
+ file.exports()
+ .unwrap()
+ .into_iter()
+ .filter_map(|sym| std::str::from_utf8(sym.name()).ok())
+ .collect()
+}
+
+/// Iterate through the symbols in an object file. See [`object::Object::symbols`].
///
-/// Panics if `path` is not a valid object file readable by the current user.
+/// Panics if `path` is not a valid object file readable by the current user or if `path` cannot be
+/// parsed as a recognized object file.
+#[track_caller]
pub fn with_symbol_iter(path: P, func: F) -> R
where
P: AsRef,
F: FnOnce(&mut SymbolIterator<'_, '_>) -> R,
{
- let raw_bytes = crate::fs::read(path);
- let f = object::File::parse(raw_bytes.as_slice()).expect("unable to parse file");
+ let path = path.as_ref();
+ let blob = crate::fs::read(path);
+ let f = object::File::parse(&*blob)
+ .unwrap_or_else(|e| panic!("failed to parse `{}`: {e}", path.display()));
let mut iter = f.symbols();
func(&mut iter)
}
/// Check an object file's symbols for substrings.
///
-/// Returns `true` if any of the symbols found in the object file at
-/// `path` contain a substring listed in `substrings`.
+/// Returns `true` if any of the symbols found in the object file at `path` contain a substring
+/// listed in `substrings`.
///
-/// Panics if `path` is not a valid object file readable by the current user.
+/// Panics if `path` is not a valid object file readable by the current user or if `path` cannot be
+/// parsed as a recognized object file.
+#[track_caller]
pub fn any_symbol_contains(path: impl AsRef, substrings: &[&str]) -> bool {
with_symbol_iter(path, |syms| {
for sym in syms {
diff --git a/src/tools/run-make-support/src/targets.rs b/src/tools/run-make-support/src/targets.rs
index ae004fd0cbdd8..a16fca71d2eec 100644
--- a/src/tools/run-make-support/src/targets.rs
+++ b/src/tools/run-make-support/src/targets.rs
@@ -22,6 +22,12 @@ pub fn is_msvc() -> bool {
target().contains("msvc")
}
+/// Check if target is windows-gnu.
+#[must_use]
+pub fn is_windows_gnu() -> bool {
+ target().ends_with("windows-gnu")
+}
+
/// Check if target uses macOS.
#[must_use]
pub fn is_darwin() -> bool {
diff --git a/src/tools/tidy/src/allowed_run_make_makefiles.txt b/src/tools/tidy/src/allowed_run_make_makefiles.txt
index e75d3dc2147bc..45b40b17ea37f 100644
--- a/src/tools/tidy/src/allowed_run_make_makefiles.txt
+++ b/src/tools/tidy/src/allowed_run_make_makefiles.txt
@@ -1,2 +1 @@
run-make/split-debuginfo/Makefile
-run-make/symbol-mangling-hashed/Makefile
diff --git a/tests/codegen/issues/issue-136329-optnone-noinline.rs b/tests/codegen/issues/issue-136329-optnone-noinline.rs
new file mode 100644
index 0000000000000..57c9e47a4992a
--- /dev/null
+++ b/tests/codegen/issues/issue-136329-optnone-noinline.rs
@@ -0,0 +1,21 @@
+//! Ensure that `#[optimize(none)]` functions are never inlined
+
+//@ compile-flags: -Copt-level=3
+
+#![feature(optimize_attribute)]
+
+#[optimize(none)]
+pub fn foo() {
+ let _x = 123;
+}
+
+// CHECK-LABEL: define{{.*}}void @bar
+// CHECK: start:
+// CHECK: {{.*}}call {{.*}}void
+// CHECK: ret void
+#[no_mangle]
+pub fn bar() {
+ foo();
+}
+
+fn main() {}
diff --git a/tests/crashes/135210.rs b/tests/crashes/135210.rs
deleted file mode 100644
index acb61e21090d2..0000000000000
--- a/tests/crashes/135210.rs
+++ /dev/null
@@ -1,8 +0,0 @@
-//@ known-bug: #135210
-
-#![feature(const_trait_impl)]
-const _: fn(&String) = |s| {
- &*s as &str;
-};
-
-fn main() {}
diff --git a/tests/run-make/symbol-mangling-hashed/Makefile b/tests/run-make/symbol-mangling-hashed/Makefile
deleted file mode 100644
index c95036ead9587..0000000000000
--- a/tests/run-make/symbol-mangling-hashed/Makefile
+++ /dev/null
@@ -1,48 +0,0 @@
-include ../tools.mk
-
-# ignore-cross-compile
-# only-linux
-# only-x86_64
-
-NM=nm -D
-RLIB_NAME=liba_rlib.rlib
-DYLIB_NAME=liba_dylib.so
-SO_NAME=libb_dylib.so
-BIN_NAME=b_bin
-
-ifeq ($(UNAME),Darwin)
-NM=nm -gU
-RLIB_NAME=liba_rlib.rlib
-DYLIB_NAME=liba_dylib.dylib
-SO_NAME=libb_dylib.dylib
-BIN_NAME=b_bin
-endif
-
-ifdef IS_WINDOWS
-NM=nm -g
-RLIB_NAME=liba_rlib.dll.a
-DYLIB_NAME=liba_dylib.dll
-SO_NAME=libb_dylib.dll
-BIN_NAME=b_bin.exe
-endif
-
-all:
- $(RUSTC) -C prefer-dynamic -Z unstable-options -C symbol-mangling-version=hashed -C metadata=foo a_dylib.rs
- $(RUSTC) -C prefer-dynamic -Z unstable-options -C symbol-mangling-version=hashed -C metadata=bar a_rlib.rs
- $(RUSTC) -C prefer-dynamic -L $(TMPDIR) b_dylib.rs
- $(RUSTC) -C prefer-dynamic -L $(TMPDIR) b_bin.rs
-
- # Check hashed symbol name
-
- [ "$$($(NM) $(TMPDIR)/$(DYLIB_NAME) | grep -c hello)" -eq "0" ]
- [ "$$($(NM) $(TMPDIR)/$(DYLIB_NAME) | grep _RNxC7a_dylib | grep -c ' T ')" -eq "2" ]
-
- [ "$$($(NM) $(TMPDIR)/$(SO_NAME) | grep b_dylib | grep -c hello)" -eq "1" ]
- [ "$$($(NM) $(TMPDIR)/$(SO_NAME) | grep _RNxC6a_rlib | grep -c ' T ')" -eq "2" ]
- [ "$$($(NM) $(TMPDIR)/$(SO_NAME) | grep _RNxC7a_dylib | grep -c ' U ')" -eq "1" ]
-
- [ "$$($(NM) $(TMPDIR)/$(BIN_NAME) | grep _RNxC6a_rlib | grep -c ' U ')" -eq "1" ]
- [ "$$($(NM) $(TMPDIR)/$(BIN_NAME) | grep _RNxC7a_dylib | grep -c ' U ')" -eq "1" ]
- [ "$$($(NM) $(TMPDIR)/$(BIN_NAME) | grep b_dylib | grep hello | grep -c ' U ')" -eq "1" ]
-
- $(call RUN,$(BIN_NAME))
diff --git a/tests/run-make/symbol-mangling-hashed/b_bin.rs b/tests/run-make/symbol-mangling-hashed/b_bin.rs
deleted file mode 100644
index 8ee7fecda62a0..0000000000000
--- a/tests/run-make/symbol-mangling-hashed/b_bin.rs
+++ /dev/null
@@ -1,9 +0,0 @@
-extern crate a_dylib;
-extern crate a_rlib;
-extern crate b_dylib;
-
-fn main() {
- a_rlib::hello();
- a_dylib::hello();
- b_dylib::hello();
-}
diff --git a/tests/run-make/symbol-mangling-hashed/b_dylib.rs b/tests/run-make/symbol-mangling-hashed/b_dylib.rs
deleted file mode 100644
index 3252c9c75c2a4..0000000000000
--- a/tests/run-make/symbol-mangling-hashed/b_dylib.rs
+++ /dev/null
@@ -1,9 +0,0 @@
-#![crate_type = "dylib"]
-
-extern crate a_dylib;
-extern crate a_rlib;
-
-pub fn hello() {
- a_rlib::hello();
- a_dylib::hello();
-}
diff --git a/tests/run-make/symbol-mangling-hashed/default_bin.rs b/tests/run-make/symbol-mangling-hashed/default_bin.rs
new file mode 100644
index 0000000000000..387596705c364
--- /dev/null
+++ b/tests/run-make/symbol-mangling-hashed/default_bin.rs
@@ -0,0 +1,9 @@
+extern crate default_dylib;
+extern crate hashed_dylib;
+extern crate hashed_rlib;
+
+fn main() {
+ hashed_rlib::hrhello();
+ hashed_dylib::hdhello();
+ default_dylib::ddhello();
+}
diff --git a/tests/run-make/symbol-mangling-hashed/default_dylib.rs b/tests/run-make/symbol-mangling-hashed/default_dylib.rs
new file mode 100644
index 0000000000000..986d1c7b74d21
--- /dev/null
+++ b/tests/run-make/symbol-mangling-hashed/default_dylib.rs
@@ -0,0 +1,9 @@
+#![crate_type = "dylib"]
+
+extern crate hashed_dylib;
+extern crate hashed_rlib;
+
+pub fn ddhello() {
+ hashed_rlib::hrhello();
+ hashed_dylib::hdhello();
+}
diff --git a/tests/run-make/symbol-mangling-hashed/a_dylib.rs b/tests/run-make/symbol-mangling-hashed/hashed_dylib.rs
similarity index 74%
rename from tests/run-make/symbol-mangling-hashed/a_dylib.rs
rename to tests/run-make/symbol-mangling-hashed/hashed_dylib.rs
index 49d65b72cacc1..fbb7cba43e050 100644
--- a/tests/run-make/symbol-mangling-hashed/a_dylib.rs
+++ b/tests/run-make/symbol-mangling-hashed/hashed_dylib.rs
@@ -1,4 +1,4 @@
#![crate_type = "dylib"]
-pub fn hello() {
+pub fn hdhello() {
println!("hello dylib");
}
diff --git a/tests/run-make/symbol-mangling-hashed/a_rlib.rs b/tests/run-make/symbol-mangling-hashed/hashed_rlib.rs
similarity index 74%
rename from tests/run-make/symbol-mangling-hashed/a_rlib.rs
rename to tests/run-make/symbol-mangling-hashed/hashed_rlib.rs
index 71e44ccc20075..048e67784d23f 100644
--- a/tests/run-make/symbol-mangling-hashed/a_rlib.rs
+++ b/tests/run-make/symbol-mangling-hashed/hashed_rlib.rs
@@ -1,5 +1,5 @@
#![crate_type = "rlib"]
-pub fn hello() {
+pub fn hrhello() {
println!("hello rlib");
}
diff --git a/tests/run-make/symbol-mangling-hashed/rmake.rs b/tests/run-make/symbol-mangling-hashed/rmake.rs
new file mode 100644
index 0000000000000..136e6b9fa3a95
--- /dev/null
+++ b/tests/run-make/symbol-mangling-hashed/rmake.rs
@@ -0,0 +1,108 @@
+// ignore-tidy-linelength
+//! Basic smoke test for the unstable option `-C symbol_mangling_version=hashed` which aims to
+//! replace full symbol mangling names based on hash digests to shorten symbol name lengths in
+//! dylibs for space savings.
+//!
+//! # References
+//!
+//! - MCP #705: Provide option to shorten symbol names by replacing them with a digest:
+//! .
+//! - Implementation PR: .
+//! - PE format: .
+
+//@ ignore-cross-compile
+
+#![deny(warnings)]
+
+use run_make_support::symbols::exported_dynamic_symbol_names;
+use run_make_support::{bin_name, cwd, dynamic_lib_name, is_darwin, object, rfs, run, rustc};
+
+macro_rules! adjust_symbol_prefix {
+ ($name:literal) => {
+ if is_darwin() { concat!("_", $name) } else { $name }
+ };
+}
+
+fn main() {
+ rustc()
+ .input("hashed_dylib.rs")
+ .prefer_dynamic()
+ .arg("-Zunstable-options")
+ .symbol_mangling_version("hashed")
+ .metadata("foo")
+ .run();
+
+ rustc()
+ .input("hashed_rlib.rs")
+ .prefer_dynamic()
+ .arg("-Zunstable-options")
+ .symbol_mangling_version("hashed")
+ .metadata("bar")
+ .run();
+
+ rustc().input("default_dylib.rs").library_search_path(cwd()).prefer_dynamic().run();
+ rustc().input("default_bin.rs").library_search_path(cwd()).prefer_dynamic().run();
+
+ {
+ // Check hashed symbol name
+
+ let dylib_filename = dynamic_lib_name("hashed_dylib");
+ println!("checking dylib `{dylib_filename}`");
+
+ let dylib_blob = rfs::read(&dylib_filename);
+ let dylib_file = object::File::parse(&*dylib_blob)
+ .unwrap_or_else(|e| panic!("failed to parse `{dylib_filename}`: {e}"));
+
+ let dynamic_symbols = exported_dynamic_symbol_names(&dylib_file);
+
+ if dynamic_symbols.iter().filter(|sym| sym.contains("hdhello")).count() != 0 {
+ eprintln!("exported dynamic symbols: {:#?}", dynamic_symbols);
+ panic!("expected no occurrence of `hdhello`");
+ }
+
+ let expected_prefix = adjust_symbol_prefix!("_RNxC12hashed_dylib");
+ if dynamic_symbols.iter().filter(|sym| sym.starts_with(expected_prefix)).count() != 2 {
+ eprintln!("exported dynamic symbols: {:#?}", dynamic_symbols);
+ panic!("expected two dynamic symbols starting with `{expected_prefix}`");
+ }
+ }
+
+ {
+ let dylib_filename = dynamic_lib_name("default_dylib");
+ println!("checking so `{dylib_filename}`");
+
+ let dylib_blob = rfs::read(&dylib_filename);
+ let dylib_file = object::File::parse(&*dylib_blob)
+ .unwrap_or_else(|e| panic!("failed to parse `{dylib_filename}`: {e}"));
+
+ let dynamic_symbols = exported_dynamic_symbol_names(&dylib_file);
+
+ if dynamic_symbols
+ .iter()
+ .filter(|sym| sym.contains("default_dylib") && sym.contains("ddhello"))
+ .count()
+ != 1
+ {
+ eprintln!("exported dynamic symbols: {:#?}", dynamic_symbols);
+ panic!("expected one occurrence of mangled `ddhello`");
+ }
+
+ let expected_rlib_prefix = adjust_symbol_prefix!("_RNxC11hashed_rlib");
+ if dynamic_symbols.iter().filter(|sym| sym.starts_with(expected_rlib_prefix)).count() != 2 {
+ eprintln!("exported dynamic symbols: {:#?}", dynamic_symbols);
+ panic!("expected two exported symbols starting with `{expected_rlib_prefix}`");
+ }
+
+ let expected_dylib_prefix = adjust_symbol_prefix!("_RNxC12hashed_dylib");
+ if dynamic_symbols.iter().any(|sym| sym.starts_with("_RNxC12hashed_dylib")) {
+ eprintln!("exported dynamic symbols: {:#?}", dynamic_symbols);
+ panic!("did not expect any symbols starting with `{expected_dylib_prefix}`");
+ }
+ }
+
+ // Check that the final binary can be run.
+ {
+ let bin_filename = bin_name("default_bin");
+ run(&bin_filename);
+ }
+}
diff --git a/tests/ui/array-slice-vec/driftsort-off-by-one-issue-136103.rs b/tests/ui/array-slice-vec/driftsort-off-by-one-issue-136103.rs
new file mode 100644
index 0000000000000..42197ff102d72
--- /dev/null
+++ b/tests/ui/array-slice-vec/driftsort-off-by-one-issue-136103.rs
@@ -0,0 +1,10 @@
+//@ run-pass
+// Ensures that driftsort doesn't crash under specific slice
+// length and memory size.
+// Based on the example given in https://github.com/rust-lang/rust/issues/136103.
+fn main() {
+ let n = 127;
+ let mut objs: Vec<_> =
+ (0..n).map(|i| [(i % 2) as u8; 125001]).collect();
+ objs.sort();
+}
diff --git a/tests/ui/associated-inherent-types/bugs/wf-check-skipped.next.stderr b/tests/ui/associated-inherent-types/bugs/wf-check-skipped.next.stderr
index bf53089675d5b..81ace4ebb6daf 100644
--- a/tests/ui/associated-inherent-types/bugs/wf-check-skipped.next.stderr
+++ b/tests/ui/associated-inherent-types/bugs/wf-check-skipped.next.stderr
@@ -5,6 +5,8 @@ LL | fn main() -> Foo::Bar::> {}
| ^^^^^^^^^^ doesn't have a size known at compile-time
|
= help: the trait `Sized` is not implemented for `[u32]`
+note: required by an implicit `Sized` bound in `Vec`
+ --> $SRC_DIR/alloc/src/vec/mod.rs:LL:COL
error: aborting due to 1 previous error
diff --git a/tests/ui/const-generics/issues/issue-88119.stderr b/tests/ui/const-generics/issues/issue-88119.stderr
index f219c90849a26..c497f1b6d0bdb 100644
--- a/tests/ui/const-generics/issues/issue-88119.stderr
+++ b/tests/ui/const-generics/issues/issue-88119.stderr
@@ -6,35 +6,29 @@ LL | #![feature(const_trait_impl, generic_const_exprs)]
|
= help: remove one of these features
-error[E0284]: type annotations needed: cannot normalize `<&T as ConstName>::{constant#0}`
- --> $DIR/issue-88119.rs:19:49
+error[E0284]: type annotations needed: cannot satisfy `the constant `name_len::()` can be evaluated`
+ --> $DIR/issue-88119.rs:21:5
|
-LL | impl const ConstName for &T
- | ^^ cannot normalize `<&T as ConstName>::{constant#0}`
+LL | [(); name_len::()]:,
+ | ^^^^^^^^^^^^^^^^^^^^^ cannot satisfy `the constant `name_len::()` can be evaluated`
|
-note: required for `&T` to implement `~const ConstName`
- --> $DIR/issue-88119.rs:19:35
+note: required by a bound in `<&T as ConstName>`
+ --> $DIR/issue-88119.rs:21:10
|
-LL | impl const ConstName for &T
- | ^^^^^^^^^ ^^
-LL | where
LL | [(); name_len::()]:,
- | --------------------- unsatisfied trait bound introduced here
+ | ^^^^^^^^^^^^^^^ required by this bound in `<&T as ConstName>`
-error[E0284]: type annotations needed: cannot normalize `<&mut T as ConstName>::{constant#0}`
- --> $DIR/issue-88119.rs:26:49
+error[E0284]: type annotations needed: cannot satisfy `the constant `name_len::()` can be evaluated`
+ --> $DIR/issue-88119.rs:28:5
|
-LL | impl const ConstName for &mut T
- | ^^^^^^ cannot normalize `<&mut T as ConstName>::{constant#0}`
+LL | [(); name_len::()]:,
+ | ^^^^^^^^^^^^^^^^^^^^^ cannot satisfy `the constant `name_len::()` can be evaluated`
|
-note: required for `&mut T` to implement `~const ConstName`
- --> $DIR/issue-88119.rs:26:35
+note: required by a bound in `<&mut T as ConstName>`
+ --> $DIR/issue-88119.rs:28:10
|
-LL | impl const ConstName for &mut T
- | ^^^^^^^^^ ^^^^^^
-LL | where
LL | [(); name_len::()]:,
- | --------------------- unsatisfied trait bound introduced here
+ | ^^^^^^^^^^^^^^^ required by this bound in `<&mut T as ConstName>`
error: aborting due to 3 previous errors
diff --git a/tests/ui/diagnostic_namespace/do_not_recommend/as_expression.next.stderr b/tests/ui/diagnostic_namespace/do_not_recommend/as_expression.next.stderr
index 1b76669ccb0d7..4f685c508c721 100644
--- a/tests/ui/diagnostic_namespace/do_not_recommend/as_expression.next.stderr
+++ b/tests/ui/diagnostic_namespace/do_not_recommend/as_expression.next.stderr
@@ -16,23 +16,13 @@ LL | where
LL | T: AsExpression,
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `Foo::check`
-error[E0277]: the trait bound `&str: AsExpression` is not satisfied
- --> $DIR/as_expression.rs:55:15
- |
-LL | SelectInt.check("bar");
- | ^^^^^ the trait `AsExpression` is not implemented for `&str`
- |
- = help: the trait `AsExpression` is not implemented for `&str`
- but trait `AsExpression` is implemented for it
- = help: for that trait implementation, expected `Text`, found `Integer`
-
error[E0271]: type mismatch resolving `::SqlType == Text`
--> $DIR/as_expression.rs:55:5
|
LL | SelectInt.check("bar");
| ^^^^^^^^^^^^^^^^^^^^^^ expected `Text`, found `Integer`
-error: aborting due to 3 previous errors
+error: aborting due to 2 previous errors
Some errors have detailed explanations: E0271, E0277.
For more information about an error, try `rustc --explain E0271`.
diff --git a/tests/ui/diagnostic_namespace/do_not_recommend/as_expression.rs b/tests/ui/diagnostic_namespace/do_not_recommend/as_expression.rs
index 583b3c4675a87..48c1ed2b02d71 100644
--- a/tests/ui/diagnostic_namespace/do_not_recommend/as_expression.rs
+++ b/tests/ui/diagnostic_namespace/do_not_recommend/as_expression.rs
@@ -53,7 +53,7 @@ impl Foo for T where T: Expression {}
fn main() {
SelectInt.check("bar");
- //~^ ERROR the trait bound `&str: AsExpression` is not satisfied
- //[next]~| the trait bound `&str: AsExpression<::SqlType>` is not satisfied
+ //[current]~^ ERROR the trait bound `&str: AsExpression` is not satisfied
+ //[next]~^^ the trait bound `&str: AsExpression<::SqlType>` is not satisfied
//[next]~| type mismatch
}
diff --git a/tests/ui/impl-trait/in-trait/alias-bounds-when-not-wf.stderr b/tests/ui/impl-trait/in-trait/alias-bounds-when-not-wf.stderr
index 1cfc2a6d94495..a95670ced8678 100644
--- a/tests/ui/impl-trait/in-trait/alias-bounds-when-not-wf.stderr
+++ b/tests/ui/impl-trait/in-trait/alias-bounds-when-not-wf.stderr
@@ -18,6 +18,11 @@ help: this trait has no implementations, consider adding one
|
LL | trait Foo {}
| ^^^^^^^^^
+note: required by a bound in `A`
+ --> $DIR/alias-bounds-when-not-wf.rs:8:11
+ |
+LL | type A = T;
+ | ^^^ required by this bound in `A`
error[E0277]: the trait bound `usize: Foo` is not satisfied
--> $DIR/alias-bounds-when-not-wf.rs:16:10
diff --git a/tests/ui/liveness/liveness-unused.rs b/tests/ui/liveness/liveness-unused.rs
index ba635e6638c8c..49e7044aeda1f 100644
--- a/tests/ui/liveness/liveness-unused.rs
+++ b/tests/ui/liveness/liveness-unused.rs
@@ -2,6 +2,7 @@
#![deny(unused_variables)]
#![deny(unused_assignments)]
#![allow(dead_code, non_camel_case_types, trivial_numeric_casts, dropping_copy_types)]
+#![feature(intrinsics)]
use std::ops::AddAssign;
@@ -137,5 +138,10 @@ fn f7() {
drop(a);
}
+// unused params warnings are not needed for intrinsic functions without bodies
+#[rustc_intrinsic]
+unsafe fn simd_shuffle(a: T, b: T, i: I) -> U;
+
+
fn main() {
}
diff --git a/tests/ui/liveness/liveness-unused.stderr b/tests/ui/liveness/liveness-unused.stderr
index f6c478ddbc72c..a69fc10dff271 100644
--- a/tests/ui/liveness/liveness-unused.stderr
+++ b/tests/ui/liveness/liveness-unused.stderr
@@ -1,5 +1,5 @@
warning: unreachable statement
- --> $DIR/liveness-unused.rs:92:9
+ --> $DIR/liveness-unused.rs:93:9
|
LL | continue;
| -------- any code following this expression is unreachable
@@ -14,7 +14,7 @@ LL | #![warn(unused)]
= note: `#[warn(unreachable_code)]` implied by `#[warn(unused)]`
error: unused variable: `x`
- --> $DIR/liveness-unused.rs:8:7
+ --> $DIR/liveness-unused.rs:9:7
|
LL | fn f1(x: isize) {
| ^ help: if this is intentional, prefix it with an underscore: `_x`
@@ -26,25 +26,25 @@ LL | #![deny(unused_variables)]
| ^^^^^^^^^^^^^^^^
error: unused variable: `x`
- --> $DIR/liveness-unused.rs:12:8
+ --> $DIR/liveness-unused.rs:13:8
|
LL | fn f1b(x: &mut isize) {
| ^ help: if this is intentional, prefix it with an underscore: `_x`
error: unused variable: `x`
- --> $DIR/liveness-unused.rs:20:9
+ --> $DIR/liveness-unused.rs:21:9
|
LL | let x: isize;
| ^ help: if this is intentional, prefix it with an underscore: `_x`
error: unused variable: `x`
- --> $DIR/liveness-unused.rs:25:9
+ --> $DIR/liveness-unused.rs:26:9
|
LL | let x = 3;
| ^ help: if this is intentional, prefix it with an underscore: `_x`
error: variable `x` is assigned to, but never used
- --> $DIR/liveness-unused.rs:30:13
+ --> $DIR/liveness-unused.rs:31:13
|
LL | let mut x = 3;
| ^
@@ -52,7 +52,7 @@ LL | let mut x = 3;
= note: consider using `_x` instead
error: value assigned to `x` is never read
- --> $DIR/liveness-unused.rs:32:5
+ --> $DIR/liveness-unused.rs:33:5
|
LL | x += 4;
| ^
@@ -65,7 +65,7 @@ LL | #![deny(unused_assignments)]
| ^^^^^^^^^^^^^^^^^^
error: variable `z` is assigned to, but never used
- --> $DIR/liveness-unused.rs:37:13
+ --> $DIR/liveness-unused.rs:38:13
|
LL | let mut z = 3;
| ^
@@ -73,31 +73,31 @@ LL | let mut z = 3;
= note: consider using `_z` instead
error: unused variable: `i`
- --> $DIR/liveness-unused.rs:59:12
+ --> $DIR/liveness-unused.rs:60:12
|
LL | Some(i) => {
| ^ help: if this is intentional, prefix it with an underscore: `_i`
error: unused variable: `x`
- --> $DIR/liveness-unused.rs:79:9
+ --> $DIR/liveness-unused.rs:80:9
|
LL | for x in 1..10 { }
| ^ help: if this is intentional, prefix it with an underscore: `_x`
error: unused variable: `x`
- --> $DIR/liveness-unused.rs:84:10
+ --> $DIR/liveness-unused.rs:85:10
|
LL | for (x, _) in [1, 2, 3].iter().enumerate() { }
| ^ help: if this is intentional, prefix it with an underscore: `_x`
error: unused variable: `x`
- --> $DIR/liveness-unused.rs:89:13
+ --> $DIR/liveness-unused.rs:90:13
|
LL | for (_, x) in [1, 2, 3].iter().enumerate() {
| ^ help: if this is intentional, prefix it with an underscore: `_x`
error: variable `x` is assigned to, but never used
- --> $DIR/liveness-unused.rs:112:9
+ --> $DIR/liveness-unused.rs:113:9
|
LL | let x;
| ^
@@ -105,7 +105,7 @@ LL | let x;
= note: consider using `_x` instead
error: value assigned to `x` is never read
- --> $DIR/liveness-unused.rs:116:9
+ --> $DIR/liveness-unused.rs:117:9
|
LL | x = 0;
| ^
diff --git a/tests/ui/target-feature/forbidden-hardfloat-target-feature-attribute.rs b/tests/ui/target-feature/forbidden-hardfloat-target-feature-attribute.rs
index dab01179c0b36..215e64979f736 100644
--- a/tests/ui/target-feature/forbidden-hardfloat-target-feature-attribute.rs
+++ b/tests/ui/target-feature/forbidden-hardfloat-target-feature-attribute.rs
@@ -1,3 +1,4 @@
+//! Ensure ABI-incompatible features cannot be enabled via `#[target_feature]`.
//@ compile-flags: --target=riscv32e-unknown-none-elf --crate-type=lib
//@ needs-llvm-components: riscv
#![feature(no_core, lang_items, riscv_target_feature)]
diff --git a/tests/ui/target-feature/forbidden-hardfloat-target-feature-attribute.stderr b/tests/ui/target-feature/forbidden-hardfloat-target-feature-attribute.stderr
index 9df56d86729c1..bfe767e5ffb07 100644
--- a/tests/ui/target-feature/forbidden-hardfloat-target-feature-attribute.stderr
+++ b/tests/ui/target-feature/forbidden-hardfloat-target-feature-attribute.stderr
@@ -1,5 +1,5 @@
error: target feature `d` cannot be enabled with `#[target_feature]`: this feature is incompatible with the target ABI
- --> $DIR/forbidden-hardfloat-target-feature-attribute.rs:9:18
+ --> $DIR/forbidden-hardfloat-target-feature-attribute.rs:10:18
|
LL | #[target_feature(enable = "d")]
| ^^^^^^^^^^^^
diff --git a/tests/ui/target-feature/forbidden-hardfloat-target-feature-cfg.rs b/tests/ui/target-feature/forbidden-hardfloat-target-feature-cfg.rs
deleted file mode 100644
index 8755791c1c04b..0000000000000
--- a/tests/ui/target-feature/forbidden-hardfloat-target-feature-cfg.rs
+++ /dev/null
@@ -1,14 +0,0 @@
-//@ compile-flags: --target=x86_64-unknown-linux-gnu --crate-type=lib
-//@ needs-llvm-components: x86
-//@ check-pass
-#![feature(no_core, lang_items)]
-#![no_core]
-#![allow(unexpected_cfgs)]
-
-#[lang = "sized"]
-pub trait Sized {}
-
-// The compile_error macro does not exist, so if the `cfg` evaluates to `true` this
-// complains about the missing macro rather than showing the error... but that's good enough.
-#[cfg(not(target_feature = "x87"))]
-compile_error!("the x87 feature *should* be exposed in `cfg`");
diff --git a/tests/ui/target-feature/forbidden-hardfloat-target-feature-flag-disable-implied.rs b/tests/ui/target-feature/forbidden-hardfloat-target-feature-flag-disable-implied.rs
index 3d09217327ab9..81f138b175f29 100644
--- a/tests/ui/target-feature/forbidden-hardfloat-target-feature-flag-disable-implied.rs
+++ b/tests/ui/target-feature/forbidden-hardfloat-target-feature-flag-disable-implied.rs
@@ -1,8 +1,11 @@
+//! Ensure that if disabling a target feature implies disabling an ABI-required target feature,
+//! we complain.
//@ compile-flags: --target=x86_64-unknown-linux-gnu --crate-type=lib
//@ needs-llvm-components: x86
//@ compile-flags: -Ctarget-feature=-sse
// For now this is just a warning.
//@ build-pass
+//@error-pattern: must be enabled to ensure that the ABI
#![feature(no_core, lang_items)]
#![no_core]
diff --git a/tests/ui/target-feature/forbidden-hardfloat-target-feature-flag-disable-neon.rs b/tests/ui/target-feature/forbidden-hardfloat-target-feature-flag-disable-neon.rs
index 95c366bb3f5be..7242bcc85bfd1 100644
--- a/tests/ui/target-feature/forbidden-hardfloat-target-feature-flag-disable-neon.rs
+++ b/tests/ui/target-feature/forbidden-hardfloat-target-feature-flag-disable-neon.rs
@@ -3,6 +3,7 @@
//@ compile-flags: -Ctarget-feature=-neon
// For now this is just a warning.
//@ build-pass
+//@error-pattern: must be enabled to ensure that the ABI
#![feature(no_core, lang_items)]
#![no_core]
diff --git a/tests/ui/target-feature/forbidden-hardfloat-target-feature-flag-disable.rs b/tests/ui/target-feature/forbidden-hardfloat-target-feature-flag-disable.rs
index fd8023664dad8..7eebcf05dc0f4 100644
--- a/tests/ui/target-feature/forbidden-hardfloat-target-feature-flag-disable.rs
+++ b/tests/ui/target-feature/forbidden-hardfloat-target-feature-flag-disable.rs
@@ -1,8 +1,10 @@
+//! Ensure ABI-required features cannot be disabled via `-Ctarget-feature`.
//@ compile-flags: --target=x86_64-unknown-linux-gnu --crate-type=lib
//@ needs-llvm-components: x86
//@ compile-flags: -Ctarget-feature=-x87
// For now this is just a warning.
//@ build-pass
+//@error-pattern: must be enabled to ensure that the ABI
#![feature(no_core, lang_items)]
#![no_core]
diff --git a/tests/ui/target-feature/forbidden-hardfloat-target-feature-flag.rs b/tests/ui/target-feature/forbidden-hardfloat-target-feature-flag.rs
new file mode 100644
index 0000000000000..f277a309cd698
--- /dev/null
+++ b/tests/ui/target-feature/forbidden-hardfloat-target-feature-flag.rs
@@ -0,0 +1,12 @@
+//! Ensure ABI-incompatible features cannot be enabled via `-Ctarget-feature`.
+//@ compile-flags: --target=x86_64-unknown-linux-gnu --crate-type=lib
+//@ needs-llvm-components: x86
+//@ compile-flags: -Ctarget-feature=+soft-float
+// For now this is just a warning.
+//@ build-pass
+//@error-pattern: must be disabled to ensure that the ABI
+#![feature(no_core, lang_items, riscv_target_feature)]
+#![no_core]
+
+#[lang = "sized"]
+pub trait Sized {}
diff --git a/tests/ui/target-feature/forbidden-hardfloat-target-feature-flag.stderr b/tests/ui/target-feature/forbidden-hardfloat-target-feature-flag.stderr
new file mode 100644
index 0000000000000..e49672f33b9a8
--- /dev/null
+++ b/tests/ui/target-feature/forbidden-hardfloat-target-feature-flag.stderr
@@ -0,0 +1,11 @@
+warning: target feature `soft-float` must be disabled to ensure that the ABI of the current target can be implemented correctly
+ |
+ = note: 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 #116344
+
+warning: unstable feature specified for `-Ctarget-feature`: `soft-float`
+ |
+ = note: this feature is not stably supported; its behavior can change in the future
+
+warning: 2 warnings emitted
+
diff --git a/tests/ui/target-feature/forbidden-target-feature-attribute.rs b/tests/ui/target-feature/forbidden-target-feature-attribute.rs
index 2ba5f2215c7b2..6bb6f8aaffb6f 100644
--- a/tests/ui/target-feature/forbidden-target-feature-attribute.rs
+++ b/tests/ui/target-feature/forbidden-target-feature-attribute.rs
@@ -1,11 +1,12 @@
-//@ compile-flags: --target=x86_64-unknown-linux-gnu --crate-type=lib
-//@ needs-llvm-components: x86
+//! Ensure "forbidden" target features cannot be enabled via `#[target_feature]`.
+//@ compile-flags: --target=riscv32e-unknown-none-elf --crate-type=lib
+//@ needs-llvm-components: riscv
#![feature(no_core, lang_items)]
#![no_core]
#[lang = "sized"]
pub trait Sized {}
-#[target_feature(enable = "soft-float")]
+#[target_feature(enable = "forced-atomics")]
//~^ERROR: cannot be enabled with
pub unsafe fn my_fun() {}
diff --git a/tests/ui/target-feature/forbidden-target-feature-attribute.stderr b/tests/ui/target-feature/forbidden-target-feature-attribute.stderr
index f3d54cc19d3e9..f8ea0c0e793fb 100644
--- a/tests/ui/target-feature/forbidden-target-feature-attribute.stderr
+++ b/tests/ui/target-feature/forbidden-target-feature-attribute.stderr
@@ -1,8 +1,8 @@
-error: target feature `soft-float` cannot be enabled with `#[target_feature]`: unsound because it changes float ABI
- --> $DIR/forbidden-target-feature-attribute.rs:9:18
+error: target feature `forced-atomics` cannot be enabled with `#[target_feature]`: unsound because it changes the ABI of atomic operations
+ --> $DIR/forbidden-target-feature-attribute.rs:10:18
|
-LL | #[target_feature(enable = "soft-float")]
- | ^^^^^^^^^^^^^^^^^^^^^
+LL | #[target_feature(enable = "forced-atomics")]
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^
error: aborting due to 1 previous error
diff --git a/tests/ui/target-feature/forbidden-target-feature-cfg.rs b/tests/ui/target-feature/forbidden-target-feature-cfg.rs
index 1f001e9f8ff8a..e848ffde018e2 100644
--- a/tests/ui/target-feature/forbidden-target-feature-cfg.rs
+++ b/tests/ui/target-feature/forbidden-target-feature-cfg.rs
@@ -1,5 +1,6 @@
-//@ compile-flags: --target=x86_64-unknown-none --crate-type=lib
-//@ needs-llvm-components: x86
+//! Ensure "forbidden" target features are not exposed via `cfg`.
+//@ compile-flags: --target=riscv32e-unknown-none-elf --crate-type=lib
+//@ needs-llvm-components: riscv
//@ check-pass
#![feature(no_core, lang_items)]
#![no_core]
@@ -10,5 +11,5 @@ pub trait Sized {}
// The compile_error macro does not exist, so if the `cfg` evaluates to `true` this
// complains about the missing macro rather than showing the error... but that's good enough.
-#[cfg(target_feature = "soft-float")]
-compile_error!("the soft-float feature should not be exposed in `cfg`");
+#[cfg(target_feature = "forced-atomics")]
+compile_error!("the forced-atomics feature should not be exposed in `cfg`");
diff --git a/tests/ui/target-feature/forbidden-target-feature-flag-disable.rs b/tests/ui/target-feature/forbidden-target-feature-flag-disable.rs
index b09c53bd46afa..cf85c5212289c 100644
--- a/tests/ui/target-feature/forbidden-target-feature-flag-disable.rs
+++ b/tests/ui/target-feature/forbidden-target-feature-flag-disable.rs
@@ -1,8 +1,10 @@
-//@ compile-flags: --target=x86_64-unknown-linux-gnu --crate-type=lib
-//@ needs-llvm-components: x86
-//@ compile-flags: -Ctarget-feature=-soft-float
+//! Ensure "forbidden" target features cannot be disabled via `-Ctarget-feature`.
+//@ compile-flags: --target=riscv32e-unknown-none-elf --crate-type=lib
+//@ needs-llvm-components: riscv
+//@ compile-flags: -Ctarget-feature=-forced-atomics
// For now this is just a warning.
//@ build-pass
+//@error-pattern: unsound because it changes the ABI
#![feature(no_core, lang_items)]
#![no_core]
diff --git a/tests/ui/target-feature/forbidden-target-feature-flag-disable.stderr b/tests/ui/target-feature/forbidden-target-feature-flag-disable.stderr
index 797cd4be5c27f..171ed0de6aaf3 100644
--- a/tests/ui/target-feature/forbidden-target-feature-flag-disable.stderr
+++ b/tests/ui/target-feature/forbidden-target-feature-flag-disable.stderr
@@ -1,4 +1,4 @@
-warning: target feature `soft-float` cannot be disabled with `-Ctarget-feature`: unsound because it changes float ABI
+warning: target feature `forced-atomics` cannot be disabled with `-Ctarget-feature`: unsound because it changes the ABI of atomic operations
|
= note: 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 #116344
diff --git a/tests/ui/target-feature/forbidden-target-feature-flag.rs b/tests/ui/target-feature/forbidden-target-feature-flag.rs
index 0f688fde7f434..245841eb0395c 100644
--- a/tests/ui/target-feature/forbidden-target-feature-flag.rs
+++ b/tests/ui/target-feature/forbidden-target-feature-flag.rs
@@ -1,8 +1,10 @@
-//@ compile-flags: --target=x86_64-unknown-linux-gnu --crate-type=lib
-//@ needs-llvm-components: x86
-//@ compile-flags: -Ctarget-feature=+soft-float
+//! Ensure "forbidden" target features cannot be enabled via `-Ctarget-feature`.
+//@ compile-flags: --target=riscv32e-unknown-none-elf --crate-type=lib
+//@ needs-llvm-components: riscv
+//@ compile-flags: -Ctarget-feature=+forced-atomics
// For now this is just a warning.
//@ build-pass
+//@error-pattern: unsound because it changes the ABI
#![feature(no_core, lang_items)]
#![no_core]
diff --git a/tests/ui/target-feature/forbidden-target-feature-flag.stderr b/tests/ui/target-feature/forbidden-target-feature-flag.stderr
index 075666fbf6682..f8490f066d1d7 100644
--- a/tests/ui/target-feature/forbidden-target-feature-flag.stderr
+++ b/tests/ui/target-feature/forbidden-target-feature-flag.stderr
@@ -1,4 +1,4 @@
-warning: target feature `soft-float` cannot be enabled with `-Ctarget-feature`: unsound because it changes float ABI
+warning: target feature `forced-atomics` cannot be enabled with `-Ctarget-feature`: unsound because it changes the ABI of atomic operations
|
= note: 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 #116344
diff --git a/tests/ui/traits/const-traits/enforce-deref-on-adjust.rs b/tests/ui/traits/const-traits/enforce-deref-on-adjust.rs
new file mode 100644
index 0000000000000..d5240b7e18ddb
--- /dev/null
+++ b/tests/ui/traits/const-traits/enforce-deref-on-adjust.rs
@@ -0,0 +1,28 @@
+//@ check-pass
+
+#![feature(const_deref)]
+#![feature(const_trait_impl)]
+
+use std::ops::Deref;
+
+struct Wrap(T);
+struct Foo;
+
+impl Foo {
+ const fn call(&self) {}
+}
+
+impl const Deref for Wrap {
+ type Target = T;
+
+ fn deref(&self) -> &Self::Target {
+ &self.0
+ }
+}
+
+const fn foo() {
+ let x = Wrap(Foo);
+ x.call();
+}
+
+fn main() {}
diff --git a/tests/ui/traits/next-solver/canonical/const-region-infer-to-static-in-binder.stderr b/tests/ui/traits/next-solver/canonical/const-region-infer-to-static-in-binder.stderr
index 377dfc8b52916..425f2d59222e0 100644
--- a/tests/ui/traits/next-solver/canonical/const-region-infer-to-static-in-binder.stderr
+++ b/tests/ui/traits/next-solver/canonical/const-region-infer-to-static-in-binder.stderr
@@ -1,8 +1,8 @@
-error[E0284]: type annotations needed: cannot normalize `X::{constant#0}`
+error[E0284]: type annotations needed: cannot satisfy `the constant `{ || {} }` can be evaluated`
--> $DIR/const-region-infer-to-static-in-binder.rs:4:10
|
LL | struct X;
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^ cannot normalize `X::{constant#0}`
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^ cannot satisfy `the constant `{ || {} }` can be evaluated`
error: using function pointers as const generic parameters is forbidden
--> $DIR/const-region-infer-to-static-in-binder.rs:4:20
diff --git a/tests/ui/traits/next-solver/specialization-transmute.stderr b/tests/ui/traits/next-solver/specialization-transmute.stderr
index b96bfab927d2d..2d0c503bc958d 100644
--- a/tests/ui/traits/next-solver/specialization-transmute.stderr
+++ b/tests/ui/traits/next-solver/specialization-transmute.stderr
@@ -10,11 +10,11 @@ LL | #![feature(specialization)]
error: cannot normalize `::Id: '_`
-error[E0284]: type annotations needed: cannot normalize `::Id`
+error[E0282]: type annotations needed
--> $DIR/specialization-transmute.rs:15:23
|
LL | fn intu(&self) -> &Self::Id {
- | ^^^^^^^^^ cannot normalize `::Id`
+ | ^^^^^^^^^ cannot infer type for reference `&::Id`
error[E0284]: type annotations needed: cannot satisfy `::Id normalizes-to T`
--> $DIR/specialization-transmute.rs:17:9
@@ -36,4 +36,5 @@ LL | fn transmute, U: Copy>(t: T) -> U {
error: aborting due to 4 previous errors; 1 warning emitted
-For more information about this error, try `rustc --explain E0284`.
+Some errors have detailed explanations: E0282, E0284.
+For more information about an error, try `rustc --explain E0282`.
diff --git a/tests/ui/typeck/issue-114918/const-in-impl-fn-return-type.next.stderr b/tests/ui/typeck/issue-114918/const-in-impl-fn-return-type.next.stderr
index 1bcc0dbaf6726..92ad83c330000 100644
--- a/tests/ui/typeck/issue-114918/const-in-impl-fn-return-type.next.stderr
+++ b/tests/ui/typeck/issue-114918/const-in-impl-fn-return-type.next.stderr
@@ -9,6 +9,8 @@ error: the constant `N` is not of type `usize`
|
LL | fn func() -> [(); N];
| ^^^^^^^ expected `usize`, found `u32`
+ |
+ = note: the length of array `[(); N]` must be type `usize`
error: aborting due to 2 previous errors
diff --git a/tests/ui/union/union-derive-eq.next.stderr b/tests/ui/union/union-derive-eq.next.stderr
index 3952b1f12840f..151ceebe1ba67 100644
--- a/tests/ui/union/union-derive-eq.next.stderr
+++ b/tests/ui/union/union-derive-eq.next.stderr
@@ -7,6 +7,8 @@ LL | union U2 {
LL | a: PartialEqNotEq,
| ^^^^^^^^^^^^^^^^^ the trait `Eq` is not implemented for `PartialEqNotEq`
|
+note: required by a bound in `AssertParamIsEq`
+ --> $SRC_DIR/core/src/cmp.rs:LL:COL
= note: this error originates in the derive macro `Eq` (in Nightly builds, run with -Z macro-backtrace for more info)
help: consider annotating `PartialEqNotEq` with `#[derive(Eq)]`
|
diff --git a/tests/ui/wf/wf-normalization-sized.next.stderr b/tests/ui/wf/wf-normalization-sized.next.stderr
index 1e898fb7b78ab..83b56bb6b19ad 100644
--- a/tests/ui/wf/wf-normalization-sized.next.stderr
+++ b/tests/ui/wf/wf-normalization-sized.next.stderr
@@ -5,6 +5,7 @@ LL | const _: <[[[[[[u8]]]]]] as WellUnformed>::RequestNormalize = ();
| ^^^^^^^^^^^^^^ doesn't have a size known at compile-time
|
= help: the trait `Sized` is not implemented for `[[[[[u8]]]]]`
+ = note: slice and array elements must have `Sized` type
error[E0277]: the size for values of type `[[[[[u8]]]]]` cannot be known at compilation time
--> $DIR/wf-normalization-sized.rs:19:11
@@ -13,6 +14,7 @@ LL | const _: <[[[[[[u8]]]]]] as WellUnformed>::RequestNormalize = ();
| ^^^^^^^^^^^^^^ doesn't have a size known at compile-time
|
= help: the trait `Sized` is not implemented for `[[[[[u8]]]]]`
+ = note: slice and array elements must have `Sized` type
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
error[E0277]: the size for values of type `str` cannot be known at compilation time
@@ -22,6 +24,8 @@ LL | const _: as WellUnformed>::RequestNormalize = ();
| ^^^^^^^^ doesn't have a size known at compile-time
|
= help: the trait `Sized` is not implemented for `str`
+note: required by an implicit `Sized` bound in `Vec`
+ --> $SRC_DIR/alloc/src/vec/mod.rs:LL:COL
error[E0277]: the size for values of type `str` cannot be known at compilation time
--> $DIR/wf-normalization-sized.rs:22:11
@@ -30,6 +34,8 @@ LL | const _: as WellUnformed>::RequestNormalize = ();
| ^^^^^^^^ doesn't have a size known at compile-time
|
= help: the trait `Sized` is not implemented for `str`
+note: required by an implicit `Sized` bound in `Vec`
+ --> $SRC_DIR/alloc/src/vec/mod.rs:LL:COL
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
error: aborting due to 4 previous errors
diff --git a/tests/ui/wf/wf-trait-fn-arg.next.stderr b/tests/ui/wf/wf-trait-fn-arg.next.stderr
index c55dc5c8a121a..d5dd36fad6dd6 100644
--- a/tests/ui/wf/wf-trait-fn-arg.next.stderr
+++ b/tests/ui/wf/wf-trait-fn-arg.next.stderr
@@ -4,6 +4,11 @@ error[E0277]: the trait bound `Self: Eq` is not satisfied
LL | fn bar(&self, x: &Bar);
| ^^^^^^^^^ the trait `Eq` is not implemented for `Self`
|
+note: required by a bound in `Bar`
+ --> $DIR/wf-trait-fn-arg.rs:11:15
+ |
+LL | struct Bar {
+ | ^^ required by this bound in `Bar`
help: consider further restricting `Self`
|
LL | fn bar(&self, x: &Bar) where Self: Eq;
diff --git a/tests/ui/wf/wf-trait-fn-ret.next.stderr b/tests/ui/wf/wf-trait-fn-ret.next.stderr
index b3dca17672d31..0ad786c2fd566 100644
--- a/tests/ui/wf/wf-trait-fn-ret.next.stderr
+++ b/tests/ui/wf/wf-trait-fn-ret.next.stderr
@@ -4,6 +4,11 @@ error[E0277]: the trait bound `Self: Eq` is not satisfied
LL | fn bar(&self) -> &Bar;
| ^^^^^^^^^ the trait `Eq` is not implemented for `Self`
|
+note: required by a bound in `Bar`
+ --> $DIR/wf-trait-fn-ret.rs:10:15
+ |
+LL | struct Bar {
+ | ^^ required by this bound in `Bar`
help: consider further restricting `Self`
|
LL | fn bar(&self) -> &Bar where Self: Eq;
diff --git a/tests/ui/wf/wf-trait-fn-where-clause.next.stderr b/tests/ui/wf/wf-trait-fn-where-clause.next.stderr
index 8c8a5fa3e7041..db5454d0f3c22 100644
--- a/tests/ui/wf/wf-trait-fn-where-clause.next.stderr
+++ b/tests/ui/wf/wf-trait-fn-where-clause.next.stderr
@@ -4,6 +4,11 @@ error[E0277]: the trait bound `Self: Eq` is not satisfied
LL | Bar: Copy;
| ^^^^ the trait `Eq` is not implemented for `Self`
|
+note: required by a bound in `Bar`
+ --> $DIR/wf-trait-fn-where-clause.rs:10:15
+ |
+LL | struct Bar {
+ | ^^ required by this bound in `Bar`
help: consider further restricting `Self`
|
LL | Bar: Copy, Self: Eq;