- {
+ if let Res::Def(DefKind::Ctor(..), _) | Res::SelfCtor(..) = path.res {
+ return Vec::new();
+ }
// We need this comparison because some imports (for std types for example)
// are "inserted" as well but directly by the compiler and they should not be
// taken into account.
diff --git a/src/librustdoc/core.rs b/src/librustdoc/core.rs
index 82a1fe310b38..7fb069d6e707 100644
--- a/src/librustdoc/core.rs
+++ b/src/librustdoc/core.rs
@@ -176,6 +176,7 @@ pub(crate) fn new_handler(
rustc_errors::Handler::with_emitter_and_flags(
emitter,
unstable_opts.diagnostic_handler_flags(true),
+ None,
)
}
@@ -296,6 +297,7 @@ pub(crate) fn create_config(
}),
make_codegen_backend: None,
registry: rustc_driver::diagnostics_registry(),
+ ice_file: None,
}
}
diff --git a/src/librustdoc/doctest.rs b/src/librustdoc/doctest.rs
index 6047cf23350c..6766dcba18af 100644
--- a/src/librustdoc/doctest.rs
+++ b/src/librustdoc/doctest.rs
@@ -108,6 +108,7 @@ pub(crate) fn run(options: RustdocOptions) -> Result<(), ErrorGuaranteed> {
override_queries: None,
make_codegen_backend: None,
registry: rustc_driver::diagnostics_registry(),
+ ice_file: None,
};
let test_args = options.test_args.clone();
@@ -586,7 +587,7 @@ pub(crate) fn make_test(
);
// FIXME(misdreavus): pass `-Z treat-err-as-bug` to the doctest parser
- let handler = Handler::with_emitter(false, None, Box::new(emitter));
+ let handler = Handler::with_emitter(false, None, Box::new(emitter), None);
let sess = ParseSess::with_span_handler(handler, sm);
let mut found_main = false;
@@ -773,7 +774,7 @@ fn check_if_attr_is_complete(source: &str, edition: Edition) -> bool {
TerminalUrl::No,
);
- let handler = Handler::with_emitter(false, None, Box::new(emitter));
+ let handler = Handler::with_emitter(false, None, Box::new(emitter), None);
let sess = ParseSess::with_span_handler(handler, sm);
let mut parser =
match maybe_new_parser_from_source_str(&sess, filename, source.to_owned()) {
diff --git a/src/librustdoc/html/static/css/rustdoc.css b/src/librustdoc/html/static/css/rustdoc.css
index 9209915895aa..94e778406f8b 100644
--- a/src/librustdoc/html/static/css/rustdoc.css
+++ b/src/librustdoc/html/static/css/rustdoc.css
@@ -888,7 +888,7 @@ so that we can apply CSS-filters to change the arrow color in themes */
justify-content: start;
flex: 3;
}
-.search-results .result-name span.alias {
+.search-results .result-name .alias {
color: var(--search-results-alias-color);
}
.search-results .result-name .grey {
@@ -904,6 +904,9 @@ so that we can apply CSS-filters to change the arrow color in themes */
max-width: calc(100% - var(--search-typename-width));
display: inline-block;
}
+.search-results .result-name .path > * {
+ display: inline;
+}
.popover {
position: absolute;
diff --git a/src/librustdoc/html/static/js/search.js b/src/librustdoc/html/static/js/search.js
index 51d8e81ca868..42088e735544 100644
--- a/src/librustdoc/html/static/js/search.js
+++ b/src/librustdoc/html/static/js/search.js
@@ -2108,30 +2108,23 @@ function initSearch(rawSearchIndex) {
const resultName = document.createElement("div");
resultName.className = "result-name";
- if (item.is_alias) {
- const alias = document.createElement("span");
- alias.className = "alias";
-
- const bold = document.createElement("b");
- bold.innerText = item.alias;
- alias.appendChild(bold);
-
- alias.insertAdjacentHTML(
- "beforeend",
- " - see ");
-
- resultName.appendChild(alias);
- }
-
resultName.insertAdjacentHTML(
"beforeend",
- `\
-${typeName}\
-
\
- ${item.displayPath}${name}\
-
`);
+ `${typeName}`);
link.appendChild(resultName);
+ let alias = " ";
+ if (item.is_alias) {
+ alias = ` \
+${item.alias} - see \
+
`;
+ }
+ resultName.insertAdjacentHTML(
+ "beforeend",
+ `${alias}\
+${item.displayPath}${name}\
+
`);
+
const description = document.createElement("div");
description.className = "desc";
description.insertAdjacentHTML("beforeend", item.desc);
diff --git a/src/librustdoc/passes/lint/check_code_block_syntax.rs b/src/librustdoc/passes/lint/check_code_block_syntax.rs
index 369a8069593d..c82f2bc987aa 100644
--- a/src/librustdoc/passes/lint/check_code_block_syntax.rs
+++ b/src/librustdoc/passes/lint/check_code_block_syntax.rs
@@ -40,7 +40,7 @@ fn check_rust_syntax(
let emitter = BufferEmitter { buffer: Lrc::clone(&buffer), fallback_bundle };
let sm = Lrc::new(SourceMap::new(FilePathMapping::empty()));
- let handler = Handler::with_emitter(false, None, Box::new(emitter));
+ let handler = Handler::with_emitter(false, None, Box::new(emitter), None);
let source = dox[code_block.code].to_owned();
let sess = ParseSess::with_span_handler(handler, sm);
diff --git a/src/librustdoc/visit_ast.rs b/src/librustdoc/visit_ast.rs
index 265123ddf6c8..66737a015215 100644
--- a/src/librustdoc/visit_ast.rs
+++ b/src/librustdoc/visit_ast.rs
@@ -35,6 +35,8 @@ pub(crate) struct Module<'hir> {
(LocalDefId, Option),
(&'hir hir::Item<'hir>, Option, Option),
>,
+ /// Same as for `items`.
+ pub(crate) inlined_foreigns: FxIndexMap<(DefId, Option), (Res, LocalDefId)>,
pub(crate) foreigns: Vec<(&'hir hir::ForeignItem<'hir>, Option)>,
}
@@ -54,6 +56,7 @@ impl Module<'_> {
import_id,
mods: Vec::new(),
items: FxIndexMap::default(),
+ inlined_foreigns: FxIndexMap::default(),
foreigns: Vec::new(),
}
}
@@ -272,21 +275,30 @@ impl<'a, 'tcx> RustdocVisitor<'a, 'tcx> {
return false;
}
- // For cross-crate impl inlining we need to know whether items are
- // reachable in documentation -- a previously unreachable item can be
- // made reachable by cross-crate inlining which we're checking here.
- // (this is done here because we need to know this upfront).
- if !ori_res_did.is_local() && !is_no_inline {
- crate::visit_lib::lib_embargo_visit_item(self.cx, ori_res_did);
- return false;
- }
-
+ let is_hidden = !document_hidden && tcx.is_doc_hidden(ori_res_did);
let Some(res_did) = ori_res_did.as_local() else {
- return false;
+ // For cross-crate impl inlining we need to know whether items are
+ // reachable in documentation -- a previously unreachable item can be
+ // made reachable by cross-crate inlining which we're checking here.
+ // (this is done here because we need to know this upfront).
+ crate::visit_lib::lib_embargo_visit_item(self.cx, ori_res_did);
+ if is_hidden {
+ return false;
+ }
+ // We store inlined foreign items otherwise, it'd mean that the `use` item would be kept
+ // around. It's not a problem unless this `use` imports both a local AND a foreign item.
+ // If a local item is inlined, its `use` is not supposed to still be around in `clean`,
+ // which would make appear the `use` in the generated documentation like the local item
+ // was not inlined even though it actually was.
+ self.modules
+ .last_mut()
+ .unwrap()
+ .inlined_foreigns
+ .insert((ori_res_did, renamed), (res, def_id));
+ return true;
};
let is_private = !self.cx.cache.effective_visibilities.is_directly_public(tcx, ori_res_did);
- let is_hidden = !document_hidden && tcx.is_doc_hidden(ori_res_did);
let item = tcx.hir().get_by_def_id(res_did);
if !please_inline {
@@ -314,7 +326,7 @@ impl<'a, 'tcx> RustdocVisitor<'a, 'tcx> {
return false;
}
- let inlined = match tcx.hir().get_by_def_id(res_did) {
+ let inlined = match item {
// Bang macros are handled a bit on their because of how they are handled by the
// compiler. If they have `#[doc(hidden)]` and the re-export doesn't have
// `#[doc(inline)]`, then we don't inline it.
@@ -346,7 +358,7 @@ impl<'a, 'tcx> RustdocVisitor<'a, 'tcx> {
};
self.view_item_stack.remove(&res_did);
if inlined {
- self.cx.cache.inlined_items.insert(res_did.to_def_id());
+ self.cx.cache.inlined_items.insert(ori_res_did);
}
inlined
}
@@ -483,7 +495,6 @@ impl<'a, 'tcx> RustdocVisitor<'a, 'tcx> {
continue;
}
}
-
self.add_to_current_mod(item, renamed, import_id);
}
}
diff --git a/src/tools/cargo b/src/tools/cargo
index 694a579566a9..1b15556767f4 160000
--- a/src/tools/cargo
+++ b/src/tools/cargo
@@ -1 +1 @@
-Subproject commit 694a579566a9a1482b20aff8a68f0e4edd99bd28
+Subproject commit 1b15556767f4b78a64e868eedf4073c423f02b93
diff --git a/src/tools/clippy/clippy_lints/src/doc.rs b/src/tools/clippy/clippy_lints/src/doc.rs
index e5f39d102cd3..8879c529262b 100644
--- a/src/tools/clippy/clippy_lints/src/doc.rs
+++ b/src/tools/clippy/clippy_lints/src/doc.rs
@@ -729,7 +729,7 @@ fn check_code(cx: &LateContext<'_>, text: &str, edition: Edition, span: Span) {
false,
TerminalUrl::No,
);
- let handler = Handler::with_emitter(false, None, Box::new(emitter));
+ let handler = Handler::with_emitter(false, None, Box::new(emitter), None);
let sess = ParseSess::with_span_handler(handler, sm);
let mut parser = match maybe_new_parser_from_source_str(&sess, filename, code) {
diff --git a/src/tools/clippy/clippy_lints/src/future_not_send.rs b/src/tools/clippy/clippy_lints/src/future_not_send.rs
index e54429aee8e8..621415c881cf 100644
--- a/src/tools/clippy/clippy_lints/src/future_not_send.rs
+++ b/src/tools/clippy/clippy_lints/src/future_not_send.rs
@@ -66,7 +66,7 @@ impl<'tcx> LateLintPass<'tcx> for FutureNotSend {
if let ty::Alias(ty::Opaque, AliasTy { def_id, args, .. }) = *ret_ty.kind() {
let preds = cx.tcx.explicit_item_bounds(def_id);
let mut is_future = false;
- for (p, _span) in preds.arg_iter_copied(cx.tcx, args) {
+ for (p, _span) in preds.iter_instantiated_copied(cx.tcx, args) {
if let Some(trait_pred) = p.as_trait_clause() {
if Some(trait_pred.skip_binder().trait_ref.def_id) == cx.tcx.lang_items().future_trait() {
is_future = true;
diff --git a/src/tools/clippy/clippy_utils/src/ty.rs b/src/tools/clippy/clippy_utils/src/ty.rs
index ad79143f4da9..fd39a246f48d 100644
--- a/src/tools/clippy/clippy_utils/src/ty.rs
+++ b/src/tools/clippy/clippy_utils/src/ty.rs
@@ -663,7 +663,7 @@ pub fn ty_sig<'tcx>(cx: &LateContext<'tcx>, ty: Ty<'tcx>) -> Option sig_from_bounds(
cx,
ty,
- cx.tcx.item_bounds(def_id).arg_iter(cx.tcx, args),
+ cx.tcx.item_bounds(def_id).iter_instantiated(cx.tcx, args),
cx.tcx.opt_parent(def_id),
),
ty::FnPtr(sig) => Some(ExprFnSig::Sig(sig, None)),
@@ -739,7 +739,7 @@ fn sig_for_projection<'tcx>(cx: &LateContext<'tcx>, ty: AliasTy<'tcx>) -> Option
let mut output = None;
let lang_items = cx.tcx.lang_items();
- for (pred, _) in cx.tcx.explicit_item_bounds(ty.def_id).arg_iter_copied(cx.tcx, ty.args) {
+ for (pred, _) in cx.tcx.explicit_item_bounds(ty.def_id).iter_instantiated_copied(cx.tcx, ty.args) {
match pred.kind().skip_binder() {
ty::ClauseKind::Trait(p)
if (lang_items.fn_trait() == Some(p.def_id())
diff --git a/src/tools/compiletest/src/header.rs b/src/tools/compiletest/src/header.rs
index d67e9aaaa6e0..4ae2249097f6 100644
--- a/src/tools/compiletest/src/header.rs
+++ b/src/tools/compiletest/src/header.rs
@@ -232,7 +232,7 @@ impl TestProps {
aux_builds: vec![],
aux_crates: vec![],
revisions: vec![],
- rustc_env: vec![],
+ rustc_env: vec![("RUSTC_ICE".to_string(), "0".to_string())],
unset_rustc_env: vec![],
exec_env: vec![],
unset_exec_env: vec![],
diff --git a/src/tools/compiletest/src/runtest.rs b/src/tools/compiletest/src/runtest.rs
index b91e1b09330e..7eeb987063fc 100644
--- a/src/tools/compiletest/src/runtest.rs
+++ b/src/tools/compiletest/src/runtest.rs
@@ -4149,8 +4149,8 @@ impl<'test> TestCx<'test> {
# Match paths that don't include spaces.
(?:\\[\pL\pN\.\-_']+)+\.\pL+
|
- # If the path starts with a well-known root, then allow spaces.
- \$(?:DIR|SRC_DIR|TEST_BUILD_DIR|BUILD_DIR|LIB_DIR)(?:\\[\pL\pN\.\-_' ]+)+
+ # If the path starts with a well-known root, then allow spaces and no file extension.
+ \$(?:DIR|SRC_DIR|TEST_BUILD_DIR|BUILD_DIR|LIB_DIR)(?:\\[\pL\pN\.\-_'\ ]+)+
)"#,
)
.unwrap()
diff --git a/src/tools/compiletest/src/runtest/tests.rs b/src/tools/compiletest/src/runtest/tests.rs
index 51105111175a..fb3dd326a4c8 100644
--- a/src/tools/compiletest/src/runtest/tests.rs
+++ b/src/tools/compiletest/src/runtest/tests.rs
@@ -8,8 +8,8 @@ fn normalize_platform_differences() {
"$BUILD_DIR/../parser.rs"
);
assert_eq!(
- TestCx::normalize_platform_differences(r"$DIR\bar.rs hello\nworld"),
- r"$DIR/bar.rs hello\nworld"
+ TestCx::normalize_platform_differences(r"$DIR\bar.rs: hello\nworld"),
+ r"$DIR/bar.rs: hello\nworld"
);
assert_eq!(
TestCx::normalize_platform_differences(r"either bar\baz.rs or bar\baz\mod.rs"),
@@ -27,8 +27,8 @@ fn normalize_platform_differences() {
);
assert_eq!(TestCx::normalize_platform_differences(r"$DIR\foo.rs:12:11"), "$DIR/foo.rs:12:11",);
assert_eq!(
- TestCx::normalize_platform_differences(r"$DIR\path with spaces 'n' quotes"),
- "$DIR/path with spaces 'n' quotes",
+ TestCx::normalize_platform_differences(r"$DIR\path with\spaces 'n' quotes"),
+ "$DIR/path with/spaces 'n' quotes",
);
assert_eq!(
TestCx::normalize_platform_differences(r"$DIR\file_with\no_extension"),
diff --git a/src/tools/miri/src/shims/foreign_items.rs b/src/tools/miri/src/shims/foreign_items.rs
index 6915c396d616..72a4adba8d41 100644
--- a/src/tools/miri/src/shims/foreign_items.rs
+++ b/src/tools/miri/src/shims/foreign_items.rs
@@ -45,8 +45,9 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriInterpCxExt<'mir, 'tcx> {
// List taken from `library/std/src/sys/common/alloc.rs`.
// This list should be kept in sync with the one from libstd.
let min_align = match this.tcx.sess.target.arch.as_ref() {
- "x86" | "arm" | "mips" | "powerpc" | "powerpc64" | "asmjs" | "wasm32" => 8,
- "x86_64" | "aarch64" | "mips64" | "s390x" | "sparc64" | "loongarch64" => 16,
+ "x86" | "arm" | "mips" | "mips32r6" | "powerpc" | "powerpc64" | "asmjs" | "wasm32" => 8,
+ "x86_64" | "aarch64" | "mips64" | "mips64r6" | "s390x" | "sparc64" | "loongarch64" =>
+ 16,
arch => bug!("unsupported target architecture for malloc: `{}`", arch),
};
// Windows always aligns, even small allocations.
diff --git a/src/tools/miri/tests/fail/layout_cycle.stderr b/src/tools/miri/tests/fail/layout_cycle.stderr
index 62b7d5fb77d1..38907a1c50cc 100644
--- a/src/tools/miri/tests/fail/layout_cycle.stderr
+++ b/src/tools/miri/tests/fail/layout_cycle.stderr
@@ -2,6 +2,7 @@ error[E0391]: cycle detected when computing layout of `S>`
|
= note: ...which requires computing layout of ` as Tr>::I`...
= note: ...which again requires computing layout of `S>`, completing the cycle
+ = note: see https://rustc-dev-guide.rust-lang.org/overview.html#queries and https://rustc-dev-guide.rust-lang.org/query.html for more information
error: post-monomorphization error: a cycle occurred during layout computation
--> RUSTLIB/core/src/mem/mod.rs:LL:CC
diff --git a/src/tools/rustfmt/src/parse/session.rs b/src/tools/rustfmt/src/parse/session.rs
index 81b5015dde33..92d2425cd3b9 100644
--- a/src/tools/rustfmt/src/parse/session.rs
+++ b/src/tools/rustfmt/src/parse/session.rs
@@ -162,6 +162,7 @@ fn default_handler(
ignore_path_set,
can_reset,
}),
+ None,
)
}
@@ -233,7 +234,7 @@ impl ParseSess {
}
pub(crate) fn set_silent_emitter(&mut self) {
- self.parse_sess.span_diagnostic = Handler::with_emitter(true, None, silent_emitter());
+ self.parse_sess.span_diagnostic = Handler::with_emitter(true, None, silent_emitter(), None);
}
pub(crate) fn span_to_filename(&self, span: Span) -> FileName {
diff --git a/src/tools/tidy/src/deps.rs b/src/tools/tidy/src/deps.rs
index 9f0f0d86c8b2..2be369d2b740 100644
--- a/src/tools/tidy/src/deps.rs
+++ b/src/tools/tidy/src/deps.rs
@@ -253,6 +253,9 @@ const PERMITTED_RUSTC_DEPENDENCIES: &[&str] = &[
"thiserror-impl",
"thorin-dwp",
"thread_local",
+ "time",
+ "time-core",
+ "time-macros",
"tinystr",
"tinyvec",
"tinyvec_macros",
diff --git a/tests/codegen/no_builtins-at-crate.rs b/tests/codegen/no_builtins-at-crate.rs
new file mode 100644
index 000000000000..02ed670900ed
--- /dev/null
+++ b/tests/codegen/no_builtins-at-crate.rs
@@ -0,0 +1,24 @@
+// compile-flags: -C opt-level=1
+
+#![no_builtins]
+#![crate_type = "lib"]
+
+// CHECK: define
+// CHECK-SAME: @__aeabi_memcpy
+// CHECK-SAME: #0
+#[no_mangle]
+pub unsafe extern "C" fn __aeabi_memcpy(dest: *mut u8, src: *const u8, size: usize) {
+ // CHECK: call
+ // CHECK-SAME: @memcpy(
+ memcpy(dest, src, size);
+}
+
+// CHECK: declare
+// CHECK-SAME: @memcpy
+// CHECK-SAME: #0
+extern "C" {
+ pub fn memcpy(dest: *mut u8, src: *const u8, n: usize) -> *mut u8;
+}
+
+// CHECK: attributes #0
+// CHECK-SAME: "no-builtins"
diff --git a/tests/run-make-fulldeps/issue-19371/foo.rs b/tests/run-make-fulldeps/issue-19371/foo.rs
index d4959247d1cd..681326387591 100644
--- a/tests/run-make-fulldeps/issue-19371/foo.rs
+++ b/tests/run-make-fulldeps/issue-19371/foo.rs
@@ -52,6 +52,7 @@ fn compile(code: String, output: PathBuf, sysroot: PathBuf) {
input,
output_file: Some(OutFileName::Real(output)),
output_dir: None,
+ ice_file: None,
file_loader: None,
locale_resources: &[],
lint_caps: Default::default(),
diff --git a/tests/run-make/dump-ice-to-disk/Makefile b/tests/run-make/dump-ice-to-disk/Makefile
new file mode 100644
index 000000000000..4f33d590237b
--- /dev/null
+++ b/tests/run-make/dump-ice-to-disk/Makefile
@@ -0,0 +1,9 @@
+include ../tools.mk
+
+# ignore-windows
+
+export RUSTC := $(RUSTC_ORIGINAL)
+export TMPDIR := $(TMPDIR)
+
+all:
+ bash check.sh
diff --git a/tests/run-make/dump-ice-to-disk/check.sh b/tests/run-make/dump-ice-to-disk/check.sh
new file mode 100644
index 000000000000..91109596a451
--- /dev/null
+++ b/tests/run-make/dump-ice-to-disk/check.sh
@@ -0,0 +1,58 @@
+#!/bin/sh
+
+# Default nightly behavior (write ICE to current directory)
+# FIXME(estebank): these are failing on CI, but passing locally.
+# $RUSTC src/lib.rs -Z treat-err-as-bug=1 1>$TMPDIR/rust-test-default.log 2>&1
+# default=$(cat ./rustc-ice-*.txt | wc -l)
+# rm ./rustc-ice-*.txt
+
+# Explicit directory set
+export RUSTC_ICE=$TMPDIR
+$RUSTC src/lib.rs -Z treat-err-as-bug=1 1>$TMPDIR/rust-test-default-set.log 2>&1
+default_set=$(cat $TMPDIR/rustc-ice-*.txt | wc -l)
+content=$(cat $TMPDIR/rustc-ice-*.txt)
+rm $TMPDIR/rustc-ice-*.txt
+RUST_BACKTRACE=short $RUSTC src/lib.rs -Z treat-err-as-bug=1 1>$TMPDIR/rust-test-short.log 2>&1
+short=$(cat $TMPDIR/rustc-ice-*.txt | wc -l)
+rm $TMPDIR/rustc-ice-*.txt
+RUST_BACKTRACE=full $RUSTC src/lib.rs -Z treat-err-as-bug=1 1>$TMPDIR/rust-test-full.log 2>&1
+full=$(cat $TMPDIR/rustc-ice-*.txt | wc -l)
+rm $TMPDIR/rustc-ice-*.txt
+
+# Explicitly disabling ICE dump
+export RUSTC_ICE=0
+$RUSTC src/lib.rs -Z treat-err-as-bug=1 1>$TMPDIR/rust-test-disabled.log 2>&1
+should_be_empty_tmp=$(ls -l $TMPDIR/rustc-ice-*.txt | wc -l)
+should_be_empty_dot=$(ls -l ./rustc-ice-*.txt | wc -l)
+
+echo "#### ICE Dump content:"
+echo $content
+echo "#### default length:"
+echo $default
+echo "#### short length:"
+echo $short
+echo "#### default_set length:"
+echo $default_set
+echo "#### full length:"
+echo $full
+echo "#### should_be_empty_dot length:"
+echo $should_be_empty_dot
+echo "#### should_be_empty_tmp length:"
+echo $should_be_empty_tmp
+
+## Verify that a the ICE dump file is created in the appropriate directories, that
+## their lengths are the same regardless of other backtrace configuration options,
+## that the file is not created when asked to (RUSTC_ICE=0) and that the file
+## contains at least part of the expected content.
+if [ $short -eq $default_set ] &&
+ #[ $default -eq $short ] &&
+ [ $default_set -eq $full ] &&
+ [[ $content == *"thread 'rustc' panicked at "* ]] &&
+ [[ $content == *"stack backtrace:"* ]] &&
+ #[ $default -gt 0 ] &&
+ [ $should_be_empty_dot -eq 0 ] &&
+ [ $should_be_empty_tmp -eq 0 ]; then
+ exit 0
+else
+ exit 1
+fi
diff --git a/tests/run-make/dump-ice-to-disk/src/lib.rs b/tests/run-make/dump-ice-to-disk/src/lib.rs
new file mode 100644
index 000000000000..b23b7f830d73
--- /dev/null
+++ b/tests/run-make/dump-ice-to-disk/src/lib.rs
@@ -0,0 +1,7 @@
+fn func(s: &str) {
+ println!("{}", s);
+}
+
+fn main() {
+ func(1);
+}
diff --git a/tests/run-make/exit-code/Makefile b/tests/run-make/exit-code/Makefile
index 6458b71688ff..155e5cd11234 100644
--- a/tests/run-make/exit-code/Makefile
+++ b/tests/run-make/exit-code/Makefile
@@ -5,7 +5,7 @@ all:
$(RUSTC) success.rs; [ $$? -eq 0 ]
$(RUSTC) --invalid-arg-foo; [ $$? -eq 1 ]
$(RUSTC) compile-error.rs; [ $$? -eq 1 ]
- $(RUSTC) -Ztreat-err-as-bug compile-error.rs; [ $$? -eq 101 ]
+ RUSTC_ICE=0 $(RUSTC) -Ztreat-err-as-bug compile-error.rs; [ $$? -eq 101 ]
$(RUSTDOC) -o $(TMPDIR)/exit-code success.rs; [ $$? -eq 0 ]
$(RUSTDOC) --invalid-arg-foo; [ $$? -eq 1 ]
$(RUSTDOC) compile-error.rs; [ $$? -eq 1 ]
diff --git a/tests/run-make/no-builtins-attribute/Makefile b/tests/run-make/no-builtins-attribute/Makefile
new file mode 100644
index 000000000000..0ce95facaea4
--- /dev/null
+++ b/tests/run-make/no-builtins-attribute/Makefile
@@ -0,0 +1,9 @@
+include ../tools.mk
+
+# We want to check if `no-builtins` is also added to the function declarations in the used crate.
+
+all:
+ $(RUSTC) no_builtins.rs --emit=link
+ $(RUSTC) main.rs --emit=llvm-ir
+
+ cat "$(TMPDIR)"/main.ll | "$(LLVM_FILECHECK)" filecheck.main.txt
diff --git a/tests/run-make/no-builtins-attribute/filecheck.main.txt b/tests/run-make/no-builtins-attribute/filecheck.main.txt
new file mode 100644
index 000000000000..ecd650bdca80
--- /dev/null
+++ b/tests/run-make/no-builtins-attribute/filecheck.main.txt
@@ -0,0 +1,5 @@
+CHECK: declare void @foo()
+CHECK-SAME: #[[ATTR_3:[0-9]+]]
+
+CHECK: attributes #[[ATTR_3]]
+CHECK-SAME: no-builtins
diff --git a/tests/run-make/no-builtins-attribute/main.rs b/tests/run-make/no-builtins-attribute/main.rs
new file mode 100644
index 000000000000..77754b37e318
--- /dev/null
+++ b/tests/run-make/no-builtins-attribute/main.rs
@@ -0,0 +1,10 @@
+extern crate no_builtins;
+
+#[no_mangle]
+fn call_foo() {
+ no_builtins::foo();
+}
+
+fn main() {
+ call_foo();
+}
diff --git a/tests/run-make/no-builtins-attribute/no_builtins.rs b/tests/run-make/no-builtins-attribute/no_builtins.rs
new file mode 100644
index 000000000000..8ca862d2f777
--- /dev/null
+++ b/tests/run-make/no-builtins-attribute/no_builtins.rs
@@ -0,0 +1,5 @@
+#![crate_type = "lib"]
+#![no_builtins]
+
+#[no_mangle]
+pub fn foo() {}
diff --git a/tests/run-make/short-ice/check.sh b/tests/run-make/short-ice/check.sh
index a13b7eeca8f3..56babd2142f8 100644
--- a/tests/run-make/short-ice/check.sh
+++ b/tests/run-make/short-ice/check.sh
@@ -1,5 +1,5 @@
#!/bin/sh
-
+export RUSTC_ICE=0
RUST_BACKTRACE=1 $RUSTC src/lib.rs -Z treat-err-as-bug=1 1>$TMPDIR/rust-test-1.log 2>&1
RUST_BACKTRACE=full $RUSTC src/lib.rs -Z treat-err-as-bug=1 1>$TMPDIR/rust-test-2.log 2>&1
diff --git a/tests/rustdoc-gui/search-reexport.goml b/tests/rustdoc-gui/search-reexport.goml
index 6ea6d53e2875..b9d2c8f15cee 100644
--- a/tests/rustdoc-gui/search-reexport.goml
+++ b/tests/rustdoc-gui/search-reexport.goml
@@ -26,7 +26,7 @@ write: (".search-input", "AliasForTheStdReexport")
wait-for: "//a[@class='result-import']"
assert-text: (
"a.result-import .result-name",
- "AliasForTheStdReexport - see re-export test_docs::TheStdReexport",
+ "re-export AliasForTheStdReexport - see test_docs::TheStdReexport",
)
// Same thing again, we click on it to ensure the background is once again set as expected.
click: "//a[@class='result-import']"
diff --git a/tests/rustdoc-gui/search-result-color.goml b/tests/rustdoc-gui/search-result-color.goml
index 7a7785fd9ac3..f9f81c5ba04e 100644
--- a/tests/rustdoc-gui/search-result-color.goml
+++ b/tests/rustdoc-gui/search-result-color.goml
@@ -368,8 +368,8 @@ define-function: (
// Waiting for the search results to appear...
wait-for: "#search-tabs"
// Checking that the colors for the alias element are the ones expected.
- assert-css: (".result-name > .alias", {"color": |alias|})
- assert-css: (".result-name > .alias > .grey", {"color": |grey|})
+ assert-css: (".result-name .path .alias", {"color": |alias|})
+ assert-css: (".result-name .path .alias > .grey", {"color": |grey|})
// Leave the search results to prevent reloading with an already filled search input.
press-key: "Escape"
},
diff --git a/tests/rustdoc-ui/ice-bug-report-url.rs b/tests/rustdoc-ui/ice-bug-report-url.rs
index 8ede91cf8f4f..7689d78d31f3 100644
--- a/tests/rustdoc-ui/ice-bug-report-url.rs
+++ b/tests/rustdoc-ui/ice-bug-report-url.rs
@@ -1,4 +1,5 @@
// compile-flags: -Ztreat-err-as-bug
+// rustc-env:RUSTC_ICE=0
// failure-status: 101
// error-pattern: aborting due to
// error-pattern: we would appreciate a bug report: https://github.com/rust-lang/rust/issues/new?labels=C-bug%2C+I-ICE%2C+T-rustdoc&template=ice.md
diff --git a/tests/rustdoc-ui/ice-bug-report-url.stderr b/tests/rustdoc-ui/ice-bug-report-url.stderr
index 98c08b9a8944..7d9f05f8f4ed 100644
--- a/tests/rustdoc-ui/ice-bug-report-url.stderr
+++ b/tests/rustdoc-ui/ice-bug-report-url.stderr
@@ -1,5 +1,5 @@
error: expected one of `->`, `where`, or `{`, found ``
- --> $DIR/ice-bug-report-url.rs:13:10
+ --> $DIR/ice-bug-report-url.rs:14:10
|
LL | fn wrong()
| ^ expected one of `->`, `where`, or `{`
diff --git a/tests/rustdoc-ui/issue-110629-private-type-cycle-dyn.stderr b/tests/rustdoc-ui/issue-110629-private-type-cycle-dyn.stderr
index 79e1b753112b..9aeb3389e2d3 100644
--- a/tests/rustdoc-ui/issue-110629-private-type-cycle-dyn.stderr
+++ b/tests/rustdoc-ui/issue-110629-private-type-cycle-dyn.stderr
@@ -19,6 +19,7 @@ LL | | fn bar<'a, 'b>(i: &'a i32) -> Bar<'a, 'b> {
LL | | assert!(bar(&meh) == bar(&muh));
LL | | }
| |_^
+ = note: see https://rustc-dev-guide.rust-lang.org/overview.html#queries and https://rustc-dev-guide.rust-lang.org/query.html for more information
error: aborting due to previous error
diff --git a/tests/rustdoc/display-hidden-items.rs b/tests/rustdoc/display-hidden-items.rs
new file mode 100644
index 000000000000..d97d5b4a9688
--- /dev/null
+++ b/tests/rustdoc/display-hidden-items.rs
@@ -0,0 +1,71 @@
+// Test to ensure that the `--document-hidden-items` option is working as expected.
+// compile-flags: -Z unstable-options --document-hidden-items
+// ignore-tidy-linelength
+
+#![crate_name = "foo"]
+
+// @has 'foo/index.html'
+// @has - '//*[@id="reexport.hidden_reexport"]/code' 'pub use hidden::inside_hidden as hidden_reexport;'
+#[doc(hidden)]
+pub use hidden::inside_hidden as hidden_reexport;
+
+// @has - '//*[@class="item-name"]/a[@class="trait"]' 'TraitHidden'
+// @has 'foo/trait.TraitHidden.html'
+#[doc(hidden)]
+pub trait TraitHidden {}
+
+// @has 'foo/index.html' '//*[@class="item-name"]/a[@class="trait"]' 'Trait'
+pub trait Trait {
+ // @has 'foo/trait.Trait.html'
+ // @has - '//*[@id="associatedconstant.BAR"]/*[@class="code-header"]' 'const BAR: u32 = 0u32'
+ #[doc(hidden)]
+ const BAR: u32 = 0;
+
+ // @has - '//*[@id="method.foo"]/*[@class="code-header"]' 'fn foo()'
+ #[doc(hidden)]
+ fn foo() {}
+}
+
+// @has 'foo/index.html' '//*[@class="item-name"]/a[@class="struct"]' 'Struct'
+// @has 'foo/struct.Struct.html'
+pub struct Struct {
+ // @has - '//*[@id="structfield.a"]/code' 'a: u32'
+ #[doc(hidden)]
+ pub a: u32,
+}
+
+impl Struct {
+ // @has - '//*[@id="method.new"]/*[@class="code-header"]' 'pub fn new() -> Self'
+ #[doc(hidden)]
+ pub fn new() -> Self { Self { a: 0 } }
+}
+
+impl Trait for Struct {
+ // @has - '//*[@id="associatedconstant.BAR"]/*[@class="code-header"]' 'const BAR: u32 = 0u32'
+ // @has - '//*[@id="method.foo"]/*[@class="code-header"]' 'fn foo()'
+}
+// @has - '//*[@id="impl-TraitHidden-for-Struct"]/*[@class="code-header"]' 'impl TraitHidden for Struct'
+impl TraitHidden for Struct {}
+
+// @has 'foo/index.html' '//*[@class="item-name"]/a[@class="enum"]' 'HiddenEnum'
+// @has 'foo/enum.HiddenEnum.html'
+#[doc(hidden)]
+pub enum HiddenEnum {
+ A,
+}
+
+// @has 'foo/index.html' '//*[@class="item-name"]/a[@class="enum"]' 'Enum'
+pub enum Enum {
+ // @has 'foo/enum.Enum.html' '//*[@id="variant.A"]/*[@class="code-header"]' 'A'
+ #[doc(hidden)]
+ A,
+}
+
+// @has 'foo/index.html' '//*[@class="item-name"]/a[@class="mod"]' 'hidden'
+#[doc(hidden)]
+pub mod hidden {
+ // @has 'foo/hidden/index.html'
+ // @has - '//*[@class="item-name"]/a[@class="fn"]' 'inside_hidden'
+ // @has 'foo/hidden/fn.inside_hidden.html'
+ pub fn inside_hidden() {}
+}
diff --git a/tests/rustdoc/issue-105735-overlapping-reexport-2.rs b/tests/rustdoc/issue-105735-overlapping-reexport-2.rs
new file mode 100644
index 000000000000..910824839489
--- /dev/null
+++ b/tests/rustdoc/issue-105735-overlapping-reexport-2.rs
@@ -0,0 +1,25 @@
+// Regression test to ensure that both `AtomicU8` items are displayed but not the re-export.
+
+#![crate_name = "foo"]
+#![no_std]
+
+// @has 'foo/index.html'
+// @has - '//*[@class="item-name"]/a[@class="type"]' 'AtomicU8'
+// @has - '//*[@class="item-name"]/a[@class="constant"]' 'AtomicU8'
+// We also ensure we don't have another item displayed.
+// @count - '//*[@id="main-content"]/*[@class="small-section-header"]' 2
+// @has - '//*[@id="main-content"]/*[@class="small-section-header"]' 'Type Definitions'
+// @has - '//*[@id="main-content"]/*[@class="small-section-header"]' 'Constants'
+
+mod other {
+ pub type AtomicU8 = ();
+}
+
+mod thing {
+ pub use crate::other::AtomicU8;
+
+ #[allow(non_upper_case_globals)]
+ pub const AtomicU8: () = ();
+}
+
+pub use crate::thing::AtomicU8;
diff --git a/tests/rustdoc/issue-105735-overlapping-reexport.rs b/tests/rustdoc/issue-105735-overlapping-reexport.rs
new file mode 100644
index 000000000000..50f2450b90a0
--- /dev/null
+++ b/tests/rustdoc/issue-105735-overlapping-reexport.rs
@@ -0,0 +1,21 @@
+// Regression test to ensure that both `AtomicU8` items are displayed but not the re-export.
+
+#![crate_name = "foo"]
+#![no_std]
+
+// @has 'foo/index.html'
+// @has - '//*[@class="item-name"]/a[@class="struct"]' 'AtomicU8'
+// @has - '//*[@class="item-name"]/a[@class="constant"]' 'AtomicU8'
+// We also ensure we don't have another item displayed.
+// @count - '//*[@id="main-content"]/*[@class="small-section-header"]' 2
+// @has - '//*[@id="main-content"]/*[@class="small-section-header"]' 'Structs'
+// @has - '//*[@id="main-content"]/*[@class="small-section-header"]' 'Constants'
+
+mod thing {
+ pub use core::sync::atomic::AtomicU8;
+
+ #[allow(non_upper_case_globals)]
+ pub const AtomicU8: () = ();
+}
+
+pub use crate::thing::AtomicU8;
diff --git a/tests/ui/associated-consts/defaults-cyclic-fail.stderr b/tests/ui/associated-consts/defaults-cyclic-fail.stderr
index a1483911b297..ebdb76e4286a 100644
--- a/tests/ui/associated-consts/defaults-cyclic-fail.stderr
+++ b/tests/ui/associated-consts/defaults-cyclic-fail.stderr
@@ -15,6 +15,7 @@ note: cycle used when const-evaluating + checking `main::promoted[1]`
|
LL | assert_eq!(<() as Tr>::A, 0);
| ^^^^^^^^^^^^^
+ = note: see https://rustc-dev-guide.rust-lang.org/overview.html#queries and https://rustc-dev-guide.rust-lang.org/query.html for more information
error: aborting due to previous error
diff --git a/tests/ui/associated-consts/issue-24949-assoc-const-static-recursion-impl.stderr b/tests/ui/associated-consts/issue-24949-assoc-const-static-recursion-impl.stderr
index be5781761517..51bf0cb5e5ce 100644
--- a/tests/ui/associated-consts/issue-24949-assoc-const-static-recursion-impl.stderr
+++ b/tests/ui/associated-consts/issue-24949-assoc-const-static-recursion-impl.stderr
@@ -26,6 +26,7 @@ LL | const BAR: u32 = IMPL_REF_BAR;
| ^^^^^^^^^^^^^^
= note: ...which again requires elaborating drops for `::BAR`, completing the cycle
= note: cycle used when running analysis passes on this crate
+ = note: see https://rustc-dev-guide.rust-lang.org/overview.html#queries and https://rustc-dev-guide.rust-lang.org/query.html for more information
error: aborting due to previous error
diff --git a/tests/ui/associated-consts/issue-24949-assoc-const-static-recursion-trait-default.stderr b/tests/ui/associated-consts/issue-24949-assoc-const-static-recursion-trait-default.stderr
index 8347b260b562..8277d41a1c94 100644
--- a/tests/ui/associated-consts/issue-24949-assoc-const-static-recursion-trait-default.stderr
+++ b/tests/ui/associated-consts/issue-24949-assoc-const-static-recursion-trait-default.stderr
@@ -26,6 +26,7 @@ LL | const BAR: u32 = DEFAULT_REF_BAR;
| ^^^^^^^^^^^^^^
= note: ...which again requires elaborating drops for `FooDefault::BAR`, completing the cycle
= note: cycle used when running analysis passes on this crate
+ = note: see https://rustc-dev-guide.rust-lang.org/overview.html#queries and https://rustc-dev-guide.rust-lang.org/query.html for more information
error: aborting due to previous error
diff --git a/tests/ui/associated-consts/issue-24949-assoc-const-static-recursion-trait.stderr b/tests/ui/associated-consts/issue-24949-assoc-const-static-recursion-trait.stderr
index 3955a3120c47..9983ba794cd2 100644
--- a/tests/ui/associated-consts/issue-24949-assoc-const-static-recursion-trait.stderr
+++ b/tests/ui/associated-consts/issue-24949-assoc-const-static-recursion-trait.stderr
@@ -26,6 +26,7 @@ LL | const BAR: u32 = TRAIT_REF_BAR;
| ^^^^^^^^^^^^^^
= note: ...which again requires elaborating drops for `::BAR`, completing the cycle
= note: cycle used when running analysis passes on this crate
+ = note: see https://rustc-dev-guide.rust-lang.org/overview.html#queries and https://rustc-dev-guide.rust-lang.org/query.html for more information
error: aborting due to previous error
diff --git a/tests/ui/associated-inherent-types/bugs/cycle-iat-inside-of-adt.stderr b/tests/ui/associated-inherent-types/bugs/cycle-iat-inside-of-adt.stderr
index 23269e1afab5..3c373f139cbe 100644
--- a/tests/ui/associated-inherent-types/bugs/cycle-iat-inside-of-adt.stderr
+++ b/tests/ui/associated-inherent-types/bugs/cycle-iat-inside-of-adt.stderr
@@ -37,6 +37,7 @@ LL | |
LL | |
LL | | fn main() {}
| |____________^
+ = note: see https://rustc-dev-guide.rust-lang.org/overview.html#queries and https://rustc-dev-guide.rust-lang.org/query.html for more information
error: aborting due to previous error
diff --git a/tests/ui/associated-inherent-types/bugs/cycle-iat-inside-of-where-predicate.stderr b/tests/ui/associated-inherent-types/bugs/cycle-iat-inside-of-where-predicate.stderr
index aaa9a39ea0f4..ab6a97b3d858 100644
--- a/tests/ui/associated-inherent-types/bugs/cycle-iat-inside-of-where-predicate.stderr
+++ b/tests/ui/associated-inherent-types/bugs/cycle-iat-inside-of-where-predicate.stderr
@@ -31,6 +31,7 @@ LL | | // FIXME(inherent_associated_types): This shouldn't lead to a cycle error
LL | |
LL | | fn main() {}
| |____________^
+ = note: see https://rustc-dev-guide.rust-lang.org/overview.html#queries and https://rustc-dev-guide.rust-lang.org/query.html for more information
error: aborting due to previous error
diff --git a/tests/ui/associated-type-bounds/ambiguous-associated-type2.rs b/tests/ui/associated-type-bounds/ambiguous-associated-type2.rs
index 48de593342fa..e9cd57f17397 100644
--- a/tests/ui/associated-type-bounds/ambiguous-associated-type2.rs
+++ b/tests/ui/associated-type-bounds/ambiguous-associated-type2.rs
@@ -7,4 +7,6 @@ trait Bar {
trait Baz: Foo + Bar {}
//~^ ERROR cycle detected when computing the super traits of `Baz` with associated type name `Item` [E0391]
+
+
fn main() {}
diff --git a/tests/ui/associated-type-bounds/ambiguous-associated-type2.stderr b/tests/ui/associated-type-bounds/ambiguous-associated-type2.stderr
index 575b00e09b02..f2604f0ba881 100644
--- a/tests/ui/associated-type-bounds/ambiguous-associated-type2.stderr
+++ b/tests/ui/associated-type-bounds/ambiguous-associated-type2.stderr
@@ -10,6 +10,7 @@ note: cycle used when computing the super predicates of `Baz`
|
LL | trait Baz: Foo + Bar {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ = note: see https://rustc-dev-guide.rust-lang.org/overview.html#queries and https://rustc-dev-guide.rust-lang.org/query.html for more information
error: aborting due to previous error
diff --git a/tests/ui/associated-types/issue-20825.stderr b/tests/ui/associated-types/issue-20825.stderr
index c4dea68b884a..02b3536e2d15 100644
--- a/tests/ui/associated-types/issue-20825.stderr
+++ b/tests/ui/associated-types/issue-20825.stderr
@@ -10,6 +10,7 @@ note: cycle used when computing the super predicates of `Processor`
|
LL | pub trait Processor: Subscriber {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ = note: see https://rustc-dev-guide.rust-lang.org/overview.html#queries and https://rustc-dev-guide.rust-lang.org/query.html for more information
error: aborting due to previous error
diff --git a/tests/ui/check-cfg/compact-values.stderr b/tests/ui/check-cfg/compact-values.stderr
index 70a967c0e5f6..5f8dbbdb05ce 100644
--- a/tests/ui/check-cfg/compact-values.stderr
+++ b/tests/ui/check-cfg/compact-values.stderr
@@ -4,7 +4,7 @@ warning: unexpected `cfg` condition value
LL | #[cfg(target(os = "linux", arch = "X"))]
| ^^^^^^^^^^
|
- = note: expected values for `target_arch` are: `aarch64`, `arm`, `avr`, `bpf`, `hexagon`, `loongarch64`, `m68k`, `mips`, `mips64`, `msp430`, `nvptx64`, `powerpc`, `powerpc64`, `riscv32`, `riscv64`, `s390x`, `sparc`, `sparc64`, `wasm32`, `wasm64`, `x86`, `x86_64`
+ = note: expected values for `target_arch` are: `aarch64`, `arm`, `avr`, `bpf`, `hexagon`, `loongarch64`, `m68k`, `mips`, `mips32r6`, `mips64`, `mips64r6`, `msp430`, `nvptx64`, `powerpc`, `powerpc64`, `riscv32`, `riscv64`, `s390x`, `sparc`, `sparc64`, `wasm32`, `wasm64`, `x86`, `x86_64`
= note: `#[warn(unexpected_cfgs)]` on by default
warning: 1 warning emitted
diff --git a/tests/ui/coherence/coherence-inherited-assoc-ty-cycle-err.stderr b/tests/ui/coherence/coherence-inherited-assoc-ty-cycle-err.stderr
index 7bd50649d6d0..684e528220f8 100644
--- a/tests/ui/coherence/coherence-inherited-assoc-ty-cycle-err.stderr
+++ b/tests/ui/coherence/coherence-inherited-assoc-ty-cycle-err.stderr
@@ -20,6 +20,7 @@ note: cycle used when coherence checking all impls of trait `Trait`
|
LL | trait Trait { type Assoc; }
| ^^^^^^^^^^^^^^
+ = note: see https://rustc-dev-guide.rust-lang.org/overview.html#queries and https://rustc-dev-guide.rust-lang.org/query.html for more information
error: aborting due to previous error; 1 warning emitted
diff --git a/tests/ui/const-generics/generic_const_exprs/closures.stderr b/tests/ui/const-generics/generic_const_exprs/closures.stderr
index a7d891d77908..45d7922bd0b8 100644
--- a/tests/ui/const-generics/generic_const_exprs/closures.stderr
+++ b/tests/ui/const-generics/generic_const_exprs/closures.stderr
@@ -20,6 +20,7 @@ note: cycle used when checking that `test` is well-formed
|
LL | fn test() -> [u8; N + (|| 42)()] {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ = note: see https://rustc-dev-guide.rust-lang.org/overview.html#queries and https://rustc-dev-guide.rust-lang.org/query.html for more information
error: aborting due to previous error
diff --git a/tests/ui/const-generics/issues/issue-83765.stderr b/tests/ui/const-generics/issues/issue-83765.stderr
index d7b2b006c2ae..df734933c250 100644
--- a/tests/ui/const-generics/issues/issue-83765.stderr
+++ b/tests/ui/const-generics/issues/issue-83765.stderr
@@ -15,6 +15,7 @@ note: cycle used when computing candidate for `;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ = note: see https://rustc-dev-guide.rust-lang.org/overview.html#queries and https://rustc-dev-guide.rust-lang.org/query.html for more information
error[E0391]: cycle detected when computing type of `S`
--> $DIR/issue-103790.rs:4:1
@@ -58,6 +59,7 @@ LL | | struct S;
LL | |
LL | | fn main() {}
| |____________^
+ = note: see https://rustc-dev-guide.rust-lang.org/overview.html#queries and https://rustc-dev-guide.rust-lang.org/query.html for more information
error: aborting due to 4 previous errors
diff --git a/tests/ui/consts/issue-36163.stderr b/tests/ui/consts/issue-36163.stderr
index 7137c053847c..190b41062f81 100644
--- a/tests/ui/consts/issue-36163.stderr
+++ b/tests/ui/consts/issue-36163.stderr
@@ -15,6 +15,7 @@ note: cycle used when simplifying constant for the type system `Foo::B::{constan
|
LL | B = A,
| ^
+ = note: see https://rustc-dev-guide.rust-lang.org/overview.html#queries and https://rustc-dev-guide.rust-lang.org/query.html for more information
error: aborting due to previous error
diff --git a/tests/ui/consts/issue-44415.stderr b/tests/ui/consts/issue-44415.stderr
index ec64b956dfe2..01d24a620814 100644
--- a/tests/ui/consts/issue-44415.stderr
+++ b/tests/ui/consts/issue-44415.stderr
@@ -23,6 +23,7 @@ note: cycle used when checking that `Foo` is well-formed
|
LL | struct Foo {
| ^^^^^^^^^^
+ = note: see https://rustc-dev-guide.rust-lang.org/overview.html#queries and https://rustc-dev-guide.rust-lang.org/query.html for more information
error: aborting due to previous error
diff --git a/tests/ui/consts/recursive-zst-static.default.stderr b/tests/ui/consts/recursive-zst-static.default.stderr
index d68960b09721..d592b5aeef5e 100644
--- a/tests/ui/consts/recursive-zst-static.default.stderr
+++ b/tests/ui/consts/recursive-zst-static.default.stderr
@@ -19,6 +19,7 @@ LL | | fn main() {
LL | | FOO
LL | | }
| |_^
+ = note: see https://rustc-dev-guide.rust-lang.org/overview.html#queries and https://rustc-dev-guide.rust-lang.org/query.html for more information
error: aborting due to previous error
diff --git a/tests/ui/consts/recursive-zst-static.unleash.stderr b/tests/ui/consts/recursive-zst-static.unleash.stderr
index d68960b09721..d592b5aeef5e 100644
--- a/tests/ui/consts/recursive-zst-static.unleash.stderr
+++ b/tests/ui/consts/recursive-zst-static.unleash.stderr
@@ -19,6 +19,7 @@ LL | | fn main() {
LL | | FOO
LL | | }
| |_^
+ = note: see https://rustc-dev-guide.rust-lang.org/overview.html#queries and https://rustc-dev-guide.rust-lang.org/query.html for more information
error: aborting due to previous error
diff --git a/tests/ui/consts/write-to-static-mut-in-static.stderr b/tests/ui/consts/write-to-static-mut-in-static.stderr
index 395b2d42f97a..5665e56439e0 100644
--- a/tests/ui/consts/write-to-static-mut-in-static.stderr
+++ b/tests/ui/consts/write-to-static-mut-in-static.stderr
@@ -27,6 +27,7 @@ LL | |
LL | |
LL | | fn main() {}
| |____________^
+ = note: see https://rustc-dev-guide.rust-lang.org/overview.html#queries and https://rustc-dev-guide.rust-lang.org/query.html for more information
error: aborting due to 2 previous errors
diff --git a/tests/ui/cycle-trait/cycle-trait-default-type-trait.stderr b/tests/ui/cycle-trait/cycle-trait-default-type-trait.stderr
index 9d715f494714..3b66704d6131 100644
--- a/tests/ui/cycle-trait/cycle-trait-default-type-trait.stderr
+++ b/tests/ui/cycle-trait/cycle-trait-default-type-trait.stderr
@@ -14,6 +14,7 @@ LL | | }
LL | |
LL | | fn main() { }
| |_____________^
+ = note: see https://rustc-dev-guide.rust-lang.org/overview.html#queries and https://rustc-dev-guide.rust-lang.org/query.html for more information
error: aborting due to previous error
diff --git a/tests/ui/cycle-trait/cycle-trait-supertrait-direct.stderr b/tests/ui/cycle-trait/cycle-trait-supertrait-direct.stderr
index e2b2aac05ac9..03cb5015ab0b 100644
--- a/tests/ui/cycle-trait/cycle-trait-supertrait-direct.stderr
+++ b/tests/ui/cycle-trait/cycle-trait-supertrait-direct.stderr
@@ -12,6 +12,7 @@ LL | / trait Chromosome: Chromosome {
LL | |
LL | | }
| |_^
+ = note: see https://rustc-dev-guide.rust-lang.org/overview.html#queries and https://rustc-dev-guide.rust-lang.org/query.html for more information
error: aborting due to previous error
diff --git a/tests/ui/cycle-trait/cycle-trait-supertrait-indirect.stderr b/tests/ui/cycle-trait/cycle-trait-supertrait-indirect.stderr
index c903e1146576..c7cc31435204 100644
--- a/tests/ui/cycle-trait/cycle-trait-supertrait-indirect.stderr
+++ b/tests/ui/cycle-trait/cycle-trait-supertrait-indirect.stderr
@@ -15,6 +15,7 @@ note: cycle used when computing the super predicates of `A`
|
LL | trait A: B {
| ^
+ = note: see https://rustc-dev-guide.rust-lang.org/overview.html#queries and https://rustc-dev-guide.rust-lang.org/query.html for more information
error: aborting due to previous error
diff --git a/tests/ui/cycle-trait/issue-12511.stderr b/tests/ui/cycle-trait/issue-12511.stderr
index 558aad10946e..f5e4f83473df 100644
--- a/tests/ui/cycle-trait/issue-12511.stderr
+++ b/tests/ui/cycle-trait/issue-12511.stderr
@@ -17,6 +17,7 @@ LL | / trait T1 : T2 {
LL | |
LL | | }
| |_^
+ = note: see https://rustc-dev-guide.rust-lang.org/overview.html#queries and https://rustc-dev-guide.rust-lang.org/query.html for more information
error: aborting due to previous error
diff --git a/tests/ui/dyn-star/param-env-region-infer.next.stderr b/tests/ui/dyn-star/param-env-region-infer.next.stderr
index dd724a659082..28aec533a006 100644
--- a/tests/ui/dyn-star/param-env-region-infer.next.stderr
+++ b/tests/ui/dyn-star/param-env-region-infer.next.stderr
@@ -23,6 +23,7 @@ LL | | use std::fmt::Debug;
LL | |
LL | | fn main() {}
| |____________^
+ = note: see https://rustc-dev-guide.rust-lang.org/overview.html#queries and https://rustc-dev-guide.rust-lang.org/query.html for more information
error: aborting due to previous error
diff --git a/tests/ui/fmt/closing-brace-as-fill.rs b/tests/ui/fmt/closing-brace-as-fill.rs
new file mode 100644
index 000000000000..6ad257f943e9
--- /dev/null
+++ b/tests/ui/fmt/closing-brace-as-fill.rs
@@ -0,0 +1,8 @@
+// issue: 112732
+
+// `}` is typoed since it is interpreted as a fill character rather than a closing bracket
+
+fn main() {
+ println!("Hello, world! {0:}<3", 2);
+ //~^ ERROR invalid format string: expected `'}'` but string was terminated
+}
diff --git a/tests/ui/fmt/closing-brace-as-fill.stderr b/tests/ui/fmt/closing-brace-as-fill.stderr
new file mode 100644
index 000000000000..aa1e5aff6525
--- /dev/null
+++ b/tests/ui/fmt/closing-brace-as-fill.stderr
@@ -0,0 +1,12 @@
+error: invalid format string: expected `'}'` but string was terminated
+ --> $DIR/closing-brace-as-fill.rs:6:35
+ |
+LL | println!("Hello, world! {0:}<3", 2);
+ | - ^ expected `'}'` in format string
+ | |
+ | this is not interpreted as a formatting closing brace
+ |
+ = note: the character `'}'` is interpreted as a fill character because of the `:` that precedes it
+
+error: aborting due to previous error
+
diff --git a/tests/ui/fmt/format-string-error-2.stderr b/tests/ui/fmt/format-string-error-2.stderr
index 76cdfbb93bf2..dfd24bf60ad5 100644
--- a/tests/ui/fmt/format-string-error-2.stderr
+++ b/tests/ui/fmt/format-string-error-2.stderr
@@ -10,7 +10,7 @@ error: invalid format string: expected `'}'`, found `'a'`
LL | format!("{
| - because of this opening brace
LL | a");
- | ^ expected `}` in format string
+ | ^ expected `'}'` in format string
|
= note: if you intended to print `{`, you can escape it using `{{`
@@ -21,7 +21,7 @@ LL | format!("{ \
| - because of this opening brace
LL | \
LL | b");
- | ^ expected `}` in format string
+ | ^ expected `'}'` in format string
|
= note: if you intended to print `{`, you can escape it using `{{`
@@ -29,7 +29,7 @@ error: invalid format string: expected `'}'`, found `'\'`
--> $DIR/format-string-error-2.rs:11:18
|
LL | format!(r#"{ \
- | - ^ expected `}` in format string
+ | - ^ expected `'}'` in format string
| |
| because of this opening brace
|
@@ -39,7 +39,7 @@ error: invalid format string: expected `'}'`, found `'\'`
--> $DIR/format-string-error-2.rs:15:18
|
LL | format!(r#"{ \n
- | - ^ expected `}` in format string
+ | - ^ expected `'}'` in format string
| |
| because of this opening brace
|
@@ -52,7 +52,7 @@ LL | format!("{ \n
| - because of this opening brace
LL | \n
LL | e");
- | ^ expected `}` in format string
+ | ^ expected `'}'` in format string
|
= note: if you intended to print `{`, you can escape it using `{{`
@@ -62,7 +62,7 @@ error: invalid format string: expected `'}'`, found `'a'`
LL | {
| - because of this opening brace
LL | a");
- | ^ expected `}` in format string
+ | ^ expected `'}'` in format string
|
= note: if you intended to print `{`, you can escape it using `{{`
@@ -72,7 +72,7 @@ error: invalid format string: expected `'}'`, found `'a'`
LL | {
| - because of this opening brace
LL | a
- | ^ expected `}` in format string
+ | ^ expected `'}'` in format string
|
= note: if you intended to print `{`, you can escape it using `{{`
@@ -83,7 +83,7 @@ LL | { \
| - because of this opening brace
LL | \
LL | b");
- | ^ expected `}` in format string
+ | ^ expected `'}'` in format string
|
= note: if you intended to print `{`, you can escape it using `{{`
@@ -94,7 +94,7 @@ LL | { \
| - because of this opening brace
LL | \
LL | b \
- | ^ expected `}` in format string
+ | ^ expected `'}'` in format string
|
= note: if you intended to print `{`, you can escape it using `{{`
@@ -102,7 +102,7 @@ error: invalid format string: expected `'}'`, found `'\'`
--> $DIR/format-string-error-2.rs:45:8
|
LL | raw { \
- | - ^ expected `}` in format string
+ | - ^ expected `'}'` in format string
| |
| because of this opening brace
|
@@ -112,7 +112,7 @@ error: invalid format string: expected `'}'`, found `'\'`
--> $DIR/format-string-error-2.rs:50:8
|
LL | raw { \n
- | - ^ expected `}` in format string
+ | - ^ expected `'}'` in format string
| |
| because of this opening brace
|
@@ -125,7 +125,7 @@ LL | { \n
| - because of this opening brace
LL | \n
LL | e");
- | ^ expected `}` in format string
+ | ^ expected `'}'` in format string
|
= note: if you intended to print `{`, you can escape it using `{{`
@@ -135,7 +135,7 @@ error: invalid format string: expected `'}'`, found `'a'`
LL | {
| - because of this opening brace
LL | asdf}
- | ^ expected `}` in format string
+ | ^ expected `'}'` in format string
|
= note: if you intended to print `{`, you can escape it using `{{`
diff --git a/tests/ui/fmt/format-string-error.stderr b/tests/ui/fmt/format-string-error.stderr
index 8a32c225485f..37a181e6fcb2 100644
--- a/tests/ui/fmt/format-string-error.stderr
+++ b/tests/ui/fmt/format-string-error.stderr
@@ -62,7 +62,7 @@ error: invalid format string: expected `'}'`, found `'\'`
--> $DIR/format-string-error.rs:19:23
|
LL | let _ = format!("{\}");
- | -^ expected `}` in format string
+ | -^ expected `'}'` in format string
| |
| because of this opening brace
|
diff --git a/tests/ui/fmt/format-string-wrong-order.stderr b/tests/ui/fmt/format-string-wrong-order.stderr
index 461af354a4e1..0a2e04026d97 100644
--- a/tests/ui/fmt/format-string-wrong-order.stderr
+++ b/tests/ui/fmt/format-string-wrong-order.stderr
@@ -26,7 +26,7 @@ error: invalid format string: expected `'}'`, found `'?'`
--> $DIR/format-string-wrong-order.rs:9:15
|
LL | format!("{??}", bar);
- | -^ expected `}` in format string
+ | -^ expected `'}'` in format string
| |
| because of this opening brace
|
@@ -36,7 +36,7 @@ error: invalid format string: expected `'}'`, found `'?'`
--> $DIR/format-string-wrong-order.rs:11:15
|
LL | format!("{?;bar}");
- | -^ expected `}` in format string
+ | -^ expected `'}'` in format string
| |
| because of this opening brace
|
diff --git a/tests/ui/fmt/ifmt-bad-arg.stderr b/tests/ui/fmt/ifmt-bad-arg.stderr
index ed008c454a31..09ce3dca4117 100644
--- a/tests/ui/fmt/ifmt-bad-arg.stderr
+++ b/tests/ui/fmt/ifmt-bad-arg.stderr
@@ -178,7 +178,7 @@ error: invalid format string: expected `'}'`, found `'t'`
LL | ninth number: {
| - because of this opening brace
LL | tenth number: {}",
- | ^ expected `}` in format string
+ | ^ expected `'}'` in format string
|
= note: if you intended to print `{`, you can escape it using `{{`
diff --git a/tests/ui/impl-trait/auto-trait-leak.stderr b/tests/ui/impl-trait/auto-trait-leak.stderr
index 92a9763bc9b5..a024cff0b8da 100644
--- a/tests/ui/impl-trait/auto-trait-leak.stderr
+++ b/tests/ui/impl-trait/auto-trait-leak.stderr
@@ -33,6 +33,7 @@ LL | | fn send(_: T) {}
LL | | Rc::new(String::from("foo"))
LL | | }
| |_^
+ = note: see https://rustc-dev-guide.rust-lang.org/overview.html#queries and https://rustc-dev-guide.rust-lang.org/query.html for more information
error[E0391]: cycle detected when computing type of `cycle1::{opaque#0}`
--> $DIR/auto-trait-leak.rs:11:16
@@ -68,6 +69,7 @@ LL | | fn send(_: T) {}
LL | | Rc::new(String::from("foo"))
LL | | }
| |_^
+ = note: see https://rustc-dev-guide.rust-lang.org/overview.html#queries and https://rustc-dev-guide.rust-lang.org/query.html for more information
error: cannot check whether the hidden type of opaque type satisfies auto traits
--> $DIR/auto-trait-leak.rs:21:10
diff --git a/tests/ui/impl-trait/defined-by-trait-resolution.rs b/tests/ui/impl-trait/defined-by-trait-resolution.rs
new file mode 100644
index 000000000000..1744046ddbb7
--- /dev/null
+++ b/tests/ui/impl-trait/defined-by-trait-resolution.rs
@@ -0,0 +1,12 @@
+//! The trait query `foo: Fn() -> u8` is a valid defining use of RPIT.
+
+// build-pass
+
+fn returns_u8(_: impl Fn() -> u8) {}
+
+pub fn foo() -> impl Sized {
+ returns_u8(foo);
+ 0u8
+}
+
+fn main() {}
diff --git a/tests/ui/infinite/infinite-trait-alias-recursion.stderr b/tests/ui/infinite/infinite-trait-alias-recursion.stderr
index 683987b4943d..39d7aa4c16aa 100644
--- a/tests/ui/infinite/infinite-trait-alias-recursion.stderr
+++ b/tests/ui/infinite/infinite-trait-alias-recursion.stderr
@@ -21,6 +21,7 @@ note: cycle used when collecting item types in top-level module
|
LL | trait T1 = T2;
| ^^^^^^^^^^^^^^
+ = note: see https://rustc-dev-guide.rust-lang.org/overview.html#queries and https://rustc-dev-guide.rust-lang.org/query.html for more information
error: aborting due to previous error
diff --git a/tests/ui/infinite/infinite-type-alias-mutual-recursion.stderr b/tests/ui/infinite/infinite-type-alias-mutual-recursion.stderr
index 7f82b294434f..bbdb1f70b803 100644
--- a/tests/ui/infinite/infinite-type-alias-mutual-recursion.stderr
+++ b/tests/ui/infinite/infinite-type-alias-mutual-recursion.stderr
@@ -28,6 +28,7 @@ LL | | type X3 = X1;
LL | |
LL | | fn main() {}
| |____________^
+ = note: see https://rustc-dev-guide.rust-lang.org/overview.html#queries and https://rustc-dev-guide.rust-lang.org/query.html for more information
error: aborting due to previous error
diff --git a/tests/ui/infinite/infinite-vec-type-recursion.stderr b/tests/ui/infinite/infinite-vec-type-recursion.stderr
index 1e487a5b11c2..a21b033a9a9a 100644
--- a/tests/ui/infinite/infinite-vec-type-recursion.stderr
+++ b/tests/ui/infinite/infinite-vec-type-recursion.stderr
@@ -16,6 +16,7 @@ LL | |
LL | |
LL | | fn main() { let b: X = Vec::new(); }
| |____________________________________^
+ = note: see https://rustc-dev-guide.rust-lang.org/overview.html#queries and https://rustc-dev-guide.rust-lang.org/query.html for more information
error: aborting due to previous error
diff --git a/tests/ui/inline-const/interpolated.rs b/tests/ui/inline-const/interpolated.rs
new file mode 100644
index 000000000000..3fcc621c9469
--- /dev/null
+++ b/tests/ui/inline-const/interpolated.rs
@@ -0,0 +1,32 @@
+// check-pass
+
+#![feature(inline_const)]
+
+// This used to be unsupported since the parser first tries to check if we have
+// any nested items, and then checks for statements (and expressions). The heuristic
+// that we were using to detect the beginning of a const item was incorrect, so
+// this used to fail.
+macro_rules! m {
+ ($b:block) => {
+ fn foo() {
+ const $b
+ }
+ }
+}
+
+// This has worked since inline-consts were implemented, since the position that
+// the const block is located at doesn't support nested items (e.g. because
+// `let x = const X: u32 = 1;` is invalid), so there's no ambiguity parsing the
+// inline const.
+macro_rules! m2 {
+ ($b:block) => {
+ fn foo2() {
+ let _ = const $b;
+ }
+ }
+}
+
+m!({});
+m2!({});
+
+fn main() {}
diff --git a/tests/ui/issues/issue-17252.stderr b/tests/ui/issues/issue-17252.stderr
index aca5242b2968..daaf82e80ade 100644
--- a/tests/ui/issues/issue-17252.stderr
+++ b/tests/ui/issues/issue-17252.stderr
@@ -10,6 +10,7 @@ note: cycle used when const-evaluating + checking `main::{constant#0}`
|
LL | let _x: [u8; FOO]; // caused stack overflow prior to fix
| ^^^
+ = note: see https://rustc-dev-guide.rust-lang.org/overview.html#queries and https://rustc-dev-guide.rust-lang.org/query.html for more information
error: aborting due to previous error
diff --git a/tests/ui/issues/issue-20772.stderr b/tests/ui/issues/issue-20772.stderr
index 416fd8c062fa..0c7e728c67e8 100644
--- a/tests/ui/issues/issue-20772.stderr
+++ b/tests/ui/issues/issue-20772.stderr
@@ -10,6 +10,7 @@ note: cycle used when computing the super predicates of `T`
|
LL | trait T : Iterator-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ = note: see https://rustc-dev-guide.rust-lang.org/overview.html#queries and https://rustc-dev-guide.rust-lang.org/query.html for more information
error: aborting due to previous error
diff --git a/tests/ui/issues/issue-21177.stderr b/tests/ui/issues/issue-21177.stderr
index 6877a1846050..8b749edcc77f 100644
--- a/tests/ui/issues/issue-21177.stderr
+++ b/tests/ui/issues/issue-21177.stderr
@@ -10,6 +10,7 @@ note: cycle used when computing explicit predicates of `foo`
|
LL | fn foo>() { }
| ^^^^
+ = note: see https://rustc-dev-guide.rust-lang.org/overview.html#queries and https://rustc-dev-guide.rust-lang.org/query.html for more information
error: aborting due to previous error
diff --git a/tests/ui/issues/issue-23302-1.stderr b/tests/ui/issues/issue-23302-1.stderr
index 9366050d7ecd..d807e24403e0 100644
--- a/tests/ui/issues/issue-23302-1.stderr
+++ b/tests/ui/issues/issue-23302-1.stderr
@@ -10,6 +10,7 @@ note: cycle used when simplifying constant for the type system `X::A::{constant#
|
LL | A = X::A as isize,
| ^^^^^^^^^^^^^
+ = note: see https://rustc-dev-guide.rust-lang.org/overview.html#queries and https://rustc-dev-guide.rust-lang.org/query.html for more information
error: aborting due to previous error
diff --git a/tests/ui/issues/issue-23302-2.stderr b/tests/ui/issues/issue-23302-2.stderr
index b97ae287a47a..91b39dba1ba2 100644
--- a/tests/ui/issues/issue-23302-2.stderr
+++ b/tests/ui/issues/issue-23302-2.stderr
@@ -10,6 +10,7 @@ note: cycle used when simplifying constant for the type system `Y::A::{constant#
|
LL | A = Y::B as isize,
| ^^^^^^^^^^^^^
+ = note: see https://rustc-dev-guide.rust-lang.org/overview.html#queries and https://rustc-dev-guide.rust-lang.org/query.html for more information
error: aborting due to previous error
diff --git a/tests/ui/issues/issue-23302-3.stderr b/tests/ui/issues/issue-23302-3.stderr
index c6cafe575e51..6b708d81f73f 100644
--- a/tests/ui/issues/issue-23302-3.stderr
+++ b/tests/ui/issues/issue-23302-3.stderr
@@ -15,6 +15,7 @@ note: cycle used when simplifying constant for the type system `A`
|
LL | const A: i32 = B;
| ^^^^^^^^^^^^
+ = note: see https://rustc-dev-guide.rust-lang.org/overview.html#queries and https://rustc-dev-guide.rust-lang.org/query.html for more information
error: aborting due to previous error
diff --git a/tests/ui/issues/issue-34373.stderr b/tests/ui/issues/issue-34373.stderr
index 8be3cfa72fb2..0f0821518a42 100644
--- a/tests/ui/issues/issue-34373.stderr
+++ b/tests/ui/issues/issue-34373.stderr
@@ -21,6 +21,7 @@ LL | | fn foo(_: T) {}
LL | | fn main() {
LL | | }
| |_^
+ = note: see https://rustc-dev-guide.rust-lang.org/overview.html#queries and https://rustc-dev-guide.rust-lang.org/query.html for more information
error: aborting due to previous error
diff --git a/tests/ui/lint/lint-qualification.fixed b/tests/ui/lint/lint-qualification.fixed
new file mode 100644
index 000000000000..c14493013623
--- /dev/null
+++ b/tests/ui/lint/lint-qualification.fixed
@@ -0,0 +1,21 @@
+// run-rustfix
+#![deny(unused_qualifications)]
+#![allow(deprecated)]
+
+mod foo {
+ pub fn bar() {}
+}
+
+fn main() {
+ use foo::bar;
+ bar(); //~ ERROR: unnecessary qualification
+ bar();
+
+ let _ = || -> Result<(), ()> { try!(Ok(())); Ok(()) }; // issue #37345
+
+ macro_rules! m { () => {
+ $crate::foo::bar(); // issue #37357
+ ::foo::bar(); // issue #38682
+ } }
+ m!();
+}
diff --git a/tests/ui/lint/lint-qualification.rs b/tests/ui/lint/lint-qualification.rs
index 0cace0ca0355..80904303559d 100644
--- a/tests/ui/lint/lint-qualification.rs
+++ b/tests/ui/lint/lint-qualification.rs
@@ -1,3 +1,4 @@
+// run-rustfix
#![deny(unused_qualifications)]
#![allow(deprecated)]
diff --git a/tests/ui/lint/lint-qualification.stderr b/tests/ui/lint/lint-qualification.stderr
index d09cb78c4f01..90a06bc6cbe5 100644
--- a/tests/ui/lint/lint-qualification.stderr
+++ b/tests/ui/lint/lint-qualification.stderr
@@ -1,18 +1,19 @@
error: unnecessary qualification
- --> $DIR/lint-qualification.rs:10:5
+ --> $DIR/lint-qualification.rs:11:5
|
LL | foo::bar();
| ^^^^^^^^
|
note: the lint level is defined here
- --> $DIR/lint-qualification.rs:1:9
+ --> $DIR/lint-qualification.rs:2:9
|
LL | #![deny(unused_qualifications)]
| ^^^^^^^^^^^^^^^^^^^^^
-help: replace it with the unqualified path
+help: remove the unnecessary path segments
+ |
+LL - foo::bar();
+LL + bar();
|
-LL | bar();
- | ~~~
error: aborting due to previous error
diff --git a/tests/ui/modules/issue-107649.stderr b/tests/ui/modules/issue-107649.stderr
index 38a910b57b47..5705e84e0d99 100644
--- a/tests/ui/modules/issue-107649.stderr
+++ b/tests/ui/modules/issue-107649.stderr
@@ -11,7 +11,7 @@ help: consider annotating `Dummy` with `#[derive(Debug)]`
--> $DIR/auxiliary/dummy_lib.rs:2:1
|
2 + #[derive(Debug)]
-3 | #[path = "auxiliary/dummy_lib.rs"]
+3 | pub struct Dummy;
|
error: aborting due to previous error
diff --git a/tests/ui/recursion/issue-26548-recursion-via-normalize.rs b/tests/ui/recursion/issue-26548-recursion-via-normalize.rs
index 91958dffcf4d..6c7fc4beb543 100644
--- a/tests/ui/recursion/issue-26548-recursion-via-normalize.rs
+++ b/tests/ui/recursion/issue-26548-recursion-via-normalize.rs
@@ -1,4 +1,5 @@
//~ ERROR cycle detected when computing layout of `core::option::Option
`
+//~| NOTE see https://rustc-dev-guide.rust-lang.org/overview.html#queries and https://rustc-dev-guide.rust-lang.org/query.html for more information
//~| NOTE ...which requires computing layout of `S`...
//~| NOTE ...which requires computing layout of `core::option::Option<::It>`...
//~| NOTE ...which again requires computing layout of `core::option::Option`, completing the cycle
diff --git a/tests/ui/recursion/issue-26548-recursion-via-normalize.stderr b/tests/ui/recursion/issue-26548-recursion-via-normalize.stderr
index a75097cdbfbd..514bed607003 100644
--- a/tests/ui/recursion/issue-26548-recursion-via-normalize.stderr
+++ b/tests/ui/recursion/issue-26548-recursion-via-normalize.stderr
@@ -4,6 +4,7 @@ error[E0391]: cycle detected when computing layout of `core::option::Option`
= note: ...which requires computing layout of `core::option::Option<::It>`...
= note: ...which again requires computing layout of `core::option::Option`, completing the cycle
= note: cycle used when computing layout of `core::option::Option<::It>`
+ = note: see https://rustc-dev-guide.rust-lang.org/overview.html#queries and https://rustc-dev-guide.rust-lang.org/query.html for more information
error: aborting due to previous error
diff --git a/tests/ui/recursion/recursive-static-definition.stderr b/tests/ui/recursion/recursive-static-definition.stderr
index 1359761457a6..b112228d4039 100644
--- a/tests/ui/recursion/recursive-static-definition.stderr
+++ b/tests/ui/recursion/recursive-static-definition.stderr
@@ -18,6 +18,7 @@ LL | |
LL | |
LL | | fn main() {}
| |____________^
+ = note: see https://rustc-dev-guide.rust-lang.org/overview.html#queries and https://rustc-dev-guide.rust-lang.org/query.html for more information
error: aborting due to previous error
diff --git a/tests/ui/resolve/issue-113808-invalid-unused-qualifications-suggestion.fixed b/tests/ui/resolve/issue-113808-invalid-unused-qualifications-suggestion.fixed
new file mode 100644
index 000000000000..e730f94660bb
--- /dev/null
+++ b/tests/ui/resolve/issue-113808-invalid-unused-qualifications-suggestion.fixed
@@ -0,0 +1,31 @@
+// run-rustfix
+
+#![deny(unused_qualifications)]
+#![feature(unsized_fn_params)]
+
+#[allow(unused_imports)]
+use std::ops;
+use std::ops::Index;
+
+pub struct A;
+
+impl Index for A {
+ //~^ ERROR unnecessary qualification
+ type Output = ();
+ fn index(&self, _: str) -> &Self::Output {
+ &()
+ }
+}
+
+mod inner {
+ pub trait Trait {}
+}
+
+// the import needs to be here for the lint to show up
+#[allow(unused_imports)]
+use inner::Trait;
+
+impl Trait for () {}
+//~^ ERROR unnecessary qualification
+
+fn main() {}
diff --git a/tests/ui/resolve/issue-113808-invalid-unused-qualifications-suggestion.rs b/tests/ui/resolve/issue-113808-invalid-unused-qualifications-suggestion.rs
new file mode 100644
index 000000000000..641c892e3de9
--- /dev/null
+++ b/tests/ui/resolve/issue-113808-invalid-unused-qualifications-suggestion.rs
@@ -0,0 +1,31 @@
+// run-rustfix
+
+#![deny(unused_qualifications)]
+#![feature(unsized_fn_params)]
+
+#[allow(unused_imports)]
+use std::ops;
+use std::ops::Index;
+
+pub struct A;
+
+impl ops::Index for A {
+ //~^ ERROR unnecessary qualification
+ type Output = ();
+ fn index(&self, _: str) -> &Self::Output {
+ &()
+ }
+}
+
+mod inner {
+ pub trait Trait {}
+}
+
+// the import needs to be here for the lint to show up
+#[allow(unused_imports)]
+use inner::Trait;
+
+impl inner::Trait for () {}
+//~^ ERROR unnecessary qualification
+
+fn main() {}
diff --git a/tests/ui/resolve/issue-113808-invalid-unused-qualifications-suggestion.stderr b/tests/ui/resolve/issue-113808-invalid-unused-qualifications-suggestion.stderr
new file mode 100644
index 000000000000..d9c7fd21871b
--- /dev/null
+++ b/tests/ui/resolve/issue-113808-invalid-unused-qualifications-suggestion.stderr
@@ -0,0 +1,31 @@
+error: unnecessary qualification
+ --> $DIR/issue-113808-invalid-unused-qualifications-suggestion.rs:12:6
+ |
+LL | impl ops::Index for A {
+ | ^^^^^^^^^^^^^^^
+ |
+note: the lint level is defined here
+ --> $DIR/issue-113808-invalid-unused-qualifications-suggestion.rs:3:9
+ |
+LL | #![deny(unused_qualifications)]
+ | ^^^^^^^^^^^^^^^^^^^^^
+help: remove the unnecessary path segments
+ |
+LL - impl ops::Index for A {
+LL + impl Index for A {
+ |
+
+error: unnecessary qualification
+ --> $DIR/issue-113808-invalid-unused-qualifications-suggestion.rs:28:6
+ |
+LL | impl inner::Trait for () {}
+ | ^^^^^^^^^^^^^^^^
+ |
+help: remove the unnecessary path segments
+ |
+LL - impl inner::Trait for () {}
+LL + impl Trait for () {}
+ |
+
+error: aborting due to 2 previous errors
+
diff --git a/tests/ui/resolve/resolve-self-in-impl.stderr b/tests/ui/resolve/resolve-self-in-impl.stderr
index 9f9ed68898f6..183a17171f7f 100644
--- a/tests/ui/resolve/resolve-self-in-impl.stderr
+++ b/tests/ui/resolve/resolve-self-in-impl.stderr
@@ -56,6 +56,7 @@ LL | | trait Tr {
LL | |
LL | | fn main() {}
| |____________^
+ = note: see https://rustc-dev-guide.rust-lang.org/overview.html#queries and https://rustc-dev-guide.rust-lang.org/query.html for more information
error: aborting due to 6 previous errors
diff --git a/tests/ui/resolve/unused-qualifications-suggestion.stderr b/tests/ui/resolve/unused-qualifications-suggestion.stderr
index c8e91e07295b..e3dac37fc6e2 100644
--- a/tests/ui/resolve/unused-qualifications-suggestion.stderr
+++ b/tests/ui/resolve/unused-qualifications-suggestion.stderr
@@ -9,10 +9,11 @@ note: the lint level is defined here
|
LL | #![deny(unused_qualifications)]
| ^^^^^^^^^^^^^^^^^^^^^
-help: replace it with the unqualified path
+help: remove the unnecessary path segments
+ |
+LL - foo::bar();
+LL + bar();
|
-LL | bar();
- | ~~~
error: unnecessary qualification
--> $DIR/unused-qualifications-suggestion.rs:21:5
@@ -20,10 +21,11 @@ error: unnecessary qualification
LL | baz::qux::quux();
| ^^^^^^^^^^^^^^
|
-help: replace it with the unqualified path
+help: remove the unnecessary path segments
+ |
+LL - baz::qux::quux();
+LL + quux();
|
-LL | quux();
- | ~~~~
error: aborting due to 2 previous errors
diff --git a/tests/ui/rfcs/rfc-2627-raw-dylib/dlltool-failed.rs b/tests/ui/rfcs/rfc-2627-raw-dylib/dlltool-failed.rs
index d7a418959bf5..880907b24b46 100644
--- a/tests/ui/rfcs/rfc-2627-raw-dylib/dlltool-failed.rs
+++ b/tests/ui/rfcs/rfc-2627-raw-dylib/dlltool-failed.rs
@@ -6,6 +6,10 @@
// compile-flags: --crate-type lib --emit link
// normalize-stderr-test: "[^ ']*/dlltool.exe" -> "$$DLLTOOL"
// normalize-stderr-test: "[^ ]*/foo.def" -> "$$DEF_FILE"
+// normalize-stderr-test: "[^ ]*/foo.lib" -> "$$LIB_FILE"
+// normalize-stderr-test: "-m [^ ]*" -> "$$TARGET_MACHINE"
+// normalize-stderr-test: "-f [^ ]*" -> "$$ASM_FLAGS"
+// normalize-stderr-test: "--temp-prefix [^ ]*/foo.dll" -> "$$TEMP_PREFIX"
#[link(name = "foo", kind = "raw-dylib")]
extern "C" {
// `@1` is an invalid name to export, as it usually indicates that something
diff --git a/tests/ui/rfcs/rfc-2627-raw-dylib/dlltool-failed.stderr b/tests/ui/rfcs/rfc-2627-raw-dylib/dlltool-failed.stderr
index 020ac6a2b670..cc532ccc4510 100644
--- a/tests/ui/rfcs/rfc-2627-raw-dylib/dlltool-failed.stderr
+++ b/tests/ui/rfcs/rfc-2627-raw-dylib/dlltool-failed.stderr
@@ -1,4 +1,5 @@
-error: Dlltool could not create import library:
+error: Dlltool could not create import library with $DLLTOOL -d $DEF_FILE -D foo.dll -l $LIB_FILE $TARGET_MACHINE $ASM_FLAGS --no-leading-underscore $TEMP_PREFIX:
+
$DLLTOOL: Syntax error in def file $DEF_FILE:1
error: aborting due to previous error
diff --git a/tests/ui/rfcs/rfc-2627-raw-dylib/multiple-declarations.stderr b/tests/ui/rfcs/rfc-2627-raw-dylib/multiple-declarations.stderr
index 510108405488..dfd24566953f 100644
--- a/tests/ui/rfcs/rfc-2627-raw-dylib/multiple-declarations.stderr
+++ b/tests/ui/rfcs/rfc-2627-raw-dylib/multiple-declarations.stderr
@@ -2,7 +2,7 @@ error: multiple declarations of external function `f` from library `foo.dll` hav
--> $DIR/multiple-declarations.rs:13:9
|
LL | fn f(x: i32);
- | ^^^^^^^^^^^^^
+ | ^^^^^^^^^^^^
error: aborting due to previous error
diff --git a/tests/ui/rfcs/rfc-2627-raw-dylib/unsupported-abi.stderr b/tests/ui/rfcs/rfc-2627-raw-dylib/unsupported-abi.stderr
index f8265ae69194..f69275a01253 100644
--- a/tests/ui/rfcs/rfc-2627-raw-dylib/unsupported-abi.stderr
+++ b/tests/ui/rfcs/rfc-2627-raw-dylib/unsupported-abi.stderr
@@ -2,7 +2,7 @@ error: ABI not supported by `#[link(kind = "raw-dylib")]` on this architecture
--> $DIR/unsupported-abi.rs:6:5
|
LL | fn f(x: i32);
- | ^^^^^^^^^^^^^
+ | ^^^^^^^^^^^^
error: aborting due to previous error
diff --git a/tests/ui/simd/intrinsic/float-minmax-pass.rs b/tests/ui/simd/intrinsic/float-minmax-pass.rs
index d79be61f9099..968b074b6ef1 100644
--- a/tests/ui/simd/intrinsic/float-minmax-pass.rs
+++ b/tests/ui/simd/intrinsic/float-minmax-pass.rs
@@ -21,7 +21,7 @@ fn main() {
#[cfg(not(any(target_arch = "mips", target_arch = "mips64")))]
let nan = f32::NAN;
- // MIPS hardware treats f32::NAN as SNAN. Clear the signaling bit.
+ // MIPS hardware except MIPS R6 treats f32::NAN as SNAN. Clear the signaling bit.
// See https://github.com/rust-lang/rust/issues/52746.
#[cfg(any(target_arch = "mips", target_arch = "mips64"))]
let nan = f32::from_bits(f32::NAN.to_bits() - 1);
diff --git a/tests/ui/sized/recursive-type-2.stderr b/tests/ui/sized/recursive-type-2.stderr
index d0e6e9db07e9..0f72f74145e8 100644
--- a/tests/ui/sized/recursive-type-2.stderr
+++ b/tests/ui/sized/recursive-type-2.stderr
@@ -7,6 +7,7 @@ note: cycle used when elaborating drops for `main`
|
LL | fn main() {
| ^^^^^^^^^
+ = note: see https://rustc-dev-guide.rust-lang.org/overview.html#queries and https://rustc-dev-guide.rust-lang.org/query.html for more information
error: aborting due to previous error
diff --git a/tests/ui/traits/new-solver/alias-bound-preference.rs b/tests/ui/traits/new-solver/alias-bound-preference.rs
new file mode 100644
index 000000000000..e4e0f634ef76
--- /dev/null
+++ b/tests/ui/traits/new-solver/alias-bound-preference.rs
@@ -0,0 +1,39 @@
+// revisions: old next
+//[next] compile-flags: -Ztrait-solver=next
+// run-pass
+
+// A test for https://github.com/rust-lang/trait-system-refactor-initiative/issues/45.
+
+trait Trait {
+ type Assoc: Into;
+}
+impl> Trait for T {
+ type Assoc = T;
+}
+fn prefer_alias_bound_projection(x: T::Assoc) {
+ // There are two possible types for `x`:
+ // - `u32` by using the "alias bound" of `::Assoc`
+ // - `::Assoc`, i.e. `u16`, by using `impl From for T`
+ //
+ // We infer the type of `x` to be `u32` here as it is highly likely
+ // that this is expected by the user.
+ let x = x.into();
+ assert_eq!(std::mem::size_of_val(&x), 4);
+}
+
+fn impl_trait() -> impl Into {
+ 0u16
+}
+
+fn main() {
+ // There are two possible types for `x`:
+ // - `u32` by using the "alias bound" of `impl Into`
+ // - `impl Into`, i.e. `u16`, by using `impl From for T`
+ //
+ // We infer the type of `x` to be `u32` here as it is highly likely
+ // that this is expected by the user.
+ let x = impl_trait().into();
+ assert_eq!(std::mem::size_of_val(&x), 4);
+
+ prefer_alias_bound_projection::(1);
+}
diff --git a/tests/ui/traits/trait-upcasting/cyclic-trait-resolution.stderr b/tests/ui/traits/trait-upcasting/cyclic-trait-resolution.stderr
index ca98e1831507..62c732fb1d95 100644
--- a/tests/ui/traits/trait-upcasting/cyclic-trait-resolution.stderr
+++ b/tests/ui/traits/trait-upcasting/cyclic-trait-resolution.stderr
@@ -10,6 +10,7 @@ note: cycle used when collecting item types in top-level module
|
LL | trait A: B + A {}
| ^^^^^^^^^^^^^^^^^
+ = note: see https://rustc-dev-guide.rust-lang.org/overview.html#queries and https://rustc-dev-guide.rust-lang.org/query.html for more information
error: aborting due to previous error
diff --git a/tests/ui/transmutability/issue-110892.rs b/tests/ui/transmutability/issue-110892.rs
new file mode 100644
index 000000000000..ce926b399963
--- /dev/null
+++ b/tests/ui/transmutability/issue-110892.rs
@@ -0,0 +1,40 @@
+// check-fail
+#![feature(generic_const_exprs, transmutability)]
+#![allow(incomplete_features)]
+
+mod assert {
+ use std::mem::{Assume, BikeshedIntrinsicFrom};
+
+ pub fn is_transmutable<
+ Src,
+ Dst,
+ Context,
+ const ASSUME_ALIGNMENT: bool,
+ const ASSUME_LIFETIMES: bool,
+ const ASSUME_SAFETY: bool,
+ const ASSUME_VALIDITY: bool,
+ >()
+ where
+ Dst: BikeshedIntrinsicFrom<
+ Src,
+ Context,
+ { from_options(ASSUME_ALIGNMENT, ASSUME_LIFETIMES, ASSUME_SAFETY, ASSUME_VALIDITY) }
+ >,
+ {}
+
+ // This should not cause an ICE
+ const fn from_options(
+ , //~ ERROR expected parameter name, found `,`
+ , //~ ERROR expected parameter name, found `,`
+ , //~ ERROR expected parameter name, found `,`
+ , //~ ERROR expected parameter name, found `,`
+ ) -> Assume {} //~ ERROR mismatched types
+}
+
+fn main() {
+ struct Context;
+ #[repr(C)] struct Src;
+ #[repr(C)] struct Dst;
+
+ assert::is_transmutable::();
+}
diff --git a/tests/ui/transmutability/issue-110892.stderr b/tests/ui/transmutability/issue-110892.stderr
new file mode 100644
index 000000000000..13654307aee7
--- /dev/null
+++ b/tests/ui/transmutability/issue-110892.stderr
@@ -0,0 +1,36 @@
+error: expected parameter name, found `,`
+ --> $DIR/issue-110892.rs:27:9
+ |
+LL | ,
+ | ^ expected parameter name
+
+error: expected parameter name, found `,`
+ --> $DIR/issue-110892.rs:28:9
+ |
+LL | ,
+ | ^ expected parameter name
+
+error: expected parameter name, found `,`
+ --> $DIR/issue-110892.rs:29:9
+ |
+LL | ,
+ | ^ expected parameter name
+
+error: expected parameter name, found `,`
+ --> $DIR/issue-110892.rs:30:9
+ |
+LL | ,
+ | ^ expected parameter name
+
+error[E0308]: mismatched types
+ --> $DIR/issue-110892.rs:31:10
+ |
+LL | const fn from_options(
+ | ------------ implicitly returns `()` as its body has no tail or `return` expression
+...
+LL | ) -> Assume {}
+ | ^^^^^^ expected `Assume`, found `()`
+
+error: aborting due to 5 previous errors
+
+For more information about this error, try `rustc --explain E0308`.
diff --git a/tests/ui/type-alias-enum-variants/self-in-enum-definition.stderr b/tests/ui/type-alias-enum-variants/self-in-enum-definition.stderr
index c943a4918ba6..aa79b1a57c4c 100644
--- a/tests/ui/type-alias-enum-variants/self-in-enum-definition.stderr
+++ b/tests/ui/type-alias-enum-variants/self-in-enum-definition.stderr
@@ -67,6 +67,7 @@ LL | | V2 = Self::V1 as u8 + 1, // OK; See #50072.
LL | |
LL | | fn main() {}
| |____________^
+ = note: see https://rustc-dev-guide.rust-lang.org/overview.html#queries and https://rustc-dev-guide.rust-lang.org/query.html for more information
error: aborting due to previous error
diff --git a/tests/ui/type-alias-impl-trait/auto-trait-leakage3.stderr b/tests/ui/type-alias-impl-trait/auto-trait-leakage3.stderr
index dd56c59bf5f2..5bd0f76c31fb 100644
--- a/tests/ui/type-alias-impl-trait/auto-trait-leakage3.stderr
+++ b/tests/ui/type-alias-impl-trait/auto-trait-leakage3.stderr
@@ -16,6 +16,7 @@ note: cycle used when checking item types in module `m`
|
LL | mod m {
| ^^^^^
+ = note: see https://rustc-dev-guide.rust-lang.org/overview.html#queries and https://rustc-dev-guide.rust-lang.org/query.html for more information
error[E0391]: cycle detected when computing type of `m::Foo::{opaque#0}`
--> $DIR/auto-trait-leakage3.rs:7:20
@@ -34,6 +35,7 @@ note: cycle used when checking item types in module `m`
|
LL | mod m {
| ^^^^^
+ = note: see https://rustc-dev-guide.rust-lang.org/overview.html#queries and https://rustc-dev-guide.rust-lang.org/query.html for more information
error: cannot check whether the hidden type of `auto_trait_leakage3[211d]::m::Foo::{opaque#0}` satisfies auto traits
--> $DIR/auto-trait-leakage3.rs:16:17
diff --git a/tests/ui/type-alias-impl-trait/defined-by-user-annotation.rs b/tests/ui/type-alias-impl-trait/defined-by-user-annotation.rs
new file mode 100644
index 000000000000..5a421ea1dc02
--- /dev/null
+++ b/tests/ui/type-alias-impl-trait/defined-by-user-annotation.rs
@@ -0,0 +1,19 @@
+// User type annotation in fn bodies is a a valid defining site for opaque types.
+// check-pass
+#![feature(type_alias_impl_trait)]
+
+trait Equate { type Proj; }
+impl Equate for T { type Proj = T; }
+
+trait Indirect { type Ty; }
+impl> Indirect for (A, B) { type Ty = (); }
+
+type Opq = impl Sized;
+fn define_1(_: Opq) {
+ let _ = None::<<(Opq, u8) as Indirect>::Ty>;
+}
+fn define_2() -> Opq {
+ 0u8
+}
+
+fn main() {}
diff --git a/tests/ui/type-alias-impl-trait/inference-cycle.stderr b/tests/ui/type-alias-impl-trait/inference-cycle.stderr
index 4d5f367476b7..41530dda983a 100644
--- a/tests/ui/type-alias-impl-trait/inference-cycle.stderr
+++ b/tests/ui/type-alias-impl-trait/inference-cycle.stderr
@@ -16,6 +16,7 @@ note: cycle used when checking item types in module `m`
|
LL | mod m {
| ^^^^^
+ = note: see https://rustc-dev-guide.rust-lang.org/overview.html#queries and https://rustc-dev-guide.rust-lang.org/query.html for more information
error[E0391]: cycle detected when computing type of `m::Foo::{opaque#0}`
--> $DIR/inference-cycle.rs:5:20
@@ -34,6 +35,7 @@ note: cycle used when checking item types in module `m`
|
LL | mod m {
| ^^^^^
+ = note: see https://rustc-dev-guide.rust-lang.org/overview.html#queries and https://rustc-dev-guide.rust-lang.org/query.html for more information
error: cannot check whether the hidden type of `inference_cycle[4ecc]::m::Foo::{opaque#0}` satisfies auto traits
--> $DIR/inference-cycle.rs:16:17
diff --git a/tests/ui/type-alias-impl-trait/issue-53092-2.stderr b/tests/ui/type-alias-impl-trait/issue-53092-2.stderr
index 2565a28b4935..6148131b491f 100644
--- a/tests/ui/type-alias-impl-trait/issue-53092-2.stderr
+++ b/tests/ui/type-alias-impl-trait/issue-53092-2.stderr
@@ -23,6 +23,7 @@ LL | | type Bug = impl Fn(T) -> U + Copy;
LL | | CONST_BUG(0);
LL | | }
| |_^
+ = note: see https://rustc-dev-guide.rust-lang.org/overview.html#queries and https://rustc-dev-guide.rust-lang.org/query.html for more information
error[E0277]: the trait bound `U: From` is not satisfied
--> $DIR/issue-53092-2.rs:9:5
diff --git a/tests/ui/type-alias-impl-trait/recursive-tait-conflicting-defn-2.rs b/tests/ui/type-alias-impl-trait/recursive-tait-conflicting-defn-2.rs
new file mode 100644
index 000000000000..10588398c9d7
--- /dev/null
+++ b/tests/ui/type-alias-impl-trait/recursive-tait-conflicting-defn-2.rs
@@ -0,0 +1,21 @@
+// issue: 113314
+
+#![feature(type_alias_impl_trait)]
+
+type Op = impl std::fmt::Display;
+fn foo() -> Op { &"hello world" }
+
+fn transform() -> impl std::fmt::Display {
+ &0usize
+}
+fn bad() -> Op {
+ transform::()
+ //~^ ERROR concrete type differs from previous defining opaque type use
+}
+
+fn main() {
+ let mut x = foo();
+ println!("{x}");
+ x = bad();
+ println!("{x}");
+}
diff --git a/tests/ui/type-alias-impl-trait/recursive-tait-conflicting-defn-2.stderr b/tests/ui/type-alias-impl-trait/recursive-tait-conflicting-defn-2.stderr
new file mode 100644
index 000000000000..7481557fcbad
--- /dev/null
+++ b/tests/ui/type-alias-impl-trait/recursive-tait-conflicting-defn-2.stderr
@@ -0,0 +1,14 @@
+error: concrete type differs from previous defining opaque type use
+ --> $DIR/recursive-tait-conflicting-defn-2.rs:12:5
+ |
+LL | transform::()
+ | ^^^^^^^^^^^^^^^^^ expected `&'static &'static str`, got `impl std::fmt::Display`
+ |
+note: previous use here
+ --> $DIR/recursive-tait-conflicting-defn-2.rs:6:18
+ |
+LL | fn foo() -> Op { &"hello world" }
+ | ^^^^^^^^^^^^^^
+
+error: aborting due to previous error
+
diff --git a/tests/ui/type-alias-impl-trait/recursive-tait-conflicting-defn.rs b/tests/ui/type-alias-impl-trait/recursive-tait-conflicting-defn.rs
new file mode 100644
index 000000000000..e221f4f3f55c
--- /dev/null
+++ b/tests/ui/type-alias-impl-trait/recursive-tait-conflicting-defn.rs
@@ -0,0 +1,34 @@
+// issue: 113596
+
+#![feature(type_alias_impl_trait)]
+
+trait Test {}
+
+struct A;
+
+impl Test for A {}
+
+struct B {
+ inner: T,
+}
+
+impl Test for B {}
+
+type TestImpl = impl Test;
+
+fn test() -> TestImpl {
+ A
+}
+
+fn make_option() -> Option {
+ Some(test())
+}
+
+fn make_option2() -> Option {
+ let inner = make_option().unwrap();
+
+ Some(B { inner })
+ //~^ ERROR concrete type differs from previous defining opaque type use
+}
+
+fn main() {}
diff --git a/tests/ui/type-alias-impl-trait/recursive-tait-conflicting-defn.stderr b/tests/ui/type-alias-impl-trait/recursive-tait-conflicting-defn.stderr
new file mode 100644
index 000000000000..e4209643b7a3
--- /dev/null
+++ b/tests/ui/type-alias-impl-trait/recursive-tait-conflicting-defn.stderr
@@ -0,0 +1,14 @@
+error: concrete type differs from previous defining opaque type use
+ --> $DIR/recursive-tait-conflicting-defn.rs:30:3
+ |
+LL | Some(B { inner })
+ | ^^^^^^^^^^^^^^^^^ expected `A`, got `B`
+ |
+note: previous use here
+ --> $DIR/recursive-tait-conflicting-defn.rs:20:3
+ |
+LL | A
+ | ^
+
+error: aborting due to previous error
+
diff --git a/tests/ui/type-alias-impl-trait/reveal_local.stderr b/tests/ui/type-alias-impl-trait/reveal_local.stderr
index 0c5ef4a6fb41..813185c13779 100644
--- a/tests/ui/type-alias-impl-trait/reveal_local.stderr
+++ b/tests/ui/type-alias-impl-trait/reveal_local.stderr
@@ -22,6 +22,7 @@ LL | |
LL | |
LL | | fn main() {}
| |____________^
+ = note: see https://rustc-dev-guide.rust-lang.org/overview.html#queries and https://rustc-dev-guide.rust-lang.org/query.html for more information
error[E0391]: cycle detected when computing type of `Foo::{opaque#0}`
--> $DIR/reveal_local.rs:5:12
@@ -46,6 +47,7 @@ LL | |
LL | |
LL | | fn main() {}
| |____________^
+ = note: see https://rustc-dev-guide.rust-lang.org/overview.html#queries and https://rustc-dev-guide.rust-lang.org/query.html for more information
error: cannot check whether the hidden type of `reveal_local[9507]::Foo::{opaque#0}` satisfies auto traits
--> $DIR/reveal_local.rs:15:15
@@ -92,6 +94,7 @@ LL | |
LL | |
LL | | fn main() {}
| |____________^
+ = note: see https://rustc-dev-guide.rust-lang.org/overview.html#queries and https://rustc-dev-guide.rust-lang.org/query.html for more information
error: cannot check whether the hidden type of `reveal_local[9507]::Foo::{opaque#0}` satisfies auto traits
--> $DIR/reveal_local.rs:25:15
diff --git a/triagebot.toml b/triagebot.toml
index 1a435ff074ee..cc26c3b3e7b9 100644
--- a/triagebot.toml
+++ b/triagebot.toml
@@ -457,7 +457,7 @@ cc = ["@davidtwco", "@compiler-errors", "@JohnTitor", "@TaKO8Ki"]
[mentions."compiler/rustc_smir"]
message = "This PR changes Stable MIR"
-cc = ["@oli-obk", "@celinval"]
+cc = ["@oli-obk", "@celinval", "@spastorino"]
[mentions."compiler/rustc_target/src/spec"]
message = """