Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rollup of 6 pull requests #136049

Closed
wants to merge 22 commits into from
Closed
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
8099510
Fix linking for symbols starting with ?
checkraisefold Sep 25, 2024
784d47b
Add a test
checkraisefold Dec 31, 2024
a4c628c
Significant test improvements
checkraisefold Dec 31, 2024
f81ebfb
Match LLVM behavior more closely
checkraisefold Jan 14, 2025
bf36338
Accept tidy changes
checkraisefold Jan 14, 2025
9c3b53d
Apply tidy suggestion (2)
checkraisefold Jan 14, 2025
893d81f
on s390x, use `PassMode::Direct` for vector types
folkertdev Jan 20, 2025
9d6a1c9
Shorten linker output even more when `--verbose` is not present
jyn514 Jan 18, 2025
a745b60
Only use linker-flavor=gnu-cc if we're actually going to compare the …
jyn514 Jan 22, 2025
aaccb71
Fix sparcv8plus test on LLVM 20
nikic Jan 20, 2025
2718710
Fix x86_64-bigint-helpers test on LLVM 20
nikic Jan 20, 2025
dd52bfc
Reword "crate not found" resolve message
estebank Nov 18, 2024
7c885c1
Compare object files, not PATH
jyn514 Jan 19, 2025
7786f7f
run-make-support: add `sysroot` helper
jieyouxu Jan 21, 2025
1912d56
run-make-support: improve docs for `assert_exit_code`
jieyouxu Jan 22, 2025
388a52f
tests: port `translation` to rmake.rs
jieyouxu Jan 21, 2025
ecbf0ac
Rollup merge of #130808 - checkraisefold:fix-questionmark-linking, r=…
matthiaskrgr Jan 25, 2025
82fe031
Rollup merge of #133154 - estebank:issue-133137, r=wesleywiser
matthiaskrgr Jan 25, 2025
8513b74
Rollup merge of #135707 - jyn514:linker-messages-2, r=bjorn3
matthiaskrgr Jan 25, 2025
59ac9a5
Rollup merge of #135764 - nikic:llvm-20-test-fixes, r=wesleywiser
matthiaskrgr Jan 25, 2025
9d2f089
Rollup merge of #135785 - folkertdev:s390x-vector-passmode-direct, r=…
matthiaskrgr Jan 25, 2025
172dcf2
Rollup merge of #135818 - jieyouxu:migrate-translation, r=compiler-er…
matthiaskrgr Jan 25, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Cargo.lock
Original file line number Diff line number Diff line change
@@ -3537,6 +3537,7 @@ dependencies = [
"ar_archive_writer",
"arrayvec",
"bitflags",
"bstr",
"cc",
"either",
"itertools",
1 change: 1 addition & 0 deletions compiler/rustc_codegen_ssa/Cargo.toml
Original file line number Diff line number Diff line change
@@ -8,6 +8,7 @@ edition = "2021"
ar_archive_writer = "0.4.2"
arrayvec = { version = "0.7", default-features = false }
bitflags = "2.4.1"
bstr = "1.11.3"
# Pinned so `cargo update` bumps don't cause breakage. Please also update the
# `cc` in `rustc_llvm` if you update the `cc` here.
cc = "=1.2.7"
17 changes: 16 additions & 1 deletion compiler/rustc_codegen_ssa/src/back/command.rs
Original file line number Diff line number Diff line change
@@ -13,6 +13,7 @@ pub(crate) struct Command {
args: Vec<OsString>,
env: Vec<(OsString, OsString)>,
env_remove: Vec<OsString>,
env_clear: bool,
}

#[derive(Clone)]
@@ -36,7 +37,13 @@ impl Command {
}

fn _new(program: Program) -> Command {
Command { program, args: Vec::new(), env: Vec::new(), env_remove: Vec::new() }
Command {
program,
args: Vec::new(),
env: Vec::new(),
env_remove: Vec::new(),
env_clear: false,
}
}

pub(crate) fn arg<P: AsRef<OsStr>>(&mut self, arg: P) -> &mut Command {
@@ -79,6 +86,11 @@ impl Command {
self
}

pub(crate) fn env_clear(&mut self) -> &mut Command {
self.env_clear = true;
self
}

fn _env_remove(&mut self, key: &OsStr) {
self.env_remove.push(key.to_owned());
}
@@ -106,6 +118,9 @@ impl Command {
for k in &self.env_remove {
ret.env_remove(k);
}
if self.env_clear {
ret.env_clear();
}
ret
}

1 change: 1 addition & 0 deletions compiler/rustc_codegen_ssa/src/back/link.rs
Original file line number Diff line number Diff line change
@@ -991,6 +991,7 @@ fn link_natively(
command: cmd,
escaped_output,
verbose: sess.opts.verbose,
sysroot_dir: sess.sysroot.clone(),
};
sess.dcx().emit_err(err);
// If MSVC's `link.exe` was expected but the return code
3 changes: 3 additions & 0 deletions compiler/rustc_codegen_ssa/src/back/symbol_export.rs
Original file line number Diff line number Diff line change
@@ -577,6 +577,9 @@ pub(crate) fn linking_symbol_name_for_instance_in_crate<'tcx>(
}

let prefix = match &target.arch[..] {
"x86" | "x86_64" if target.is_like_msvc && undecorated.starts_with("?") => {
return undecorated;
}
"x86" => Some('_'),
"x86_64" => None,
"arm64ec" => Some('#'),
62 changes: 47 additions & 15 deletions compiler/rustc_codegen_ssa/src/errors.rs
Original file line number Diff line number Diff line change
@@ -351,6 +351,7 @@ pub(crate) struct LinkingFailed<'a> {
pub command: Command,
pub escaped_output: String,
pub verbose: bool,
pub sysroot_dir: PathBuf,
}

impl<G: EmissionGuarantee> Diagnostic<'_, G> for LinkingFailed<'_> {
@@ -364,6 +365,8 @@ impl<G: EmissionGuarantee> Diagnostic<'_, G> for LinkingFailed<'_> {
if self.verbose {
diag.note(format!("{:?}", self.command));
} else {
self.command.env_clear();

enum ArgGroup {
Regular(OsString),
Objects(usize),
@@ -398,26 +401,55 @@ impl<G: EmissionGuarantee> Diagnostic<'_, G> for LinkingFailed<'_> {
args.push(ArgGroup::Regular(arg));
}
}
self.command.args(args.into_iter().map(|arg_group| match arg_group {
ArgGroup::Regular(arg) => arg,
ArgGroup::Objects(n) => OsString::from(format!("<{n} object files omitted>")),
ArgGroup::Rlibs(dir, rlibs) => {
let mut arg = dir.into_os_string();
arg.push("/{");
let mut first = true;
for rlib in rlibs {
if !first {
arg.push(",");
let crate_hash = regex::bytes::Regex::new(r"-[0-9a-f]+\.rlib$").unwrap();
self.command.args(args.into_iter().map(|arg_group| {
match arg_group {
// SAFETY: we are only matching on ASCII, not any surrogate pairs, so any replacements we do will still be valid.
ArgGroup::Regular(arg) => unsafe {
use bstr::ByteSlice;
OsString::from_encoded_bytes_unchecked(
arg.as_encoded_bytes().replace(
self.sysroot_dir.as_os_str().as_encoded_bytes(),
b"<sysroot>",
),
)
},
ArgGroup::Objects(n) => OsString::from(format!("<{n} object files omitted>")),
ArgGroup::Rlibs(mut dir, rlibs) => {
let is_sysroot_dir = match dir.strip_prefix(&self.sysroot_dir) {
Ok(short) => {
dir = Path::new("<sysroot>").join(short);
true
}
Err(_) => false,
};
let mut arg = dir.into_os_string();
arg.push("/{");
let mut first = true;
for mut rlib in rlibs {
if !first {
arg.push(",");
}
first = false;
if is_sysroot_dir {
// SAFETY: Regex works one byte at a type, and our regex will not match surrogate pairs (because it only matches ascii).
rlib = unsafe {
OsString::from_encoded_bytes_unchecked(
crate_hash
.replace(rlib.as_encoded_bytes(), b"-*")
.into_owned(),
)
};
}
arg.push(rlib);
}
first = false;
arg.push(rlib);
arg.push("}.rlib");
arg
}
arg.push("}");
arg
}
}));

diag.note(format!("{:?}", self.command));
diag.note(format!("{:?}", self.command).trim_start_matches("env -i").to_owned());
diag.note("some arguments are omitted. use `--verbose` to show all linker arguments");
}

2 changes: 1 addition & 1 deletion compiler/rustc_error_codes/src/error_codes/E0433.md
Original file line number Diff line number Diff line change
@@ -19,7 +19,7 @@ If you've expected to use a crate name:

```compile_fail
use ferris_wheel::BigO;
// error: failed to resolve: use of undeclared crate or module `ferris_wheel`
// error: failed to resolve: use of undeclared module or unlinked crate
```

Make sure the crate has been added as a dependency in `Cargo.toml`.
36 changes: 32 additions & 4 deletions compiler/rustc_resolve/src/diagnostics.rs
Original file line number Diff line number Diff line change
@@ -24,6 +24,7 @@ use rustc_session::lint::builtin::{
MACRO_EXPANDED_MACRO_EXPORTS_ACCESSED_BY_ABSOLUTE_PATHS,
};
use rustc_session::lint::{AmbiguityErrorDiag, BuiltinLintDiag};
use rustc_session::utils::was_invoked_from_cargo;
use rustc_span::edit_distance::find_best_match_for_name;
use rustc_span::edition::Edition;
use rustc_span::hygiene::MacroKind;
@@ -800,7 +801,6 @@ impl<'ra, 'tcx> Resolver<'ra, 'tcx> {
}
err.multipart_suggestion(msg, suggestions, applicability);
}

if let Some(ModuleOrUniformRoot::Module(module)) = module
&& let Some(module) = module.opt_def_id()
&& let Some(segment) = segment
@@ -2034,13 +2034,23 @@ impl<'ra, 'tcx> Resolver<'ra, 'tcx> {
(format!("`_` is not a valid crate or module name"), None)
} else if self.tcx.sess.is_rust_2015() {
(
format!("you might be missing crate `{ident}`"),
format!("use of unresolved module or unlinked crate `{ident}`"),
Some((
vec![(
self.current_crate_outer_attr_insert_span,
format!("extern crate {ident};\n"),
)],
format!("consider importing the `{ident}` crate"),
if was_invoked_from_cargo() {
format!(
"if you wanted to use a crate named `{ident}`, use `cargo add {ident}` \
to add it to your `Cargo.toml` and import it in your code",
)
} else {
format!(
"you might be missing a crate named `{ident}`, add it to your \
project and import it in your code",
)
},
Applicability::MaybeIncorrect,
)),
)
@@ -2219,7 +2229,25 @@ impl<'ra, 'tcx> Resolver<'ra, 'tcx> {
let descr = binding.res().descr();
(format!("{descr} `{ident}` is not a crate or module"), suggestion)
} else {
(format!("use of undeclared crate or module `{ident}`"), suggestion)
let suggestion = if suggestion.is_some() {
suggestion
} else if was_invoked_from_cargo() {
Some((
vec![],
format!(
"if you wanted to use a crate named `{ident}`, use `cargo add {ident}` \
to add it to your `Cargo.toml`",
),
Applicability::MaybeIncorrect,
))
} else {
Some((
vec![],
format!("you might be missing a crate named `{ident}`",),
Applicability::MaybeIncorrect,
))
};
(format!("use of unresolved module or unlinked crate `{ident}`"), suggestion)
}
}
}
14 changes: 11 additions & 3 deletions compiler/rustc_target/src/callconv/s390x.rs
Original file line number Diff line number Diff line change
@@ -38,9 +38,17 @@ where
}

let size = arg.layout.size;
if size.bits() <= 128 && arg.layout.is_single_vector_element(cx, size) {
arg.cast_to(Reg { kind: RegKind::Vector, size });
return;
if size.bits() <= 128 {
if let BackendRepr::Vector { .. } = arg.layout.backend_repr {
// pass non-wrapped vector types using `PassMode::Direct`
return;
}

if arg.layout.is_single_vector_element(cx, size) {
// pass non-transparant wrappers around a vector as `PassMode::Cast`
arg.cast_to(Reg { kind: RegKind::Vector, size });
return;
}
}
if !arg.layout.is_aggregate() && size.bits() <= 64 {
arg.extend_integer_width_to(64);
2 changes: 2 additions & 0 deletions src/tools/compiletest/src/runtest/run_make.rs
Original file line number Diff line number Diff line change
@@ -414,6 +414,8 @@ impl TestCx<'_> {
// Provide path to checkout root. This is the top-level directory containing
// rust-lang/rust checkout.
.env("SOURCE_ROOT", &source_root)
// Path to the build directory. This is usually the same as `source_root.join("build").join("host")`.
.env("BUILD_ROOT", &build_root)
// Provide path to stage-corresponding rustc.
.env("RUSTC", &self.config.rustc_path)
// Provide the directory to libraries that are needed to run the *compiler*. This is not
2 changes: 1 addition & 1 deletion src/tools/miri/tests/fail/rustc-error2.rs
Original file line number Diff line number Diff line change
@@ -4,7 +4,7 @@ struct Struct<T>(T);
impl<T> std::ops::Deref for Struct<T> {
type Target = dyn Fn(T);
fn deref(&self) -> &assert_mem_uninitialized_valid::Target {
//~^ERROR: undeclared crate or module
//~^ERROR: use of unresolved module or unlinked crate
unimplemented!()
}
}
6 changes: 4 additions & 2 deletions src/tools/miri/tests/fail/rustc-error2.stderr
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
error[E0433]: failed to resolve: use of undeclared crate or module `assert_mem_uninitialized_valid`
error[E0433]: failed to resolve: use of unresolved module or unlinked crate `assert_mem_uninitialized_valid`
--> tests/fail/rustc-error2.rs:LL:CC
|
LL | fn deref(&self) -> &assert_mem_uninitialized_valid::Target {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ use of undeclared crate or module `assert_mem_uninitialized_valid`
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ use of unresolved module or unlinked crate `assert_mem_uninitialized_valid`
|
= help: you might be missing a crate named `assert_mem_uninitialized_valid`

error: aborting due to 1 previous error

8 changes: 7 additions & 1 deletion src/tools/run-make-support/src/command.rs
Original file line number Diff line number Diff line change
@@ -388,9 +388,15 @@ impl CompletedProcess {
self
}

/// Check the **exit status** of the process. On Unix, this is *not* the **wait status**.
///
/// See [`std::process::ExitStatus::code`]. This is not to be confused with
/// [`std::process::ExitCode`].
#[track_caller]
pub fn assert_exit_code(&self, code: i32) -> &Self {
assert!(self.output.status.code() == Some(code));
// FIXME(jieyouxu): this should really be named `exit_status`, because std has an `ExitCode`
// that means a different thing.
assert_eq!(self.output.status.code(), Some(code));
self
}
}
10 changes: 9 additions & 1 deletion src/tools/run-make-support/src/external_deps/rustc.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
use std::ffi::{OsStr, OsString};
use std::path::Path;
use std::path::{Path, PathBuf};
use std::str::FromStr as _;

use crate::command::Command;
use crate::env::env_var;
@@ -390,3 +391,10 @@ impl Rustc {
self
}
}

/// Query the sysroot path corresponding `rustc --print=sysroot`.
#[track_caller]
pub fn sysroot() -> PathBuf {
let path = rustc().print("sysroot").run().stdout_utf8();
PathBuf::from_str(path.trim()).unwrap()
}
2 changes: 1 addition & 1 deletion src/tools/run-make-support/src/lib.rs
Original file line number Diff line number Diff line change
@@ -90,7 +90,7 @@ pub use artifact_names::{
/// Path-related helpers.
pub use path_helpers::{
cwd, filename_contains, filename_not_in_denylist, has_extension, has_prefix, has_suffix,
not_contains, path, shallow_find_files, source_root,
not_contains, path, shallow_find_files, build_root, source_root,
};

/// Helpers for scoped test execution where certain properties are attempted to be maintained.
6 changes: 6 additions & 0 deletions src/tools/run-make-support/src/path_helpers.rs
Original file line number Diff line number Diff line change
@@ -34,6 +34,12 @@ pub fn source_root() -> PathBuf {
env_var("SOURCE_ROOT").into()
}

/// Path to the build directory root.
#[must_use]
pub fn build_root() -> PathBuf {
env_var("BUILD_ROOT").into()
}

/// Browse the directory `path` non-recursively and return all files which respect the parameters
/// outlined by `closure`.
#[track_caller]
1 change: 0 additions & 1 deletion src/tools/tidy/src/allowed_run_make_makefiles.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
run-make/split-debuginfo/Makefile
run-make/symbol-mangling-hashed/Makefile
run-make/translation/Makefile
1 change: 1 addition & 0 deletions src/tools/tidy/src/deps.rs
Original file line number Diff line number Diff line change
@@ -253,6 +253,7 @@ const PERMITTED_RUSTC_DEPENDENCIES: &[&str] = &[
"bitflags",
"blake3",
"block-buffer",
"bstr",
"byteorder", // via ruzstd in object in thorin-dwp
"cc",
"cfg-if",
19 changes: 13 additions & 6 deletions tests/assembly/x86_64-bigint-helpers.rs
Original file line number Diff line number Diff line change
@@ -2,6 +2,9 @@
//@ assembly-output: emit-asm
//@ compile-flags: --crate-type=lib -O -C target-cpu=x86-64-v4
//@ compile-flags: -C llvm-args=-x86-asm-syntax=intel
//@ revisions: llvm-pre-20 llvm-20
//@ [llvm-20] min-llvm-version: 20
//@ [llvm-pre-20] max-llvm-major-version: 19

#![no_std]
#![feature(bigint_helper_methods)]
@@ -20,12 +23,16 @@ pub unsafe extern "sysv64" fn bigint_chain_carrying_add(
n: usize,
mut carry: bool,
) -> bool {
// CHECK: mov [[TEMP:r..]], qword ptr [rsi + 8*[[IND:r..]] + 8]
// CHECK: adc [[TEMP]], qword ptr [rdx + 8*[[IND]] + 8]
// CHECK: mov qword ptr [rdi + 8*[[IND]] + 8], [[TEMP]]
// CHECK: mov [[TEMP]], qword ptr [rsi + 8*[[IND]] + 16]
// CHECK: adc [[TEMP]], qword ptr [rdx + 8*[[IND]] + 16]
// CHECK: mov qword ptr [rdi + 8*[[IND]] + 16], [[TEMP]]
// llvm-pre-20: mov [[TEMP:r..]], qword ptr [rsi + 8*[[IND:r..]] + 8]
// llvm-pre-20: adc [[TEMP]], qword ptr [rdx + 8*[[IND]] + 8]
// llvm-pre-20: mov qword ptr [rdi + 8*[[IND]] + 8], [[TEMP]]
// llvm-pre-20: mov [[TEMP]], qword ptr [rsi + 8*[[IND]] + 16]
// llvm-pre-20: adc [[TEMP]], qword ptr [rdx + 8*[[IND]] + 16]
// llvm-pre-20: mov qword ptr [rdi + 8*[[IND]] + 16], [[TEMP]]
// llvm-20: adc [[TEMP:r..]], qword ptr [rdx + 8*[[IND:r..]]]
// llvm-20: mov qword ptr [rdi + 8*[[IND]]], [[TEMP]]
// llvm-20: mov [[TEMP]], qword ptr [rsi + 8*[[IND]] + 8]
// llvm-20: adc [[TEMP]], qword ptr [rdx + 8*[[IND]] + 8]
for i in 0..n {
(*dest.add(i), carry) = u64::carrying_add(*src1.add(i), *src2.add(i), carry);
}
143 changes: 143 additions & 0 deletions tests/codegen/s390x-simd.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,143 @@
//! test that s390x vector types are passed using `PassMode::Direct`
//! see also https://github.com/rust-lang/rust/issues/135744
//@ add-core-stubs
//@ compile-flags: --target s390x-unknown-linux-gnu -O
//@ needs-llvm-components: systemz

#![crate_type = "rlib"]
#![feature(no_core, asm_experimental_arch)]
#![feature(s390x_target_feature, simd_ffi, link_llvm_intrinsics, repr_simd)]
#![no_core]

extern crate minicore;
use minicore::*;

#[repr(simd)]
struct i8x16([i8; 16]);

#[repr(simd)]
struct i16x8([i16; 8]);

#[repr(simd)]
struct i32x4([i32; 4]);

#[repr(simd)]
struct i64x2([i64; 2]);

#[repr(simd)]
struct f32x4([f32; 4]);

#[repr(simd)]
struct f64x2([f64; 2]);

#[allow(improper_ctypes)]
extern "C" {
#[link_name = "llvm.smax.v16i8"]
fn vmxb(a: i8x16, b: i8x16) -> i8x16;
#[link_name = "llvm.smax.v8i16"]
fn vmxh(a: i16x8, b: i16x8) -> i16x8;
#[link_name = "llvm.smax.v4i32"]
fn vmxf(a: i32x4, b: i32x4) -> i32x4;
#[link_name = "llvm.smax.v2i64"]
fn vmxg(a: i64x2, b: i64x2) -> i64x2;
}

// CHECK-LABEL: define <16 x i8> @max_i8x16
// CHECK-SAME: <16 x i8> %a, <16 x i8> %b
// CHECK: call <16 x i8> @llvm.smax.v16i8(<16 x i8> %a, <16 x i8> %b)
#[no_mangle]
#[target_feature(enable = "vector")]
pub unsafe extern "C" fn max_i8x16(a: i8x16, b: i8x16) -> i8x16 {
vmxb(a, b)
}

// CHECK-LABEL: define <8 x i16> @max_i16x8
// CHECK-SAME: <8 x i16> %a, <8 x i16> %b
// CHECK: call <8 x i16> @llvm.smax.v8i16(<8 x i16> %a, <8 x i16> %b)
#[no_mangle]
#[target_feature(enable = "vector")]
pub unsafe extern "C" fn max_i16x8(a: i16x8, b: i16x8) -> i16x8 {
vmxh(a, b)
}

// CHECK-LABEL: define <4 x i32> @max_i32x4
// CHECK-SAME: <4 x i32> %a, <4 x i32> %b
// CHECK: call <4 x i32> @llvm.smax.v4i32(<4 x i32> %a, <4 x i32> %b)
#[no_mangle]
#[target_feature(enable = "vector")]
pub unsafe extern "C" fn max_i32x4(a: i32x4, b: i32x4) -> i32x4 {
vmxf(a, b)
}

// CHECK-LABEL: define <2 x i64> @max_i64x2
// CHECK-SAME: <2 x i64> %a, <2 x i64> %b
// CHECK: call <2 x i64> @llvm.smax.v2i64(<2 x i64> %a, <2 x i64> %b)
#[no_mangle]
#[target_feature(enable = "vector")]
pub unsafe extern "C" fn max_i64x2(a: i64x2, b: i64x2) -> i64x2 {
vmxg(a, b)
}

// CHECK-LABEL: define <4 x float> @choose_f32x4
// CHECK-SAME: <4 x float> %a, <4 x float> %b
#[no_mangle]
#[target_feature(enable = "vector")]
pub unsafe extern "C" fn choose_f32x4(a: f32x4, b: f32x4, c: bool) -> f32x4 {
if c { a } else { b }
}

// CHECK-LABEL: define <2 x double> @choose_f64x2
// CHECK-SAME: <2 x double> %a, <2 x double> %b
#[no_mangle]
#[target_feature(enable = "vector")]
pub unsafe extern "C" fn choose_f64x2(a: f64x2, b: f64x2, c: bool) -> f64x2 {
if c { a } else { b }
}

#[repr(C)]
struct Wrapper<T>(T);

#[no_mangle]
#[inline(never)]
#[target_feature(enable = "vector")]
pub unsafe extern "C" fn max_wrapper_i8x16(a: Wrapper<i8x16>, b: Wrapper<i8x16>) -> Wrapper<i8x16> {
// CHECK-LABEL: max_wrapper_i8x16
// CHECK-SAME: sret([16 x i8])
// CHECK-SAME: <16 x i8>
// CHECK-SAME: <16 x i8>
// CHECK: call <16 x i8> @llvm.smax.v16i8
// CHECK-SAME: <16 x i8>
// CHECK-SAME: <16 x i8>
Wrapper(vmxb(a.0, b.0))
}

#[no_mangle]
#[inline(never)]
#[target_feature(enable = "vector")]
pub unsafe extern "C" fn max_wrapper_i64x2(a: Wrapper<i64x2>, b: Wrapper<i64x2>) -> Wrapper<i64x2> {
// CHECK-LABEL: max_wrapper_i64x2
// CHECK-SAME: sret([16 x i8])
// CHECK-SAME: <16 x i8>
// CHECK-SAME: <16 x i8>
// CHECK: call <2 x i64> @llvm.smax.v2i64
// CHECK-SAME: <2 x i64>
// CHECK-SAME: <2 x i64>
Wrapper(vmxg(a.0, b.0))
}

#[no_mangle]
#[inline(never)]
#[target_feature(enable = "vector")]
pub unsafe extern "C" fn choose_wrapper_f64x2(
a: Wrapper<f64x2>,
b: Wrapper<f64x2>,
c: bool,
) -> Wrapper<f64x2> {
// CHECK-LABEL: choose_wrapper_f64x2
// CHECK-SAME: sret([16 x i8])
// CHECK-SAME: <16 x i8>
// CHECK-SAME: <16 x i8>
Wrapper(choose_f64x2(a.0, b.0, c))
}

// CHECK: declare <2 x i64> @llvm.smax.v2i64(<2 x i64>, <2 x i64>)
44 changes: 33 additions & 11 deletions tests/run-make/linker-warning/rmake.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,19 @@
use run_make_support::{Rustc, rustc};
use run_make_support::{Rustc, diff, regex, rustc};

fn run_rustc() -> Rustc {
let mut rustc = rustc();
rustc.arg("main.rs").output("main").linker("./fake-linker");
rustc
.arg("main.rs")
// NOTE: `link-self-contained` can vary depending on config.toml.
// Make sure we use a consistent value.
.arg("-Clink-self-contained=-linker")
.arg("-Zunstable-options")
.output("main")
.linker("./fake-linker");
if run_make_support::target() == "x86_64-unknown-linux-gnu" {
// The value of `rust.lld` is different between CI and locally. Override it explicitly.
rustc.arg("-Clinker-flavor=gnu-cc");
}
rustc
}

@@ -11,18 +22,29 @@ fn main() {
rustc().arg("fake-linker.rs").output("fake-linker").run();

// Make sure we don't show the linker args unless `--verbose` is passed
run_rustc()
.link_arg("run_make_error")
.verbose()
.run_fail()
.assert_stderr_contains_regex("fake-linker.*run_make_error")
let out = run_rustc().link_arg("run_make_error").verbose().run_fail();
out.assert_stderr_contains_regex("fake-linker.*run_make_error")
.assert_stderr_not_contains("object files omitted")
.assert_stderr_contains(r".rcgu.o")
.assert_stderr_contains_regex(r"lib(/|\\\\)libstd");
run_rustc()
.link_arg("run_make_error")
.run_fail()
.assert_stderr_contains("fake-linker")

let out = run_rustc().link_arg("run_make_error").run_fail();
out.assert_stderr_contains("fake-linker")
.assert_stderr_contains("object files omitted")
.assert_stderr_contains_regex(r"\{")
.assert_stderr_not_contains(r".rcgu.o")
.assert_stderr_not_contains_regex(r"lib(/|\\\\)libstd");

// FIXME: we should have a version of this for mac and windows
if run_make_support::target() == "x86_64-unknown-linux-gnu" {
diff()
.expected_file("short-error.txt")
.actual_text("(linker error)", out.stderr())
.normalize(r#"/rustc[^/]*/"#, "/rustc/")
.normalize(
regex::escape(run_make_support::build_root().to_str().unwrap()),
"/build-root",
)
.run();
}
}
9 changes: 9 additions & 0 deletions tests/run-make/linker-warning/short-error.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
error: linking with `./fake-linker` failed: exit status: 1
|
= note: "./fake-linker" "-m64" "/tmp/rustc/symbols.o" "<2 object files omitted>" "-Wl,--as-needed" "-Wl,-Bstatic" "<sysroot>/lib/rustlib/x86_64-unknown-linux-gnu/lib/{libstd-*,libpanic_unwind-*,libobject-*,libmemchr-*,libaddr2line-*,libgimli-*,librustc_demangle-*,libstd_detect-*,libhashbrown-*,librustc_std_workspace_alloc-*,libminiz_oxide-*,libadler2-*,libunwind-*,libcfg_if-*,liblibc-*,liballoc-*,librustc_std_workspace_core-*,libcore-*,libcompiler_builtins-*}.rlib" "-Wl,-Bdynamic" "-lgcc_s" "-lutil" "-lrt" "-lpthread" "-lm" "-ldl" "-lc" "-Wl,--eh-frame-hdr" "-Wl,-z,noexecstack" "-L" "/build-root/test/run-make/linker-warning/rmake_out" "-L" "<sysroot>/lib/rustlib/x86_64-unknown-linux-gnu/lib" "-o" "main" "-Wl,--gc-sections" "-pie" "-Wl,-z,relro,-z,now" "-nodefaultlibs" "run_make_error"
= note: some arguments are omitted. use `--verbose` to show all linker arguments
= note: error: baz


error: aborting due to 1 previous error

78 changes: 0 additions & 78 deletions tests/run-make/translation/Makefile

This file was deleted.

174 changes: 174 additions & 0 deletions tests/run-make/translation/rmake.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,174 @@
//! Smoke test for the rustc diagnostics translation infrastructure.
//!
//! # References
//!
//! - Current tracking issue: <https://github.com/rust-lang/rust/issues/132181>.
//! - Old tracking issue: <https://github.com/rust-lang/rust/issues/100717>
//! - Initial translation infra implementation: <https://github.com/rust-lang/rust/pull/95512>.
// This test uses symbolic links to stub out a fake sysroot to save testing time.
//@ needs-symlink
//@ needs-subprocess

#![deny(warnings)]

use std::path::{Path, PathBuf};

use run_make_support::rustc::sysroot;
use run_make_support::{cwd, rfs, run_in_tmpdir, rustc};

fn main() {
builtin_fallback_bundle();
additional_primary_bundle();
missing_slug_prefers_fallback_bundle();
broken_primary_bundle_prefers_fallback_bundle();
locale_sysroot();
missing_sysroot();
file_sysroot();
}

/// Check that the test works normally, using the built-in fallback bundle.
fn builtin_fallback_bundle() {
rustc().input("test.rs").run_fail().assert_stderr_contains("struct literal body without path");
}

/// Check that a primary bundle can be loaded and will be preferentially used where possible.
fn additional_primary_bundle() {
rustc()
.input("test.rs")
.arg("-Ztranslate-additional-ftl=working.ftl")
.run_fail()
.assert_stderr_contains("this is a test message");
}

/// Check that a primary bundle without the desired message will use the fallback bundle.
fn missing_slug_prefers_fallback_bundle() {
rustc()
.input("test.rs")
.arg("-Ztranslate-additional-ftl=missing.ftl")
.run_fail()
.assert_stderr_contains("struct literal body without path");
}

/// Check that a primary bundle with a broken message (e.g. an interpolated variable is not
/// provided) will use the fallback bundle.
fn broken_primary_bundle_prefers_fallback_bundle() {
// FIXME(#135817): as of the rmake.rs port, the compiler actually ICEs on the additional
// `broken.ftl`, even though the original intention seems to be that it should gracefully
// failover to the fallback bundle.

rustc()
.env("RUSTC_ICE", "0") // disable ICE dump file, not needed
.input("test.rs")
.arg("-Ztranslate-additional-ftl=broken.ftl")
.run_fail()
.assert_exit_code(101);
}

#[track_caller]
fn shallow_symlink_dir_entries(src_dir: &Path, dst_dir: &Path) {
for entry in rfs::read_dir(src_dir) {
let entry = entry.unwrap();
let src_entry_path = entry.path();
let src_filename = src_entry_path.file_name().unwrap();
let meta = rfs::symlink_metadata(&src_entry_path);

if meta.is_symlink() || meta.is_file() {
rfs::symlink_file(&src_entry_path, dst_dir.join(src_filename));
} else if meta.is_dir() {
rfs::symlink_dir(&src_entry_path, dst_dir.join(src_filename));
} else {
unreachable!()
}
}
}

#[track_caller]
fn shallow_symlink_dir_entries_materialize_single_dir(
src_dir: &Path,
dst_dir: &Path,
dir_filename: &str,
) {
shallow_symlink_dir_entries(src_dir, dst_dir);
rfs::remove_file(dst_dir.join(dir_filename));
rfs::create_dir_all(dst_dir.join(dir_filename));
}

#[track_caller]
fn setup_fakeroot_parents() -> PathBuf {
let sysroot = sysroot();
let fakeroot = cwd().join("fakeroot");
rfs::create_dir_all(&fakeroot);
shallow_symlink_dir_entries_materialize_single_dir(&sysroot, &fakeroot, "lib");
shallow_symlink_dir_entries_materialize_single_dir(
&sysroot.join("lib"),
&fakeroot.join("lib"),
"rustlib",
);
shallow_symlink_dir_entries_materialize_single_dir(
&sysroot.join("lib").join("rustlib"),
&fakeroot.join("lib").join("rustlib"),
"src",
);
shallow_symlink_dir_entries(
&sysroot.join("lib").join("rustlib").join("src"),
&fakeroot.join("lib").join("rustlib").join("src"),
);
fakeroot
}

/// Check that a locale can be loaded from the sysroot given a language identifier by making a local
/// copy of the sysroot and adding the custom locale to it.
fn locale_sysroot() {
run_in_tmpdir(|| {
let fakeroot = setup_fakeroot_parents();

// When download-rustc is enabled, real sysroot will have a share directory. Delete the link
// to it.
let _ = std::fs::remove_file(fakeroot.join("share"));

let fake_locale_path = fakeroot.join("share").join("locale").join("zh-CN");
rfs::create_dir_all(&fake_locale_path);
rfs::symlink_file(
cwd().join("working.ftl"),
fake_locale_path.join("basic-translation.ftl"),
);

rustc()
.env("RUSTC_ICE", "0")
.input("test.rs")
.sysroot(&fakeroot)
.arg("-Ztranslate-lang=zh-CN")
.run_fail()
.assert_stderr_contains("this is a test message");
});
}

/// Check that the compiler errors out when the sysroot requested cannot be found. This test might
/// start failing if there actually exists a Klingon translation of rustc's error messages.
fn missing_sysroot() {
run_in_tmpdir(|| {
rustc()
.input("test.rs")
.arg("-Ztranslate-lang=tlh")
.run_fail()
.assert_stderr_contains("missing locale directory");
});
}

/// Check that the compiler errors out when the directory for the locale in the sysroot is actually
/// a file.
fn file_sysroot() {
run_in_tmpdir(|| {
let fakeroot = setup_fakeroot_parents();
rfs::create_dir_all(fakeroot.join("share").join("locale"));
rfs::write(fakeroot.join("share").join("locale").join("zh-CN"), b"not a dir");

rustc()
.input("test.rs")
.sysroot(&fakeroot)
.arg("-Ztranslate-lang=zh-CN")
.run_fail()
.assert_stderr_contains("is not a directory");
});
}
4 changes: 2 additions & 2 deletions tests/rustdoc-ui/ice-unresolved-import-100241.stderr
Original file line number Diff line number Diff line change
@@ -2,9 +2,9 @@ error[E0432]: unresolved import `inner`
--> $DIR/ice-unresolved-import-100241.rs:9:13
|
LL | pub use inner::S;
| ^^^^^ you might be missing crate `inner`
| ^^^^^ use of unresolved module or unlinked crate `inner`
|
help: consider importing the `inner` crate
help: you might be missing a crate named `inner`, add it to your project and import it in your code
|
LL + extern crate inner;
|
6 changes: 3 additions & 3 deletions tests/rustdoc-ui/intra-doc/unresolved-import-recovery.stderr
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
error[E0433]: failed to resolve: you might be missing crate `unresolved_crate`
error[E0433]: failed to resolve: use of unresolved module or unlinked crate `unresolved_crate`
--> $DIR/unresolved-import-recovery.rs:3:5
|
LL | use unresolved_crate::module::Name;
| ^^^^^^^^^^^^^^^^ you might be missing crate `unresolved_crate`
| ^^^^^^^^^^^^^^^^ use of unresolved module or unlinked crate `unresolved_crate`
|
help: consider importing the `unresolved_crate` crate
help: you might be missing a crate named `unresolved_crate`, add it to your project and import it in your code
|
LL + extern crate unresolved_crate;
|
2 changes: 1 addition & 1 deletion tests/rustdoc-ui/issues/issue-61732.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// This previously triggered an ICE.

pub(in crate::r#mod) fn main() {}
//~^ ERROR failed to resolve: you might be missing crate `r#mod`
//~^ ERROR failed to resolve: use of unresolved module or unlinked crate `r#mod`
6 changes: 3 additions & 3 deletions tests/rustdoc-ui/issues/issue-61732.stderr
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
error[E0433]: failed to resolve: you might be missing crate `r#mod`
error[E0433]: failed to resolve: use of unresolved module or unlinked crate `r#mod`
--> $DIR/issue-61732.rs:3:15
|
LL | pub(in crate::r#mod) fn main() {}
| ^^^^^ you might be missing crate `r#mod`
| ^^^^^ use of unresolved module or unlinked crate `r#mod`
|
help: consider importing the `r#mod` crate
help: you might be missing a crate named `r#mod`, add it to your project and import it in your code
|
LL + extern crate r#mod;
|
43 changes: 43 additions & 0 deletions tests/ui/abi/sparcv8plus-llvm19.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
//@ revisions: sparc sparcv8plus sparc_cpu_v9 sparc_feature_v8plus sparc_cpu_v9_feature_v8plus
//@[sparc] compile-flags: --target sparc-unknown-none-elf
//@[sparc] needs-llvm-components: sparc
//@[sparcv8plus] compile-flags: --target sparc-unknown-linux-gnu
//@[sparcv8plus] needs-llvm-components: sparc
//@[sparc_cpu_v9] compile-flags: --target sparc-unknown-none-elf -C target-cpu=v9
//@[sparc_cpu_v9] needs-llvm-components: sparc
//@[sparc_feature_v8plus] compile-flags: --target sparc-unknown-none-elf -C target-feature=+v8plus
//@[sparc_feature_v8plus] needs-llvm-components: sparc
//@[sparc_cpu_v9_feature_v8plus] compile-flags: --target sparc-unknown-none-elf -C target-cpu=v9 -C target-feature=+v8plus
//@[sparc_cpu_v9_feature_v8plus] needs-llvm-components: sparc
//@ exact-llvm-major-version: 19

#![crate_type = "rlib"]
#![feature(no_core, rustc_attrs, lang_items)]
#![no_core]

#[lang = "sized"]
trait Sized {}
#[lang = "copy"]
trait Copy {}

#[rustc_builtin_macro]
macro_rules! compile_error {
() => {};
}

#[cfg(all(not(target_feature = "v8plus"), not(target_feature = "v9")))]
compile_error!("-v8plus,-v9");
//[sparc]~^ ERROR -v8plus,-v9

// FIXME: sparc_cpu_v9 should be in "-v8plus,+v9" group (fixed in LLVM 20)
#[cfg(all(target_feature = "v8plus", target_feature = "v9"))]
compile_error!("+v8plus,+v9");
//[sparcv8plus,sparc_cpu_v9_feature_v8plus,sparc_cpu_v9]~^ ERROR +v8plus,+v9

// FIXME: should be rejected
#[cfg(all(target_feature = "v8plus", not(target_feature = "v9")))]
compile_error!("+v8plus,-v9 (FIXME)");
//[sparc_feature_v8plus]~^ ERROR +v8plus,-v9 (FIXME)

#[cfg(all(not(target_feature = "v8plus"), target_feature = "v9"))]
compile_error!("-v8plus,+v9");
8 changes: 8 additions & 0 deletions tests/ui/abi/sparcv8plus-llvm19.sparc.stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
error: -v8plus,-v9
--> $DIR/sparcv8plus-llvm19.rs:29:1
|
LL | compile_error!("-v8plus,-v9");
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error: aborting due to 1 previous error

8 changes: 8 additions & 0 deletions tests/ui/abi/sparcv8plus-llvm19.sparc_cpu_v9.stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
error: +v8plus,+v9
--> $DIR/sparcv8plus-llvm19.rs:34:1
|
LL | compile_error!("+v8plus,+v9");
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error: aborting due to 1 previous error

Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
error: +v8plus,+v9
--> $DIR/sparcv8plus-llvm19.rs:34:1
|
LL | compile_error!("+v8plus,+v9");
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error: aborting due to 1 previous error

8 changes: 8 additions & 0 deletions tests/ui/abi/sparcv8plus-llvm19.sparc_feature_v8plus.stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
error: +v8plus,-v9 (FIXME)
--> $DIR/sparcv8plus-llvm19.rs:39:1
|
LL | compile_error!("+v8plus,-v9 (FIXME)");
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error: aborting due to 1 previous error

8 changes: 8 additions & 0 deletions tests/ui/abi/sparcv8plus-llvm19.sparcv8plus.stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
error: +v8plus,+v9
--> $DIR/sparcv8plus-llvm19.rs:34:1
|
LL | compile_error!("+v8plus,+v9");
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error: aborting due to 1 previous error

6 changes: 3 additions & 3 deletions tests/ui/abi/sparcv8plus.rs
Original file line number Diff line number Diff line change
@@ -9,7 +9,7 @@
//@[sparc_feature_v8plus] needs-llvm-components: sparc
//@[sparc_cpu_v9_feature_v8plus] compile-flags: --target sparc-unknown-none-elf -C target-cpu=v9 -C target-feature=+v8plus
//@[sparc_cpu_v9_feature_v8plus] needs-llvm-components: sparc
//@ min-llvm-version: 19
//@ min-llvm-version: 20

#![crate_type = "rlib"]
#![feature(no_core, rustc_attrs, lang_items)]
@@ -29,10 +29,9 @@ macro_rules! compile_error {
compile_error!("-v8plus,-v9");
//[sparc]~^ ERROR -v8plus,-v9

// FIXME: sparc_cpu_v9 should be in "-v8plus,+v9" group (fixed in LLVM 20)
#[cfg(all(target_feature = "v8plus", target_feature = "v9"))]
compile_error!("+v8plus,+v9");
//[sparcv8plus,sparc_cpu_v9_feature_v8plus,sparc_cpu_v9]~^ ERROR +v8plus,+v9
//[sparcv8plus,sparc_cpu_v9_feature_v8plus]~^ ERROR +v8plus,+v9

// FIXME: should be rejected
#[cfg(all(target_feature = "v8plus", not(target_feature = "v9")))]
@@ -41,3 +40,4 @@ compile_error!("+v8plus,-v9 (FIXME)");

#[cfg(all(not(target_feature = "v8plus"), target_feature = "v9"))]
compile_error!("-v8plus,+v9");
//[sparc_cpu_v9]~^ ERROR -v8plus,+v9
6 changes: 3 additions & 3 deletions tests/ui/abi/sparcv8plus.sparc_cpu_v9.stderr
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
error: +v8plus,+v9
--> $DIR/sparcv8plus.rs:34:1
error: -v8plus,+v9
--> $DIR/sparcv8plus.rs:42:1
|
LL | compile_error!("+v8plus,+v9");
LL | compile_error!("-v8plus,+v9");
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error: aborting due to 1 previous error
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
error: +v8plus,+v9
--> $DIR/sparcv8plus.rs:34:1
--> $DIR/sparcv8plus.rs:33:1
|
LL | compile_error!("+v8plus,+v9");
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2 changes: 1 addition & 1 deletion tests/ui/abi/sparcv8plus.sparc_feature_v8plus.stderr
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
error: +v8plus,-v9 (FIXME)
--> $DIR/sparcv8plus.rs:39:1
--> $DIR/sparcv8plus.rs:38:1
|
LL | compile_error!("+v8plus,-v9 (FIXME)");
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2 changes: 1 addition & 1 deletion tests/ui/abi/sparcv8plus.sparcv8plus.stderr
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
error: +v8plus,+v9
--> $DIR/sparcv8plus.rs:34:1
--> $DIR/sparcv8plus.rs:33:1
|
LL | compile_error!("+v8plus,+v9");
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
12 changes: 6 additions & 6 deletions tests/ui/attributes/check-builtin-attr-ice.stderr
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
error[E0433]: failed to resolve: use of undeclared crate or module `should_panic`
error[E0433]: failed to resolve: use of unresolved module or unlinked crate `should_panic`
--> $DIR/check-builtin-attr-ice.rs:43:7
|
LL | #[should_panic::skip]
| ^^^^^^^^^^^^ use of undeclared crate or module `should_panic`
| ^^^^^^^^^^^^ use of unresolved module or unlinked crate `should_panic`

error[E0433]: failed to resolve: use of undeclared crate or module `should_panic`
error[E0433]: failed to resolve: use of unresolved module or unlinked crate `should_panic`
--> $DIR/check-builtin-attr-ice.rs:47:7
|
LL | #[should_panic::a::b::c]
| ^^^^^^^^^^^^ use of undeclared crate or module `should_panic`
| ^^^^^^^^^^^^ use of unresolved module or unlinked crate `should_panic`

error[E0433]: failed to resolve: use of undeclared crate or module `deny`
error[E0433]: failed to resolve: use of unresolved module or unlinked crate `deny`
--> $DIR/check-builtin-attr-ice.rs:55:7
|
LL | #[deny::skip]
| ^^^^ use of undeclared crate or module `deny`
| ^^^^ use of unresolved module or unlinked crate `deny`

error: aborting due to 3 previous errors

52 changes: 26 additions & 26 deletions tests/ui/attributes/check-cfg_attr-ice.stderr
Original file line number Diff line number Diff line change
@@ -17,83 +17,83 @@ LL | #[cfg_attr::no_such_thing]
= help: add `#![feature(stmt_expr_attributes)]` to the crate attributes to enable
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date

error[E0433]: failed to resolve: use of undeclared crate or module `cfg_attr`
error[E0433]: failed to resolve: use of unresolved module or unlinked crate `cfg_attr`
--> $DIR/check-cfg_attr-ice.rs:52:3
|
LL | #[cfg_attr::no_such_thing]
| ^^^^^^^^ use of undeclared crate or module `cfg_attr`
| ^^^^^^^^ use of unresolved module or unlinked crate `cfg_attr`

error[E0433]: failed to resolve: use of undeclared crate or module `cfg_attr`
error[E0433]: failed to resolve: use of unresolved module or unlinked crate `cfg_attr`
--> $DIR/check-cfg_attr-ice.rs:55:7
|
LL | #[cfg_attr::no_such_thing]
| ^^^^^^^^ use of undeclared crate or module `cfg_attr`
| ^^^^^^^^ use of unresolved module or unlinked crate `cfg_attr`

error[E0433]: failed to resolve: use of undeclared crate or module `cfg_attr`
error[E0433]: failed to resolve: use of unresolved module or unlinked crate `cfg_attr`
--> $DIR/check-cfg_attr-ice.rs:57:17
|
LL | GiveYouUp(#[cfg_attr::no_such_thing] u8),
| ^^^^^^^^ use of undeclared crate or module `cfg_attr`
| ^^^^^^^^ use of unresolved module or unlinked crate `cfg_attr`

error[E0433]: failed to resolve: use of undeclared crate or module `cfg_attr`
error[E0433]: failed to resolve: use of unresolved module or unlinked crate `cfg_attr`
--> $DIR/check-cfg_attr-ice.rs:64:11
|
LL | #[cfg_attr::no_such_thing]
| ^^^^^^^^ use of undeclared crate or module `cfg_attr`
| ^^^^^^^^ use of unresolved module or unlinked crate `cfg_attr`

error[E0433]: failed to resolve: use of undeclared crate or module `cfg_attr`
error[E0433]: failed to resolve: use of unresolved module or unlinked crate `cfg_attr`
--> $DIR/check-cfg_attr-ice.rs:41:7
|
LL | #[cfg_attr::no_such_thing]
| ^^^^^^^^ use of undeclared crate or module `cfg_attr`
| ^^^^^^^^ use of unresolved module or unlinked crate `cfg_attr`

error[E0433]: failed to resolve: use of undeclared crate or module `cfg_attr`
error[E0433]: failed to resolve: use of unresolved module or unlinked crate `cfg_attr`
--> $DIR/check-cfg_attr-ice.rs:43:15
|
LL | fn from(#[cfg_attr::no_such_thing] any_other_guy: AnyOtherGuy) -> This {
| ^^^^^^^^ use of undeclared crate or module `cfg_attr`
| ^^^^^^^^ use of unresolved module or unlinked crate `cfg_attr`

error[E0433]: failed to resolve: use of undeclared crate or module `cfg_attr`
error[E0433]: failed to resolve: use of unresolved module or unlinked crate `cfg_attr`
--> $DIR/check-cfg_attr-ice.rs:45:11
|
LL | #[cfg_attr::no_such_thing]
| ^^^^^^^^ use of undeclared crate or module `cfg_attr`
| ^^^^^^^^ use of unresolved module or unlinked crate `cfg_attr`

error[E0433]: failed to resolve: use of undeclared crate or module `cfg_attr`
error[E0433]: failed to resolve: use of unresolved module or unlinked crate `cfg_attr`
--> $DIR/check-cfg_attr-ice.rs:32:3
|
LL | #[cfg_attr::no_such_thing]
| ^^^^^^^^ use of undeclared crate or module `cfg_attr`
| ^^^^^^^^ use of unresolved module or unlinked crate `cfg_attr`

error[E0433]: failed to resolve: use of undeclared crate or module `cfg_attr`
error[E0433]: failed to resolve: use of unresolved module or unlinked crate `cfg_attr`
--> $DIR/check-cfg_attr-ice.rs:24:3
|
LL | #[cfg_attr::no_such_thing]
| ^^^^^^^^ use of undeclared crate or module `cfg_attr`
| ^^^^^^^^ use of unresolved module or unlinked crate `cfg_attr`

error[E0433]: failed to resolve: use of undeclared crate or module `cfg_attr`
error[E0433]: failed to resolve: use of unresolved module or unlinked crate `cfg_attr`
--> $DIR/check-cfg_attr-ice.rs:27:7
|
LL | #[cfg_attr::no_such_thing]
| ^^^^^^^^ use of undeclared crate or module `cfg_attr`
| ^^^^^^^^ use of unresolved module or unlinked crate `cfg_attr`

error[E0433]: failed to resolve: use of undeclared crate or module `cfg_attr`
error[E0433]: failed to resolve: use of unresolved module or unlinked crate `cfg_attr`
--> $DIR/check-cfg_attr-ice.rs:16:3
|
LL | #[cfg_attr::no_such_thing]
| ^^^^^^^^ use of undeclared crate or module `cfg_attr`
| ^^^^^^^^ use of unresolved module or unlinked crate `cfg_attr`

error[E0433]: failed to resolve: use of undeclared crate or module `cfg_attr`
error[E0433]: failed to resolve: use of unresolved module or unlinked crate `cfg_attr`
--> $DIR/check-cfg_attr-ice.rs:19:7
|
LL | #[cfg_attr::no_such_thing]
| ^^^^^^^^ use of undeclared crate or module `cfg_attr`
| ^^^^^^^^ use of unresolved module or unlinked crate `cfg_attr`

error[E0433]: failed to resolve: use of undeclared crate or module `cfg_attr`
error[E0433]: failed to resolve: use of unresolved module or unlinked crate `cfg_attr`
--> $DIR/check-cfg_attr-ice.rs:12:3
|
LL | #[cfg_attr::no_such_thing]
| ^^^^^^^^ use of undeclared crate or module `cfg_attr`
| ^^^^^^^^ use of unresolved module or unlinked crate `cfg_attr`

error: aborting due to 15 previous errors

12 changes: 6 additions & 6 deletions tests/ui/attributes/field-attributes-vis-unresolved.stderr
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
error[E0433]: failed to resolve: you might be missing crate `nonexistent`
error[E0433]: failed to resolve: use of unresolved module or unlinked crate `nonexistent`
--> $DIR/field-attributes-vis-unresolved.rs:17:12
|
LL | pub(in nonexistent) field: u8
| ^^^^^^^^^^^ you might be missing crate `nonexistent`
| ^^^^^^^^^^^ use of unresolved module or unlinked crate `nonexistent`
|
help: consider importing the `nonexistent` crate
help: you might be missing a crate named `nonexistent`, add it to your project and import it in your code
|
LL + extern crate nonexistent;
|

error[E0433]: failed to resolve: you might be missing crate `nonexistent`
error[E0433]: failed to resolve: use of unresolved module or unlinked crate `nonexistent`
--> $DIR/field-attributes-vis-unresolved.rs:22:12
|
LL | pub(in nonexistent) u8
| ^^^^^^^^^^^ you might be missing crate `nonexistent`
| ^^^^^^^^^^^ use of unresolved module or unlinked crate `nonexistent`
|
help: consider importing the `nonexistent` crate
help: you might be missing a crate named `nonexistent`, add it to your project and import it in your code
|
LL + extern crate nonexistent;
|
12 changes: 8 additions & 4 deletions tests/ui/coherence/conflicting-impl-with-err.stderr
Original file line number Diff line number Diff line change
@@ -1,14 +1,18 @@
error[E0433]: failed to resolve: use of undeclared crate or module `nope`
error[E0433]: failed to resolve: use of unresolved module or unlinked crate `nope`
--> $DIR/conflicting-impl-with-err.rs:4:11
|
LL | impl From<nope::Thing> for Error {
| ^^^^ use of undeclared crate or module `nope`
| ^^^^ use of unresolved module or unlinked crate `nope`
|
= help: you might be missing a crate named `nope`

error[E0433]: failed to resolve: use of undeclared crate or module `nope`
error[E0433]: failed to resolve: use of unresolved module or unlinked crate `nope`
--> $DIR/conflicting-impl-with-err.rs:5:16
|
LL | fn from(_: nope::Thing) -> Self {
| ^^^^ use of undeclared crate or module `nope`
| ^^^^ use of unresolved module or unlinked crate `nope`
|
= help: you might be missing a crate named `nope`

error: aborting due to 2 previous errors

2 changes: 1 addition & 1 deletion tests/ui/delegation/bad-resolve.rs
Original file line number Diff line number Diff line change
@@ -40,7 +40,7 @@ impl Trait for S {
}

mod prefix {}
reuse unresolved_prefix::{a, b, c}; //~ ERROR use of undeclared crate or module `unresolved_prefix`
reuse unresolved_prefix::{a, b, c}; //~ ERROR use of unresolved module or unlinked crate
reuse prefix::{self, super, crate}; //~ ERROR `crate` in paths can only be used in start position

fn main() {}
6 changes: 4 additions & 2 deletions tests/ui/delegation/bad-resolve.stderr
Original file line number Diff line number Diff line change
@@ -81,11 +81,13 @@ LL | type Type;
LL | impl Trait for S {
| ^^^^^^^^^^^^^^^^ missing `Type` in implementation

error[E0433]: failed to resolve: use of undeclared crate or module `unresolved_prefix`
error[E0433]: failed to resolve: use of unresolved module or unlinked crate `unresolved_prefix`
--> $DIR/bad-resolve.rs:43:7
|
LL | reuse unresolved_prefix::{a, b, c};
| ^^^^^^^^^^^^^^^^^ use of undeclared crate or module `unresolved_prefix`
| ^^^^^^^^^^^^^^^^^ use of unresolved module or unlinked crate `unresolved_prefix`
|
= help: you might be missing a crate named `unresolved_prefix`

error[E0433]: failed to resolve: `crate` in paths can only be used in start position
--> $DIR/bad-resolve.rs:44:29
2 changes: 1 addition & 1 deletion tests/ui/delegation/glob-bad-path.rs
Original file line number Diff line number Diff line change
@@ -5,7 +5,7 @@ trait Trait {}
struct S;

impl Trait for u8 {
reuse unresolved::*; //~ ERROR failed to resolve: use of undeclared crate or module `unresolved`
reuse unresolved::*; //~ ERROR failed to resolve: use of unresolved module or unlinked crate `unresolved`
reuse S::*; //~ ERROR expected trait, found struct `S`
}

4 changes: 2 additions & 2 deletions tests/ui/delegation/glob-bad-path.stderr
Original file line number Diff line number Diff line change
@@ -4,11 +4,11 @@ error: expected trait, found struct `S`
LL | reuse S::*;
| ^ not a trait

error[E0433]: failed to resolve: use of undeclared crate or module `unresolved`
error[E0433]: failed to resolve: use of unresolved module or unlinked crate `unresolved`
--> $DIR/glob-bad-path.rs:8:11
|
LL | reuse unresolved::*;
| ^^^^^^^^^^ use of undeclared crate or module `unresolved`
| ^^^^^^^^^^ use of unresolved module or unlinked crate `unresolved`

error: aborting due to 2 previous errors

4 changes: 2 additions & 2 deletions tests/ui/error-codes/E0432.stderr
Original file line number Diff line number Diff line change
@@ -2,9 +2,9 @@ error[E0432]: unresolved import `something`
--> $DIR/E0432.rs:1:5
|
LL | use something::Foo;
| ^^^^^^^^^ you might be missing crate `something`
| ^^^^^^^^^ use of unresolved module or unlinked crate `something`
|
help: consider importing the `something` crate
help: you might be missing a crate named `something`, add it to your project and import it in your code
|
LL + extern crate something;
|
6 changes: 4 additions & 2 deletions tests/ui/extern-flag/multiple-opts.stderr
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
error[E0433]: failed to resolve: use of undeclared crate or module `somedep`
error[E0433]: failed to resolve: use of unresolved module or unlinked crate `somedep`
--> $DIR/multiple-opts.rs:19:5
|
LL | somedep::somefun();
| ^^^^^^^ use of undeclared crate or module `somedep`
| ^^^^^^^ use of unresolved module or unlinked crate `somedep`
|
= help: you might be missing a crate named `somedep`

error: aborting due to 1 previous error

6 changes: 4 additions & 2 deletions tests/ui/extern-flag/noprelude.stderr
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
error[E0433]: failed to resolve: use of undeclared crate or module `somedep`
error[E0433]: failed to resolve: use of unresolved module or unlinked crate `somedep`
--> $DIR/noprelude.rs:6:5
|
LL | somedep::somefun();
| ^^^^^^^ use of undeclared crate or module `somedep`
| ^^^^^^^ use of unresolved module or unlinked crate `somedep`
|
= help: you might be missing a crate named `somedep`

error: aborting due to 1 previous error

2 changes: 1 addition & 1 deletion tests/ui/foreign/stashed-issue-121451.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
extern "C" fn _f() -> libc::uintptr_t {}
//~^ ERROR failed to resolve: use of undeclared crate or module `libc`
//~^ ERROR failed to resolve

fn main() {}
6 changes: 4 additions & 2 deletions tests/ui/foreign/stashed-issue-121451.stderr
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
error[E0433]: failed to resolve: use of undeclared crate or module `libc`
error[E0433]: failed to resolve: use of unresolved module or unlinked crate `libc`
--> $DIR/stashed-issue-121451.rs:1:23
|
LL | extern "C" fn _f() -> libc::uintptr_t {}
| ^^^^ use of undeclared crate or module `libc`
| ^^^^ use of unresolved module or unlinked crate `libc`
|
= help: you might be missing a crate named `libc`

error: aborting due to 1 previous error

4 changes: 2 additions & 2 deletions tests/ui/hygiene/extern-prelude-from-opaque-fail-2018.rs
Original file line number Diff line number Diff line change
@@ -10,7 +10,7 @@ macro a() {
mod u {
// Late resolution.
fn f() { my_core::mem::drop(0); }
//~^ ERROR failed to resolve: use of undeclared crate or module `my_core`
//~^ ERROR failed to resolve: use of unresolved module or unlinked crate `my_core`
}
}

@@ -23,7 +23,7 @@ mod v {
mod u {
// Late resolution.
fn f() { my_core::mem::drop(0); }
//~^ ERROR failed to resolve: use of undeclared crate or module `my_core`
//~^ ERROR failed to resolve: use of unresolved module or unlinked crate `my_core`
}

fn main() {}
10 changes: 6 additions & 4 deletions tests/ui/hygiene/extern-prelude-from-opaque-fail-2018.stderr
Original file line number Diff line number Diff line change
@@ -15,25 +15,27 @@ LL | a!();
|
= note: this error originates in the macro `a` (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0433]: failed to resolve: use of undeclared crate or module `my_core`
error[E0433]: failed to resolve: use of unresolved module or unlinked crate `my_core`
--> $DIR/extern-prelude-from-opaque-fail-2018.rs:12:18
|
LL | fn f() { my_core::mem::drop(0); }
| ^^^^^^^ use of undeclared crate or module `my_core`
| ^^^^^^^ use of unresolved module or unlinked crate `my_core`
...
LL | a!();
| ---- in this macro invocation
|
= help: you might be missing a crate named `my_core`
= help: consider importing this module:
std::mem
= note: this error originates in the macro `a` (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0433]: failed to resolve: use of undeclared crate or module `my_core`
error[E0433]: failed to resolve: use of unresolved module or unlinked crate `my_core`
--> $DIR/extern-prelude-from-opaque-fail-2018.rs:25:14
|
LL | fn f() { my_core::mem::drop(0); }
| ^^^^^^^ use of undeclared crate or module `my_core`
| ^^^^^^^ use of unresolved module or unlinked crate `my_core`
|
= help: you might be missing a crate named `my_core`
help: consider importing this module
|
LL + use std::mem;
4 changes: 2 additions & 2 deletions tests/ui/hygiene/extern-prelude-from-opaque-fail.rs
Original file line number Diff line number Diff line change
@@ -10,7 +10,7 @@ macro a() {
mod u {
// Late resolution.
fn f() { my_core::mem::drop(0); }
//~^ ERROR failed to resolve: use of undeclared crate or module `my_core`
//~^ ERROR failed to resolve: use of unresolved module or unlinked crate `my_core`
}
}

@@ -23,7 +23,7 @@ mod v {
mod u {
// Late resolution.
fn f() { my_core::mem::drop(0); }
//~^ ERROR failed to resolve: use of undeclared crate or module `my_core`
//~^ ERROR failed to resolve: use of unresolved module or unlinked crate `my_core`
}

fn main() {}
10 changes: 6 additions & 4 deletions tests/ui/hygiene/extern-prelude-from-opaque-fail.stderr
Original file line number Diff line number Diff line change
@@ -15,25 +15,27 @@ LL | a!();
|
= note: this error originates in the macro `a` (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0433]: failed to resolve: use of undeclared crate or module `my_core`
error[E0433]: failed to resolve: use of unresolved module or unlinked crate `my_core`
--> $DIR/extern-prelude-from-opaque-fail.rs:12:18
|
LL | fn f() { my_core::mem::drop(0); }
| ^^^^^^^ use of undeclared crate or module `my_core`
| ^^^^^^^ use of unresolved module or unlinked crate `my_core`
...
LL | a!();
| ---- in this macro invocation
|
= help: you might be missing a crate named `my_core`
= help: consider importing this module:
my_core::mem
= note: this error originates in the macro `a` (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0433]: failed to resolve: use of undeclared crate or module `my_core`
error[E0433]: failed to resolve: use of unresolved module or unlinked crate `my_core`
--> $DIR/extern-prelude-from-opaque-fail.rs:25:14
|
LL | fn f() { my_core::mem::drop(0); }
| ^^^^^^^ use of undeclared crate or module `my_core`
| ^^^^^^^ use of unresolved module or unlinked crate `my_core`
|
= help: you might be missing a crate named `my_core`
help: consider importing this module
|
LL + use my_core::mem;
12 changes: 8 additions & 4 deletions tests/ui/impl-trait/issue-72911.stderr
Original file line number Diff line number Diff line change
@@ -1,14 +1,18 @@
error[E0433]: failed to resolve: use of undeclared crate or module `foo`
error[E0433]: failed to resolve: use of unresolved module or unlinked crate `foo`
--> $DIR/issue-72911.rs:11:33
|
LL | fn gather_from_file(dir_entry: &foo::MissingItem) -> impl Iterator<Item = Lint> {
| ^^^ use of undeclared crate or module `foo`
| ^^^ use of unresolved module or unlinked crate `foo`
|
= help: you might be missing a crate named `foo`

error[E0433]: failed to resolve: use of undeclared crate or module `foo`
error[E0433]: failed to resolve: use of unresolved module or unlinked crate `foo`
--> $DIR/issue-72911.rs:16:41
|
LL | fn lint_files() -> impl Iterator<Item = foo::MissingItem> {
| ^^^ use of undeclared crate or module `foo`
| ^^^ use of unresolved module or unlinked crate `foo`
|
= help: you might be missing a crate named `foo`

error: aborting due to 2 previous errors

2 changes: 1 addition & 1 deletion tests/ui/impl-trait/stashed-diag-issue-121504.rs
Original file line number Diff line number Diff line change
@@ -4,7 +4,7 @@ trait MyTrait {
async fn foo(self) -> (Self, i32);
}

impl MyTrait for xyz::T { //~ ERROR failed to resolve: use of undeclared crate or module `xyz`
impl MyTrait for xyz::T { //~ ERROR failed to resolve: use of unresolved module or unlinked crate `xyz`
async fn foo(self, key: i32) -> (u32, i32) {
(self, key)
}
6 changes: 4 additions & 2 deletions tests/ui/impl-trait/stashed-diag-issue-121504.stderr
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
error[E0433]: failed to resolve: use of undeclared crate or module `xyz`
error[E0433]: failed to resolve: use of unresolved module or unlinked crate `xyz`
--> $DIR/stashed-diag-issue-121504.rs:7:18
|
LL | impl MyTrait for xyz::T {
| ^^^ use of undeclared crate or module `xyz`
| ^^^ use of unresolved module or unlinked crate `xyz`
|
= help: you might be missing a crate named `xyz`

error: aborting due to 1 previous error

2 changes: 1 addition & 1 deletion tests/ui/imports/extern-prelude-extern-crate-fail.rs
Original file line number Diff line number Diff line change
@@ -7,7 +7,7 @@ mod n {

mod m {
fn check() {
two_macros::m!(); //~ ERROR failed to resolve: use of undeclared crate or module `two_macros`
two_macros::m!(); //~ ERROR failed to resolve: use of unresolved module or unlinked crate `two_macros`
}
}

4 changes: 2 additions & 2 deletions tests/ui/imports/extern-prelude-extern-crate-fail.stderr
Original file line number Diff line number Diff line change
@@ -9,11 +9,11 @@ LL | define_std_as_non_existent!();
|
= note: this error originates in the macro `define_std_as_non_existent` (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0433]: failed to resolve: use of undeclared crate or module `two_macros`
error[E0433]: failed to resolve: use of unresolved module or unlinked crate `two_macros`
--> $DIR/extern-prelude-extern-crate-fail.rs:10:9
|
LL | two_macros::m!();
| ^^^^^^^^^^ use of undeclared crate or module `two_macros`
| ^^^^^^^^^^ use of unresolved module or unlinked crate `two_macros`

error: aborting due to 2 previous errors

4 changes: 2 additions & 2 deletions tests/ui/imports/import-from-missing-star-2.stderr
Original file line number Diff line number Diff line change
@@ -2,9 +2,9 @@ error[E0432]: unresolved import `spam`
--> $DIR/import-from-missing-star-2.rs:2:9
|
LL | use spam::*;
| ^^^^ you might be missing crate `spam`
| ^^^^ use of unresolved module or unlinked crate `spam`
|
help: consider importing the `spam` crate
help: you might be missing a crate named `spam`, add it to your project and import it in your code
|
LL + extern crate spam;
|
8 changes: 4 additions & 4 deletions tests/ui/imports/import-from-missing-star-3.stderr
Original file line number Diff line number Diff line change
@@ -2,9 +2,9 @@ error[E0432]: unresolved import `spam`
--> $DIR/import-from-missing-star-3.rs:2:9
|
LL | use spam::*;
| ^^^^ you might be missing crate `spam`
| ^^^^ use of unresolved module or unlinked crate `spam`
|
help: consider importing the `spam` crate
help: you might be missing a crate named `spam`, add it to your project and import it in your code
|
LL + extern crate spam;
|
@@ -13,9 +13,9 @@ error[E0432]: unresolved import `spam`
--> $DIR/import-from-missing-star-3.rs:27:13
|
LL | use spam::*;
| ^^^^ you might be missing crate `spam`
| ^^^^ use of unresolved module or unlinked crate `spam`
|
help: consider importing the `spam` crate
help: you might be missing a crate named `spam`, add it to your project and import it in your code
|
LL + extern crate spam;
|
4 changes: 2 additions & 2 deletions tests/ui/imports/import-from-missing-star.stderr
Original file line number Diff line number Diff line change
@@ -2,9 +2,9 @@ error[E0432]: unresolved import `spam`
--> $DIR/import-from-missing-star.rs:1:5
|
LL | use spam::*;
| ^^^^ you might be missing crate `spam`
| ^^^^ use of unresolved module or unlinked crate `spam`
|
help: consider importing the `spam` crate
help: you might be missing a crate named `spam`, add it to your project and import it in your code
|
LL + extern crate spam;
|
4 changes: 2 additions & 2 deletions tests/ui/imports/import3.stderr
Original file line number Diff line number Diff line change
@@ -2,9 +2,9 @@ error[E0432]: unresolved import `main`
--> $DIR/import3.rs:2:5
|
LL | use main::bar;
| ^^^^ you might be missing crate `main`
| ^^^^ use of unresolved module or unlinked crate `main`
|
help: consider importing the `main` crate
help: you might be missing a crate named `main`, add it to your project and import it in your code
|
LL + extern crate main;
|
4 changes: 2 additions & 2 deletions tests/ui/imports/issue-109343.stderr
Original file line number Diff line number Diff line change
@@ -2,9 +2,9 @@ error[E0432]: unresolved import `unresolved`
--> $DIR/issue-109343.rs:4:9
|
LL | pub use unresolved::f;
| ^^^^^^^^^^ you might be missing crate `unresolved`
| ^^^^^^^^^^ use of unresolved module or unlinked crate `unresolved`
|
help: consider importing the `unresolved` crate
help: you might be missing a crate named `unresolved`, add it to your project and import it in your code
|
LL + extern crate unresolved;
|
4 changes: 2 additions & 2 deletions tests/ui/imports/issue-1697.rs
Original file line number Diff line number Diff line change
@@ -2,7 +2,7 @@

use unresolved::*;
//~^ ERROR unresolved import `unresolved` [E0432]
//~| NOTE you might be missing crate `unresolved`
//~| HELP consider importing the `unresolved` crate
//~| NOTE use of unresolved module or unlinked crate `unresolved`
//~| HELP you might be missing a crate named `unresolved`

fn main() {}
4 changes: 2 additions & 2 deletions tests/ui/imports/issue-1697.stderr
Original file line number Diff line number Diff line change
@@ -2,9 +2,9 @@ error[E0432]: unresolved import `unresolved`
--> $DIR/issue-1697.rs:3:5
|
LL | use unresolved::*;
| ^^^^^^^^^^ you might be missing crate `unresolved`
| ^^^^^^^^^^ use of unresolved module or unlinked crate `unresolved`
|
help: consider importing the `unresolved` crate
help: you might be missing a crate named `unresolved`, add it to your project and import it in your code
|
LL + extern crate unresolved;
|
12 changes: 6 additions & 6 deletions tests/ui/imports/issue-33464.stderr
Original file line number Diff line number Diff line change
@@ -2,9 +2,9 @@ error[E0432]: unresolved import `abc`
--> $DIR/issue-33464.rs:3:5
|
LL | use abc::one_el;
| ^^^ you might be missing crate `abc`
| ^^^ use of unresolved module or unlinked crate `abc`
|
help: consider importing the `abc` crate
help: you might be missing a crate named `abc`, add it to your project and import it in your code
|
LL + extern crate abc;
|
@@ -13,9 +13,9 @@ error[E0432]: unresolved import `abc`
--> $DIR/issue-33464.rs:5:5
|
LL | use abc::{a, bbb, cccccc};
| ^^^ you might be missing crate `abc`
| ^^^ use of unresolved module or unlinked crate `abc`
|
help: consider importing the `abc` crate
help: you might be missing a crate named `abc`, add it to your project and import it in your code
|
LL + extern crate abc;
|
@@ -24,9 +24,9 @@ error[E0432]: unresolved import `a_very_long_name`
--> $DIR/issue-33464.rs:7:5
|
LL | use a_very_long_name::{el, el2};
| ^^^^^^^^^^^^^^^^ you might be missing crate `a_very_long_name`
| ^^^^^^^^^^^^^^^^ use of unresolved module or unlinked crate `a_very_long_name`
|
help: consider importing the `a_very_long_name` crate
help: you might be missing a crate named `a_very_long_name`, add it to your project and import it in your code
|
LL + extern crate a_very_long_name;
|
4 changes: 2 additions & 2 deletions tests/ui/imports/issue-36881.stderr
Original file line number Diff line number Diff line change
@@ -2,9 +2,9 @@ error[E0432]: unresolved import `issue_36881_aux`
--> $DIR/issue-36881.rs:5:9
|
LL | use issue_36881_aux::Foo;
| ^^^^^^^^^^^^^^^ you might be missing crate `issue_36881_aux`
| ^^^^^^^^^^^^^^^ use of unresolved module or unlinked crate `issue_36881_aux`
|
help: consider importing the `issue_36881_aux` crate
help: you might be missing a crate named `issue_36881_aux`, add it to your project and import it in your code
|
LL + extern crate issue_36881_aux;
|
4 changes: 2 additions & 2 deletions tests/ui/imports/issue-37887.stderr
Original file line number Diff line number Diff line change
@@ -2,9 +2,9 @@ error[E0432]: unresolved import `test`
--> $DIR/issue-37887.rs:3:9
|
LL | use test::*;
| ^^^^ you might be missing crate `test`
| ^^^^ use of unresolved module or unlinked crate `test`
|
help: consider importing the `test` crate
help: you might be missing a crate named `test`, add it to your project and import it in your code
|
LL + extern crate test;
|
4 changes: 2 additions & 2 deletions tests/ui/imports/issue-53269.stderr
Original file line number Diff line number Diff line change
@@ -2,9 +2,9 @@ error[E0432]: unresolved import `nonexistent_module`
--> $DIR/issue-53269.rs:6:9
|
LL | use nonexistent_module::mac;
| ^^^^^^^^^^^^^^^^^^ you might be missing crate `nonexistent_module`
| ^^^^^^^^^^^^^^^^^^ use of unresolved module or unlinked crate `nonexistent_module`
|
help: consider importing the `nonexistent_module` crate
help: you might be missing a crate named `nonexistent_module`, add it to your project and import it in your code
|
LL + extern crate nonexistent_module;
|
4 changes: 2 additions & 2 deletions tests/ui/imports/issue-55457.stderr
Original file line number Diff line number Diff line change
@@ -11,9 +11,9 @@ error[E0432]: unresolved import `non_existent`
--> $DIR/issue-55457.rs:2:5
|
LL | use non_existent::non_existent;
| ^^^^^^^^^^^^ you might be missing crate `non_existent`
| ^^^^^^^^^^^^ use of unresolved module or unlinked crate `non_existent`
|
help: consider importing the `non_existent` crate
help: you might be missing a crate named `non_existent`, add it to your project and import it in your code
|
LL + extern crate non_existent;
|
4 changes: 2 additions & 2 deletions tests/ui/imports/issue-81413.stderr
Original file line number Diff line number Diff line change
@@ -2,9 +2,9 @@ error[E0432]: unresolved import `doesnt_exist`
--> $DIR/issue-81413.rs:7:9
|
LL | pub use doesnt_exist::*;
| ^^^^^^^^^^^^ you might be missing crate `doesnt_exist`
| ^^^^^^^^^^^^ use of unresolved module or unlinked crate `doesnt_exist`
|
help: consider importing the `doesnt_exist` crate
help: you might be missing a crate named `doesnt_exist`, add it to your project and import it in your code
|
LL + extern crate doesnt_exist;
|
4 changes: 2 additions & 2 deletions tests/ui/imports/tool-mod-child.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use clippy::a; //~ ERROR unresolved import `clippy`
use clippy::a::b; //~ ERROR failed to resolve: you might be missing crate `clippy`
use clippy::a::b; //~ ERROR failed to resolve: use of unresolved module or unlinked crate `clippy`

use rustdoc::a; //~ ERROR unresolved import `rustdoc`
use rustdoc::a::b; //~ ERROR failed to resolve: you might be missing crate `rustdoc`
use rustdoc::a::b; //~ ERROR failed to resolve: use of unresolved module or unlinked crate `rustdoc`

fn main() {}
20 changes: 10 additions & 10 deletions tests/ui/imports/tool-mod-child.stderr
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
error[E0433]: failed to resolve: you might be missing crate `clippy`
error[E0433]: failed to resolve: use of unresolved module or unlinked crate `clippy`
--> $DIR/tool-mod-child.rs:2:5
|
LL | use clippy::a::b;
| ^^^^^^ you might be missing crate `clippy`
| ^^^^^^ use of unresolved module or unlinked crate `clippy`
|
help: consider importing the `clippy` crate
help: you might be missing a crate named `clippy`, add it to your project and import it in your code
|
LL + extern crate clippy;
|
@@ -13,20 +13,20 @@ error[E0432]: unresolved import `clippy`
--> $DIR/tool-mod-child.rs:1:5
|
LL | use clippy::a;
| ^^^^^^ you might be missing crate `clippy`
| ^^^^^^ use of unresolved module or unlinked crate `clippy`
|
help: consider importing the `clippy` crate
help: you might be missing a crate named `clippy`, add it to your project and import it in your code
|
LL + extern crate clippy;
|

error[E0433]: failed to resolve: you might be missing crate `rustdoc`
error[E0433]: failed to resolve: use of unresolved module or unlinked crate `rustdoc`
--> $DIR/tool-mod-child.rs:5:5
|
LL | use rustdoc::a::b;
| ^^^^^^^ you might be missing crate `rustdoc`
| ^^^^^^^ use of unresolved module or unlinked crate `rustdoc`
|
help: consider importing the `rustdoc` crate
help: you might be missing a crate named `rustdoc`, add it to your project and import it in your code
|
LL + extern crate rustdoc;
|
@@ -35,9 +35,9 @@ error[E0432]: unresolved import `rustdoc`
--> $DIR/tool-mod-child.rs:4:5
|
LL | use rustdoc::a;
| ^^^^^^^ you might be missing crate `rustdoc`
| ^^^^^^^ use of unresolved module or unlinked crate `rustdoc`
|
help: consider importing the `rustdoc` crate
help: you might be missing a crate named `rustdoc`, add it to your project and import it in your code
|
LL + extern crate rustdoc;
|
16 changes: 8 additions & 8 deletions tests/ui/imports/unresolved-imports-used.stderr
Original file line number Diff line number Diff line change
@@ -14,9 +14,9 @@ error[E0432]: unresolved import `foo`
--> $DIR/unresolved-imports-used.rs:11:5
|
LL | use foo::bar;
| ^^^ you might be missing crate `foo`
| ^^^ use of unresolved module or unlinked crate `foo`
|
help: consider importing the `foo` crate
help: you might be missing a crate named `foo`, add it to your project and import it in your code
|
LL + extern crate foo;
|
@@ -25,9 +25,9 @@ error[E0432]: unresolved import `baz`
--> $DIR/unresolved-imports-used.rs:12:5
|
LL | use baz::*;
| ^^^ you might be missing crate `baz`
| ^^^ use of unresolved module or unlinked crate `baz`
|
help: consider importing the `baz` crate
help: you might be missing a crate named `baz`, add it to your project and import it in your code
|
LL + extern crate baz;
|
@@ -36,9 +36,9 @@ error[E0432]: unresolved import `foo2`
--> $DIR/unresolved-imports-used.rs:14:5
|
LL | use foo2::bar2;
| ^^^^ you might be missing crate `foo2`
| ^^^^ use of unresolved module or unlinked crate `foo2`
|
help: consider importing the `foo2` crate
help: you might be missing a crate named `foo2`, add it to your project and import it in your code
|
LL + extern crate foo2;
|
@@ -47,9 +47,9 @@ error[E0432]: unresolved import `baz2`
--> $DIR/unresolved-imports-used.rs:15:5
|
LL | use baz2::*;
| ^^^^ you might be missing crate `baz2`
| ^^^^ use of unresolved module or unlinked crate `baz2`
|
help: consider importing the `baz2` crate
help: you might be missing a crate named `baz2`, add it to your project and import it in your code
|
LL + extern crate baz2;
|
2 changes: 1 addition & 1 deletion tests/ui/issues/issue-33293.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
fn main() {
match 0 {
aaa::bbb(_) => ()
//~^ ERROR failed to resolve: use of undeclared crate or module `aaa`
//~^ ERROR failed to resolve: use of unresolved module or unlinked crate `aaa`
};
}
6 changes: 4 additions & 2 deletions tests/ui/issues/issue-33293.stderr
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
error[E0433]: failed to resolve: use of undeclared crate or module `aaa`
error[E0433]: failed to resolve: use of unresolved module or unlinked crate `aaa`
--> $DIR/issue-33293.rs:3:9
|
LL | aaa::bbb(_) => ()
| ^^^ use of undeclared crate or module `aaa`
| ^^^ use of unresolved module or unlinked crate `aaa`
|
= help: you might be missing a crate named `aaa`

error: aborting due to 1 previous error

Original file line number Diff line number Diff line change
@@ -13,9 +13,9 @@ error[E0432]: unresolved import `r#extern`
--> $DIR/keyword-extern-as-identifier-use.rs:1:5
|
LL | use extern::foo;
| ^^^^^^ you might be missing crate `r#extern`
| ^^^^^^ use of unresolved module or unlinked crate `r#extern`
|
help: consider importing the `r#extern` crate
help: you might be missing a crate named `r#extern`, add it to your project and import it in your code
|
LL + extern crate r#extern;
|
6 changes: 3 additions & 3 deletions tests/ui/macros/builtin-prelude-no-accidents.rs
Original file line number Diff line number Diff line change
@@ -2,7 +2,7 @@
// because macros with the same names are in prelude.

fn main() {
env::current_dir; //~ ERROR use of undeclared crate or module `env`
type A = panic::PanicInfo; //~ ERROR use of undeclared crate or module `panic`
type B = vec::Vec<u8>; //~ ERROR use of undeclared crate or module `vec`
env::current_dir; //~ ERROR use of unresolved module or unlinked crate `env`
type A = panic::PanicInfo; //~ ERROR use of unresolved module or unlinked crate `panic`
type B = vec::Vec<u8>; //~ ERROR use of unresolved module or unlinked crate `vec`
}
15 changes: 9 additions & 6 deletions tests/ui/macros/builtin-prelude-no-accidents.stderr
Original file line number Diff line number Diff line change
@@ -1,31 +1,34 @@
error[E0433]: failed to resolve: use of undeclared crate or module `env`
error[E0433]: failed to resolve: use of unresolved module or unlinked crate `env`
--> $DIR/builtin-prelude-no-accidents.rs:5:5
|
LL | env::current_dir;
| ^^^ use of undeclared crate or module `env`
| ^^^ use of unresolved module or unlinked crate `env`
|
= help: you might be missing a crate named `env`
help: consider importing this module
|
LL + use std::env;
|

error[E0433]: failed to resolve: use of undeclared crate or module `panic`
error[E0433]: failed to resolve: use of unresolved module or unlinked crate `panic`
--> $DIR/builtin-prelude-no-accidents.rs:6:14
|
LL | type A = panic::PanicInfo;
| ^^^^^ use of undeclared crate or module `panic`
| ^^^^^ use of unresolved module or unlinked crate `panic`
|
= help: you might be missing a crate named `panic`
help: consider importing this module
|
LL + use std::panic;
|

error[E0433]: failed to resolve: use of undeclared crate or module `vec`
error[E0433]: failed to resolve: use of unresolved module or unlinked crate `vec`
--> $DIR/builtin-prelude-no-accidents.rs:7:14
|
LL | type B = vec::Vec<u8>;
| ^^^ use of undeclared crate or module `vec`
| ^^^ use of unresolved module or unlinked crate `vec`
|
= help: you might be missing a crate named `vec`
help: consider importing this module
|
LL + use std::vec;
2 changes: 1 addition & 1 deletion tests/ui/macros/macro-inner-attributes.rs
Original file line number Diff line number Diff line change
@@ -15,6 +15,6 @@ test!(b,
#[rustc_dummy]
fn main() {
a::bar();
//~^ ERROR failed to resolve: use of undeclared crate or module `a`
//~^ ERROR failed to resolve: use of unresolved module or unlinked crate `a`
b::bar();
}
4 changes: 2 additions & 2 deletions tests/ui/macros/macro-inner-attributes.stderr
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
error[E0433]: failed to resolve: use of undeclared crate or module `a`
error[E0433]: failed to resolve: use of unresolved module or unlinked crate `a`
--> $DIR/macro-inner-attributes.rs:17:5
|
LL | a::bar();
| ^ use of undeclared crate or module `a`
| ^ use of unresolved module or unlinked crate `a`
|
help: there is a crate or module with a similar name
|
6 changes: 4 additions & 2 deletions tests/ui/macros/macro_path_as_generic_bound.stderr
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
error[E0433]: failed to resolve: use of undeclared crate or module `m`
error[E0433]: failed to resolve: use of unresolved module or unlinked crate `m`
--> $DIR/macro_path_as_generic_bound.rs:7:6
|
LL | foo!(m::m2::A);
| ^ use of undeclared crate or module `m`
| ^ use of unresolved module or unlinked crate `m`
|
= help: you might be missing a crate named `m`

error: aborting due to 1 previous error

8 changes: 4 additions & 4 deletions tests/ui/macros/meta-item-absolute-path.stderr
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
error[E0433]: failed to resolve: you might be missing crate `Absolute`
error[E0433]: failed to resolve: use of unresolved module or unlinked crate `Absolute`
--> $DIR/meta-item-absolute-path.rs:1:12
|
LL | #[derive(::Absolute)]
| ^^^^^^^^ you might be missing crate `Absolute`
| ^^^^^^^^ use of unresolved module or unlinked crate `Absolute`

error[E0433]: failed to resolve: you might be missing crate `Absolute`
error[E0433]: failed to resolve: use of unresolved module or unlinked crate `Absolute`
--> $DIR/meta-item-absolute-path.rs:1:12
|
LL | #[derive(::Absolute)]
| ^^^^^^^^ you might be missing crate `Absolute`
| ^^^^^^^^ use of unresolved module or unlinked crate `Absolute`
|
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`

4 changes: 2 additions & 2 deletions tests/ui/mir/issue-121103.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
fn main(_: <lib2::GenericType<42> as lib2::TypeFn>::Output) {}
//~^ ERROR failed to resolve: use of undeclared crate or module `lib2`
//~| ERROR failed to resolve: use of undeclared crate or module `lib2`
//~^ ERROR failed to resolve: use of unresolved module or unlinked crate `lib2`
//~| ERROR failed to resolve: use of unresolved module or unlinked crate `lib2`
12 changes: 8 additions & 4 deletions tests/ui/mir/issue-121103.stderr
Original file line number Diff line number Diff line change
@@ -1,14 +1,18 @@
error[E0433]: failed to resolve: use of undeclared crate or module `lib2`
error[E0433]: failed to resolve: use of unresolved module or unlinked crate `lib2`
--> $DIR/issue-121103.rs:1:38
|
LL | fn main(_: <lib2::GenericType<42> as lib2::TypeFn>::Output) {}
| ^^^^ use of undeclared crate or module `lib2`
| ^^^^ use of unresolved module or unlinked crate `lib2`
|
= help: you might be missing a crate named `lib2`

error[E0433]: failed to resolve: use of undeclared crate or module `lib2`
error[E0433]: failed to resolve: use of unresolved module or unlinked crate `lib2`
--> $DIR/issue-121103.rs:1:13
|
LL | fn main(_: <lib2::GenericType<42> as lib2::TypeFn>::Output) {}
| ^^^^ use of undeclared crate or module `lib2`
| ^^^^ use of unresolved module or unlinked crate `lib2`
|
= help: you might be missing a crate named `lib2`

error: aborting due to 2 previous errors

2 changes: 1 addition & 1 deletion tests/ui/modules_and_files_visibility/mod_file_disambig.rs
Original file line number Diff line number Diff line change
@@ -2,5 +2,5 @@ mod mod_file_disambig_aux; //~ ERROR file for module `mod_file_disambig_aux` fou

fn main() {
assert_eq!(mod_file_aux::bar(), 10);
//~^ ERROR failed to resolve: use of undeclared crate or module `mod_file_aux`
//~^ ERROR failed to resolve: use of unresolved module or unlinked crate `mod_file_aux`
}
Original file line number Diff line number Diff line change
@@ -6,11 +6,13 @@ LL | mod mod_file_disambig_aux;
|
= help: delete or rename one of them to remove the ambiguity

error[E0433]: failed to resolve: use of undeclared crate or module `mod_file_aux`
error[E0433]: failed to resolve: use of unresolved module or unlinked crate `mod_file_aux`
--> $DIR/mod_file_disambig.rs:4:16
|
LL | assert_eq!(mod_file_aux::bar(), 10);
| ^^^^^^^^^^^^ use of undeclared crate or module `mod_file_aux`
| ^^^^^^^^^^^^ use of unresolved module or unlinked crate `mod_file_aux`
|
= help: you might be missing a crate named `mod_file_aux`

error: aborting due to 2 previous errors

Original file line number Diff line number Diff line change
@@ -11,5 +11,5 @@ fn banana(a: <T<const N: usize>>::BAR) {}
fn chaenomeles() {
path::path::Struct::<const N: usize>()
//~^ ERROR unexpected `const` parameter declaration
//~| ERROR failed to resolve: use of undeclared crate or module `path`
//~| ERROR failed to resolve: use of unresolved module or unlinked crate `path`
}
Original file line number Diff line number Diff line change
@@ -21,11 +21,13 @@ error: unexpected `const` parameter declaration
LL | path::path::Struct::<const N: usize>()
| ^^^^^^^^^^^^^^ expected a `const` expression, not a parameter declaration

error[E0433]: failed to resolve: use of undeclared crate or module `path`
error[E0433]: failed to resolve: use of unresolved module or unlinked crate `path`
--> $DIR/const-param-decl-on-type-instead-of-impl.rs:12:5
|
LL | path::path::Struct::<const N: usize>()
| ^^^^ use of undeclared crate or module `path`
| ^^^^ use of unresolved module or unlinked crate `path`
|
= help: you might be missing a crate named `path`

error[E0412]: cannot find type `T` in this scope
--> $DIR/const-param-decl-on-type-instead-of-impl.rs:8:15
2 changes: 1 addition & 1 deletion tests/ui/parser/dyn-trait-compatibility.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
type A0 = dyn;
//~^ ERROR cannot find type `dyn` in this scope
type A1 = dyn::dyn;
//~^ ERROR use of undeclared crate or module `dyn`
//~^ ERROR use of unresolved module or unlinked crate `dyn`
type A2 = dyn<dyn, dyn>;
//~^ ERROR cannot find type `dyn` in this scope
//~| ERROR cannot find type `dyn` in this scope
6 changes: 4 additions & 2 deletions tests/ui/parser/dyn-trait-compatibility.stderr
Original file line number Diff line number Diff line change
@@ -40,11 +40,13 @@ error[E0412]: cannot find type `dyn` in this scope
LL | type A3 = dyn<<dyn as dyn>::dyn>;
| ^^^ not found in this scope

error[E0433]: failed to resolve: use of undeclared crate or module `dyn`
error[E0433]: failed to resolve: use of unresolved module or unlinked crate `dyn`
--> $DIR/dyn-trait-compatibility.rs:3:11
|
LL | type A1 = dyn::dyn;
| ^^^ use of undeclared crate or module `dyn`
| ^^^ use of unresolved module or unlinked crate `dyn`
|
= help: you might be missing a crate named `dyn`

error: aborting due to 8 previous errors

3 changes: 2 additions & 1 deletion tests/ui/parser/mod_file_not_exist.rs
Original file line number Diff line number Diff line change
@@ -5,5 +5,6 @@ mod not_a_real_file; //~ ERROR file not found for module `not_a_real_file`

fn main() {
assert_eq!(mod_file_aux::bar(), 10);
//~^ ERROR failed to resolve: use of undeclared crate or module `mod_file_aux`
//~^ ERROR failed to resolve: use of unresolved module or unlinked crate `mod_file_aux`
//~| HELP you might be missing a crate named `mod_file_aux`
}
6 changes: 4 additions & 2 deletions tests/ui/parser/mod_file_not_exist.stderr
Original file line number Diff line number Diff line change
@@ -7,11 +7,13 @@ LL | mod not_a_real_file;
= help: to create the module `not_a_real_file`, create file "$DIR/not_a_real_file.rs" or "$DIR/not_a_real_file/mod.rs"
= note: if there is a `mod not_a_real_file` elsewhere in the crate already, import it with `use crate::...` instead

error[E0433]: failed to resolve: use of undeclared crate or module `mod_file_aux`
error[E0433]: failed to resolve: use of unresolved module or unlinked crate `mod_file_aux`
--> $DIR/mod_file_not_exist.rs:7:16
|
LL | assert_eq!(mod_file_aux::bar(), 10);
| ^^^^^^^^^^^^ use of undeclared crate or module `mod_file_aux`
| ^^^^^^^^^^^^ use of unresolved module or unlinked crate `mod_file_aux`
|
= help: you might be missing a crate named `mod_file_aux`

error: aborting due to 2 previous errors

3 changes: 2 additions & 1 deletion tests/ui/parser/mod_file_not_exist_windows.rs
Original file line number Diff line number Diff line change
@@ -5,5 +5,6 @@ mod not_a_real_file; //~ ERROR file not found for module `not_a_real_file`

fn main() {
assert_eq!(mod_file_aux::bar(), 10);
//~^ ERROR failed to resolve: use of undeclared crate or module `mod_file_aux`
//~^ ERROR failed to resolve: use of unresolved module or unlinked crate `mod_file_aux`
//~| HELP you might be missing a crate named `mod_file_aux`
}
6 changes: 4 additions & 2 deletions tests/ui/parser/mod_file_not_exist_windows.stderr
Original file line number Diff line number Diff line change
@@ -7,11 +7,13 @@ LL | mod not_a_real_file;
= help: to create the module `not_a_real_file`, create file "$DIR/not_a_real_file.rs" or "$DIR/not_a_real_file/mod.rs"
= note: if there is a `mod not_a_real_file` elsewhere in the crate already, import it with `use crate::...` instead

error[E0433]: failed to resolve: use of undeclared crate or module `mod_file_aux`
error[E0433]: failed to resolve: use of unresolved module or unlinked crate `mod_file_aux`
--> $DIR/mod_file_not_exist_windows.rs:7:16
|
LL | assert_eq!(mod_file_aux::bar(), 10);
| ^^^^^^^^^^^^ use of undeclared crate or module `mod_file_aux`
| ^^^^^^^^^^^^ use of unresolved module or unlinked crate `mod_file_aux`
|
= help: you might be missing a crate named `mod_file_aux`

error: aborting due to 2 previous errors

2 changes: 1 addition & 1 deletion tests/ui/privacy/restricted/test.rs
Original file line number Diff line number Diff line change
@@ -47,6 +47,6 @@ fn main() {
}

mod pathological {
pub(in bad::path) mod m1 {} //~ ERROR failed to resolve: you might be missing crate `bad`
pub(in bad::path) mod m1 {} //~ ERROR failed to resolve: use of unresolved module or unlinked crate `bad`
pub(in foo) mod m2 {} //~ ERROR visibilities can only be restricted to ancestor modules
}
6 changes: 3 additions & 3 deletions tests/ui/privacy/restricted/test.stderr
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
error[E0433]: failed to resolve: you might be missing crate `bad`
error[E0433]: failed to resolve: use of unresolved module or unlinked crate `bad`
--> $DIR/test.rs:50:12
|
LL | pub(in bad::path) mod m1 {}
| ^^^ you might be missing crate `bad`
| ^^^ use of unresolved module or unlinked crate `bad`
|
help: consider importing the `bad` crate
help: you might be missing a crate named `bad`, add it to your project and import it in your code
|
LL + extern crate bad;
|
16 changes: 10 additions & 6 deletions tests/ui/resolve/112590-2.stderr
Original file line number Diff line number Diff line change
@@ -14,12 +14,13 @@ LL - let _: Vec<i32> = super::foo::baf::baz::MyVec::new();
LL + let _: Vec<i32> = MyVec::new();
|

error[E0433]: failed to resolve: use of undeclared crate or module `fox`
error[E0433]: failed to resolve: use of unresolved module or unlinked crate `fox`
--> $DIR/112590-2.rs:18:27
|
LL | let _: Vec<i32> = fox::bar::baz::MyVec::new();
| ^^^ use of undeclared crate or module `fox`
| ^^^ use of unresolved module or unlinked crate `fox`
|
= help: you might be missing a crate named `fox`
help: consider importing this struct through its public re-export
|
LL + use foo::bar::baz::MyVec;
@@ -30,12 +31,13 @@ LL - let _: Vec<i32> = fox::bar::baz::MyVec::new();
LL + let _: Vec<i32> = MyVec::new();
|

error[E0433]: failed to resolve: use of undeclared crate or module `vec`
error[E0433]: failed to resolve: use of unresolved module or unlinked crate `vec`
--> $DIR/112590-2.rs:24:15
|
LL | type _B = vec::Vec::<u8>;
| ^^^ use of undeclared crate or module `vec`
| ^^^ use of unresolved module or unlinked crate `vec`
|
= help: you might be missing a crate named `vec`
help: consider importing this module
|
LL + use std::vec;
@@ -57,14 +59,16 @@ LL - let _t = std::sync_error::atomic::AtomicBool::new(true);
LL + let _t = AtomicBool::new(true);
|

error[E0433]: failed to resolve: use of undeclared crate or module `vec`
error[E0433]: failed to resolve: use of unresolved module or unlinked crate `vec`
--> $DIR/112590-2.rs:23:24
|
LL | let _t: Vec<i32> = vec::new();
| ^^^
| |
| use of undeclared crate or module `vec`
| use of unresolved module or unlinked crate `vec`
| help: a struct with a similar name exists (notice the capitalization): `Vec`
|
= help: you might be missing a crate named `vec`

error: aborting due to 5 previous errors

4 changes: 2 additions & 2 deletions tests/ui/resolve/bad-module.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
fn main() {
let foo = thing::len(Vec::new());
//~^ ERROR failed to resolve: use of undeclared crate or module `thing`
//~^ ERROR failed to resolve: use of unresolved module or unlinked crate `thing`

let foo = foo::bar::baz();
//~^ ERROR failed to resolve: use of undeclared crate or module `foo`
//~^ ERROR failed to resolve: use of unresolved module or unlinked crate `foo`
}
12 changes: 8 additions & 4 deletions tests/ui/resolve/bad-module.stderr
Original file line number Diff line number Diff line change
@@ -1,14 +1,18 @@
error[E0433]: failed to resolve: use of undeclared crate or module `foo`
error[E0433]: failed to resolve: use of unresolved module or unlinked crate `foo`
--> $DIR/bad-module.rs:5:15
|
LL | let foo = foo::bar::baz();
| ^^^ use of undeclared crate or module `foo`
| ^^^ use of unresolved module or unlinked crate `foo`
|
= help: you might be missing a crate named `foo`

error[E0433]: failed to resolve: use of undeclared crate or module `thing`
error[E0433]: failed to resolve: use of unresolved module or unlinked crate `thing`
--> $DIR/bad-module.rs:2:15
|
LL | let foo = thing::len(Vec::new());
| ^^^^^ use of undeclared crate or module `thing`
| ^^^^^ use of unresolved module or unlinked crate `thing`
|
= help: you might be missing a crate named `thing`

error: aborting due to 2 previous errors

4 changes: 2 additions & 2 deletions tests/ui/resolve/editions-crate-root-2015.rs
Original file line number Diff line number Diff line change
@@ -2,10 +2,10 @@

mod inner {
fn global_inner(_: ::nonexistant::Foo) {
//~^ ERROR failed to resolve: you might be missing crate `nonexistant`
//~^ ERROR failed to resolve: use of unresolved module or unlinked crate `nonexistant`
}
fn crate_inner(_: crate::nonexistant::Foo) {
//~^ ERROR failed to resolve: you might be missing crate `nonexistant`
//~^ ERROR failed to resolve: use of unresolved module or unlinked crate `nonexistant`
}

fn bare_global(_: ::nonexistant) {
12 changes: 6 additions & 6 deletions tests/ui/resolve/editions-crate-root-2015.stderr
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
error[E0433]: failed to resolve: you might be missing crate `nonexistant`
error[E0433]: failed to resolve: use of unresolved module or unlinked crate `nonexistant`
--> $DIR/editions-crate-root-2015.rs:4:26
|
LL | fn global_inner(_: ::nonexistant::Foo) {
| ^^^^^^^^^^^ you might be missing crate `nonexistant`
| ^^^^^^^^^^^ use of unresolved module or unlinked crate `nonexistant`
|
help: consider importing the `nonexistant` crate
help: you might be missing a crate named `nonexistant`, add it to your project and import it in your code
|
LL + extern crate nonexistant;
|

error[E0433]: failed to resolve: you might be missing crate `nonexistant`
error[E0433]: failed to resolve: use of unresolved module or unlinked crate `nonexistant`
--> $DIR/editions-crate-root-2015.rs:7:30
|
LL | fn crate_inner(_: crate::nonexistant::Foo) {
| ^^^^^^^^^^^ you might be missing crate `nonexistant`
| ^^^^^^^^^^^ use of unresolved module or unlinked crate `nonexistant`
|
help: consider importing the `nonexistant` crate
help: you might be missing a crate named `nonexistant`, add it to your project and import it in your code
|
LL + extern crate nonexistant;
|
2 changes: 1 addition & 1 deletion tests/ui/resolve/export-fully-qualified-2018.rs
Original file line number Diff line number Diff line change
@@ -5,7 +5,7 @@
// want to change eventually.

mod foo {
pub fn bar() { foo::baz(); } //~ ERROR failed to resolve: use of undeclared crate or module `foo`
pub fn bar() { foo::baz(); } //~ ERROR failed to resolve: use of unresolved module or unlinked crate `foo`

fn baz() { }
}
6 changes: 4 additions & 2 deletions tests/ui/resolve/export-fully-qualified-2018.stderr
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
error[E0433]: failed to resolve: use of undeclared crate or module `foo`
error[E0433]: failed to resolve: use of unresolved module or unlinked crate `foo`
--> $DIR/export-fully-qualified-2018.rs:8:20
|
LL | pub fn bar() { foo::baz(); }
| ^^^ use of undeclared crate or module `foo`
| ^^^ use of unresolved module or unlinked crate `foo`
|
= help: you might be missing a crate named `foo`

error: aborting due to 1 previous error

2 changes: 1 addition & 1 deletion tests/ui/resolve/export-fully-qualified.rs
Original file line number Diff line number Diff line change
@@ -5,7 +5,7 @@
// want to change eventually.

mod foo {
pub fn bar() { foo::baz(); } //~ ERROR failed to resolve: use of undeclared crate or module `foo`
pub fn bar() { foo::baz(); } //~ ERROR failed to resolve: use of unresolved module or unlinked crate `foo`

fn baz() { }
}
6 changes: 4 additions & 2 deletions tests/ui/resolve/export-fully-qualified.stderr
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
error[E0433]: failed to resolve: use of undeclared crate or module `foo`
error[E0433]: failed to resolve: use of unresolved module or unlinked crate `foo`
--> $DIR/export-fully-qualified.rs:8:20
|
LL | pub fn bar() { foo::baz(); }
| ^^^ use of undeclared crate or module `foo`
| ^^^ use of unresolved module or unlinked crate `foo`
|
= help: you might be missing a crate named `foo`

error: aborting due to 1 previous error

10 changes: 5 additions & 5 deletions tests/ui/resolve/extern-prelude-fail.stderr
Original file line number Diff line number Diff line change
@@ -2,20 +2,20 @@ error[E0432]: unresolved import `extern_prelude`
--> $DIR/extern-prelude-fail.rs:7:9
|
LL | use extern_prelude::S;
| ^^^^^^^^^^^^^^ you might be missing crate `extern_prelude`
| ^^^^^^^^^^^^^^ use of unresolved module or unlinked crate `extern_prelude`
|
help: consider importing the `extern_prelude` crate
help: you might be missing a crate named `extern_prelude`, add it to your project and import it in your code
|
LL + extern crate extern_prelude;
|

error[E0433]: failed to resolve: you might be missing crate `extern_prelude`
error[E0433]: failed to resolve: use of unresolved module or unlinked crate `extern_prelude`
--> $DIR/extern-prelude-fail.rs:8:15
|
LL | let s = ::extern_prelude::S;
| ^^^^^^^^^^^^^^ you might be missing crate `extern_prelude`
| ^^^^^^^^^^^^^^ use of unresolved module or unlinked crate `extern_prelude`
|
help: consider importing the `extern_prelude` crate
help: you might be missing a crate named `extern_prelude`, add it to your project and import it in your code
|
LL + extern crate extern_prelude;
|
2 changes: 1 addition & 1 deletion tests/ui/resolve/issue-101749-2.rs
Original file line number Diff line number Diff line change
@@ -12,5 +12,5 @@ fn main() {
let rect = Rectangle::new(3, 4);
// `area` is not implemented for `Rectangle`, so this should not suggest
let _ = rect::area();
//~^ ERROR failed to resolve: use of undeclared crate or module `rect`
//~^ ERROR failed to resolve: use of unresolved module or unlinked crate `rect`
}
6 changes: 4 additions & 2 deletions tests/ui/resolve/issue-101749-2.stderr
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
error[E0433]: failed to resolve: use of undeclared crate or module `rect`
error[E0433]: failed to resolve: use of unresolved module or unlinked crate `rect`
--> $DIR/issue-101749-2.rs:14:13
|
LL | let _ = rect::area();
| ^^^^ use of undeclared crate or module `rect`
| ^^^^ use of unresolved module or unlinked crate `rect`
|
= help: you might be missing a crate named `rect`

error: aborting due to 1 previous error

2 changes: 1 addition & 1 deletion tests/ui/resolve/issue-101749.fixed
Original file line number Diff line number Diff line change
@@ -15,5 +15,5 @@ impl Rectangle {
fn main() {
let rect = Rectangle::new(3, 4);
let _ = rect.area();
//~^ ERROR failed to resolve: use of undeclared crate or module `rect`
//~^ ERROR failed to resolve: use of unresolved module or unlinked crate `rect`
}
2 changes: 1 addition & 1 deletion tests/ui/resolve/issue-101749.rs
Original file line number Diff line number Diff line change
@@ -15,5 +15,5 @@ impl Rectangle {
fn main() {
let rect = Rectangle::new(3, 4);
let _ = rect::area();
//~^ ERROR failed to resolve: use of undeclared crate or module `rect`
//~^ ERROR failed to resolve: use of unresolved module or unlinked crate `rect`
}
5 changes: 3 additions & 2 deletions tests/ui/resolve/issue-101749.stderr
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
error[E0433]: failed to resolve: use of undeclared crate or module `rect`
error[E0433]: failed to resolve: use of unresolved module or unlinked crate `rect`
--> $DIR/issue-101749.rs:17:13
|
LL | let _ = rect::area();
| ^^^^ use of undeclared crate or module `rect`
| ^^^^ use of unresolved module or unlinked crate `rect`
|
= help: you might be missing a crate named `rect`
help: you may have meant to call an instance method
|
LL | let _ = rect.area();
2 changes: 1 addition & 1 deletion tests/ui/resolve/issue-82865.rs
Original file line number Diff line number Diff line change
@@ -2,7 +2,7 @@

#![feature(decl_macro)]

use x::y::z; //~ ERROR: failed to resolve: you might be missing crate `x`
use x::y::z; //~ ERROR: failed to resolve: use of unresolved module or unlinked crate `x`

macro mac () {
Box::z //~ ERROR: no function or associated item
6 changes: 3 additions & 3 deletions tests/ui/resolve/issue-82865.stderr
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
error[E0433]: failed to resolve: you might be missing crate `x`
error[E0433]: failed to resolve: use of unresolved module or unlinked crate `x`
--> $DIR/issue-82865.rs:5:5
|
LL | use x::y::z;
| ^ you might be missing crate `x`
| ^ use of unresolved module or unlinked crate `x`
|
help: consider importing the `x` crate
help: you might be missing a crate named `x`, add it to your project and import it in your code
|
LL + extern crate x;
|
12 changes: 6 additions & 6 deletions tests/ui/resolve/resolve-bad-visibility.stderr
Original file line number Diff line number Diff line change
@@ -16,24 +16,24 @@ error[E0742]: visibilities can only be restricted to ancestor modules
LL | pub(in std::vec) struct F;
| ^^^^^^^^

error[E0433]: failed to resolve: you might be missing crate `nonexistent`
error[E0433]: failed to resolve: use of unresolved module or unlinked crate `nonexistent`
--> $DIR/resolve-bad-visibility.rs:7:8
|
LL | pub(in nonexistent) struct G;
| ^^^^^^^^^^^ you might be missing crate `nonexistent`
| ^^^^^^^^^^^ use of unresolved module or unlinked crate `nonexistent`
|
help: consider importing the `nonexistent` crate
help: you might be missing a crate named `nonexistent`, add it to your project and import it in your code
|
LL + extern crate nonexistent;
|

error[E0433]: failed to resolve: you might be missing crate `too_soon`
error[E0433]: failed to resolve: use of unresolved module or unlinked crate `too_soon`
--> $DIR/resolve-bad-visibility.rs:8:8
|
LL | pub(in too_soon) struct H;
| ^^^^^^^^ you might be missing crate `too_soon`
| ^^^^^^^^ use of unresolved module or unlinked crate `too_soon`
|
help: consider importing the `too_soon` crate
help: you might be missing a crate named `too_soon`, add it to your project and import it in your code
|
LL + extern crate too_soon;
|
4 changes: 2 additions & 2 deletions tests/ui/resolve/typo-suggestion-mistyped-in-path.rs
Original file line number Diff line number Diff line change
@@ -29,8 +29,8 @@ fn main() {
//~| NOTE use of undeclared type `Struc`

modul::foo();
//~^ ERROR failed to resolve: use of undeclared crate or module `modul`
//~| NOTE use of undeclared crate or module `modul`
//~^ ERROR failed to resolve: use of unresolved module or unlinked crate `modul`
//~| NOTE use of unresolved module or unlinked crate `modul`

module::Struc::foo();
//~^ ERROR failed to resolve: could not find `Struc` in `module`
4 changes: 2 additions & 2 deletions tests/ui/resolve/typo-suggestion-mistyped-in-path.stderr
Original file line number Diff line number Diff line change
@@ -30,11 +30,11 @@ LL | Struc::foo();
| use of undeclared type `Struc`
| help: a struct with a similar name exists: `Struct`

error[E0433]: failed to resolve: use of undeclared crate or module `modul`
error[E0433]: failed to resolve: use of unresolved module or unlinked crate `modul`
--> $DIR/typo-suggestion-mistyped-in-path.rs:31:5
|
LL | modul::foo();
| ^^^^^ use of undeclared crate or module `modul`
| ^^^^^ use of unresolved module or unlinked crate `modul`
|
help: there is a crate or module with a similar name
|
Original file line number Diff line number Diff line change
@@ -2,7 +2,9 @@ error[E0432]: unresolved import `xcrate`
--> $DIR/non-existent-1.rs:3:5
|
LL | use xcrate::S;
| ^^^^^^ use of undeclared crate or module `xcrate`
| ^^^^^^ use of unresolved module or unlinked crate `xcrate`
|
= help: you might be missing a crate named `xcrate`

error: aborting due to 1 previous error

4 changes: 3 additions & 1 deletion tests/ui/rust-2018/unresolved-asterisk-imports.stderr
Original file line number Diff line number Diff line change
@@ -2,7 +2,9 @@ error[E0432]: unresolved import `not_existing_crate`
--> $DIR/unresolved-asterisk-imports.rs:3:5
|
LL | use not_existing_crate::*;
| ^^^^^^^^^^^^^^^^^^ use of undeclared crate or module `not_existing_crate`
| ^^^^^^^^^^^^^^^^^^ use of unresolved module or unlinked crate `not_existing_crate`
|
= help: you might be missing a crate named `not_existing_crate`

error: aborting due to 1 previous error

4 changes: 2 additions & 2 deletions tests/ui/suggestions/crate-or-module-typo.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//@ edition:2018

use st::cell::Cell; //~ ERROR failed to resolve: use of undeclared crate or module `st`
use st::cell::Cell; //~ ERROR failed to resolve: use of unresolved module or unlinked crate `st`

mod bar {
pub fn bar() { bar::baz(); } //~ ERROR failed to resolve: function `bar` is not a crate or module
@@ -11,7 +11,7 @@ mod bar {
use bas::bar; //~ ERROR unresolved import `bas`

struct Foo {
bar: st::cell::Cell<bool> //~ ERROR failed to resolve: use of undeclared crate or module `st`
bar: st::cell::Cell<bool> //~ ERROR failed to resolve: use of unresolved module or unlinked crate `st`
}

fn main() {}
10 changes: 5 additions & 5 deletions tests/ui/suggestions/crate-or-module-typo.stderr
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
error[E0433]: failed to resolve: use of undeclared crate or module `st`
error[E0433]: failed to resolve: use of unresolved module or unlinked crate `st`
--> $DIR/crate-or-module-typo.rs:3:5
|
LL | use st::cell::Cell;
| ^^ use of undeclared crate or module `st`
| ^^ use of unresolved module or unlinked crate `st`
|
help: there is a crate or module with a similar name
|
@@ -13,18 +13,18 @@ error[E0432]: unresolved import `bas`
--> $DIR/crate-or-module-typo.rs:11:5
|
LL | use bas::bar;
| ^^^ use of undeclared crate or module `bas`
| ^^^ use of unresolved module or unlinked crate `bas`
|
help: there is a crate or module with a similar name
|
LL | use bar::bar;
| ~~~

error[E0433]: failed to resolve: use of undeclared crate or module `st`
error[E0433]: failed to resolve: use of unresolved module or unlinked crate `st`
--> $DIR/crate-or-module-typo.rs:14:10
|
LL | bar: st::cell::Cell<bool>
| ^^ use of undeclared crate or module `st`
| ^^ use of unresolved module or unlinked crate `st`
|
help: there is a crate or module with a similar name
|
6 changes: 3 additions & 3 deletions tests/ui/suggestions/issue-112590-suggest-import.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
pub struct S;

impl fmt::Debug for S { //~ ERROR failed to resolve: use of undeclared crate or module `fmt`
fn fmt(&self, _f: &mut fmt::Formatter<'_>) -> fmt::Result { //~ ERROR failed to resolve: use of undeclared crate or module `fmt`
//~^ ERROR failed to resolve: use of undeclared crate or module `fmt`
impl fmt::Debug for S { //~ ERROR failed to resolve: use of unresolved module or unlinked crate `fmt`
fn fmt(&self, _f: &mut fmt::Formatter<'_>) -> fmt::Result { //~ ERROR failed to resolve: use of unresolved module or unlinked crate `fmt`
//~^ ERROR failed to resolve: use of unresolved module or unlinked crate `fmt`
Ok(())
}
}
15 changes: 9 additions & 6 deletions tests/ui/suggestions/issue-112590-suggest-import.stderr
Original file line number Diff line number Diff line change
@@ -1,31 +1,34 @@
error[E0433]: failed to resolve: use of undeclared crate or module `fmt`
error[E0433]: failed to resolve: use of unresolved module or unlinked crate `fmt`
--> $DIR/issue-112590-suggest-import.rs:3:6
|
LL | impl fmt::Debug for S {
| ^^^ use of undeclared crate or module `fmt`
| ^^^ use of unresolved module or unlinked crate `fmt`
|
= help: you might be missing a crate named `fmt`
help: consider importing this module
|
LL + use std::fmt;
|

error[E0433]: failed to resolve: use of undeclared crate or module `fmt`
error[E0433]: failed to resolve: use of unresolved module or unlinked crate `fmt`
--> $DIR/issue-112590-suggest-import.rs:4:28
|
LL | fn fmt(&self, _f: &mut fmt::Formatter<'_>) -> fmt::Result {
| ^^^ use of undeclared crate or module `fmt`
| ^^^ use of unresolved module or unlinked crate `fmt`
|
= help: you might be missing a crate named `fmt`
help: consider importing this module
|
LL + use std::fmt;
|

error[E0433]: failed to resolve: use of undeclared crate or module `fmt`
error[E0433]: failed to resolve: use of unresolved module or unlinked crate `fmt`
--> $DIR/issue-112590-suggest-import.rs:4:51
|
LL | fn fmt(&self, _f: &mut fmt::Formatter<'_>) -> fmt::Result {
| ^^^ use of undeclared crate or module `fmt`
| ^^^ use of unresolved module or unlinked crate `fmt`
|
= help: you might be missing a crate named `fmt`
help: consider importing this module
|
LL + use std::fmt;
2 changes: 1 addition & 1 deletion tests/ui/suggestions/undeclared-module-alloc.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//@ edition:2018

use alloc::rc::Rc; //~ ERROR failed to resolve: use of undeclared crate or module `alloc`
use alloc::rc::Rc; //~ ERROR failed to resolve: use of unresolved module or unlinked crate `alloc`

fn main() {}
4 changes: 2 additions & 2 deletions tests/ui/suggestions/undeclared-module-alloc.stderr
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
error[E0433]: failed to resolve: use of undeclared crate or module `alloc`
error[E0433]: failed to resolve: use of unresolved module or unlinked crate `alloc`
--> $DIR/undeclared-module-alloc.rs:3:5
|
LL | use alloc::rc::Rc;
| ^^^^^ use of undeclared crate or module `alloc`
| ^^^^^ use of unresolved module or unlinked crate `alloc`
|
= help: add `extern crate alloc` to use the `alloc` crate

25 changes: 25 additions & 0 deletions tests/ui/symbol-names/symbol-with-question-mark-links.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
// This test ensures functions with an exported name beginning with a question mark
// successfully compile and link.
//
// Regression test for <https://github.com/rust-lang/rust/issues/44282>

//@ build-pass
//@ only-windows
//@ only-x86
// Reason: This test regards a linker issue which only applies to Windows.
// Specifically, it only occurs due to Windows x86 name decoration, combined with
// a mismatch between LLVM's decoration logic and Rust's (for `lib.def` generation)

#![crate_type = "cdylib"]

#[no_mangle]
pub extern "C" fn decorated(a: i32, b: i32) -> i32 {
1
}

// This isn't just `?undecorated` because MSVC's linker fails if the decorated
// symbol is not valid.
#[export_name = "?undecorated@@YAXXZ"]
pub extern "C" fn undecorated(a: i32, b: i32) -> i32 {
2
}
2 changes: 1 addition & 1 deletion tests/ui/tool-attributes/unknown-tool-name.rs
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
#[foo::bar] //~ ERROR failed to resolve: use of undeclared crate or module `foo`
#[foo::bar] //~ ERROR failed to resolve: use of unresolved module or unlinked crate `foo`
fn main() {}
4 changes: 2 additions & 2 deletions tests/ui/tool-attributes/unknown-tool-name.stderr
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
error[E0433]: failed to resolve: use of undeclared crate or module `foo`
error[E0433]: failed to resolve: use of unresolved module or unlinked crate `foo`
--> $DIR/unknown-tool-name.rs:1:3
|
LL | #[foo::bar]
| ^^^ use of undeclared crate or module `foo`
| ^^^ use of unresolved module or unlinked crate `foo`

error: aborting due to 1 previous error

4 changes: 2 additions & 2 deletions tests/ui/typeck/issue-120856.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
pub type Archived<T> = <m::Alias as n::Trait>::Archived;
//~^ ERROR failed to resolve: use of undeclared crate or module `m`
//~| ERROR failed to resolve: use of undeclared crate or module `n`
//~^ ERROR failed to resolve: use of unresolved module or unlinked crate `m`
//~| ERROR failed to resolve: use of unresolved module or unlinked crate `n`

fn main() {}
12 changes: 8 additions & 4 deletions tests/ui/typeck/issue-120856.stderr
Original file line number Diff line number Diff line change
@@ -1,20 +1,24 @@
error[E0433]: failed to resolve: use of undeclared crate or module `n`
error[E0433]: failed to resolve: use of unresolved module or unlinked crate `n`
--> $DIR/issue-120856.rs:1:37
|
LL | pub type Archived<T> = <m::Alias as n::Trait>::Archived;
| ^
| |
| use of undeclared crate or module `n`
| use of unresolved module or unlinked crate `n`
| help: a trait with a similar name exists: `Fn`
|
= help: you might be missing a crate named `n`

error[E0433]: failed to resolve: use of undeclared crate or module `m`
error[E0433]: failed to resolve: use of unresolved module or unlinked crate `m`
--> $DIR/issue-120856.rs:1:25
|
LL | pub type Archived<T> = <m::Alias as n::Trait>::Archived;
| ^
| |
| use of undeclared crate or module `m`
| use of unresolved module or unlinked crate `m`
| help: a type parameter with a similar name exists: `T`
|
= help: you might be missing a crate named `m`

error: aborting due to 2 previous errors

Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
error[E0433]: failed to resolve: use of unresolved module or unlinked crate `page_size`
--> $DIR/path-to-method-sugg-unresolved-expr.rs:5:21
|
LL | let page_size = page_size::get();
| ^^^^^^^^^ use of unresolved module or unlinked crate `page_size`
|
= help: if you wanted to use a crate named `page_size`, use `cargo add page_size` to add it to your `Cargo.toml`

error: aborting due to 1 previous error

For more information about this error, try `rustc --explain E0433`.
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
error[E0433]: failed to resolve: use of unresolved module or unlinked crate `page_size`
--> $DIR/path-to-method-sugg-unresolved-expr.rs:5:21
|
LL | let page_size = page_size::get();
| ^^^^^^^^^ use of unresolved module or unlinked crate `page_size`
|
= help: you might be missing a crate named `page_size`

error: aborting due to 1 previous error

For more information about this error, try `rustc --explain E0433`.
8 changes: 7 additions & 1 deletion tests/ui/typeck/path-to-method-sugg-unresolved-expr.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
//@ revisions: only-rustc cargo-invoked
//@[only-rustc] unset-rustc-env:CARGO_CRATE_NAME
//@[cargo-invoked] rustc-env:CARGO_CRATE_NAME=foo
fn main() {
let page_size = page_size::get();
//~^ ERROR failed to resolve: use of undeclared crate or module `page_size`
//~^ ERROR failed to resolve: use of unresolved module or unlinked crate `page_size`
//~| NOTE use of unresolved module or unlinked crate `page_size`
//@[cargo-invoked]~^^^ HELP if you wanted to use a crate named `page_size`, use `cargo add
//@[only-rustc]~^^^^ HELP you might be missing a crate named `page_size`
}
9 changes: 0 additions & 9 deletions tests/ui/typeck/path-to-method-sugg-unresolved-expr.stderr

This file was deleted.

4 changes: 2 additions & 2 deletions tests/ui/unresolved/unresolved-asterisk-imports.stderr
Original file line number Diff line number Diff line change
@@ -2,9 +2,9 @@ error[E0432]: unresolved import `not_existing_crate`
--> $DIR/unresolved-asterisk-imports.rs:1:5
|
LL | use not_existing_crate::*;
| ^^^^^^^^^^^^^^^^^^ you might be missing crate `not_existing_crate`
| ^^^^^^^^^^^^^^^^^^ use of unresolved module or unlinked crate `not_existing_crate`
|
help: consider importing the `not_existing_crate` crate
help: you might be missing a crate named `not_existing_crate`, add it to your project and import it in your code
|
LL + extern crate not_existing_crate;
|
4 changes: 2 additions & 2 deletions tests/ui/unresolved/unresolved-import.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use foo::bar;
//~^ ERROR unresolved import `foo` [E0432]
//~| NOTE you might be missing crate `foo`
//~| HELP consider importing the `foo` crate
//~| NOTE use of unresolved module or unlinked crate `foo`
//~| HELP you might be missing a crate named `foo`
//~| SUGGESTION extern crate foo;

use bar::Baz as x;
4 changes: 2 additions & 2 deletions tests/ui/unresolved/unresolved-import.stderr
Original file line number Diff line number Diff line change
@@ -2,9 +2,9 @@ error[E0432]: unresolved import `foo`
--> $DIR/unresolved-import.rs:1:5
|
LL | use foo::bar;
| ^^^ you might be missing crate `foo`
| ^^^ use of unresolved module or unlinked crate `foo`
|
help: consider importing the `foo` crate
help: you might be missing a crate named `foo`, add it to your project and import it in your code
|
LL + extern crate foo;
|