Skip to content

Commit 083b373

Browse files
authored
Rollup merge of #66720 - Mark-Simulacrum:error-reported, r=Centril
Move ErrorReported to rustc_errors The new location is more consistent with what this type is for, though we don't remove it from the old location (via a re-export) to avoid changing the dozens of use sites (~139 at this time).
2 parents 9c4a639 + 4964c41 commit 083b373

File tree

4 files changed

+9
-5
lines changed

4 files changed

+9
-5
lines changed

Cargo.lock

+1
Original file line numberDiff line numberDiff line change
@@ -3585,6 +3585,7 @@ dependencies = [
35853585
"atty",
35863586
"log",
35873587
"rustc_data_structures",
3588+
"rustc_macros",
35883589
"serialize",
35893590
"syntax_pos",
35903591
"term_size",

src/librustc/util/common.rs

+1-5
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ use std::fmt::Debug;
77
use std::time::{Duration, Instant};
88

99
use syntax::symbol::{Symbol, sym};
10-
use rustc_macros::HashStable;
1110
use crate::session::Session;
1211

1312
#[cfg(test)]
@@ -16,10 +15,7 @@ mod tests;
1615
// The name of the associated type for `Fn` return types.
1716
pub const FN_OUTPUT_NAME: Symbol = sym::Output;
1817

19-
// Useful type to use with `Result<>` indicate that an error has already
20-
// been reported to the user, so no need to continue checking.
21-
#[derive(Clone, Copy, Debug, RustcEncodable, RustcDecodable, HashStable)]
22-
pub struct ErrorReported;
18+
pub use errors::ErrorReported;
2319

2420
thread_local!(static TIME_DEPTH: Cell<usize> = Cell::new(0));
2521

src/librustc_errors/Cargo.toml

+1
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,4 @@ atty = "0.2"
1919
termcolor = "1.0"
2020
annotate-snippets = "0.6.1"
2121
term_size = "0.3.1"
22+
rustc_macros = { path = "../librustc_macros" }

src/librustc_errors/lib.rs

+6
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ use rustc_data_structures::fx::{FxHashSet, FxIndexMap};
2020
use rustc_data_structures::stable_hasher::StableHasher;
2121
use syntax_pos::source_map::SourceMap;
2222
use syntax_pos::{Loc, Span, MultiSpan};
23+
use rustc_macros::HashStable_Generic;
2324

2425
use std::borrow::Cow;
2526
use std::cell::Cell;
@@ -993,3 +994,8 @@ macro_rules! pluralize {
993994
if $x != 1 { "s" } else { "" }
994995
};
995996
}
997+
998+
// Useful type to use with `Result<>` indicate that an error has already
999+
// been reported to the user, so no need to continue checking.
1000+
#[derive(Clone, Copy, Debug, RustcEncodable, RustcDecodable, HashStable_Generic)]
1001+
pub struct ErrorReported;

0 commit comments

Comments
 (0)