Pin {
#[stable(feature = "pin", since = "1.33.0")]
#[inline(always)]
pub fn as_ref(&self) -> Pin<&P::Target> {
+ // SAFETY: see documentation on this function
unsafe { Pin::new_unchecked(&*self.pointer) }
}
@@ -610,6 +611,7 @@ impl Pin {
#[stable(feature = "pin", since = "1.33.0")]
#[inline(always)]
pub fn as_mut(&mut self) -> Pin<&mut P::Target> {
+ // SAFETY: see documentation on this function
unsafe { Pin::new_unchecked(&mut *self.pointer) }
}
diff --git a/src/libcore/ptr/mod.rs b/src/libcore/ptr/mod.rs
index 1a13ac465f436..5a75730cf2bd4 100644
--- a/src/libcore/ptr/mod.rs
+++ b/src/libcore/ptr/mod.rs
@@ -65,6 +65,8 @@
//! [`write_volatile`]: ./fn.write_volatile.html
//! [`NonNull::dangling`]: ./struct.NonNull.html#method.dangling
+// ignore-tidy-undocumented-unsafe
+
#![stable(feature = "rust1", since = "1.0.0")]
use crate::intrinsics;
diff --git a/src/libcore/ptr/non_null.rs b/src/libcore/ptr/non_null.rs
index 7dcd57f1f9858..7599991f0f15a 100644
--- a/src/libcore/ptr/non_null.rs
+++ b/src/libcore/ptr/non_null.rs
@@ -7,6 +7,8 @@ use crate::mem;
use crate::ptr::Unique;
use crate::cmp::Ordering;
+// ignore-tidy-undocumented-unsafe
+
/// `*mut T` but non-zero and covariant.
///
/// This is often the correct thing to use when building data structures using
diff --git a/src/libcore/ptr/unique.rs b/src/libcore/ptr/unique.rs
index 3521dd7997956..11a3aed1ab41b 100644
--- a/src/libcore/ptr/unique.rs
+++ b/src/libcore/ptr/unique.rs
@@ -5,6 +5,8 @@ use crate::marker::{PhantomData, Unsize};
use crate::mem;
use crate::ptr::NonNull;
+// ignore-tidy-undocumented-unsafe
+
/// A wrapper around a raw non-null `*mut T` that indicates that the possessor
/// of this wrapper owns the referent. Useful for building abstractions like
/// `Box`, `Vec`, `String`, and `HashMap`.
diff --git a/src/libcore/slice/memchr.rs b/src/libcore/slice/memchr.rs
index 45ab016c49628..2a2169dd348c2 100644
--- a/src/libcore/slice/memchr.rs
+++ b/src/libcore/slice/memchr.rs
@@ -1,6 +1,8 @@
// Original implementation taken from rust-memchr.
// Copyright 2015 Andrew Gallant, bluss and Nicolas Koch
+// ignore-tidy-undocumented-unsafe
+
use crate::cmp;
use crate::mem;
diff --git a/src/libcore/slice/mod.rs b/src/libcore/slice/mod.rs
index 7655b2f806532..c8fe9f9861315 100644
--- a/src/libcore/slice/mod.rs
+++ b/src/libcore/slice/mod.rs
@@ -1,4 +1,5 @@
// ignore-tidy-filelength
+// ignore-tidy-undocumented-unsafe
//! Slice management and manipulation.
//!
diff --git a/src/libcore/slice/sort.rs b/src/libcore/slice/sort.rs
index 2f2170f7ff14c..a719a51b61605 100644
--- a/src/libcore/slice/sort.rs
+++ b/src/libcore/slice/sort.rs
@@ -6,6 +6,8 @@
//! Unstable sorting is compatible with libcore because it doesn't allocate memory, unlike our
//! stable sorting implementation.
+// ignore-tidy-undocumented-unsafe
+
use crate::cmp;
use crate::mem::{self, MaybeUninit};
use crate::ptr;
diff --git a/src/libcore/str/lossy.rs b/src/libcore/str/lossy.rs
index e8f747f1a67d5..762de0489a975 100644
--- a/src/libcore/str/lossy.rs
+++ b/src/libcore/str/lossy.rs
@@ -3,6 +3,8 @@ use crate::str as core_str;
use crate::fmt::{self, Write};
use crate::mem;
+// ignore-tidy-undocumented-unsafe
+
/// Lossy UTF-8 string.
#[unstable(feature = "str_internals", issue = "0")]
pub struct Utf8Lossy {
diff --git a/src/libcore/str/mod.rs b/src/libcore/str/mod.rs
index 1968919f5541c..25b7eec5b3343 100644
--- a/src/libcore/str/mod.rs
+++ b/src/libcore/str/mod.rs
@@ -1,4 +1,5 @@
// ignore-tidy-filelength
+// ignore-tidy-undocumented-unsafe
//! String manipulation.
//!
diff --git a/src/libcore/str/pattern.rs b/src/libcore/str/pattern.rs
index ad9d956fda1c8..a494274118a74 100644
--- a/src/libcore/str/pattern.rs
+++ b/src/libcore/str/pattern.rs
@@ -3,6 +3,8 @@
//! For more details, see the traits [`Pattern`], [`Searcher`],
//! [`ReverseSearcher`], and [`DoubleEndedSearcher`].
+// ignore-tidy-undocumented-unsafe
+
#![unstable(feature = "pattern",
reason = "API not fully fleshed out and ready to be stabilized",
issue = "27721")]
diff --git a/src/libcore/sync/atomic.rs b/src/libcore/sync/atomic.rs
index 73d5abf1aed23..d311cb16b64d3 100644
--- a/src/libcore/sync/atomic.rs
+++ b/src/libcore/sync/atomic.rs
@@ -112,6 +112,8 @@
//! println!("live threads: {}", old_thread_count + 1);
//! ```
+// ignore-tidy-undocumented-unsafe
+
#![stable(feature = "rust1", since = "1.0.0")]
#![cfg_attr(not(target_has_atomic_load_store = "8"), allow(dead_code))]
#![cfg_attr(not(target_has_atomic_load_store = "8"), allow(unused_imports))]
diff --git a/src/libcore/tests/num/flt2dec/mod.rs b/src/libcore/tests/num/flt2dec/mod.rs
index c41d35efced6c..a35897e9bc1ac 100644
--- a/src/libcore/tests/num/flt2dec/mod.rs
+++ b/src/libcore/tests/num/flt2dec/mod.rs
@@ -85,6 +85,8 @@ fn ldexp_f64(a: f64, b: i32) -> f64 {
extern {
fn ldexp(x: f64, n: i32) -> f64;
}
+ // SAFETY: assuming a correct `ldexp` has been supplied, the given arguments cannot possibly
+ // cause undefined behavior
unsafe { ldexp(a, b) }
}
diff --git a/src/libcore/time.rs b/src/libcore/time.rs
index 5a0e4388e0325..57fc1a7b76075 100644
--- a/src/libcore/time.rs
+++ b/src/libcore/time.rs
@@ -920,7 +920,7 @@ impl fmt::Debug for Duration {
if end == 0 {
write!(f, "{}", integer_part)
} else {
- // We are only writing ASCII digits into the buffer and it was
+ // SAFETY: We are only writing ASCII digits into the buffer and it was
// initialized with '0's, so it contains valid UTF8.
let s = unsafe {
crate::str::from_utf8_unchecked(&buf[..end])
diff --git a/src/librustc/session/config.rs b/src/librustc/session/config.rs
index 2bcddeaf1962d..eb5654e80a82c 100644
--- a/src/librustc/session/config.rs
+++ b/src/librustc/session/config.rs
@@ -1800,7 +1800,7 @@ pub fn rustc_optgroups() -> Vec {
"",
"extern",
"Specify where an external rust library is located",
- "NAME=PATH",
+ "NAME[=PATH]",
),
opt::multi_s(
"",
@@ -2164,7 +2164,6 @@ fn collect_print_requests(
cg: &mut CodegenOptions,
dopts: &mut DebuggingOptions,
matches: &getopts::Matches,
- is_unstable_enabled: bool,
error_format: ErrorOutputType,
) -> Vec {
let mut prints = Vec::::new();
@@ -2206,7 +2205,7 @@ fn collect_print_requests(
"tls-models" => PrintRequest::TlsModels,
"native-static-libs" => PrintRequest::NativeStaticLibs,
"target-spec-json" => {
- if is_unstable_enabled {
+ if dopts.unstable_options {
PrintRequest::TargetSpec
} else {
early_error(
@@ -2370,7 +2369,6 @@ fn parse_externs(
matches: &getopts::Matches,
debugging_opts: &DebuggingOptions,
error_format: ErrorOutputType,
- is_unstable_enabled: bool,
) -> Externs {
if matches.opt_present("extern-private") && !debugging_opts.unstable_options {
early_error(
@@ -2392,13 +2390,6 @@ fn parse_externs(
let name = parts.next().unwrap_or_else(||
early_error(error_format, "--extern value must not be empty"));
let location = parts.next().map(|s| s.to_string());
- if location.is_none() && !is_unstable_enabled {
- early_error(
- error_format,
- "the `-Z unstable-options` flag must also be passed to \
- enable `--extern crate_name` without `=path`",
- );
- };
let entry = externs
.entry(name.to_owned())
@@ -2483,12 +2474,10 @@ pub fn build_session_options(matches: &getopts::Matches) -> Options {
);
}
- let is_unstable_enabled = nightly_options::is_unstable_enabled(matches);
let prints = collect_print_requests(
&mut cg,
&mut debugging_opts,
matches,
- is_unstable_enabled,
error_format,
);
@@ -2521,7 +2510,7 @@ pub fn build_session_options(matches: &getopts::Matches) -> Options {
);
}
- let externs = parse_externs(matches, &debugging_opts, error_format, is_unstable_enabled);
+ let externs = parse_externs(matches, &debugging_opts, error_format);
let crate_name = matches.opt_str("crate-name");
diff --git a/src/librustc/ty/codec.rs b/src/librustc/ty/codec.rs
index d5e7ac19263a0..b3ef3217ec6a0 100644
--- a/src/librustc/ty/codec.rs
+++ b/src/librustc/ty/codec.rs
@@ -76,7 +76,10 @@ pub fn encode_with_shorthand(encoder: &mut E,
// The shorthand encoding uses the same usize as the
// discriminant, with an offset so they can't conflict.
+ #[cfg(bootstrap)]
let discriminant = unsafe { intrinsics::discriminant_value(variant) };
+ #[cfg(not(bootstrap))]
+ let discriminant = intrinsics::discriminant_value(variant);
assert!(discriminant < SHORTHAND_OFFSET as u64);
let shorthand = start + SHORTHAND_OFFSET;
diff --git a/src/librustc_lint/builtin.rs b/src/librustc_lint/builtin.rs
index 867f5f76b59bc..c6fd1256a8e64 100644
--- a/src/librustc_lint/builtin.rs
+++ b/src/librustc_lint/builtin.rs
@@ -2052,7 +2052,8 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for InvalidValue {
);
err.span_label(expr.span,
"this code causes undefined behavior when executed");
- err.span_label(expr.span, "help: use `MaybeUninit` instead");
+ err.span_label(expr.span, "help: use `MaybeUninit` instead, \
+ and only call `assume_init` after initialization is done");
if let Some(span) = span {
err.span_note(span, &msg);
} else {
diff --git a/src/librustc_typeck/check/intrinsic.rs b/src/librustc_typeck/check/intrinsic.rs
index 33dc85fc68a2e..693f6f05fab28 100644
--- a/src/librustc_typeck/check/intrinsic.rs
+++ b/src/librustc_typeck/check/intrinsic.rs
@@ -67,11 +67,13 @@ fn equate_intrinsic_type<'tcx>(
pub fn intrinsic_operation_unsafety(intrinsic: &str) -> hir::Unsafety {
match intrinsic {
"size_of" | "min_align_of" | "needs_drop" | "caller_location" |
+ "size_of_val" | "min_align_of_val" |
"add_with_overflow" | "sub_with_overflow" | "mul_with_overflow" |
"wrapping_add" | "wrapping_sub" | "wrapping_mul" |
"saturating_add" | "saturating_sub" |
"rotate_left" | "rotate_right" |
"ctpop" | "ctlz" | "cttz" | "bswap" | "bitreverse" |
+ "discriminant_value" | "type_id" | "likely" | "unlikely" |
"minnumf32" | "minnumf64" | "maxnumf32" | "maxnumf64" | "type_name"
=> hir::Unsafety::Normal,
_ => hir::Unsafety::Unsafe,
diff --git a/src/librustdoc/config.rs b/src/librustdoc/config.rs
index 0b8d4d6c302f1..255d5f9f35dbf 100644
--- a/src/librustdoc/config.rs
+++ b/src/librustdoc/config.rs
@@ -615,10 +615,6 @@ fn parse_externs(matches: &getopts::Matches) -> Result {
let mut parts = arg.splitn(2, '=');
let name = parts.next().ok_or("--extern value must not be empty".to_string())?;
let location = parts.next().map(|s| s.to_string());
- if location.is_none() && !nightly_options::is_unstable_enabled(matches) {
- return Err("the `-Z unstable-options` flag must also be passed to \
- enable `--extern crate_name` without `=path`".to_string());
- }
let name = name.to_string();
// For Rustdoc purposes, we can treat all externs as public
externs.entry(name)
diff --git a/src/librustdoc/html/render.rs b/src/librustdoc/html/render.rs
index 29f0b99d8ee69..9a87bcc10db8e 100644
--- a/src/librustdoc/html/render.rs
+++ b/src/librustdoc/html/render.rs
@@ -1230,18 +1230,87 @@ impl AllTypes {
}
}
+#[derive(Debug)]
+enum Setting {
+ Section {
+ description: &'static str,
+ sub_settings: Vec,
+ },
+ Entry {
+ js_data_name: &'static str,
+ description: &'static str,
+ default_value: bool,
+ }
+}
+
+impl Setting {
+ fn display(&self) -> String {
+ match *self {
+ Setting::Section { ref description, ref sub_settings } => {
+ format!(
+ "",
+ description,
+ sub_settings.iter().map(|s| s.display()).collect::()
+ )
+ }
+ Setting::Entry { ref js_data_name, ref description, ref default_value } => {
+ format!(
+ "\
+
\
+ \
+ \
+ \
+
{}
\
+
",
+ js_data_name,
+ if *default_value { " checked" } else { "" },
+ description,
+ )
+ }
+ }
+ }
+}
+
+impl From<(&'static str, &'static str, bool)> for Setting {
+ fn from(values: (&'static str, &'static str, bool)) -> Setting {
+ Setting::Entry {
+ js_data_name: values.0,
+ description: values.1,
+ default_value: values.2,
+ }
+ }
+}
+
+impl> From<(&'static str, Vec)> for Setting {
+ fn from(values: (&'static str, Vec)) -> Setting {
+ Setting::Section {
+ description: values.0,
+ sub_settings: values.1.into_iter().map(|v| v.into()).collect::>(),
+ }
+ }
+}
+
fn settings(root_path: &str, suffix: &str) -> String {
// (id, explanation, default value)
- let settings = [
- ("item-declarations", "Auto-hide item declarations.", true),
- ("item-attributes", "Auto-hide item attributes.", true),
- ("trait-implementations", "Auto-hide trait implementations documentation",
- true),
- ("method-docs", "Auto-hide item methods' documentation", false),
+ let settings: &[Setting] = &[
+ ("Auto-hide item declarations", vec![
+ ("auto-hide-struct", "Auto-hide structs declaration", true),
+ ("auto-hide-enum", "Auto-hide enums declaration", false),
+ ("auto-hide-union", "Auto-hide unions declaration", true),
+ ("auto-hide-trait", "Auto-hide traits declaration", true),
+ ("auto-hide-macro", "Auto-hide macros declaration", false),
+ ]).into(),
+ ("auto-hide-attributes", "Auto-hide item attributes.", true).into(),
+ ("auto-hide-method-docs", "Auto-hide item methods' documentation", false).into(),
+ ("auto-hide-trait-implementations", "Auto-hide trait implementations documentation",
+ true).into(),
("go-to-only-result", "Directly go to item in search if there is only one result",
- false),
- ("line-numbers", "Show line numbers on code examples", false),
- ("disable-shortcuts", "Disable keyboard shortcuts", false),
+ false).into(),
+ ("line-numbers", "Show line numbers on code examples", false).into(),
+ ("disable-shortcuts", "Disable keyboard shortcuts", false).into(),
];
format!(
"\
@@ -1249,17 +1318,7 @@ fn settings(root_path: &str, suffix: &str) -> String {
\
{}
\
",
- settings.iter()
- .map(|(id, text, enabled)| {
- format!("\
-
\
- \
- \
- \
-
{}
\
-
", id, if *enabled { " checked" } else { "" }, text)
- })
- .collect::(),
+ settings.iter().map(|s| s.display()).collect::(),
root_path,
suffix)
}
diff --git a/src/librustdoc/html/static/main.js b/src/librustdoc/html/static/main.js
index 53e16978ff12b..87eb36aba1370 100644
--- a/src/librustdoc/html/static/main.js
+++ b/src/librustdoc/html/static/main.js
@@ -2118,7 +2118,7 @@ function getSearchElement() {
function autoCollapse(pageId, collapse) {
if (collapse) {
toggleAllDocs(pageId, true);
- } else if (getCurrentValue("rustdoc-trait-implementations") !== "false") {
+ } else if (getCurrentValue("rustdoc-auto-hide-trait-implementations") !== "false") {
var impl_list = document.getElementById("implementations-list");
if (impl_list !== null) {
@@ -2156,7 +2156,7 @@ function getSearchElement() {
}
var toggle = createSimpleToggle(false);
- var hideMethodDocs = getCurrentValue("rustdoc-method-docs") === "true";
+ var hideMethodDocs = getCurrentValue("rustdoc-auto-hide-method-docs") === "true";
var pageId = getPageId();
var func = function(e) {
@@ -2286,7 +2286,31 @@ function getSearchElement() {
return wrapper;
}
- var showItemDeclarations = getCurrentValue("rustdoc-item-declarations") === "false";
+ var currentType = document.getElementsByClassName("type-decl")[0];
+ var className = null;
+ if (currentType) {
+ currentType = currentType.getElementsByClassName("rust")[0];
+ if (currentType) {
+ currentType.classList.forEach(function(item) {
+ if (item !== "main") {
+ className = item;
+ return true;
+ }
+ });
+ }
+ }
+ var showItemDeclarations = getCurrentValue("rustdoc-auto-hide-" + className);
+ if (showItemDeclarations === null) {
+ if (className === "enum" || className === "macro") {
+ showItemDeclarations = "false";
+ } else if (className === "struct" || className === "union" || className === "trait") {
+ showItemDeclarations = "true";
+ } else {
+ // In case we found an unknown type, we just use the "parent" value.
+ showItemDeclarations = getCurrentValue("rustdoc-auto-hide-declarations");
+ }
+ }
+ showItemDeclarations = showItemDeclarations === "false";
function buildToggleWrapper(e) {
if (hasClass(e, "autohide")) {
var wrap = e.previousElementSibling;
@@ -2369,7 +2393,7 @@ function getSearchElement() {
// To avoid checking on "rustdoc-item-attributes" value on every loop...
var itemAttributesFunc = function() {};
- if (getCurrentValue("rustdoc-item-attributes") !== "false") {
+ if (getCurrentValue("rustdoc-auto-hide-attributes") !== "false") {
itemAttributesFunc = function(x) {
collapseDocs(x.previousSibling.childNodes[0], "toggle");
};
diff --git a/src/librustdoc/html/static/settings.css b/src/librustdoc/html/static/settings.css
index b31ad96fa545f..d03cf7fcc459e 100644
--- a/src/librustdoc/html/static/settings.css
+++ b/src/librustdoc/html/static/settings.css
@@ -1,5 +1,6 @@
.setting-line {
padding: 5px;
+ position: relative;
}
.setting-line > div {
@@ -10,6 +11,13 @@
padding-top: 2px;
}
+.setting-line > .title {
+ font-size: 19px;
+ width: 100%;
+ max-width: none;
+ border-bottom: 1px solid;
+}
+
.toggle {
position: relative;
display: inline-block;
@@ -59,3 +67,9 @@ input:checked + .slider:before {
-ms-transform: translateX(19px);
transform: translateX(19px);
}
+
+.setting-line > .sub-settings {
+ padding-left: 42px;
+ width: 100%;
+ display: block;
+}
diff --git a/src/librustdoc/html/static/themes/dark.css b/src/librustdoc/html/static/themes/dark.css
index c3116dbe7a242..a60d543a53936 100644
--- a/src/librustdoc/html/static/themes/dark.css
+++ b/src/librustdoc/html/static/themes/dark.css
@@ -425,3 +425,6 @@ div.files > a:hover, div.name:hover {
div.files > .selected {
background-color: #333;
}
+.setting-line > .title {
+ border-bottom-color: #ddd;
+}
diff --git a/src/librustdoc/html/static/themes/light.css b/src/librustdoc/html/static/themes/light.css
index e2bf9f9d2f23a..351f027b942ff 100644
--- a/src/librustdoc/html/static/themes/light.css
+++ b/src/librustdoc/html/static/themes/light.css
@@ -419,3 +419,6 @@ div.files > a:hover, div.name:hover {
div.files > .selected {
background-color: #fff;
}
+.setting-line > .title {
+ border-bottom-color: #D5D5D5;
+}
diff --git a/src/librustdoc/lib.rs b/src/librustdoc/lib.rs
index 8cd32a3d1b508..13b8809e23e40 100644
--- a/src/librustdoc/lib.rs
+++ b/src/librustdoc/lib.rs
@@ -140,7 +140,7 @@ fn opts() -> Vec {
}),
stable("cfg", |o| o.optmulti("", "cfg", "pass a --cfg to rustc", "")),
stable("extern", |o| {
- o.optmulti("", "extern", "pass an --extern to rustc", "NAME=PATH")
+ o.optmulti("", "extern", "pass an --extern to rustc", "NAME[=PATH]")
}),
unstable("extern-html-root-url", |o| {
o.optmulti("", "extern-html-root-url",
diff --git a/src/test/run-make-fulldeps/extern-flag-fun/Makefile b/src/test/run-make-fulldeps/extern-flag-fun/Makefile
index a9f2585335003..38d1d5bb8488a 100644
--- a/src/test/run-make-fulldeps/extern-flag-fun/Makefile
+++ b/src/test/run-make-fulldeps/extern-flag-fun/Makefile
@@ -4,7 +4,6 @@ all:
$(RUSTC) bar.rs --crate-type=rlib
$(RUSTC) bar.rs --crate-type=rlib -C extra-filename=-a
$(RUSTC) bar-alt.rs --crate-type=rlib
- $(RUSTC) foo.rs --extern hello && exit 1 || exit 0
$(RUSTC) foo.rs --extern bar=no-exist && exit 1 || exit 0
$(RUSTC) foo.rs --extern bar=foo.rs && exit 1 || exit 0
$(RUSTC) foo.rs \
@@ -15,3 +14,6 @@ all:
--extern bar=$(TMPDIR)/libbar.rlib \
--extern bar=$(TMPDIR)/libbar-a.rlib
$(RUSTC) foo.rs --extern bar=$(TMPDIR)/libbar.rlib
+ # Try to be sneaky and load a private crate from with a non-private name.
+ $(RUSTC) rustc.rs -Zforce-unstable-if-unmarked --crate-type=rlib
+ $(RUSTC) gated_unstable.rs --extern alloc=$(TMPDIR)/librustc.rlib 2>&1 | $(CGREP) 'rustc_private'
diff --git a/src/test/run-make-fulldeps/extern-flag-fun/gated_unstable.rs b/src/test/run-make-fulldeps/extern-flag-fun/gated_unstable.rs
new file mode 100644
index 0000000000000..03600c830fff6
--- /dev/null
+++ b/src/test/run-make-fulldeps/extern-flag-fun/gated_unstable.rs
@@ -0,0 +1,3 @@
+extern crate alloc;
+
+fn main() {}
diff --git a/src/test/run-make-fulldeps/extern-flag-fun/rustc.rs b/src/test/run-make-fulldeps/extern-flag-fun/rustc.rs
new file mode 100644
index 0000000000000..b76b4321d62aa
--- /dev/null
+++ b/src/test/run-make-fulldeps/extern-flag-fun/rustc.rs
@@ -0,0 +1 @@
+pub fn foo() {}
diff --git a/src/test/run-make-fulldeps/extern-flag-pathless/Makefile b/src/test/run-make-fulldeps/extern-flag-pathless/Makefile
new file mode 100644
index 0000000000000..4849fc62f4a95
--- /dev/null
+++ b/src/test/run-make-fulldeps/extern-flag-pathless/Makefile
@@ -0,0 +1,18 @@
+-include ../tools.mk
+
+# Test mixing pathless --extern with paths.
+
+all:
+ $(RUSTC) bar-static.rs --crate-name=bar --crate-type=rlib
+ $(RUSTC) bar-dynamic.rs --crate-name=bar --crate-type=dylib -C prefer-dynamic
+ # rlib preferred over dylib
+ $(RUSTC) foo.rs --extern bar
+ $(call RUN,foo) | $(CGREP) 'static'
+ $(RUSTC) foo.rs --extern bar=$(TMPDIR)/libbar.rlib --extern bar
+ $(call RUN,foo) | $(CGREP) 'static'
+ # explicit --extern overrides pathless
+ $(RUSTC) foo.rs --extern bar=$(call DYLIB,bar) --extern bar
+ $(call RUN,foo) | $(CGREP) 'dynamic'
+ # prefer-dynamic does what it says
+ $(RUSTC) foo.rs --extern bar -C prefer-dynamic
+ $(call RUN,foo) | $(CGREP) 'dynamic'
diff --git a/src/test/run-make-fulldeps/extern-flag-pathless/bar-dynamic.rs b/src/test/run-make-fulldeps/extern-flag-pathless/bar-dynamic.rs
new file mode 100644
index 0000000000000..e2d68d517ff97
--- /dev/null
+++ b/src/test/run-make-fulldeps/extern-flag-pathless/bar-dynamic.rs
@@ -0,0 +1,3 @@
+pub fn f() {
+ println!("dynamic");
+}
diff --git a/src/test/run-make-fulldeps/extern-flag-pathless/bar-static.rs b/src/test/run-make-fulldeps/extern-flag-pathless/bar-static.rs
new file mode 100644
index 0000000000000..240d8bde4d186
--- /dev/null
+++ b/src/test/run-make-fulldeps/extern-flag-pathless/bar-static.rs
@@ -0,0 +1,3 @@
+pub fn f() {
+ println!("static");
+}
diff --git a/src/test/run-make-fulldeps/extern-flag-pathless/foo.rs b/src/test/run-make-fulldeps/extern-flag-pathless/foo.rs
new file mode 100644
index 0000000000000..1ea64da7dad26
--- /dev/null
+++ b/src/test/run-make-fulldeps/extern-flag-pathless/foo.rs
@@ -0,0 +1,3 @@
+fn main() {
+ bar::f();
+}
diff --git a/src/test/run-make-fulldeps/save-analysis-rfc2126/Makefile b/src/test/run-make-fulldeps/save-analysis-rfc2126/Makefile
index bf98fcd10cfde..36288c4b870e7 100644
--- a/src/test/run-make-fulldeps/save-analysis-rfc2126/Makefile
+++ b/src/test/run-make-fulldeps/save-analysis-rfc2126/Makefile
@@ -1,8 +1,7 @@
-include ../tools.mk
all: extern_absolute_paths.rs krate2
- $(RUSTC) extern_absolute_paths.rs -Zsave-analysis --edition=2018 \
- -Z unstable-options --extern krate2
+ $(RUSTC) extern_absolute_paths.rs -Zsave-analysis --edition=2018 --extern krate2
cat $(TMPDIR)/save-analysis/extern_absolute_paths.json | "$(PYTHON)" validate_json.py
krate2: krate2.rs
diff --git a/src/test/rustdoc/inline_cross/use_crate.rs b/src/test/rustdoc/inline_cross/use_crate.rs
index f678ba0a46c0d..00e0f041c56fe 100644
--- a/src/test/rustdoc/inline_cross/use_crate.rs
+++ b/src/test/rustdoc/inline_cross/use_crate.rs
@@ -2,7 +2,7 @@
// aux-build:use_crate_2.rs
// build-aux-docs
// edition:2018
-// compile-flags:--extern use_crate --extern use_crate_2 -Z unstable-options
+// compile-flags:--extern use_crate --extern use_crate_2
// During the buildup to Rust 2018, rustdoc would eagerly inline `pub use some_crate;` as if it
// were a module, so we changed it to make `pub use`ing crate roots remain as a `pub use` statement
diff --git a/src/test/ui-fulldeps/pathless-extern-unstable.rs b/src/test/ui-fulldeps/pathless-extern-unstable.rs
new file mode 100644
index 0000000000000..00b3ec5409ff0
--- /dev/null
+++ b/src/test/ui-fulldeps/pathless-extern-unstable.rs
@@ -0,0 +1,10 @@
+// ignore-stage1
+// edition:2018
+// compile-flags:--extern rustc
+
+// Test that `--extern rustc` fails with `rustc_private`.
+
+pub use rustc;
+//~^ ERROR use of unstable library feature 'rustc_private'
+
+fn main() {}
diff --git a/src/test/ui-fulldeps/pathless-extern-unstable.stderr b/src/test/ui-fulldeps/pathless-extern-unstable.stderr
new file mode 100644
index 0000000000000..edc3b1c58be22
--- /dev/null
+++ b/src/test/ui-fulldeps/pathless-extern-unstable.stderr
@@ -0,0 +1,12 @@
+error[E0658]: use of unstable library feature 'rustc_private': this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via `Cargo.toml` instead?
+ --> $DIR/pathless-extern-unstable.rs:7:9
+ |
+LL | pub use rustc;
+ | ^^^^^
+ |
+ = note: for more information, see https://github.com/rust-lang/rust/issues/27812
+ = help: add `#![feature(rustc_private)]` to the crate attributes to enable
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0658`.
diff --git a/src/test/ui/async-await/issues/issue-62009-1.rs b/src/test/ui/async-await/issues/issue-62009-1.rs
index 788474365c9e5..e95f7df388c45 100644
--- a/src/test/ui/async-await/issues/issue-62009-1.rs
+++ b/src/test/ui/async-await/issues/issue-62009-1.rs
@@ -1,6 +1,5 @@
// edition:2018
-// ignore-x86
-// ^ due to stderr output differences
+// ignore-x86 FIXME: missing sysroot spans (#53081)
async fn print_dur() {}
diff --git a/src/test/ui/async-await/issues/issue-62009-1.stderr b/src/test/ui/async-await/issues/issue-62009-1.stderr
index 538430290d299..6c8e0d0a5c403 100644
--- a/src/test/ui/async-await/issues/issue-62009-1.stderr
+++ b/src/test/ui/async-await/issues/issue-62009-1.stderr
@@ -1,5 +1,5 @@
error[E0728]: `await` is only allowed inside `async` functions and blocks
- --> $DIR/issue-62009-1.rs:8:5
+ --> $DIR/issue-62009-1.rs:7:5
|
LL | fn main() {
| ---- this is not `async`
@@ -7,7 +7,7 @@ LL | async { let (); }.await;
| ^^^^^^^^^^^^^^^^^^^^^^^ only allowed inside `async` functions and blocks
error[E0728]: `await` is only allowed inside `async` functions and blocks
- --> $DIR/issue-62009-1.rs:10:5
+ --> $DIR/issue-62009-1.rs:9:5
|
LL | fn main() {
| ---- this is not `async`
@@ -19,7 +19,7 @@ LL | | }.await;
| |___________^ only allowed inside `async` functions and blocks
error[E0728]: `await` is only allowed inside `async` functions and blocks
- --> $DIR/issue-62009-1.rs:14:5
+ --> $DIR/issue-62009-1.rs:13:5
|
LL | fn main() {
| ---- this is not `async`
@@ -27,11 +27,11 @@ LL | fn main() {
LL | (|_| 2333).await;
| ^^^^^^^^^^^^^^^^ only allowed inside `async` functions and blocks
-error[E0277]: the trait bound `[closure@$DIR/issue-62009-1.rs:14:5: 14:15]: std::future::Future` is not satisfied
- --> $DIR/issue-62009-1.rs:14:5
+error[E0277]: the trait bound `[closure@$DIR/issue-62009-1.rs:13:5: 13:15]: std::future::Future` is not satisfied
+ --> $DIR/issue-62009-1.rs:13:5
|
LL | (|_| 2333).await;
- | ^^^^^^^^^^^^^^^^ the trait `std::future::Future` is not implemented for `[closure@$DIR/issue-62009-1.rs:14:5: 14:15]`
+ | ^^^^^^^^^^^^^^^^ the trait `std::future::Future` is not implemented for `[closure@$DIR/issue-62009-1.rs:13:5: 13:15]`
|
::: $SRC_DIR/libstd/future.rs:LL:COL
|
diff --git a/src/test/ui/closures/closure-move-sync.rs b/src/test/ui/closures/closure-move-sync.rs
index 951a3bcb5f423..2f1e6c81ae5a8 100644
--- a/src/test/ui/closures/closure-move-sync.rs
+++ b/src/test/ui/closures/closure-move-sync.rs
@@ -1,5 +1,4 @@
-// ignore-x86
-// ^ due to stderr output differences
+// ignore-x86 FIXME: missing sysroot spans (#53081)
use std::thread;
use std::sync::mpsc::channel;
diff --git a/src/test/ui/closures/closure-move-sync.stderr b/src/test/ui/closures/closure-move-sync.stderr
index f676df9c559eb..ac5e3ccb42187 100644
--- a/src/test/ui/closures/closure-move-sync.stderr
+++ b/src/test/ui/closures/closure-move-sync.stderr
@@ -1,5 +1,5 @@
error[E0277]: `std::sync::mpsc::Receiver<()>` cannot be shared between threads safely
- --> $DIR/closure-move-sync.rs:8:13
+ --> $DIR/closure-move-sync.rs:7:13
|
LL | let t = thread::spawn(|| {
| ^^^^^^^^^^^^^ `std::sync::mpsc::Receiver<()>` cannot be shared between threads safely
@@ -11,10 +11,10 @@ LL | F: FnOnce() -> T, F: Send + 'static, T: Send + 'static
|
= help: the trait `std::marker::Sync` is not implemented for `std::sync::mpsc::Receiver<()>`
= note: required because of the requirements on the impl of `std::marker::Send` for `&std::sync::mpsc::Receiver<()>`
- = note: required because it appears within the type `[closure@$DIR/closure-move-sync.rs:8:27: 11:6 recv:&std::sync::mpsc::Receiver<()>]`
+ = note: required because it appears within the type `[closure@$DIR/closure-move-sync.rs:7:27: 10:6 recv:&std::sync::mpsc::Receiver<()>]`
error[E0277]: `std::sync::mpsc::Sender<()>` cannot be shared between threads safely
- --> $DIR/closure-move-sync.rs:20:5
+ --> $DIR/closure-move-sync.rs:19:5
|
LL | thread::spawn(|| tx.send(()).unwrap());
| ^^^^^^^^^^^^^ `std::sync::mpsc::Sender<()>` cannot be shared between threads safely
@@ -26,7 +26,7 @@ LL | F: FnOnce() -> T, F: Send + 'static, T: Send + 'static
|
= help: the trait `std::marker::Sync` is not implemented for `std::sync::mpsc::Sender<()>`
= note: required because of the requirements on the impl of `std::marker::Send` for `&std::sync::mpsc::Sender<()>`
- = note: required because it appears within the type `[closure@$DIR/closure-move-sync.rs:20:19: 20:42 tx:&std::sync::mpsc::Sender<()>]`
+ = note: required because it appears within the type `[closure@$DIR/closure-move-sync.rs:19:19: 19:42 tx:&std::sync::mpsc::Sender<()>]`
error: aborting due to 2 previous errors
diff --git a/src/test/ui/consts/const-size_of-cycle.rs b/src/test/ui/consts/const-size_of-cycle.rs
index 1bbe881872cb3..6c35b9212c6cb 100644
--- a/src/test/ui/consts/const-size_of-cycle.rs
+++ b/src/test/ui/consts/const-size_of-cycle.rs
@@ -1,5 +1,4 @@
-// ignore-musl
-// ignore-x86
+// ignore-x86 FIXME: missing sysroot spans (#53081)
// error-pattern: cycle detected
struct Foo {
diff --git a/src/test/ui/consts/const-size_of-cycle.stderr b/src/test/ui/consts/const-size_of-cycle.stderr
index 1ae39e7563a82..5b06ade44c5cb 100644
--- a/src/test/ui/consts/const-size_of-cycle.stderr
+++ b/src/test/ui/consts/const-size_of-cycle.stderr
@@ -1,11 +1,11 @@
error[E0391]: cycle detected when const-evaluating + checking `Foo::bytes::{{constant}}#0`
- --> $DIR/const-size_of-cycle.rs:6:17
+ --> $DIR/const-size_of-cycle.rs:5:17
|
LL | bytes: [u8; std::mem::size_of::()]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
note: ...which requires const-evaluating + checking `Foo::bytes::{{constant}}#0`...
- --> $DIR/const-size_of-cycle.rs:6:17
+ --> $DIR/const-size_of-cycle.rs:5:17
|
LL | bytes: [u8; std::mem::size_of::()]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -23,7 +23,7 @@ LL | pub fn size_of() -> usize;
= note: ...which requires normalizing `ParamEnvAnd { param_env: ParamEnv { caller_bounds: [], reveal: All, def_id: None }, value: [u8; _] }`...
= note: ...which again requires const-evaluating + checking `Foo::bytes::{{constant}}#0`, completing the cycle
note: cycle used when processing `Foo`
- --> $DIR/const-size_of-cycle.rs:5:1
+ --> $DIR/const-size_of-cycle.rs:4:1
|
LL | struct Foo {
| ^^^^^^^^^^
diff --git a/src/test/ui/derives/derives-span-Clone-enum-struct-variant.rs b/src/test/ui/derives/derives-span-Clone-enum-struct-variant.rs
index b556d442420e0..da00f81b96ead 100644
--- a/src/test/ui/derives/derives-span-Clone-enum-struct-variant.rs
+++ b/src/test/ui/derives/derives-span-Clone-enum-struct-variant.rs
@@ -1,3 +1,4 @@
+// ignore-x86 FIXME: missing sysroot spans (#53081)
// This file was auto-generated using 'src/etc/generate-deriving-span-tests.py'
diff --git a/src/test/ui/derives/derives-span-Clone-enum-struct-variant.stderr b/src/test/ui/derives/derives-span-Clone-enum-struct-variant.stderr
index 7db5fbe3de402..796e6a2b744f7 100644
--- a/src/test/ui/derives/derives-span-Clone-enum-struct-variant.stderr
+++ b/src/test/ui/derives/derives-span-Clone-enum-struct-variant.stderr
@@ -1,5 +1,5 @@
error[E0277]: the trait bound `Error: std::clone::Clone` is not satisfied
- --> $DIR/derives-span-Clone-enum-struct-variant.rs:9:6
+ --> $DIR/derives-span-Clone-enum-struct-variant.rs:10:6
|
LL | x: Error
| ^^^^^^^^ the trait `std::clone::Clone` is not implemented for `Error`
diff --git a/src/test/ui/derives/derives-span-Clone-enum.rs b/src/test/ui/derives/derives-span-Clone-enum.rs
index 9bb4f486c3ef0..98ae1b2c5b8a2 100644
--- a/src/test/ui/derives/derives-span-Clone-enum.rs
+++ b/src/test/ui/derives/derives-span-Clone-enum.rs
@@ -1,3 +1,4 @@
+// ignore-x86 FIXME: missing sysroot spans (#53081)
// This file was auto-generated using 'src/etc/generate-deriving-span-tests.py'
diff --git a/src/test/ui/derives/derives-span-Clone-enum.stderr b/src/test/ui/derives/derives-span-Clone-enum.stderr
index 4371dc900ac10..3e94bb551ea97 100644
--- a/src/test/ui/derives/derives-span-Clone-enum.stderr
+++ b/src/test/ui/derives/derives-span-Clone-enum.stderr
@@ -1,5 +1,5 @@
error[E0277]: the trait bound `Error: std::clone::Clone` is not satisfied
- --> $DIR/derives-span-Clone-enum.rs:9:6
+ --> $DIR/derives-span-Clone-enum.rs:10:6
|
LL | Error
| ^^^^^ the trait `std::clone::Clone` is not implemented for `Error`
diff --git a/src/test/ui/derives/derives-span-Clone-struct.rs b/src/test/ui/derives/derives-span-Clone-struct.rs
index f151636f848a0..db677e26f5049 100644
--- a/src/test/ui/derives/derives-span-Clone-struct.rs
+++ b/src/test/ui/derives/derives-span-Clone-struct.rs
@@ -1,3 +1,4 @@
+// ignore-x86 FIXME: missing sysroot spans (#53081)
// This file was auto-generated using 'src/etc/generate-deriving-span-tests.py'
diff --git a/src/test/ui/derives/derives-span-Clone-struct.stderr b/src/test/ui/derives/derives-span-Clone-struct.stderr
index cc3b602c9c0b9..0674d64fe9dfe 100644
--- a/src/test/ui/derives/derives-span-Clone-struct.stderr
+++ b/src/test/ui/derives/derives-span-Clone-struct.stderr
@@ -1,5 +1,5 @@
error[E0277]: the trait bound `Error: std::clone::Clone` is not satisfied
- --> $DIR/derives-span-Clone-struct.rs:8:5
+ --> $DIR/derives-span-Clone-struct.rs:9:5
|
LL | x: Error
| ^^^^^^^^ the trait `std::clone::Clone` is not implemented for `Error`
diff --git a/src/test/ui/derives/derives-span-Clone-tuple-struct.rs b/src/test/ui/derives/derives-span-Clone-tuple-struct.rs
index 7a62885324ebd..d716b6fe900ca 100644
--- a/src/test/ui/derives/derives-span-Clone-tuple-struct.rs
+++ b/src/test/ui/derives/derives-span-Clone-tuple-struct.rs
@@ -1,3 +1,4 @@
+// ignore-x86 FIXME: missing sysroot spans (#53081)
// This file was auto-generated using 'src/etc/generate-deriving-span-tests.py'
diff --git a/src/test/ui/derives/derives-span-Clone-tuple-struct.stderr b/src/test/ui/derives/derives-span-Clone-tuple-struct.stderr
index b2bf3527b0cc4..f6b4006014a3a 100644
--- a/src/test/ui/derives/derives-span-Clone-tuple-struct.stderr
+++ b/src/test/ui/derives/derives-span-Clone-tuple-struct.stderr
@@ -1,5 +1,5 @@
error[E0277]: the trait bound `Error: std::clone::Clone` is not satisfied
- --> $DIR/derives-span-Clone-tuple-struct.rs:8:5
+ --> $DIR/derives-span-Clone-tuple-struct.rs:9:5
|
LL | Error
| ^^^^^ the trait `std::clone::Clone` is not implemented for `Error`
diff --git a/src/test/ui/derives/derives-span-Debug-enum-struct-variant.rs b/src/test/ui/derives/derives-span-Debug-enum-struct-variant.rs
index 949597bc8f6ee..10deccb8ad7c1 100644
--- a/src/test/ui/derives/derives-span-Debug-enum-struct-variant.rs
+++ b/src/test/ui/derives/derives-span-Debug-enum-struct-variant.rs
@@ -1,3 +1,4 @@
+// ignore-x86 FIXME: missing sysroot spans (#53081)
// This file was auto-generated using 'src/etc/generate-deriving-span-tests.py'
diff --git a/src/test/ui/derives/derives-span-Debug-enum-struct-variant.stderr b/src/test/ui/derives/derives-span-Debug-enum-struct-variant.stderr
index ca5bcfe930d61..6a0e382b9e545 100644
--- a/src/test/ui/derives/derives-span-Debug-enum-struct-variant.stderr
+++ b/src/test/ui/derives/derives-span-Debug-enum-struct-variant.stderr
@@ -1,5 +1,5 @@
error[E0277]: `Error` doesn't implement `std::fmt::Debug`
- --> $DIR/derives-span-Debug-enum-struct-variant.rs:9:6
+ --> $DIR/derives-span-Debug-enum-struct-variant.rs:10:6
|
LL | x: Error
| ^^^^^^^^ `Error` cannot be formatted using `{:?}`
diff --git a/src/test/ui/derives/derives-span-Debug-enum.rs b/src/test/ui/derives/derives-span-Debug-enum.rs
index b2a39708ceb9a..b8bed0eab552e 100644
--- a/src/test/ui/derives/derives-span-Debug-enum.rs
+++ b/src/test/ui/derives/derives-span-Debug-enum.rs
@@ -1,3 +1,4 @@
+// ignore-x86 FIXME: missing sysroot spans (#53081)
// This file was auto-generated using 'src/etc/generate-deriving-span-tests.py'
diff --git a/src/test/ui/derives/derives-span-Debug-enum.stderr b/src/test/ui/derives/derives-span-Debug-enum.stderr
index cd367a334fc60..f27499ba441a0 100644
--- a/src/test/ui/derives/derives-span-Debug-enum.stderr
+++ b/src/test/ui/derives/derives-span-Debug-enum.stderr
@@ -1,5 +1,5 @@
error[E0277]: `Error` doesn't implement `std::fmt::Debug`
- --> $DIR/derives-span-Debug-enum.rs:9:6
+ --> $DIR/derives-span-Debug-enum.rs:10:6
|
LL | Error
| ^^^^^ `Error` cannot be formatted using `{:?}`
diff --git a/src/test/ui/derives/derives-span-Debug-struct.rs b/src/test/ui/derives/derives-span-Debug-struct.rs
index cf91c9436a623..22f037ee36f24 100644
--- a/src/test/ui/derives/derives-span-Debug-struct.rs
+++ b/src/test/ui/derives/derives-span-Debug-struct.rs
@@ -1,3 +1,4 @@
+// ignore-x86 FIXME: missing sysroot spans (#53081)
// This file was auto-generated using 'src/etc/generate-deriving-span-tests.py'
diff --git a/src/test/ui/derives/derives-span-Debug-struct.stderr b/src/test/ui/derives/derives-span-Debug-struct.stderr
index e00695ec0ba62..09d62f12b0449 100644
--- a/src/test/ui/derives/derives-span-Debug-struct.stderr
+++ b/src/test/ui/derives/derives-span-Debug-struct.stderr
@@ -1,5 +1,5 @@
error[E0277]: `Error` doesn't implement `std::fmt::Debug`
- --> $DIR/derives-span-Debug-struct.rs:8:5
+ --> $DIR/derives-span-Debug-struct.rs:9:5
|
LL | x: Error
| ^^^^^^^^ `Error` cannot be formatted using `{:?}`
diff --git a/src/test/ui/derives/derives-span-Debug-tuple-struct.rs b/src/test/ui/derives/derives-span-Debug-tuple-struct.rs
index cea973c91a783..c693facfeaa92 100644
--- a/src/test/ui/derives/derives-span-Debug-tuple-struct.rs
+++ b/src/test/ui/derives/derives-span-Debug-tuple-struct.rs
@@ -1,3 +1,4 @@
+// ignore-x86 FIXME: missing sysroot spans (#53081)
// This file was auto-generated using 'src/etc/generate-deriving-span-tests.py'
diff --git a/src/test/ui/derives/derives-span-Debug-tuple-struct.stderr b/src/test/ui/derives/derives-span-Debug-tuple-struct.stderr
index 37440b59ae704..f100cf32fdf85 100644
--- a/src/test/ui/derives/derives-span-Debug-tuple-struct.stderr
+++ b/src/test/ui/derives/derives-span-Debug-tuple-struct.stderr
@@ -1,5 +1,5 @@
error[E0277]: `Error` doesn't implement `std::fmt::Debug`
- --> $DIR/derives-span-Debug-tuple-struct.rs:8:5
+ --> $DIR/derives-span-Debug-tuple-struct.rs:9:5
|
LL | Error
| ^^^^^ `Error` cannot be formatted using `{:?}`
diff --git a/src/test/ui/derives/derives-span-Default-struct.rs b/src/test/ui/derives/derives-span-Default-struct.rs
index 71fd5829e7585..1654883998def 100644
--- a/src/test/ui/derives/derives-span-Default-struct.rs
+++ b/src/test/ui/derives/derives-span-Default-struct.rs
@@ -1,3 +1,4 @@
+// ignore-x86 FIXME: missing sysroot spans (#53081)
// This file was auto-generated using 'src/etc/generate-deriving-span-tests.py'
diff --git a/src/test/ui/derives/derives-span-Default-struct.stderr b/src/test/ui/derives/derives-span-Default-struct.stderr
index 413d4ec8c291a..11664d400ee71 100644
--- a/src/test/ui/derives/derives-span-Default-struct.stderr
+++ b/src/test/ui/derives/derives-span-Default-struct.stderr
@@ -1,5 +1,5 @@
error[E0277]: the trait bound `Error: std::default::Default` is not satisfied
- --> $DIR/derives-span-Default-struct.rs:8:5
+ --> $DIR/derives-span-Default-struct.rs:9:5
|
LL | x: Error
| ^^^^^^^^ the trait `std::default::Default` is not implemented for `Error`
diff --git a/src/test/ui/derives/derives-span-Default-tuple-struct.rs b/src/test/ui/derives/derives-span-Default-tuple-struct.rs
index 463f7d230ca41..f1390c8b6f6b5 100644
--- a/src/test/ui/derives/derives-span-Default-tuple-struct.rs
+++ b/src/test/ui/derives/derives-span-Default-tuple-struct.rs
@@ -1,3 +1,4 @@
+// ignore-x86 FIXME: missing sysroot spans (#53081)
// This file was auto-generated using 'src/etc/generate-deriving-span-tests.py'
diff --git a/src/test/ui/derives/derives-span-Default-tuple-struct.stderr b/src/test/ui/derives/derives-span-Default-tuple-struct.stderr
index 8f4d43daa5191..c79f093942fdd 100644
--- a/src/test/ui/derives/derives-span-Default-tuple-struct.stderr
+++ b/src/test/ui/derives/derives-span-Default-tuple-struct.stderr
@@ -1,5 +1,5 @@
error[E0277]: the trait bound `Error: std::default::Default` is not satisfied
- --> $DIR/derives-span-Default-tuple-struct.rs:8:5
+ --> $DIR/derives-span-Default-tuple-struct.rs:9:5
|
LL | Error
| ^^^^^ the trait `std::default::Default` is not implemented for `Error`
diff --git a/src/test/ui/derives/derives-span-Eq-enum-struct-variant.rs b/src/test/ui/derives/derives-span-Eq-enum-struct-variant.rs
index d2dab8687f774..77c386d7f9094 100644
--- a/src/test/ui/derives/derives-span-Eq-enum-struct-variant.rs
+++ b/src/test/ui/derives/derives-span-Eq-enum-struct-variant.rs
@@ -1,3 +1,4 @@
+// ignore-x86 FIXME: missing sysroot spans (#53081)
// This file was auto-generated using 'src/etc/generate-deriving-span-tests.py'
#[derive(PartialEq)]
diff --git a/src/test/ui/derives/derives-span-Eq-enum-struct-variant.stderr b/src/test/ui/derives/derives-span-Eq-enum-struct-variant.stderr
index 52ecce4632d12..87c0313ca1fc6 100644
--- a/src/test/ui/derives/derives-span-Eq-enum-struct-variant.stderr
+++ b/src/test/ui/derives/derives-span-Eq-enum-struct-variant.stderr
@@ -1,5 +1,5 @@
error[E0277]: the trait bound `Error: std::cmp::Eq` is not satisfied
- --> $DIR/derives-span-Eq-enum-struct-variant.rs:9:6
+ --> $DIR/derives-span-Eq-enum-struct-variant.rs:10:6
|
LL | x: Error
| ^^^^^^^^ the trait `std::cmp::Eq` is not implemented for `Error`
diff --git a/src/test/ui/derives/derives-span-Eq-enum.rs b/src/test/ui/derives/derives-span-Eq-enum.rs
index c6c0d4321083b..c7fe37813325d 100644
--- a/src/test/ui/derives/derives-span-Eq-enum.rs
+++ b/src/test/ui/derives/derives-span-Eq-enum.rs
@@ -1,3 +1,4 @@
+// ignore-x86 FIXME: missing sysroot spans (#53081)
// This file was auto-generated using 'src/etc/generate-deriving-span-tests.py'
#[derive(PartialEq)]
diff --git a/src/test/ui/derives/derives-span-Eq-enum.stderr b/src/test/ui/derives/derives-span-Eq-enum.stderr
index bf91a0edc375b..c8db6d3ff2f7b 100644
--- a/src/test/ui/derives/derives-span-Eq-enum.stderr
+++ b/src/test/ui/derives/derives-span-Eq-enum.stderr
@@ -1,5 +1,5 @@
error[E0277]: the trait bound `Error: std::cmp::Eq` is not satisfied
- --> $DIR/derives-span-Eq-enum.rs:9:6
+ --> $DIR/derives-span-Eq-enum.rs:10:6
|
LL | Error
| ^^^^^ the trait `std::cmp::Eq` is not implemented for `Error`
diff --git a/src/test/ui/derives/derives-span-Eq-struct.rs b/src/test/ui/derives/derives-span-Eq-struct.rs
index df310039847d4..8674cadb3092d 100644
--- a/src/test/ui/derives/derives-span-Eq-struct.rs
+++ b/src/test/ui/derives/derives-span-Eq-struct.rs
@@ -1,3 +1,4 @@
+// ignore-x86 FIXME: missing sysroot spans (#53081)
// This file was auto-generated using 'src/etc/generate-deriving-span-tests.py'
#[derive(PartialEq)]
diff --git a/src/test/ui/derives/derives-span-Eq-struct.stderr b/src/test/ui/derives/derives-span-Eq-struct.stderr
index 531e8887cd2bc..df4ea5b1d4144 100644
--- a/src/test/ui/derives/derives-span-Eq-struct.stderr
+++ b/src/test/ui/derives/derives-span-Eq-struct.stderr
@@ -1,5 +1,5 @@
error[E0277]: the trait bound `Error: std::cmp::Eq` is not satisfied
- --> $DIR/derives-span-Eq-struct.rs:8:5
+ --> $DIR/derives-span-Eq-struct.rs:9:5
|
LL | x: Error
| ^^^^^^^^ the trait `std::cmp::Eq` is not implemented for `Error`
diff --git a/src/test/ui/derives/derives-span-Eq-tuple-struct.rs b/src/test/ui/derives/derives-span-Eq-tuple-struct.rs
index abf6526b90078..99cc9582b5b60 100644
--- a/src/test/ui/derives/derives-span-Eq-tuple-struct.rs
+++ b/src/test/ui/derives/derives-span-Eq-tuple-struct.rs
@@ -1,3 +1,4 @@
+// ignore-x86 FIXME: missing sysroot spans (#53081)
// This file was auto-generated using 'src/etc/generate-deriving-span-tests.py'
#[derive(PartialEq)]
diff --git a/src/test/ui/derives/derives-span-Eq-tuple-struct.stderr b/src/test/ui/derives/derives-span-Eq-tuple-struct.stderr
index 9e21c6c67bfc7..def06d710867f 100644
--- a/src/test/ui/derives/derives-span-Eq-tuple-struct.stderr
+++ b/src/test/ui/derives/derives-span-Eq-tuple-struct.stderr
@@ -1,5 +1,5 @@
error[E0277]: the trait bound `Error: std::cmp::Eq` is not satisfied
- --> $DIR/derives-span-Eq-tuple-struct.rs:8:5
+ --> $DIR/derives-span-Eq-tuple-struct.rs:9:5
|
LL | Error
| ^^^^^ the trait `std::cmp::Eq` is not implemented for `Error`
diff --git a/src/test/ui/derives/derives-span-Hash-enum-struct-variant.rs b/src/test/ui/derives/derives-span-Hash-enum-struct-variant.rs
index ed87360a0be9f..604b0842fa93c 100644
--- a/src/test/ui/derives/derives-span-Hash-enum-struct-variant.rs
+++ b/src/test/ui/derives/derives-span-Hash-enum-struct-variant.rs
@@ -1,5 +1,4 @@
-// ignore-x86
-// ^ due to stderr output differences
+// ignore-x86 FIXME: missing sysroot spans (#53081)
// This file was auto-generated using 'src/etc/generate-deriving-span-tests.py'
diff --git a/src/test/ui/derives/derives-span-Hash-enum-struct-variant.stderr b/src/test/ui/derives/derives-span-Hash-enum-struct-variant.stderr
index 708ebca9fb153..cc1caf7804186 100644
--- a/src/test/ui/derives/derives-span-Hash-enum-struct-variant.stderr
+++ b/src/test/ui/derives/derives-span-Hash-enum-struct-variant.stderr
@@ -1,5 +1,5 @@
error[E0277]: the trait bound `Error: std::hash::Hash` is not satisfied
- --> $DIR/derives-span-Hash-enum-struct-variant.rs:11:6
+ --> $DIR/derives-span-Hash-enum-struct-variant.rs:10:6
|
LL | x: Error
| ^^^^^^^^ the trait `std::hash::Hash` is not implemented for `Error`
diff --git a/src/test/ui/derives/derives-span-Hash-enum.rs b/src/test/ui/derives/derives-span-Hash-enum.rs
index 5b3649c9826e6..bf3033a232c0c 100644
--- a/src/test/ui/derives/derives-span-Hash-enum.rs
+++ b/src/test/ui/derives/derives-span-Hash-enum.rs
@@ -1,5 +1,4 @@
-// ignore-x86
-// ^ due to stderr output differences
+// ignore-x86 FIXME: missing sysroot spans (#53081)
// This file was auto-generated using 'src/etc/generate-deriving-span-tests.py'
diff --git a/src/test/ui/derives/derives-span-Hash-enum.stderr b/src/test/ui/derives/derives-span-Hash-enum.stderr
index dc171cbe5dd13..246d821ed2bf6 100644
--- a/src/test/ui/derives/derives-span-Hash-enum.stderr
+++ b/src/test/ui/derives/derives-span-Hash-enum.stderr
@@ -1,5 +1,5 @@
error[E0277]: the trait bound `Error: std::hash::Hash` is not satisfied
- --> $DIR/derives-span-Hash-enum.rs:11:6
+ --> $DIR/derives-span-Hash-enum.rs:10:6
|
LL | Error
| ^^^^^ the trait `std::hash::Hash` is not implemented for `Error`
diff --git a/src/test/ui/derives/derives-span-Hash-struct.rs b/src/test/ui/derives/derives-span-Hash-struct.rs
index ead70861a0ad6..b6abb9d229e13 100644
--- a/src/test/ui/derives/derives-span-Hash-struct.rs
+++ b/src/test/ui/derives/derives-span-Hash-struct.rs
@@ -1,5 +1,4 @@
-// ignore-x86
-// ^ due to stderr output differences
+// ignore-x86 FIXME: missing sysroot spans (#53081)
// This file was auto-generated using 'src/etc/generate-deriving-span-tests.py'
diff --git a/src/test/ui/derives/derives-span-Hash-struct.stderr b/src/test/ui/derives/derives-span-Hash-struct.stderr
index 429449b82bf64..720c127635e62 100644
--- a/src/test/ui/derives/derives-span-Hash-struct.stderr
+++ b/src/test/ui/derives/derives-span-Hash-struct.stderr
@@ -1,5 +1,5 @@
error[E0277]: the trait bound `Error: std::hash::Hash` is not satisfied
- --> $DIR/derives-span-Hash-struct.rs:10:5
+ --> $DIR/derives-span-Hash-struct.rs:9:5
|
LL | x: Error
| ^^^^^^^^ the trait `std::hash::Hash` is not implemented for `Error`
diff --git a/src/test/ui/derives/derives-span-Hash-tuple-struct.rs b/src/test/ui/derives/derives-span-Hash-tuple-struct.rs
index 820f13ed18ef2..e01351fe8a6ba 100644
--- a/src/test/ui/derives/derives-span-Hash-tuple-struct.rs
+++ b/src/test/ui/derives/derives-span-Hash-tuple-struct.rs
@@ -1,5 +1,4 @@
-// ignore-x86
-// ^ due to stderr output differences
+// ignore-x86 FIXME: missing sysroot spans (#53081)
// This file was auto-generated using 'src/etc/generate-deriving-span-tests.py'
diff --git a/src/test/ui/derives/derives-span-Hash-tuple-struct.stderr b/src/test/ui/derives/derives-span-Hash-tuple-struct.stderr
index a6c4c479b24d7..1fd1e601eca01 100644
--- a/src/test/ui/derives/derives-span-Hash-tuple-struct.stderr
+++ b/src/test/ui/derives/derives-span-Hash-tuple-struct.stderr
@@ -1,5 +1,5 @@
error[E0277]: the trait bound `Error: std::hash::Hash` is not satisfied
- --> $DIR/derives-span-Hash-tuple-struct.rs:10:5
+ --> $DIR/derives-span-Hash-tuple-struct.rs:9:5
|
LL | Error
| ^^^^^ the trait `std::hash::Hash` is not implemented for `Error`
diff --git a/src/test/ui/derives/derives-span-Ord-enum-struct-variant.rs b/src/test/ui/derives/derives-span-Ord-enum-struct-variant.rs
index 62355cc2d9619..6d516d4b0adc3 100644
--- a/src/test/ui/derives/derives-span-Ord-enum-struct-variant.rs
+++ b/src/test/ui/derives/derives-span-Ord-enum-struct-variant.rs
@@ -1,3 +1,4 @@
+// ignore-x86 FIXME: missing sysroot spans (#53081)
// This file was auto-generated using 'src/etc/generate-deriving-span-tests.py'
#[derive(Eq,PartialOrd,PartialEq)]
diff --git a/src/test/ui/derives/derives-span-Ord-enum-struct-variant.stderr b/src/test/ui/derives/derives-span-Ord-enum-struct-variant.stderr
index 5c0d4e4ebe917..f0d7e4465a79b 100644
--- a/src/test/ui/derives/derives-span-Ord-enum-struct-variant.stderr
+++ b/src/test/ui/derives/derives-span-Ord-enum-struct-variant.stderr
@@ -1,5 +1,5 @@
error[E0277]: the trait bound `Error: std::cmp::Ord` is not satisfied
- --> $DIR/derives-span-Ord-enum-struct-variant.rs:9:6
+ --> $DIR/derives-span-Ord-enum-struct-variant.rs:10:6
|
LL | x: Error
| ^^^^^^^^ the trait `std::cmp::Ord` is not implemented for `Error`
diff --git a/src/test/ui/derives/derives-span-Ord-enum.rs b/src/test/ui/derives/derives-span-Ord-enum.rs
index 72738931d10f2..51b5d7f0ed1d2 100644
--- a/src/test/ui/derives/derives-span-Ord-enum.rs
+++ b/src/test/ui/derives/derives-span-Ord-enum.rs
@@ -1,3 +1,4 @@
+// ignore-x86 FIXME: missing sysroot spans (#53081)
// This file was auto-generated using 'src/etc/generate-deriving-span-tests.py'
#[derive(Eq,PartialOrd,PartialEq)]
diff --git a/src/test/ui/derives/derives-span-Ord-enum.stderr b/src/test/ui/derives/derives-span-Ord-enum.stderr
index 56268a237450a..37eca92e77e63 100644
--- a/src/test/ui/derives/derives-span-Ord-enum.stderr
+++ b/src/test/ui/derives/derives-span-Ord-enum.stderr
@@ -1,5 +1,5 @@
error[E0277]: the trait bound `Error: std::cmp::Ord` is not satisfied
- --> $DIR/derives-span-Ord-enum.rs:9:6
+ --> $DIR/derives-span-Ord-enum.rs:10:6
|
LL | Error
| ^^^^^ the trait `std::cmp::Ord` is not implemented for `Error`
diff --git a/src/test/ui/derives/derives-span-Ord-struct.rs b/src/test/ui/derives/derives-span-Ord-struct.rs
index 53d4c2c22b55f..c924ecaa315fc 100644
--- a/src/test/ui/derives/derives-span-Ord-struct.rs
+++ b/src/test/ui/derives/derives-span-Ord-struct.rs
@@ -1,3 +1,4 @@
+// ignore-x86 FIXME: missing sysroot spans (#53081)
// This file was auto-generated using 'src/etc/generate-deriving-span-tests.py'
#[derive(Eq,PartialOrd,PartialEq)]
diff --git a/src/test/ui/derives/derives-span-Ord-struct.stderr b/src/test/ui/derives/derives-span-Ord-struct.stderr
index 40dc3d09dad7e..72c1fe4803c4d 100644
--- a/src/test/ui/derives/derives-span-Ord-struct.stderr
+++ b/src/test/ui/derives/derives-span-Ord-struct.stderr
@@ -1,5 +1,5 @@
error[E0277]: the trait bound `Error: std::cmp::Ord` is not satisfied
- --> $DIR/derives-span-Ord-struct.rs:8:5
+ --> $DIR/derives-span-Ord-struct.rs:9:5
|
LL | x: Error
| ^^^^^^^^ the trait `std::cmp::Ord` is not implemented for `Error`
diff --git a/src/test/ui/derives/derives-span-Ord-tuple-struct.rs b/src/test/ui/derives/derives-span-Ord-tuple-struct.rs
index 4e09c27098641..80546634690c3 100644
--- a/src/test/ui/derives/derives-span-Ord-tuple-struct.rs
+++ b/src/test/ui/derives/derives-span-Ord-tuple-struct.rs
@@ -1,3 +1,4 @@
+// ignore-x86 FIXME: missing sysroot spans (#53081)
// This file was auto-generated using 'src/etc/generate-deriving-span-tests.py'
#[derive(Eq,PartialOrd,PartialEq)]
diff --git a/src/test/ui/derives/derives-span-Ord-tuple-struct.stderr b/src/test/ui/derives/derives-span-Ord-tuple-struct.stderr
index 4a9dea8c12e9a..642c8579b514c 100644
--- a/src/test/ui/derives/derives-span-Ord-tuple-struct.stderr
+++ b/src/test/ui/derives/derives-span-Ord-tuple-struct.stderr
@@ -1,5 +1,5 @@
error[E0277]: the trait bound `Error: std::cmp::Ord` is not satisfied
- --> $DIR/derives-span-Ord-tuple-struct.rs:8:5
+ --> $DIR/derives-span-Ord-tuple-struct.rs:9:5
|
LL | Error
| ^^^^^ the trait `std::cmp::Ord` is not implemented for `Error`
diff --git a/src/test/ui/derives/derives-span-PartialEq-enum-struct-variant.rs b/src/test/ui/derives/derives-span-PartialEq-enum-struct-variant.rs
index d66faa086dec7..b13798686c001 100644
--- a/src/test/ui/derives/derives-span-PartialEq-enum-struct-variant.rs
+++ b/src/test/ui/derives/derives-span-PartialEq-enum-struct-variant.rs
@@ -1,3 +1,4 @@
+// ignore-x86 FIXME: missing sysroot spans (#53081)
// This file was auto-generated using 'src/etc/generate-deriving-span-tests.py'
diff --git a/src/test/ui/derives/derives-span-PartialEq-enum-struct-variant.stderr b/src/test/ui/derives/derives-span-PartialEq-enum-struct-variant.stderr
index ed5468cc4dac2..d6a5652560187 100644
--- a/src/test/ui/derives/derives-span-PartialEq-enum-struct-variant.stderr
+++ b/src/test/ui/derives/derives-span-PartialEq-enum-struct-variant.stderr
@@ -1,5 +1,5 @@
error[E0369]: binary operation `==` cannot be applied to type `Error`
- --> $DIR/derives-span-PartialEq-enum-struct-variant.rs:9:6
+ --> $DIR/derives-span-PartialEq-enum-struct-variant.rs:10:6
|
LL | x: Error
| ^^^^^^^^
@@ -7,7 +7,7 @@ LL | x: Error
= note: an implementation of `std::cmp::PartialEq` might be missing for `Error`
error[E0369]: binary operation `!=` cannot be applied to type `Error`
- --> $DIR/derives-span-PartialEq-enum-struct-variant.rs:9:6
+ --> $DIR/derives-span-PartialEq-enum-struct-variant.rs:10:6
|
LL | x: Error
| ^^^^^^^^
diff --git a/src/test/ui/derives/derives-span-PartialEq-enum.rs b/src/test/ui/derives/derives-span-PartialEq-enum.rs
index 66edf460b312a..5f8f05ad94b47 100644
--- a/src/test/ui/derives/derives-span-PartialEq-enum.rs
+++ b/src/test/ui/derives/derives-span-PartialEq-enum.rs
@@ -1,3 +1,4 @@
+// ignore-x86 FIXME: missing sysroot spans (#53081)
// This file was auto-generated using 'src/etc/generate-deriving-span-tests.py'
diff --git a/src/test/ui/derives/derives-span-PartialEq-enum.stderr b/src/test/ui/derives/derives-span-PartialEq-enum.stderr
index 06a88c03f58af..1f5ad42a3aa33 100644
--- a/src/test/ui/derives/derives-span-PartialEq-enum.stderr
+++ b/src/test/ui/derives/derives-span-PartialEq-enum.stderr
@@ -1,5 +1,5 @@
error[E0369]: binary operation `==` cannot be applied to type `Error`
- --> $DIR/derives-span-PartialEq-enum.rs:9:6
+ --> $DIR/derives-span-PartialEq-enum.rs:10:6
|
LL | Error
| ^^^^^
@@ -7,7 +7,7 @@ LL | Error
= note: an implementation of `std::cmp::PartialEq` might be missing for `Error`
error[E0369]: binary operation `!=` cannot be applied to type `Error`
- --> $DIR/derives-span-PartialEq-enum.rs:9:6
+ --> $DIR/derives-span-PartialEq-enum.rs:10:6
|
LL | Error
| ^^^^^
diff --git a/src/test/ui/derives/derives-span-PartialEq-struct.rs b/src/test/ui/derives/derives-span-PartialEq-struct.rs
index ce5c67af77f05..560bf582e8da2 100644
--- a/src/test/ui/derives/derives-span-PartialEq-struct.rs
+++ b/src/test/ui/derives/derives-span-PartialEq-struct.rs
@@ -1,3 +1,4 @@
+// ignore-x86 FIXME: missing sysroot spans (#53081)
// This file was auto-generated using 'src/etc/generate-deriving-span-tests.py'
diff --git a/src/test/ui/derives/derives-span-PartialEq-struct.stderr b/src/test/ui/derives/derives-span-PartialEq-struct.stderr
index b8481048361e5..4e0b2fa4e6f26 100644
--- a/src/test/ui/derives/derives-span-PartialEq-struct.stderr
+++ b/src/test/ui/derives/derives-span-PartialEq-struct.stderr
@@ -1,5 +1,5 @@
error[E0369]: binary operation `==` cannot be applied to type `Error`
- --> $DIR/derives-span-PartialEq-struct.rs:8:5
+ --> $DIR/derives-span-PartialEq-struct.rs:9:5
|
LL | x: Error
| ^^^^^^^^
@@ -7,7 +7,7 @@ LL | x: Error
= note: an implementation of `std::cmp::PartialEq` might be missing for `Error`
error[E0369]: binary operation `!=` cannot be applied to type `Error`
- --> $DIR/derives-span-PartialEq-struct.rs:8:5
+ --> $DIR/derives-span-PartialEq-struct.rs:9:5
|
LL | x: Error
| ^^^^^^^^
diff --git a/src/test/ui/derives/derives-span-PartialEq-tuple-struct.rs b/src/test/ui/derives/derives-span-PartialEq-tuple-struct.rs
index eaa628311361c..09a3249f0593f 100644
--- a/src/test/ui/derives/derives-span-PartialEq-tuple-struct.rs
+++ b/src/test/ui/derives/derives-span-PartialEq-tuple-struct.rs
@@ -1,3 +1,4 @@
+// ignore-x86 FIXME: missing sysroot spans (#53081)
// This file was auto-generated using 'src/etc/generate-deriving-span-tests.py'
diff --git a/src/test/ui/derives/derives-span-PartialEq-tuple-struct.stderr b/src/test/ui/derives/derives-span-PartialEq-tuple-struct.stderr
index 4398d25212550..78e215534e0da 100644
--- a/src/test/ui/derives/derives-span-PartialEq-tuple-struct.stderr
+++ b/src/test/ui/derives/derives-span-PartialEq-tuple-struct.stderr
@@ -1,5 +1,5 @@
error[E0369]: binary operation `==` cannot be applied to type `Error`
- --> $DIR/derives-span-PartialEq-tuple-struct.rs:8:5
+ --> $DIR/derives-span-PartialEq-tuple-struct.rs:9:5
|
LL | Error
| ^^^^^
@@ -7,7 +7,7 @@ LL | Error
= note: an implementation of `std::cmp::PartialEq` might be missing for `Error`
error[E0369]: binary operation `!=` cannot be applied to type `Error`
- --> $DIR/derives-span-PartialEq-tuple-struct.rs:8:5
+ --> $DIR/derives-span-PartialEq-tuple-struct.rs:9:5
|
LL | Error
| ^^^^^
diff --git a/src/test/ui/derives/derives-span-PartialOrd-enum-struct-variant.rs b/src/test/ui/derives/derives-span-PartialOrd-enum-struct-variant.rs
index 0bc6f98d9825b..0d18bdc113aee 100644
--- a/src/test/ui/derives/derives-span-PartialOrd-enum-struct-variant.rs
+++ b/src/test/ui/derives/derives-span-PartialOrd-enum-struct-variant.rs
@@ -1,3 +1,4 @@
+// ignore-x86 FIXME: missing sysroot spans (#53081)
// This file was auto-generated using 'src/etc/generate-deriving-span-tests.py'
#[derive(PartialEq)]
diff --git a/src/test/ui/derives/derives-span-PartialOrd-enum-struct-variant.stderr b/src/test/ui/derives/derives-span-PartialOrd-enum-struct-variant.stderr
index ac9f45046353a..a6f0c873e2fd0 100644
--- a/src/test/ui/derives/derives-span-PartialOrd-enum-struct-variant.stderr
+++ b/src/test/ui/derives/derives-span-PartialOrd-enum-struct-variant.stderr
@@ -1,5 +1,5 @@
error[E0277]: can't compare `Error` with `Error`
- --> $DIR/derives-span-PartialOrd-enum-struct-variant.rs:9:6
+ --> $DIR/derives-span-PartialOrd-enum-struct-variant.rs:10:6
|
LL | x: Error
| ^^^^^^^^ no implementation for `Error < Error` and `Error > Error`
diff --git a/src/test/ui/derives/derives-span-PartialOrd-enum.rs b/src/test/ui/derives/derives-span-PartialOrd-enum.rs
index ee4423f3bee7a..78e4babb976cd 100644
--- a/src/test/ui/derives/derives-span-PartialOrd-enum.rs
+++ b/src/test/ui/derives/derives-span-PartialOrd-enum.rs
@@ -1,3 +1,4 @@
+// ignore-x86 FIXME: missing sysroot spans (#53081)
// This file was auto-generated using 'src/etc/generate-deriving-span-tests.py'
#[derive(PartialEq)]
diff --git a/src/test/ui/derives/derives-span-PartialOrd-enum.stderr b/src/test/ui/derives/derives-span-PartialOrd-enum.stderr
index 3e684aef39f24..838126111c35e 100644
--- a/src/test/ui/derives/derives-span-PartialOrd-enum.stderr
+++ b/src/test/ui/derives/derives-span-PartialOrd-enum.stderr
@@ -1,5 +1,5 @@
error[E0277]: can't compare `Error` with `Error`
- --> $DIR/derives-span-PartialOrd-enum.rs:9:6
+ --> $DIR/derives-span-PartialOrd-enum.rs:10:6
|
LL | Error
| ^^^^^ no implementation for `Error < Error` and `Error > Error`
diff --git a/src/test/ui/derives/derives-span-PartialOrd-struct.rs b/src/test/ui/derives/derives-span-PartialOrd-struct.rs
index 48435e0cd45a5..728ec75b6c40a 100644
--- a/src/test/ui/derives/derives-span-PartialOrd-struct.rs
+++ b/src/test/ui/derives/derives-span-PartialOrd-struct.rs
@@ -1,3 +1,4 @@
+// ignore-x86 FIXME: missing sysroot spans (#53081)
// This file was auto-generated using 'src/etc/generate-deriving-span-tests.py'
#[derive(PartialEq)]
diff --git a/src/test/ui/derives/derives-span-PartialOrd-struct.stderr b/src/test/ui/derives/derives-span-PartialOrd-struct.stderr
index 10659aac64217..2df64d915a94d 100644
--- a/src/test/ui/derives/derives-span-PartialOrd-struct.stderr
+++ b/src/test/ui/derives/derives-span-PartialOrd-struct.stderr
@@ -1,5 +1,5 @@
error[E0277]: can't compare `Error` with `Error`
- --> $DIR/derives-span-PartialOrd-struct.rs:8:5
+ --> $DIR/derives-span-PartialOrd-struct.rs:9:5
|
LL | x: Error
| ^^^^^^^^ no implementation for `Error < Error` and `Error > Error`
diff --git a/src/test/ui/derives/derives-span-PartialOrd-tuple-struct.rs b/src/test/ui/derives/derives-span-PartialOrd-tuple-struct.rs
index 2aa412e6d1d8f..c92b47e9297be 100644
--- a/src/test/ui/derives/derives-span-PartialOrd-tuple-struct.rs
+++ b/src/test/ui/derives/derives-span-PartialOrd-tuple-struct.rs
@@ -1,3 +1,4 @@
+// ignore-x86 FIXME: missing sysroot spans (#53081)
// This file was auto-generated using 'src/etc/generate-deriving-span-tests.py'
#[derive(PartialEq)]
diff --git a/src/test/ui/derives/derives-span-PartialOrd-tuple-struct.stderr b/src/test/ui/derives/derives-span-PartialOrd-tuple-struct.stderr
index cbe05e3784057..63aebe32ed298 100644
--- a/src/test/ui/derives/derives-span-PartialOrd-tuple-struct.stderr
+++ b/src/test/ui/derives/derives-span-PartialOrd-tuple-struct.stderr
@@ -1,5 +1,5 @@
error[E0277]: can't compare `Error` with `Error`
- --> $DIR/derives-span-PartialOrd-tuple-struct.rs:8:5
+ --> $DIR/derives-span-PartialOrd-tuple-struct.rs:9:5
|
LL | Error
| ^^^^^ no implementation for `Error < Error` and `Error > Error`
diff --git a/src/test/ui/enum-discriminant/discriminant_value.rs b/src/test/ui/enum-discriminant/discriminant_value.rs
index b7000015c71db..32d2d40241c82 100644
--- a/src/test/ui/enum-discriminant/discriminant_value.rs
+++ b/src/test/ui/enum-discriminant/discriminant_value.rs
@@ -51,34 +51,31 @@ enum Mixed {
}
pub fn main() {
- unsafe {
+ assert_eq!(discriminant_value(&CLike1::A), 0);
+ assert_eq!(discriminant_value(&CLike1::B), 1);
+ assert_eq!(discriminant_value(&CLike1::C), 2);
+ assert_eq!(discriminant_value(&CLike1::D), 3);
- assert_eq!(discriminant_value(&CLike1::A), 0);
- assert_eq!(discriminant_value(&CLike1::B), 1);
- assert_eq!(discriminant_value(&CLike1::C), 2);
- assert_eq!(discriminant_value(&CLike1::D), 3);
+ assert_eq!(discriminant_value(&CLike2::A), 5);
+ assert_eq!(discriminant_value(&CLike2::B), 2);
+ assert_eq!(discriminant_value(&CLike2::C), 19);
+ assert_eq!(discriminant_value(&CLike2::D), 20);
- assert_eq!(discriminant_value(&CLike2::A), 5);
- assert_eq!(discriminant_value(&CLike2::B), 2);
- assert_eq!(discriminant_value(&CLike2::C), 19);
- assert_eq!(discriminant_value(&CLike2::D), 20);
+ assert_eq!(discriminant_value(&CLike3::A), 5);
+ assert_eq!(discriminant_value(&CLike3::B), 6);
+ assert_eq!(discriminant_value(&CLike3::C), -1_i8 as u64);
+ assert_eq!(discriminant_value(&CLike3::D), 0);
- assert_eq!(discriminant_value(&CLike3::A), 5);
- assert_eq!(discriminant_value(&CLike3::B), 6);
- assert_eq!(discriminant_value(&CLike3::C), -1_i8 as u64);
- assert_eq!(discriminant_value(&CLike3::D), 0);
+ assert_eq!(discriminant_value(&ADT::First(0,0)), 0);
+ assert_eq!(discriminant_value(&ADT::Second(5)), 1);
- assert_eq!(discriminant_value(&ADT::First(0,0)), 0);
- assert_eq!(discriminant_value(&ADT::Second(5)), 1);
+ assert_eq!(discriminant_value(&NullablePointer::Nothing), 1);
+ assert_eq!(discriminant_value(&NullablePointer::Something(&CONST)), 0);
- assert_eq!(discriminant_value(&NullablePointer::Nothing), 1);
- assert_eq!(discriminant_value(&NullablePointer::Something(&CONST)), 0);
+ assert_eq!(discriminant_value(&10), 0);
+ assert_eq!(discriminant_value(&"test"), 0);
- assert_eq!(discriminant_value(&10), 0);
- assert_eq!(discriminant_value(&"test"), 0);
-
- assert_eq!(3, discriminant_value(&Mixed::Unit));
- assert_eq!(2, discriminant_value(&Mixed::Tuple(5)));
- assert_eq!(1, discriminant_value(&Mixed::Struct{a: 7, b: 11}));
- }
+ assert_eq!(3, discriminant_value(&Mixed::Unit));
+ assert_eq!(2, discriminant_value(&Mixed::Tuple(5)));
+ assert_eq!(1, discriminant_value(&Mixed::Struct{a: 7, b: 11}));
}
diff --git a/src/test/ui/impl-trait/impl-generic-mismatch.rs b/src/test/ui/impl-trait/impl-generic-mismatch.rs
index f4fba4c34c142..5597df4ba499b 100644
--- a/src/test/ui/impl-trait/impl-generic-mismatch.rs
+++ b/src/test/ui/impl-trait/impl-generic-mismatch.rs
@@ -1,5 +1,4 @@
-// ignore-musl
-// ignore-x86
+// ignore-x86 FIXME: missing sysroot spans (#53081)
use std::fmt::Debug;
diff --git a/src/test/ui/impl-trait/impl-generic-mismatch.stderr b/src/test/ui/impl-trait/impl-generic-mismatch.stderr
index bfe94119a02f6..2278519e95ad1 100644
--- a/src/test/ui/impl-trait/impl-generic-mismatch.stderr
+++ b/src/test/ui/impl-trait/impl-generic-mismatch.stderr
@@ -1,5 +1,5 @@
error[E0643]: method `foo` has incompatible signature for trait
- --> $DIR/impl-generic-mismatch.rs:11:12
+ --> $DIR/impl-generic-mismatch.rs:10:12
|
LL | fn foo(&self, _: &impl Debug);
| ---------- declaration in trait here
@@ -13,7 +13,7 @@ LL | fn foo(&self, _: &impl Debug) { }
| -- ^^^^^^^^^^
error[E0643]: method `bar` has incompatible signature for trait
- --> $DIR/impl-generic-mismatch.rs:20:23
+ --> $DIR/impl-generic-mismatch.rs:19:23
|
LL | fn bar(&self, _: &U);
| - declaration in trait here
@@ -27,7 +27,7 @@ LL | fn bar(&self, _: &U) { }
| ^^^^^^^^^^ ^
error[E0643]: method `hash` has incompatible signature for trait
- --> $DIR/impl-generic-mismatch.rs:31:33
+ --> $DIR/impl-generic-mismatch.rs:30:33
|
LL | fn hash(&self, hasher: &mut impl Hasher) {}
| ^^^^^^^^^^^ expected generic parameter, found `impl Trait`
diff --git a/src/test/ui/imports/extern-prelude-extern-crate-restricted-shadowing.rs b/src/test/ui/imports/extern-prelude-extern-crate-restricted-shadowing.rs
index ce8c2d5168fbb..abcc92ce34d17 100644
--- a/src/test/ui/imports/extern-prelude-extern-crate-restricted-shadowing.rs
+++ b/src/test/ui/imports/extern-prelude-extern-crate-restricted-shadowing.rs
@@ -1,5 +1,4 @@
-// ignore-x86
-// ^ due to stderr output differences
+// ignore-x86 FIXME: missing sysroot spans (#53081)
// aux-build:two_macros.rs
macro_rules! define_vec {
diff --git a/src/test/ui/imports/extern-prelude-extern-crate-restricted-shadowing.stderr b/src/test/ui/imports/extern-prelude-extern-crate-restricted-shadowing.stderr
index 8e01fc8df3def..7a55abe42556c 100644
--- a/src/test/ui/imports/extern-prelude-extern-crate-restricted-shadowing.stderr
+++ b/src/test/ui/imports/extern-prelude-extern-crate-restricted-shadowing.stderr
@@ -1,5 +1,5 @@
error: macro-expanded `extern crate` items cannot shadow names passed with `--extern`
- --> $DIR/extern-prelude-extern-crate-restricted-shadowing.rs:21:9
+ --> $DIR/extern-prelude-extern-crate-restricted-shadowing.rs:20:9
|
LL | extern crate std as core;
| ^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -8,13 +8,13 @@ LL | define_other_core!();
| --------------------- in this macro invocation
error[E0659]: `Vec` is ambiguous (macro-expanded name vs less macro-expanded name from outer scope during import/macro resolution)
- --> $DIR/extern-prelude-extern-crate-restricted-shadowing.rs:15:9
+ --> $DIR/extern-prelude-extern-crate-restricted-shadowing.rs:14:9
|
LL | Vec::panic!();
| ^^^ ambiguous name
|
note: `Vec` could refer to the crate imported here
- --> $DIR/extern-prelude-extern-crate-restricted-shadowing.rs:7:9
+ --> $DIR/extern-prelude-extern-crate-restricted-shadowing.rs:6:9
|
LL | extern crate std as Vec;
| ^^^^^^^^^^^^^^^^^^^^^^^^
diff --git a/src/test/ui/in-band-lifetimes/mismatched_trait_impl-2.rs b/src/test/ui/in-band-lifetimes/mismatched_trait_impl-2.rs
index eca9a67fcb387..369de04007022 100644
--- a/src/test/ui/in-band-lifetimes/mismatched_trait_impl-2.rs
+++ b/src/test/ui/in-band-lifetimes/mismatched_trait_impl-2.rs
@@ -1,5 +1,4 @@
-// ignore-x86
-// ^ due to stderr output differences
+// ignore-x86 FIXME: missing sysroot spans (#53081)
use std::ops::Deref;
trait Trait {}
diff --git a/src/test/ui/in-band-lifetimes/mismatched_trait_impl-2.stderr b/src/test/ui/in-band-lifetimes/mismatched_trait_impl-2.stderr
index d3862e3d4df60..8086d3f1fbc64 100644
--- a/src/test/ui/in-band-lifetimes/mismatched_trait_impl-2.stderr
+++ b/src/test/ui/in-band-lifetimes/mismatched_trait_impl-2.stderr
@@ -1,5 +1,5 @@
error: `impl` item signature doesn't match `trait` item signature
- --> $DIR/mismatched_trait_impl-2.rs:10:5
+ --> $DIR/mismatched_trait_impl-2.rs:9:5
|
LL | fn deref(&self) -> &dyn Trait {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ found fn(&Struct) -> &dyn Trait
diff --git a/src/test/ui/interior-mutability/interior-mutability.rs b/src/test/ui/interior-mutability/interior-mutability.rs
index 6968e3669caec..60633fdd393ee 100644
--- a/src/test/ui/interior-mutability/interior-mutability.rs
+++ b/src/test/ui/interior-mutability/interior-mutability.rs
@@ -1,5 +1,4 @@
-// ignore-x86
-// ^ due to stderr output differences
+// ignore-x86 FIXME: missing sysroot spans (#53081)
use std::cell::Cell;
use std::panic::catch_unwind;
fn main() {
diff --git a/src/test/ui/interior-mutability/interior-mutability.stderr b/src/test/ui/interior-mutability/interior-mutability.stderr
index b76fce2880552..5c129524f51b4 100644
--- a/src/test/ui/interior-mutability/interior-mutability.stderr
+++ b/src/test/ui/interior-mutability/interior-mutability.stderr
@@ -1,5 +1,5 @@
error[E0277]: the type `std::cell::UnsafeCell` may contain interior mutability and a reference may not be safely transferrable across a catch_unwind boundary
- --> $DIR/interior-mutability.rs:7:5
+ --> $DIR/interior-mutability.rs:6:5
|
LL | catch_unwind(|| { x.set(23); });
| ^^^^^^^^^^^^ `std::cell::UnsafeCell` may contain interior mutability and a reference may not be safely transferrable across a catch_unwind boundary
@@ -12,7 +12,7 @@ LL | pub fn catch_unwind R + UnwindSafe, R>(f: F) -> Result {
= help: within `std::cell::Cell`, the trait `std::panic::RefUnwindSafe` is not implemented for `std::cell::UnsafeCell`
= note: required because it appears within the type `std::cell::Cell`
= note: required because of the requirements on the impl of `std::panic::UnwindSafe` for `&std::cell::Cell`
- = note: required because it appears within the type `[closure@$DIR/interior-mutability.rs:7:18: 7:35 x:&std::cell::Cell]`
+ = note: required because it appears within the type `[closure@$DIR/interior-mutability.rs:6:18: 6:35 x:&std::cell::Cell]`
error: aborting due to previous error
diff --git a/src/test/ui/issues/issue-21160.rs b/src/test/ui/issues/issue-21160.rs
index dfb39743352fc..0199abbd8f04a 100644
--- a/src/test/ui/issues/issue-21160.rs
+++ b/src/test/ui/issues/issue-21160.rs
@@ -1,5 +1,4 @@
-// ignore-x86
-// ^ due to stderr output differences
+// ignore-x86 FIXME: missing sysroot spans (#53081)
struct Bar;
impl Bar {
diff --git a/src/test/ui/issues/issue-21160.stderr b/src/test/ui/issues/issue-21160.stderr
index 9f88fa2fadd4c..65ba64b49d06d 100644
--- a/src/test/ui/issues/issue-21160.stderr
+++ b/src/test/ui/issues/issue-21160.stderr
@@ -1,5 +1,5 @@
error[E0277]: the trait bound `Bar: std::hash::Hash` is not satisfied
- --> $DIR/issue-21160.rs:10:12
+ --> $DIR/issue-21160.rs:9:12
|
LL | struct Foo(Bar);
| ^^^ the trait `std::hash::Hash` is not implemented for `Bar`
diff --git a/src/test/ui/issues/issue-27033.rs b/src/test/ui/issues/issue-27033.rs
index bcb06d743a05d..7120dee6339f1 100644
--- a/src/test/ui/issues/issue-27033.rs
+++ b/src/test/ui/issues/issue-27033.rs
@@ -1,5 +1,4 @@
-// ignore-x86
-// ^ due to stderr output differences
+// ignore-x86 FIXME: missing sysroot spans (#53081)
fn main() {
match Some(1) {
None @ _ => {} //~ ERROR match bindings cannot shadow unit variants
diff --git a/src/test/ui/issues/issue-27033.stderr b/src/test/ui/issues/issue-27033.stderr
index a4baa7bdf7f85..2d6d2ef41bd74 100644
--- a/src/test/ui/issues/issue-27033.stderr
+++ b/src/test/ui/issues/issue-27033.stderr
@@ -1,5 +1,5 @@
error[E0530]: match bindings cannot shadow unit variants
- --> $DIR/issue-27033.rs:5:9
+ --> $DIR/issue-27033.rs:4:9
|
LL | None @ _ => {}
| ^^^^ cannot be named the same as a unit variant
@@ -10,7 +10,7 @@ LL | pub use crate::option::Option::{self, Some, None};
| ---- the unit variant `None` is defined here
error[E0530]: match bindings cannot shadow constants
- --> $DIR/issue-27033.rs:9:9
+ --> $DIR/issue-27033.rs:8:9
|
LL | const C: u8 = 1;
| ---------------- the constant `C` is defined here
diff --git a/src/test/ui/issues/issue-43398.rs b/src/test/ui/issues/issue-43398.rs
index ae52e8f3f6b43..f0b762c6254a3 100644
--- a/src/test/ui/issues/issue-43398.rs
+++ b/src/test/ui/issues/issue-43398.rs
@@ -7,9 +7,7 @@
enum Big { A, B }
fn main() {
- unsafe {
- println!("{} {:?}",
- std::intrinsics::discriminant_value(&Big::A),
- std::mem::discriminant(&Big::B));
- }
+ println!("{} {:?}",
+ std::intrinsics::discriminant_value(&Big::A),
+ std::mem::discriminant(&Big::B));
}
diff --git a/src/test/ui/issues/issue-51582.rs b/src/test/ui/issues/issue-51582.rs
index 63ef05729bc56..40a70c623a741 100644
--- a/src/test/ui/issues/issue-51582.rs
+++ b/src/test/ui/issues/issue-51582.rs
@@ -14,5 +14,5 @@ fn main() {
assert_eq!(1, make_b() as u8);
assert_eq!(1, make_b() as i32);
assert_eq!(1, make_b() as u32);
- assert_eq!(1, unsafe { std::intrinsics::discriminant_value(&make_b()) });
+ assert_eq!(1, std::intrinsics::discriminant_value(&make_b()));
}
diff --git a/src/test/ui/lint/uninitialized-zeroed.stderr b/src/test/ui/lint/uninitialized-zeroed.stderr
index e12b1897ade1b..bdb5959953f50 100644
--- a/src/test/ui/lint/uninitialized-zeroed.stderr
+++ b/src/test/ui/lint/uninitialized-zeroed.stderr
@@ -5,7 +5,7 @@ LL | let _val: &'static T = mem::zeroed();
| ^^^^^^^^^^^^^
| |
| this code causes undefined behavior when executed
- | help: use `MaybeUninit` instead
+ | help: use `MaybeUninit` instead, and only call `assume_init` after initialization is done
|
note: lint level defined here
--> $DIR/uninitialized-zeroed.rs:7:9
@@ -21,7 +21,7 @@ LL | let _val: &'static T = mem::uninitialized();
| ^^^^^^^^^^^^^^^^^^^^
| |
| this code causes undefined behavior when executed
- | help: use `MaybeUninit` instead
+ | help: use `MaybeUninit` instead, and only call `assume_init` after initialization is done
|
= note: References must be non-null
@@ -32,7 +32,7 @@ LL | let _val: Wrap<&'static T> = mem::zeroed();
| ^^^^^^^^^^^^^
| |
| this code causes undefined behavior when executed
- | help: use `MaybeUninit` instead
+ | help: use `MaybeUninit` instead, and only call `assume_init` after initialization is done
|
note: References must be non-null (in this struct field)
--> $DIR/uninitialized-zeroed.rs:18:18
@@ -47,7 +47,7 @@ LL | let _val: Wrap<&'static T> = mem::uninitialized();
| ^^^^^^^^^^^^^^^^^^^^
| |
| this code causes undefined behavior when executed
- | help: use `MaybeUninit` instead
+ | help: use `MaybeUninit` instead, and only call `assume_init` after initialization is done
|
note: References must be non-null (in this struct field)
--> $DIR/uninitialized-zeroed.rs:18:18
@@ -62,7 +62,7 @@ LL | let _val: ! = mem::zeroed();
| ^^^^^^^^^^^^^
| |
| this code causes undefined behavior when executed
- | help: use `MaybeUninit` instead
+ | help: use `MaybeUninit` instead, and only call `assume_init` after initialization is done
|
= note: The never type (`!`) has no valid value
@@ -73,7 +73,7 @@ LL | let _val: ! = mem::uninitialized();
| ^^^^^^^^^^^^^^^^^^^^
| |
| this code causes undefined behavior when executed
- | help: use `MaybeUninit` instead
+ | help: use `MaybeUninit` instead, and only call `assume_init` after initialization is done
|
= note: The never type (`!`) has no valid value
@@ -84,7 +84,7 @@ LL | let _val: (i32, !) = mem::zeroed();
| ^^^^^^^^^^^^^
| |
| this code causes undefined behavior when executed
- | help: use `MaybeUninit` instead
+ | help: use `MaybeUninit` instead, and only call `assume_init` after initialization is done
|
= note: The never type (`!`) has no valid value
@@ -95,7 +95,7 @@ LL | let _val: (i32, !) = mem::uninitialized();
| ^^^^^^^^^^^^^^^^^^^^
| |
| this code causes undefined behavior when executed
- | help: use `MaybeUninit` instead
+ | help: use `MaybeUninit` instead, and only call `assume_init` after initialization is done
|
= note: The never type (`!`) has no valid value
@@ -106,7 +106,7 @@ LL | let _val: Void = mem::zeroed();
| ^^^^^^^^^^^^^
| |
| this code causes undefined behavior when executed
- | help: use `MaybeUninit` instead
+ | help: use `MaybeUninit` instead, and only call `assume_init` after initialization is done
|
= note: 0-variant enums have no valid value
@@ -117,7 +117,7 @@ LL | let _val: Void = mem::uninitialized();
| ^^^^^^^^^^^^^^^^^^^^
| |
| this code causes undefined behavior when executed
- | help: use `MaybeUninit` instead
+ | help: use `MaybeUninit` instead, and only call `assume_init` after initialization is done
|
= note: 0-variant enums have no valid value
@@ -128,7 +128,7 @@ LL | let _val: &'static i32 = mem::zeroed();
| ^^^^^^^^^^^^^
| |
| this code causes undefined behavior when executed
- | help: use `MaybeUninit` instead
+ | help: use `MaybeUninit` instead, and only call `assume_init` after initialization is done
|
= note: References must be non-null
@@ -139,7 +139,7 @@ LL | let _val: &'static i32 = mem::uninitialized();
| ^^^^^^^^^^^^^^^^^^^^
| |
| this code causes undefined behavior when executed
- | help: use `MaybeUninit` instead
+ | help: use `MaybeUninit` instead, and only call `assume_init` after initialization is done
|
= note: References must be non-null
@@ -150,7 +150,7 @@ LL | let _val: Ref = mem::zeroed();
| ^^^^^^^^^^^^^
| |
| this code causes undefined behavior when executed
- | help: use `MaybeUninit` instead
+ | help: use `MaybeUninit` instead, and only call `assume_init` after initialization is done
|
note: References must be non-null (in this struct field)
--> $DIR/uninitialized-zeroed.rs:15:12
@@ -165,7 +165,7 @@ LL | let _val: Ref = mem::uninitialized();
| ^^^^^^^^^^^^^^^^^^^^
| |
| this code causes undefined behavior when executed
- | help: use `MaybeUninit` instead
+ | help: use `MaybeUninit` instead, and only call `assume_init` after initialization is done
|
note: References must be non-null (in this struct field)
--> $DIR/uninitialized-zeroed.rs:15:12
@@ -180,7 +180,7 @@ LL | let _val: fn() = mem::zeroed();
| ^^^^^^^^^^^^^
| |
| this code causes undefined behavior when executed
- | help: use `MaybeUninit` instead
+ | help: use `MaybeUninit` instead, and only call `assume_init` after initialization is done
|
= note: Function pointers must be non-null
@@ -191,7 +191,7 @@ LL | let _val: fn() = mem::uninitialized();
| ^^^^^^^^^^^^^^^^^^^^
| |
| this code causes undefined behavior when executed
- | help: use `MaybeUninit` instead
+ | help: use `MaybeUninit` instead, and only call `assume_init` after initialization is done
|
= note: Function pointers must be non-null
@@ -202,7 +202,7 @@ LL | let _val: Wrap = mem::zeroed();
| ^^^^^^^^^^^^^
| |
| this code causes undefined behavior when executed
- | help: use `MaybeUninit` instead
+ | help: use `MaybeUninit` instead, and only call `assume_init` after initialization is done
|
note: Function pointers must be non-null (in this struct field)
--> $DIR/uninitialized-zeroed.rs:18:18
@@ -217,7 +217,7 @@ LL | let _val: Wrap = mem::uninitialized();
| ^^^^^^^^^^^^^^^^^^^^
| |
| this code causes undefined behavior when executed
- | help: use `MaybeUninit` instead
+ | help: use `MaybeUninit` instead, and only call `assume_init` after initialization is done
|
note: Function pointers must be non-null (in this struct field)
--> $DIR/uninitialized-zeroed.rs:18:18
@@ -232,7 +232,7 @@ LL | let _val: WrapEnum = mem::zeroed();
| ^^^^^^^^^^^^^
| |
| this code causes undefined behavior when executed
- | help: use `MaybeUninit` instead
+ | help: use `MaybeUninit` instead, and only call `assume_init` after initialization is done
|
note: Function pointers must be non-null (in this enum field)
--> $DIR/uninitialized-zeroed.rs:19:28
@@ -247,7 +247,7 @@ LL | let _val: WrapEnum = mem::uninitialized();
| ^^^^^^^^^^^^^^^^^^^^
| |
| this code causes undefined behavior when executed
- | help: use `MaybeUninit` instead
+ | help: use `MaybeUninit` instead, and only call `assume_init` after initialization is done
|
note: Function pointers must be non-null (in this enum field)
--> $DIR/uninitialized-zeroed.rs:19:28
@@ -262,7 +262,7 @@ LL | let _val: Wrap<(RefPair, i32)> = mem::zeroed();
| ^^^^^^^^^^^^^
| |
| this code causes undefined behavior when executed
- | help: use `MaybeUninit` instead
+ | help: use `MaybeUninit` instead, and only call `assume_init` after initialization is done
|
note: References must be non-null (in this struct field)
--> $DIR/uninitialized-zeroed.rs:16:16
@@ -277,7 +277,7 @@ LL | let _val: Wrap<(RefPair, i32)> = mem::uninitialized();
| ^^^^^^^^^^^^^^^^^^^^
| |
| this code causes undefined behavior when executed
- | help: use `MaybeUninit` instead
+ | help: use `MaybeUninit` instead, and only call `assume_init` after initialization is done
|
note: References must be non-null (in this struct field)
--> $DIR/uninitialized-zeroed.rs:16:16
@@ -292,7 +292,7 @@ LL | let _val: NonNull = mem::zeroed();
| ^^^^^^^^^^^^^
| |
| this code causes undefined behavior when executed
- | help: use `MaybeUninit` instead
+ | help: use `MaybeUninit` instead, and only call `assume_init` after initialization is done
|
= note: std::ptr::NonNull must be non-null
@@ -303,7 +303,7 @@ LL | let _val: NonNull = mem::uninitialized();
| ^^^^^^^^^^^^^^^^^^^^
| |
| this code causes undefined behavior when executed
- | help: use `MaybeUninit` instead
+ | help: use `MaybeUninit` instead, and only call `assume_init` after initialization is done
|
= note: std::ptr::NonNull must be non-null
@@ -314,7 +314,7 @@ LL | let _val: *const dyn Send = mem::zeroed();
| ^^^^^^^^^^^^^
| |
| this code causes undefined behavior when executed
- | help: use `MaybeUninit` instead
+ | help: use `MaybeUninit` instead, and only call `assume_init` after initialization is done
|
= note: The vtable of a wide raw pointer must be non-null
@@ -325,7 +325,7 @@ LL | let _val: *const dyn Send = mem::uninitialized();
| ^^^^^^^^^^^^^^^^^^^^
| |
| this code causes undefined behavior when executed
- | help: use `MaybeUninit` instead
+ | help: use `MaybeUninit` instead, and only call `assume_init` after initialization is done
|
= note: The vtable of a wide raw pointer must be non-null
@@ -336,7 +336,7 @@ LL | let _val: bool = mem::uninitialized();
| ^^^^^^^^^^^^^^^^^^^^
| |
| this code causes undefined behavior when executed
- | help: use `MaybeUninit` instead
+ | help: use `MaybeUninit` instead, and only call `assume_init` after initialization is done
|
= note: Booleans must be `true` or `false`
@@ -347,7 +347,7 @@ LL | let _val: Wrap = mem::uninitialized();
| ^^^^^^^^^^^^^^^^^^^^
| |
| this code causes undefined behavior when executed
- | help: use `MaybeUninit` instead
+ | help: use `MaybeUninit` instead, and only call `assume_init` after initialization is done
|
note: Characters must be a valid unicode codepoint (in this struct field)
--> $DIR/uninitialized-zeroed.rs:18:18
@@ -362,7 +362,7 @@ LL | let _val: NonBig = mem::uninitialized();
| ^^^^^^^^^^^^^^^^^^^^
| |
| this code causes undefined behavior when executed
- | help: use `MaybeUninit` instead
+ | help: use `MaybeUninit` instead, and only call `assume_init` after initialization is done
|
= note: NonBig must be initialized inside its custom valid range
@@ -373,7 +373,7 @@ LL | let _val: &'static i32 = mem::transmute(0usize);
| ^^^^^^^^^^^^^^^^^^^^^^
| |
| this code causes undefined behavior when executed
- | help: use `MaybeUninit` instead
+ | help: use `MaybeUninit` instead, and only call `assume_init` after initialization is done
|
= note: References must be non-null
@@ -384,7 +384,7 @@ LL | let _val: &'static [i32] = mem::transmute((0usize, 0usize));
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| |
| this code causes undefined behavior when executed
- | help: use `MaybeUninit` instead
+ | help: use `MaybeUninit` instead, and only call `assume_init` after initialization is done
|
= note: References must be non-null
@@ -395,7 +395,7 @@ LL | let _val: NonZeroU32 = mem::transmute(0);
| ^^^^^^^^^^^^^^^^^
| |
| this code causes undefined behavior when executed
- | help: use `MaybeUninit` instead
+ | help: use `MaybeUninit` instead, and only call `assume_init` after initialization is done
|
= note: std::num::NonZeroU32 must be non-null
@@ -406,7 +406,7 @@ LL | let _val: NonNull = MaybeUninit::zeroed().assume_init();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| |
| this code causes undefined behavior when executed
- | help: use `MaybeUninit` instead
+ | help: use `MaybeUninit` instead, and only call `assume_init` after initialization is done
|
= note: std::ptr::NonNull must be non-null
@@ -417,7 +417,7 @@ LL | let _val: NonNull = MaybeUninit::uninit().assume_init();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| |
| this code causes undefined behavior when executed
- | help: use `MaybeUninit` instead
+ | help: use `MaybeUninit` instead, and only call `assume_init` after initialization is done
|
= note: std::ptr::NonNull must be non-null
@@ -428,7 +428,7 @@ LL | let _val: bool = MaybeUninit::uninit().assume_init();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| |
| this code causes undefined behavior when executed
- | help: use `MaybeUninit` instead
+ | help: use `MaybeUninit` instead, and only call `assume_init` after initialization is done
|
= note: Booleans must be `true` or `false`
diff --git a/src/test/ui/no-send-res-ports.rs b/src/test/ui/no-send-res-ports.rs
index 01fc29713a45d..85d812dd61904 100644
--- a/src/test/ui/no-send-res-ports.rs
+++ b/src/test/ui/no-send-res-ports.rs
@@ -1,5 +1,4 @@
-// ignore-x86
-// ^ due to stderr output differences
+// ignore-x86 FIXME: missing sysroot spans (#53081)
use std::thread;
use std::rc::Rc;
diff --git a/src/test/ui/no-send-res-ports.stderr b/src/test/ui/no-send-res-ports.stderr
index dc186f7c85e94..f23a3bf832ab6 100644
--- a/src/test/ui/no-send-res-ports.stderr
+++ b/src/test/ui/no-send-res-ports.stderr
@@ -1,5 +1,5 @@
error[E0277]: `std::rc::Rc<()>` cannot be sent between threads safely
- --> $DIR/no-send-res-ports.rs:27:5
+ --> $DIR/no-send-res-ports.rs:26:5
|
LL | thread::spawn(move|| {
| ^^^^^^^^^^^^^ `std::rc::Rc<()>` cannot be sent between threads safely
@@ -9,10 +9,10 @@ LL | thread::spawn(move|| {
LL | F: FnOnce() -> T, F: Send + 'static, T: Send + 'static
| ---- required by this bound in `std::thread::spawn`
|
- = help: within `[closure@$DIR/no-send-res-ports.rs:27:19: 31:6 x:main::Foo]`, the trait `std::marker::Send` is not implemented for `std::rc::Rc<()>`
+ = help: within `[closure@$DIR/no-send-res-ports.rs:26:19: 30:6 x:main::Foo]`, the trait `std::marker::Send` is not implemented for `std::rc::Rc<()>`
= note: required because it appears within the type `Port<()>`
= note: required because it appears within the type `main::Foo`
- = note: required because it appears within the type `[closure@$DIR/no-send-res-ports.rs:27:19: 31:6 x:main::Foo]`
+ = note: required because it appears within the type `[closure@$DIR/no-send-res-ports.rs:26:19: 30:6 x:main::Foo]`
error: aborting due to previous error
diff --git a/src/test/ui/pathless-extern-ok.rs b/src/test/ui/pathless-extern-ok.rs
new file mode 100644
index 0000000000000..0ffa5eb894040
--- /dev/null
+++ b/src/test/ui/pathless-extern-ok.rs
@@ -0,0 +1,9 @@
+// edition:2018
+// compile-flags:--extern alloc
+// build-pass
+
+// Test that `--extern alloc` will load from the sysroot without error.
+
+fn main() {
+ let _: Vec = alloc::vec::Vec::new();
+}
diff --git a/src/test/ui/rfc-1937-termination-trait/termination-trait-test-wrong-type.rs b/src/test/ui/rfc-1937-termination-trait/termination-trait-test-wrong-type.rs
index c27cea302fc40..a028247ec5c11 100644
--- a/src/test/ui/rfc-1937-termination-trait/termination-trait-test-wrong-type.rs
+++ b/src/test/ui/rfc-1937-termination-trait/termination-trait-test-wrong-type.rs
@@ -1,6 +1,5 @@
// compile-flags: --test
-// ignore-x86
-// ^ due to stderr output differences
+// ignore-x86 FIXME: missing sysroot spans (#53081)
use std::num::ParseFloatError;
diff --git a/src/test/ui/rfc-1937-termination-trait/termination-trait-test-wrong-type.stderr b/src/test/ui/rfc-1937-termination-trait/termination-trait-test-wrong-type.stderr
index 6aa95c308f248..9cefef58bf53a 100644
--- a/src/test/ui/rfc-1937-termination-trait/termination-trait-test-wrong-type.stderr
+++ b/src/test/ui/rfc-1937-termination-trait/termination-trait-test-wrong-type.stderr
@@ -1,5 +1,5 @@
error[E0277]: `main` has invalid return type `std::result::Result`
- --> $DIR/termination-trait-test-wrong-type.rs:8:1
+ --> $DIR/termination-trait-test-wrong-type.rs:7:1
|
LL | / fn can_parse_zero_as_f32() -> Result {
LL | | "0".parse()
diff --git a/src/test/ui/traits/trait-suggest-where-clause.rs b/src/test/ui/traits/trait-suggest-where-clause.rs
index 5ed14a6a86685..5d3464d20f30d 100644
--- a/src/test/ui/traits/trait-suggest-where-clause.rs
+++ b/src/test/ui/traits/trait-suggest-where-clause.rs
@@ -1,5 +1,4 @@
-// ignore-x86
-// ^ due to stderr output differences
+// ignore-x86 FIXME: missing sysroot spans (#53081)
use std::mem;
struct Misc(T);
diff --git a/src/test/ui/traits/trait-suggest-where-clause.stderr b/src/test/ui/traits/trait-suggest-where-clause.stderr
index f1004ea9dc6ee..2bb7defdac710 100644
--- a/src/test/ui/traits/trait-suggest-where-clause.stderr
+++ b/src/test/ui/traits/trait-suggest-where-clause.stderr
@@ -1,5 +1,5 @@
error[E0277]: the size for values of type `U` cannot be known at compilation time
- --> $DIR/trait-suggest-where-clause.rs:9:20
+ --> $DIR/trait-suggest-where-clause.rs:8:20
|
LL | fn check() {
| -- help: consider further restricting this bound: `U: std::marker::Sized +`
@@ -16,7 +16,7 @@ LL | pub const fn size_of() -> usize {
= note: to learn more, visit
error[E0277]: the size for values of type `U` cannot be known at compilation time
- --> $DIR/trait-suggest-where-clause.rs:12:5
+ --> $DIR/trait-suggest-where-clause.rs:11:5
|
LL | fn check() {
| -- help: consider further restricting this bound: `U: std::marker::Sized +`
@@ -34,7 +34,7 @@ LL | pub const fn size_of() -> usize {
= note: required because it appears within the type `Misc`
error[E0277]: the trait bound `u64: std::convert::From` is not satisfied
- --> $DIR/trait-suggest-where-clause.rs:17:5
+ --> $DIR/trait-suggest-where-clause.rs:16:5
|
LL | >::from;
| ^^^^^^^^^^^^^^^^^^^^^^ the trait `std::convert::From` is not implemented for `u64`
@@ -42,7 +42,7 @@ LL | >::from;
= note: required by `std::convert::From::from`
error[E0277]: the trait bound `u64: std::convert::From<::Item>` is not satisfied
- --> $DIR/trait-suggest-where-clause.rs:20:5
+ --> $DIR/trait-suggest-where-clause.rs:19:5
|
LL | ::Item>>::from;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `std::convert::From<::Item>` is not implemented for `u64`
@@ -50,7 +50,7 @@ LL | ::Item>>::from;
= note: required by `std::convert::From::from`
error[E0277]: the trait bound `Misc<_>: std::convert::From` is not satisfied
- --> $DIR/trait-suggest-where-clause.rs:25:5
+ --> $DIR/trait-suggest-where-clause.rs:24:5
|
LL | as From>::from;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `std::convert::From` is not implemented for `Misc<_>`
@@ -58,7 +58,7 @@ LL | as From>::from;
= note: required by `std::convert::From::from`
error[E0277]: the size for values of type `[T]` cannot be known at compilation time
- --> $DIR/trait-suggest-where-clause.rs:30:20
+ --> $DIR/trait-suggest-where-clause.rs:29:20
|
LL | mem::size_of::<[T]>();
| ^^^ doesn't have a size known at compile-time
@@ -72,7 +72,7 @@ LL | pub const fn size_of() -> usize {
= note: to learn more, visit
error[E0277]: the size for values of type `[&U]` cannot be known at compilation time
- --> $DIR/trait-suggest-where-clause.rs:33:5
+ --> $DIR/trait-suggest-where-clause.rs:32:5
|
LL | mem::size_of::<[&U]>();
| ^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time
diff --git a/src/test/ui/type_length_limit.rs b/src/test/ui/type_length_limit.rs
index cd15f81a61535..926f12911c52a 100644
--- a/src/test/ui/type_length_limit.rs
+++ b/src/test/ui/type_length_limit.rs
@@ -1,5 +1,4 @@
-// ignore-musl
-// ignore-x86
+// ignore-x86 FIXME: missing sysroot spans (#53081)
// error-pattern: reached the type-length limit while instantiating
// Test that the type length limit can be changed.
diff --git a/src/tools/tidy/src/style.rs b/src/tools/tidy/src/style.rs
index 9302909968615..5abe481368df5 100644
--- a/src/tools/tidy/src/style.rs
+++ b/src/tools/tidy/src/style.rs
@@ -160,6 +160,8 @@ pub fn check(path: &Path, bad: &mut bool) {
let can_contain = contents.contains("// ignore-tidy-") ||
contents.contains("# ignore-tidy-");
let mut skip_cr = contains_ignore_directive(can_contain, &contents, "cr");
+ let mut skip_undocumented_unsafe =
+ contains_ignore_directive(can_contain, &contents, "undocumented-unsafe");
let mut skip_tab = contains_ignore_directive(can_contain, &contents, "tab");
let mut skip_line_length = contains_ignore_directive(can_contain, &contents, "linelength");
let mut skip_file_length = contains_ignore_directive(can_contain, &contents, "filelength");
@@ -171,6 +173,7 @@ pub fn check(path: &Path, bad: &mut bool) {
let mut leading_new_lines = false;
let mut trailing_new_lines = 0;
let mut lines = 0;
+ let mut last_safety_comment = false;
for (i, line) in contents.split('\n').enumerate() {
let mut err = |msg: &str| {
tidy_error!(bad, "{}:{}: {}", file.display(), i + 1, msg);
@@ -200,6 +203,20 @@ pub fn check(path: &Path, bad: &mut bool) {
err("XXX is deprecated; use FIXME")
}
}
+ let is_test = || file.components().any(|c| c.as_os_str() == "tests");
+ // for now we just check libcore
+ if line.contains("unsafe {") && !line.trim().starts_with("//") && !last_safety_comment {
+ if file.components().any(|c| c.as_os_str() == "libcore") && !is_test() {
+ suppressible_tidy_err!(err, skip_undocumented_unsafe, "undocumented unsafe");
+ }
+ }
+ if line.contains("// SAFETY: ") || line.contains("// Safety: ") {
+ last_safety_comment = true;
+ } else if line.trim().starts_with("//") || line.trim().is_empty() {
+ // keep previous value
+ } else {
+ last_safety_comment = false;
+ }
if (line.starts_with("// Copyright") ||
line.starts_with("# Copyright") ||
line.starts_with("Copyright"))