Skip to content

Commit 5aa3d9a

Browse files
committedAug 8, 2019
Auto merge of #63395 - Centril:rollup-kt805cj, r=Centril
Rollup of 6 pull requests Successful merges: - #63162 (Miri tests: use xargo to build separate libstd) - #63289 (Don't recommend `extern crate` syntax) - #63373 (gitignore: add comment explaining policy) - #63374 (move of packed fields might or might not occur when they actually are sufficiently aligned) - #63381 (reduce visibility) - #63387 (Test interaction between `async { ... }` and `?`, `return`, and `break`) Failed merges: r? @ghost
2 parents 2d1a551 + 87fb0ad commit 5aa3d9a

35 files changed

+270
-153
lines changed
 

‎.gitignore

+7-22
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# This file should only ignore things that are generated during a build,
2+
# generated by common IDEs, and optional files controlled by the user
3+
# that affect the build (such as config.toml).
4+
# FIXME: This needs cleanup.
15
*~
26
.#*
37
.DS_Store
@@ -14,20 +18,16 @@ __pycache__/
1418
.valgrindrc
1519
.vscode
1620
.favorites.json
17-
/*-*-*-*/
18-
/*-*-*/
1921
/Makefile
20-
/build
22+
/build/
2123
/config.toml
2224
/dist/
2325
/dl/
24-
/doc
26+
/doc/
2527
/inst/
2628
/llvm/
2729
/mingw-build/
28-
/nd/
2930
/obj/
30-
/rt/
3131
/rustllvm/
3232
/src/libcore/unicode/DerivedCoreProperties.txt
3333
/src/libcore/unicode/DerivedNormalizationProps.txt
@@ -37,11 +37,7 @@ __pycache__/
3737
/src/libcore/unicode/SpecialCasing.txt
3838
/src/libcore/unicode/UnicodeData.txt
3939
/src/libcore/unicode/downloaded
40-
/stage[0-9]+/
41-
/target
42-
target/
43-
/test/
44-
/tmp/
40+
/target/
4541
tags
4642
tags.*
4743
TAGS
@@ -50,17 +46,6 @@ TAGS.*
5046
\#*\#
5147
config.mk
5248
config.stamp
53-
keywords.md
54-
lexer.ml
5549
Session.vim
56-
src/etc/dl
57-
tmp.*.rs
58-
version.md
59-
version.ml
60-
version.texi
6150
.cargo
62-
!src/vendor/**
63-
/src/target/
64-
6551
no_llvm_build
66-

‎config.toml.example

-4
Original file line numberDiff line numberDiff line change
@@ -368,10 +368,6 @@
368368
# When creating source tarballs whether or not to create a source tarball.
369369
#dist-src = false
370370

371-
# Whether to also run the Miri tests suite when running tests.
372-
# As a side-effect also generates MIR for all libraries.
373-
#test-miri = false
374-
375371
# After building or testing extended tools (e.g. clippy and rustfmt), append the
376372
# result (broken, compiling, testing) into this JSON file.
377373
#save-toolstates = "/path/to/toolstates.json"

‎src/.gitignore

-46
This file was deleted.

‎src/bootstrap/bin/rustc.rs

+5-16
Original file line numberDiff line numberDiff line change
@@ -143,8 +143,11 @@ fn main() {
143143

144144
if let Some(target) = target {
145145
// The stage0 compiler has a special sysroot distinct from what we
146-
// actually downloaded, so we just always pass the `--sysroot` option.
147-
cmd.arg("--sysroot").arg(&sysroot);
146+
// actually downloaded, so we just always pass the `--sysroot` option,
147+
// unless one is already set.
148+
if !args.iter().any(|arg| arg == "--sysroot") {
149+
cmd.arg("--sysroot").arg(&sysroot);
150+
}
148151

149152
cmd.arg("-Zexternal-macro-backtrace");
150153

@@ -285,20 +288,6 @@ fn main() {
285288
}
286289
}
287290

288-
// When running miri tests, we need to generate MIR for all libraries
289-
if env::var("TEST_MIRI").ok().map_or(false, |val| val == "true") {
290-
// The flags here should be kept in sync with `add_miri_default_args`
291-
// in miri's `src/lib.rs`.
292-
cmd.arg("-Zalways-encode-mir");
293-
cmd.arg("--cfg=miri");
294-
// These options are preferred by miri, to be able to perform better validation,
295-
// but the bootstrap compiler might not understand them.
296-
if stage != "0" {
297-
cmd.arg("-Zmir-emit-retag");
298-
cmd.arg("-Zmir-opt-level=0");
299-
}
300-
}
301-
302291
if let Ok(map) = env::var("RUSTC_DEBUGINFO_MAP") {
303292
cmd.arg("--remap-path-prefix").arg(&map);
304293
}

‎src/bootstrap/builder.rs

-10
Original file line numberDiff line numberDiff line change
@@ -543,15 +543,6 @@ impl<'a> Builder<'a> {
543543
parent: Cell::new(None),
544544
};
545545

546-
if kind == Kind::Dist {
547-
assert!(
548-
!builder.config.test_miri,
549-
"Do not distribute with miri enabled.\n\
550-
The distributed libraries would include all MIR (increasing binary size).
551-
The distributed MIR would include validation statements."
552-
);
553-
}
554-
555546
builder
556547
}
557548

@@ -981,7 +972,6 @@ impl<'a> Builder<'a> {
981972
PathBuf::from("/path/to/nowhere/rustdoc/not/required")
982973
},
983974
)
984-
.env("TEST_MIRI", self.config.test_miri.to_string())
985975
.env("RUSTC_ERROR_METADATA_DST", self.extended_error_dir());
986976

987977
if let Some(host_linker) = self.linker(compiler.host) {

‎src/bootstrap/config.rs

-4
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,6 @@ pub struct Config {
128128
pub low_priority: bool,
129129
pub channel: String,
130130
pub verbose_tests: bool,
131-
pub test_miri: bool,
132131
pub save_toolstates: Option<PathBuf>,
133132
pub print_step_timings: bool,
134133
pub missing_tools: bool,
@@ -315,7 +314,6 @@ struct Rust {
315314
debug: Option<bool>,
316315
dist_src: Option<bool>,
317316
verbose_tests: Option<bool>,
318-
test_miri: Option<bool>,
319317
incremental: Option<bool>,
320318
save_toolstates: Option<String>,
321319
codegen_backends: Option<Vec<String>>,
@@ -375,7 +373,6 @@ impl Config {
375373
config.codegen_tests = true;
376374
config.ignore_git = false;
377375
config.rust_dist_src = true;
378-
config.test_miri = false;
379376
config.rust_codegen_backends = vec![INTERNER.intern_str("llvm")];
380377
config.rust_codegen_backends_dir = "codegen-backends".to_owned();
381378
config.deny_warnings = true;
@@ -557,7 +554,6 @@ impl Config {
557554
set(&mut config.channel, rust.channel.clone());
558555
set(&mut config.rust_dist_src, rust.dist_src);
559556
set(&mut config.verbose_tests, rust.verbose_tests);
560-
set(&mut config.test_miri, rust.test_miri);
561557
// in the case "false" is set explicitly, do not overwrite the command line args
562558
if let Some(true) = rust.incremental {
563559
config.incremental = true;

‎src/bootstrap/configure.py

-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ def v(*args):
3636
o("compiler-docs", "build.compiler-docs", "build compiler documentation")
3737
o("optimize-tests", "rust.optimize-tests", "build tests with optimizations")
3838
o("parallel-compiler", "rust.parallel-compiler", "build a multi-threaded rustc")
39-
o("test-miri", "rust.test-miri", "run miri's test suite")
4039
o("verbose-tests", "rust.verbose-tests", "enable verbose output when running tests")
4140
o("ccache", "llvm.ccache", "invoke gcc/clang via ccache to reuse object files between builds")
4241
o("sccache", None, "invoke gcc/clang via sccache to reuse object files between builds")

‎src/bootstrap/lib.rs

+1-3
Original file line numberDiff line numberDiff line change
@@ -540,9 +540,7 @@ impl Build {
540540
Mode::Rustc => "-rustc",
541541
Mode::Codegen => "-codegen",
542542
Mode::ToolBootstrap => "-bootstrap-tools",
543-
Mode::ToolStd => "-tools",
544-
Mode::ToolTest => "-tools",
545-
Mode::ToolRustc => "-tools",
543+
Mode::ToolStd | Mode::ToolTest | Mode::ToolRustc => "-tools",
546544
};
547545
self.out.join(&*compiler.host)
548546
.join(format!("stage{}{}", compiler.stage, suffix))

‎src/bootstrap/test.rs

+78-14
Original file line numberDiff line numberDiff line change
@@ -363,11 +363,9 @@ pub struct Miri {
363363
impl Step for Miri {
364364
type Output = ();
365365
const ONLY_HOSTS: bool = true;
366-
const DEFAULT: bool = true;
367366

368367
fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> {
369-
let test_miri = run.builder.config.test_miri;
370-
run.path("src/tools/miri").default_condition(test_miri)
368+
run.path("src/tools/miri")
371369
}
372370

373371
fn make_run(run: RunConfig<'_>) {
@@ -389,26 +387,92 @@ impl Step for Miri {
389387
extra_features: Vec::new(),
390388
});
391389
if let Some(miri) = miri {
392-
let mut cargo = tool::prepare_tool_cargo(builder,
393-
compiler,
394-
Mode::ToolRustc,
395-
host,
396-
"test",
397-
"src/tools/miri",
398-
SourceType::Submodule,
399-
&[]);
390+
// # Run `cargo miri setup`.
391+
// As a side-effect, this will install xargo.
392+
let mut cargo = tool::prepare_tool_cargo(
393+
builder,
394+
compiler,
395+
Mode::ToolRustc,
396+
host,
397+
"run",
398+
"src/tools/miri",
399+
SourceType::Submodule,
400+
&[],
401+
);
402+
cargo
403+
.arg("--bin")
404+
.arg("cargo-miri")
405+
.arg("--")
406+
.arg("miri")
407+
.arg("setup");
408+
409+
// Tell `cargo miri` not to worry about the sysroot mismatch (we built with
410+
// stage1 but run with stage2).
411+
cargo.env("MIRI_SKIP_SYSROOT_CHECK", "1");
412+
// Tell `cargo miri setup` where to find the sources.
413+
cargo.env("XARGO_RUST_SRC", builder.src.join("src"));
414+
// Debug things.
415+
cargo.env("RUST_BACKTRACE", "1");
416+
// Configure `cargo install` path, and let cargo-miri know that that's where
417+
// xargo ends up.
418+
cargo.env("CARGO_INSTALL_ROOT", &builder.out); // cargo adds a `bin/`
419+
cargo.env("XARGO", builder.out.join("bin").join("xargo"));
420+
421+
if !try_run(builder, &mut cargo) {
422+
return;
423+
}
424+
425+
// # Determine where Miri put its sysroot.
426+
// To this end, we run `cargo miri setup --env` and capture the output.
427+
// (We do this separately from the above so that when the setup actually
428+
// happens we get some output.)
429+
// We re-use the `cargo` from above.
430+
cargo.arg("--env");
431+
432+
// FIXME: Is there a way in which we can re-use the usual `run` helpers?
433+
let miri_sysroot = if builder.config.dry_run {
434+
String::new()
435+
} else {
436+
builder.verbose(&format!("running: {:?}", cargo));
437+
let out = cargo.output()
438+
.expect("We already ran `cargo miri setup` before and that worked");
439+
assert!(out.status.success(), "`cargo miri setup` returned with non-0 exit code");
440+
// Output is "MIRI_SYSROOT=<str>\n".
441+
let stdout = String::from_utf8(out.stdout)
442+
.expect("`cargo miri setup` stdout is not valid UTF-8");
443+
let stdout = stdout.trim();
444+
builder.verbose(&format!("`cargo miri setup --env` returned: {:?}", stdout));
445+
let sysroot = stdout.splitn(2, '=')
446+
.nth(1).expect("`cargo miri setup` stdout did not contain '='");
447+
sysroot.to_owned()
448+
};
449+
450+
// # Run `cargo test`.
451+
let mut cargo = tool::prepare_tool_cargo(
452+
builder,
453+
compiler,
454+
Mode::ToolRustc,
455+
host,
456+
"test",
457+
"src/tools/miri",
458+
SourceType::Submodule,
459+
&[],
460+
);
400461

401462
// miri tests need to know about the stage sysroot
402-
cargo.env("MIRI_SYSROOT", builder.sysroot(compiler));
463+
cargo.env("MIRI_SYSROOT", miri_sysroot);
403464
cargo.env("RUSTC_TEST_SUITE", builder.rustc(compiler));
404465
cargo.env("RUSTC_LIB_PATH", builder.rustc_libdir(compiler));
405466
cargo.env("MIRI_PATH", miri);
406467

407468
builder.add_rustc_lib_path(compiler, &mut cargo);
408469

409-
if try_run(builder, &mut cargo) {
410-
builder.save_toolstate("miri", ToolState::TestPass);
470+
if !try_run(builder, &mut cargo) {
471+
return;
411472
}
473+
474+
// # Done!
475+
builder.save_toolstate("miri", ToolState::TestPass);
412476
} else {
413477
eprintln!("failed to test miri: could not build");
414478
}

‎src/ci/azure-pipelines/auto.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,7 @@ jobs:
254254
x86_64-msvc-tools:
255255
MSYS_BITS: 64
256256
SCRIPT: src/ci/docker/x86_64-gnu-tools/checktools.sh x.py /tmp/toolstates.json windows
257-
RUST_CONFIGURE_ARGS: --build=x86_64-pc-windows-msvc --save-toolstates=/tmp/toolstates.json --enable-test-miri
257+
RUST_CONFIGURE_ARGS: --build=x86_64-pc-windows-msvc --save-toolstates=/tmp/toolstates.json
258258

259259
# 32/64-bit MinGW builds.
260260
#

‎src/ci/docker/x86_64-gnu-tools/Dockerfile

-1
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,5 @@ COPY x86_64-gnu-tools/repo.sh /tmp/
2323

2424
ENV RUST_CONFIGURE_ARGS \
2525
--build=x86_64-unknown-linux-gnu \
26-
--enable-test-miri \
2726
--save-toolstates=/tmp/toolstates.json
2827
ENV SCRIPT /tmp/checktools.sh ../x.py /tmp/toolstates.json linux

‎src/libcore/pin.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,8 @@
188188
//! you do not accidentally use `self`/`this` in a way that is in conflict with pinning.
189189
//!
190190
//! Moreover, if your type is `#[repr(packed)]`, the compiler will automatically
191-
//! move fields around to be able to drop them. As a consequence, you cannot use
191+
//! move fields around to be able to drop them. It might even do
192+
//! that for fields that happen to be sufficiently aligned. As a consequence, you cannot use
192193
//! pinning with a `#[repr(packed)]` type.
193194
//!
194195
//! # Projections and Structural Pinning

‎src/librustc_resolve/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -4084,7 +4084,7 @@ impl<'a> Resolver<'a> {
40844084
)),
40854085
)
40864086
} else if !ident.is_reserved() {
4087-
(format!("maybe a missing `extern crate {};`?", ident), None)
4087+
(format!("maybe a missing crate `{}`?", ident), None)
40884088
} else {
40894089
// the parser will already have complained about the keyword being used
40904090
return PathResult::NonModule(PartialRes::new(Res::Err));

‎src/libsyntax/source_map.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -125,12 +125,12 @@ impl StableSourceFileId {
125125

126126
#[derive(Default)]
127127
pub(super) struct SourceMapFiles {
128-
pub(super) source_files: Vec<Lrc<SourceFile>>,
128+
source_files: Vec<Lrc<SourceFile>>,
129129
stable_id_to_source_file: FxHashMap<StableSourceFileId, Lrc<SourceFile>>
130130
}
131131

132132
pub struct SourceMap {
133-
pub(super) files: Lock<SourceMapFiles>,
133+
files: Lock<SourceMapFiles>,
134134
file_loader: Box<dyn FileLoader + Sync + Send>,
135135
// This is used to apply the file path remapping as specified via
136136
// --remap-path-prefix to all SourceFiles allocated within this SourceMap.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
// Test that `async { .. }` blocks:
2+
// 1. do not allow `break` expressions.
3+
// 2. get targeted by `return` and not the parent function.
4+
// 3. get targeted by `?` and not the parent function.
5+
//
6+
// edition:2018
7+
// ignore-tidy-linelength
8+
9+
#![feature(async_await)]
10+
11+
fn main() {}
12+
13+
use core::future::Future;
14+
15+
fn return_targets_async_block_not_fn() -> u8 {
16+
//~^ ERROR mismatched types
17+
let block = async {
18+
return 0u8;
19+
};
20+
let _: &dyn Future<Output = ()> = &block;
21+
//~^ ERROR type mismatch resolving `<impl std::future::Future as std::future::Future>::Output == ()`
22+
}
23+
24+
async fn return_targets_async_block_not_async_fn() -> u8 {
25+
//~^ ERROR type mismatch resolving
26+
let block = async {
27+
return 0u8;
28+
};
29+
let _: &dyn Future<Output = ()> = &block;
30+
//~^ ERROR type mismatch resolving `<impl std::future::Future as std::future::Future>::Output == ()`
31+
}
32+
33+
fn no_break_in_async_block() {
34+
async {
35+
break 0u8; //~ ERROR `break` inside of a closure
36+
// FIXME: This diagnostic is pretty bad.
37+
};
38+
}
39+
40+
fn no_break_in_async_block_even_with_outer_loop() {
41+
loop {
42+
async {
43+
break 0u8; //~ ERROR `break` inside of a closure
44+
};
45+
}
46+
}
47+
48+
struct MyErr;
49+
fn err() -> Result<u8, MyErr> { Err(MyErr) }
50+
51+
fn rethrow_targets_async_block_not_fn() -> Result<u8, MyErr> {
52+
//~^ ERROR mismatched types
53+
let block = async {
54+
err()?;
55+
Ok(())
56+
};
57+
let _: &dyn Future<Output = Result<(), MyErr>> = &block;
58+
}
59+
60+
fn rethrow_targets_async_block_not_async_fn() -> Result<u8, MyErr> {
61+
//~^ ERROR mismatched types
62+
let block = async {
63+
err()?;
64+
Ok(())
65+
};
66+
let _: &dyn Future<Output = Result<(), MyErr>> = &block;
67+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
error[E0267]: `break` inside of a closure
2+
--> $DIR/async-block-control-flow-static-semantics.rs:35:9
3+
|
4+
LL | break 0u8;
5+
| ^^^^^^^^^ cannot break inside of a closure
6+
7+
error[E0267]: `break` inside of a closure
8+
--> $DIR/async-block-control-flow-static-semantics.rs:43:13
9+
|
10+
LL | break 0u8;
11+
| ^^^^^^^^^ cannot break inside of a closure
12+
13+
error[E0308]: mismatched types
14+
--> $DIR/async-block-control-flow-static-semantics.rs:15:43
15+
|
16+
LL | fn return_targets_async_block_not_fn() -> u8 {
17+
| --------------------------------- ^^ expected u8, found ()
18+
| |
19+
| this function's body doesn't return
20+
|
21+
= note: expected type `u8`
22+
found type `()`
23+
24+
error[E0271]: type mismatch resolving `<impl std::future::Future as std::future::Future>::Output == ()`
25+
--> $DIR/async-block-control-flow-static-semantics.rs:20:39
26+
|
27+
LL | let _: &dyn Future<Output = ()> = &block;
28+
| ^^^^^^ expected u8, found ()
29+
|
30+
= note: expected type `u8`
31+
found type `()`
32+
= note: required for the cast to the object type `dyn std::future::Future<Output = ()>`
33+
34+
error[E0271]: type mismatch resolving `<impl std::future::Future as std::future::Future>::Output == ()`
35+
--> $DIR/async-block-control-flow-static-semantics.rs:29:39
36+
|
37+
LL | let _: &dyn Future<Output = ()> = &block;
38+
| ^^^^^^ expected u8, found ()
39+
|
40+
= note: expected type `u8`
41+
found type `()`
42+
= note: required for the cast to the object type `dyn std::future::Future<Output = ()>`
43+
44+
error[E0271]: type mismatch resolving `<impl std::future::Future as std::future::Future>::Output == u8`
45+
--> $DIR/async-block-control-flow-static-semantics.rs:24:55
46+
|
47+
LL | async fn return_targets_async_block_not_async_fn() -> u8 {
48+
| ^^ expected (), found u8
49+
|
50+
= note: expected type `()`
51+
found type `u8`
52+
= note: the return type of a function must have a statically known size
53+
54+
error[E0308]: mismatched types
55+
--> $DIR/async-block-control-flow-static-semantics.rs:51:44
56+
|
57+
LL | fn rethrow_targets_async_block_not_fn() -> Result<u8, MyErr> {
58+
| ---------------------------------- ^^^^^^^^^^^^^^^^^ expected enum `std::result::Result`, found ()
59+
| |
60+
| this function's body doesn't return
61+
|
62+
= note: expected type `std::result::Result<u8, MyErr>`
63+
found type `()`
64+
65+
error[E0308]: mismatched types
66+
--> $DIR/async-block-control-flow-static-semantics.rs:60:50
67+
|
68+
LL | fn rethrow_targets_async_block_not_async_fn() -> Result<u8, MyErr> {
69+
| ---------------------------------------- ^^^^^^^^^^^^^^^^^ expected enum `std::result::Result`, found ()
70+
| |
71+
| this function's body doesn't return
72+
|
73+
= note: expected type `std::result::Result<u8, MyErr>`
74+
found type `()`
75+
76+
error: aborting due to 8 previous errors
77+
78+
Some errors have detailed explanations: E0267, E0271, E0308.
79+
For more information about an error, try `rustc --explain E0267`.

‎src/test/ui/error-codes/E0432.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ error[E0432]: unresolved import `something`
22
--> $DIR/E0432.rs:1:5
33
|
44
LL | use something::Foo;
5-
| ^^^^^^^^^ maybe a missing `extern crate something;`?
5+
| ^^^^^^^^^ maybe a missing crate `something`?
66

77
error: aborting due to previous error
88

‎src/test/ui/extern-prelude-fail.stderr

+3-3
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@ error[E0432]: unresolved import `extern_prelude`
22
--> $DIR/extern-prelude-fail.rs:7:9
33
|
44
LL | use extern_prelude::S;
5-
| ^^^^^^^^^^^^^^ maybe a missing `extern crate extern_prelude;`?
5+
| ^^^^^^^^^^^^^^ maybe a missing crate `extern_prelude`?
66

7-
error[E0433]: failed to resolve: maybe a missing `extern crate extern_prelude;`?
7+
error[E0433]: failed to resolve: maybe a missing crate `extern_prelude`?
88
--> $DIR/extern-prelude-fail.rs:8:15
99
|
1010
LL | let s = ::extern_prelude::S;
11-
| ^^^^^^^^^^^^^^ maybe a missing `extern crate extern_prelude;`?
11+
| ^^^^^^^^^^^^^^ maybe a missing crate `extern_prelude`?
1212

1313
error: aborting due to 2 previous errors
1414

‎src/test/ui/feature-gates/feature-gate-extern_absolute_paths.stderr

+3-3
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@ error[E0432]: unresolved import `core`
22
--> $DIR/feature-gate-extern_absolute_paths.rs:1:5
33
|
44
LL | use core::default;
5-
| ^^^^ maybe a missing `extern crate core;`?
5+
| ^^^^ maybe a missing crate `core`?
66

7-
error[E0433]: failed to resolve: maybe a missing `extern crate core;`?
7+
error[E0433]: failed to resolve: maybe a missing crate `core`?
88
--> $DIR/feature-gate-extern_absolute_paths.rs:4:19
99
|
1010
LL | let _: u8 = ::core::default::Default();
11-
| ^^^^ maybe a missing `extern crate core;`?
11+
| ^^^^ maybe a missing crate `core`?
1212

1313
error: aborting due to 2 previous errors
1414

‎src/test/ui/import3.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ error[E0432]: unresolved import `main`
22
--> $DIR/import3.rs:2:5
33
|
44
LL | use main::bar;
5-
| ^^^^ maybe a missing `extern crate main;`?
5+
| ^^^^ maybe a missing crate `main`?
66

77
error: aborting due to previous error
88

‎src/test/ui/imports/issue-53269.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ error[E0432]: unresolved import `nonexistent_module`
22
--> $DIR/issue-53269.rs:6:9
33
|
44
LL | use nonexistent_module::mac;
5-
| ^^^^^^^^^^^^^^^^^^ maybe a missing `extern crate nonexistent_module;`?
5+
| ^^^^^^^^^^^^^^^^^^ maybe a missing crate `nonexistent_module`?
66

77
error[E0659]: `mac` is ambiguous (`macro_rules` vs non-`macro_rules` from other module)
88
--> $DIR/issue-53269.rs:8:5

‎src/test/ui/imports/issue-55457.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ error[E0432]: unresolved import `non_existent`
1111
--> $DIR/issue-55457.rs:2:5
1212
|
1313
LL | use non_existent::non_existent;
14-
| ^^^^^^^^^^^^ maybe a missing `extern crate non_existent;`?
14+
| ^^^^^^^^^^^^ maybe a missing crate `non_existent`?
1515

1616
error: cannot determine resolution for the derive macro `NonExistent`
1717
--> $DIR/issue-55457.rs:5:10

‎src/test/ui/imports/unresolved-imports-used.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ error[E0432]: unresolved import `foo`
88
--> $DIR/unresolved-imports-used.rs:10:5
99
|
1010
LL | use foo::bar;
11-
| ^^^ maybe a missing `extern crate foo;`?
11+
| ^^^ maybe a missing crate `foo`?
1212

1313
error[E0603]: function `quz` is private
1414
--> $DIR/unresolved-imports-used.rs:8:10

‎src/test/ui/issues/issue-1697.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// Testing that we don't fail abnormally after hitting the errors
22

33
use unresolved::*; //~ ERROR unresolved import `unresolved` [E0432]
4-
//~^ maybe a missing `extern crate unresolved;`?
4+
//~^ maybe a missing crate `unresolved`?
55

66
fn main() {}

‎src/test/ui/issues/issue-1697.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ error[E0432]: unresolved import `unresolved`
22
--> $DIR/issue-1697.rs:3:5
33
|
44
LL | use unresolved::*;
5-
| ^^^^^^^^^^ maybe a missing `extern crate unresolved;`?
5+
| ^^^^^^^^^^ maybe a missing crate `unresolved`?
66

77
error: aborting due to previous error
88

‎src/test/ui/issues/issue-33464.stderr

+3-3
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,19 @@ error[E0432]: unresolved import `abc`
22
--> $DIR/issue-33464.rs:3:5
33
|
44
LL | use abc::one_el;
5-
| ^^^ maybe a missing `extern crate abc;`?
5+
| ^^^ maybe a missing crate `abc`?
66

77
error[E0432]: unresolved import `abc`
88
--> $DIR/issue-33464.rs:5:5
99
|
1010
LL | use abc::{a, bbb, cccccc};
11-
| ^^^ maybe a missing `extern crate abc;`?
11+
| ^^^ maybe a missing crate `abc`?
1212

1313
error[E0432]: unresolved import `a_very_long_name`
1414
--> $DIR/issue-33464.rs:7:5
1515
|
1616
LL | use a_very_long_name::{el, el2};
17-
| ^^^^^^^^^^^^^^^^ maybe a missing `extern crate a_very_long_name;`?
17+
| ^^^^^^^^^^^^^^^^ maybe a missing crate `a_very_long_name`?
1818

1919
error: aborting due to 3 previous errors
2020

‎src/test/ui/issues/issue-36881.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ error[E0432]: unresolved import `issue_36881_aux`
22
--> $DIR/issue-36881.rs:5:9
33
|
44
LL | use issue_36881_aux::Foo;
5-
| ^^^^^^^^^^^^^^^ maybe a missing `extern crate issue_36881_aux;`?
5+
| ^^^^^^^^^^^^^^^ maybe a missing crate `issue_36881_aux`?
66

77
error: aborting due to previous error
88

‎src/test/ui/issues/issue-37887.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ error[E0432]: unresolved import `libc`
22
--> $DIR/issue-37887.rs:3:9
33
|
44
LL | use libc::*;
5-
| ^^^^ maybe a missing `extern crate libc;`?
5+
| ^^^^ maybe a missing crate `libc`?
66

77
error[E0658]: use of unstable library feature 'rustc_private': this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via `Cargo.toml` instead?
88
--> $DIR/issue-37887.rs:2:5

‎src/test/ui/macros/meta-item-absolute-path.stderr

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
error[E0433]: failed to resolve: maybe a missing `extern crate Absolute;`?
1+
error[E0433]: failed to resolve: maybe a missing crate `Absolute`?
22
--> $DIR/meta-item-absolute-path.rs:1:12
33
|
44
LL | #[derive(::Absolute)]
5-
| ^^^^^^^^ maybe a missing `extern crate Absolute;`?
5+
| ^^^^^^^^ maybe a missing crate `Absolute`?
66

77
error: aborting due to previous error
88

‎src/test/ui/privacy/restricted/test.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,6 @@ fn main() {
4747
}
4848

4949
mod pathological {
50-
pub(in bad::path) mod m1 {} //~ ERROR failed to resolve: maybe a missing `extern crate bad;`?
50+
pub(in bad::path) mod m1 {} //~ ERROR failed to resolve: maybe a missing crate `bad`?
5151
pub(in foo) mod m2 {} //~ ERROR visibilities can only be restricted to ancestor modules
5252
}

‎src/test/ui/privacy/restricted/test.stderr

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
error[E0433]: failed to resolve: maybe a missing `extern crate bad;`?
1+
error[E0433]: failed to resolve: maybe a missing crate `bad`?
22
--> $DIR/test.rs:50:12
33
|
44
LL | pub(in bad::path) mod m1 {}
5-
| ^^^ maybe a missing `extern crate bad;`?
5+
| ^^^ maybe a missing crate `bad`?
66

77
error: visibilities can only be restricted to ancestor modules
88
--> $DIR/test.rs:51:12

‎src/test/ui/unresolved/unresolved-import.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
use foo::bar; //~ ERROR unresolved import `foo` [E0432]
2-
//~^ maybe a missing `extern crate foo;`?
2+
//~^ maybe a missing crate `foo`?
33

44
use bar::Baz as x; //~ ERROR unresolved import `bar::Baz` [E0432]
55
//~| no `Baz` in `bar`

‎src/test/ui/unresolved/unresolved-import.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ error[E0432]: unresolved import `foo`
22
--> $DIR/unresolved-import.rs:1:5
33
|
44
LL | use foo::bar;
5-
| ^^^ maybe a missing `extern crate foo;`?
5+
| ^^^ maybe a missing crate `foo`?
66

77
error[E0432]: unresolved import `bar::Baz`
88
--> $DIR/unresolved-import.rs:4:5

‎src/test/ui/use/use-mod/use-mod-4.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ error[E0432]: unresolved import `foo`
1414
--> $DIR/use-mod-4.rs:1:5
1515
|
1616
LL | use foo::self;
17-
| ^^^ maybe a missing `extern crate foo;`?
17+
| ^^^ maybe a missing crate `foo`?
1818

1919
error: aborting due to 3 previous errors
2020

0 commit comments

Comments
 (0)
Please sign in to comment.