Skip to content

Commit

Permalink
Rollup merge of #66720 - Mark-Simulacrum:error-reported, r=Centril
Browse files Browse the repository at this point in the history
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).
  • Loading branch information
pietroalbini authored Nov 25, 2019
2 parents 9c4a639 + 4964c41 commit 083b373
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 5 deletions.
1 change: 1 addition & 0 deletions Cargo.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3585,6 +3585,7 @@ dependencies = [
"atty",
"log",
"rustc_data_structures",
"rustc_macros",
"serialize",
"syntax_pos",
"term_size",
Expand Down
6 changes: 1 addition & 5 deletions src/librustc/util/common.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ use std::fmt::Debug;
use std::time::{Duration, Instant};

use syntax::symbol::{Symbol, sym};
use rustc_macros::HashStable;
use crate::session::Session;

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

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

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

Expand Down
1 change: 1 addition & 0 deletions src/librustc_errors/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,4 @@ atty = "0.2"
termcolor = "1.0"
annotate-snippets = "0.6.1"
term_size = "0.3.1"
rustc_macros = { path = "../librustc_macros" }
6 changes: 6 additions & 0 deletions src/librustc_errors/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ use rustc_data_structures::fx::{FxHashSet, FxIndexMap};
use rustc_data_structures::stable_hasher::StableHasher;
use syntax_pos::source_map::SourceMap;
use syntax_pos::{Loc, Span, MultiSpan};
use rustc_macros::HashStable_Generic;

use std::borrow::Cow;
use std::cell::Cell;
Expand Down Expand Up @@ -993,3 +994,8 @@ macro_rules! pluralize {
if $x != 1 { "s" } else { "" }
};
}

// Useful type to use with `Result<>` indicate that an error has already
// been reported to the user, so no need to continue checking.
#[derive(Clone, Copy, Debug, RustcEncodable, RustcDecodable, HashStable_Generic)]
pub struct ErrorReported;

0 comments on commit 083b373

Please sign in to comment.