Skip to content

Commit 798e389

Browse files
Update to use new librustc_error_codes library
1 parent 3816fce commit 798e389

File tree

106 files changed

+179
-59
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

106 files changed

+179
-59
lines changed

src/librustc/Cargo.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,3 +40,5 @@ byteorder = { version = "1.3" }
4040
chalk-engine = { version = "0.9.0", default-features=false }
4141
rustc_fs_util = { path = "../librustc_fs_util" }
4242
smallvec = { version = "1.0", features = ["union", "may_dangle"] }
43+
measureme = "0.4"
44+
rustc_error_codes = { path = "../librustc_error_codes" }

src/librustc/hir/check_attr.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ use std::fmt::{self, Display};
1616
use syntax::{attr, symbol::sym};
1717
use syntax_pos::Span;
1818

19+
use rustc_error_codes::*;
20+
1921
#[derive(Copy, Clone, PartialEq)]
2022
pub(crate) enum MethodKind {
2123
Trait { body: bool },

src/librustc/hir/lowering.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,8 @@ use syntax::visit::{self, Visitor};
7474
use syntax_pos::hygiene::ExpnId;
7575
use syntax_pos::Span;
7676

77+
use rustc_error_codes::*;
78+
7779
const HIR_ID_COUNTER_LOCKED: u32 = 0xFFFFFFFF;
7880

7981
pub struct LoweringContext<'a> {

src/librustc/hir/lowering/expr.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ use syntax::ast::*;
1111
use syntax::source_map::{respan, DesugaringKind, Span, Spanned};
1212
use syntax::symbol::{sym, Symbol};
1313

14+
use rustc_error_codes::*;
15+
1416
impl LoweringContext<'_> {
1517
fn lower_exprs(&mut self, exprs: &[AstP<Expr>]) -> HirVec<hir::Expr> {
1618
exprs.iter().map(|x| self.lower_expr(x)).collect()

src/librustc/hir/lowering/item.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ use syntax::source_map::{respan, DesugaringKind};
2323
use syntax::symbol::{kw, sym};
2424
use syntax_pos::Span;
2525

26+
use rustc_error_codes::*;
27+
2628
pub(super) struct ItemLowerer<'tcx, 'interner> {
2729
pub(super) lctx: &'tcx mut LoweringContext<'interner>,
2830
}

src/librustc/infer/error_reporting/mod.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,8 @@ use errors::{Applicability, DiagnosticBuilder, DiagnosticStyledString};
6363
use std::{cmp, fmt};
6464
use syntax_pos::{Pos, Span};
6565

66+
use rustc_error_codes::*;
67+
6668
mod note;
6769

6870
mod need_type_info;

src/librustc/infer/error_reporting/need_type_info.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ use syntax::source_map::DesugaringKind;
99
use syntax_pos::Span;
1010
use errors::{Applicability, DiagnosticBuilder};
1111

12+
use rustc_error_codes::*;
13+
1214
struct FindLocalByTypeVisitor<'a, 'tcx> {
1315
infcx: &'a InferCtxt<'a, 'tcx>,
1416
target_ty: Ty<'tcx>,

src/librustc/infer/error_reporting/nice_region_error/different_lifetimes.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ use crate::infer::error_reporting::nice_region_error::NiceRegionError;
55
use crate::infer::error_reporting::nice_region_error::util::AnonymousParamInfo;
66
use crate::util::common::ErrorReported;
77

8+
use rustc_error_codes::*;
9+
810
impl<'a, 'tcx> NiceRegionError<'a, 'tcx> {
911
/// Print the error message for lifetime errors when both the concerned regions are anonymous.
1012
///

src/librustc/infer/error_reporting/nice_region_error/named_anon_conflict.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ use crate::hir::{FunctionRetTy, TyKind};
55
use crate::ty;
66
use errors::{Applicability, DiagnosticBuilder};
77

8+
use rustc_error_codes::*;
9+
810
impl<'a, 'tcx> NiceRegionError<'a, 'tcx> {
911
/// When given a `ConcreteFailure` for a function with parameters containing a named region and
1012
/// an anonymous region, emit an descriptive diagnostic error.

src/librustc/infer/error_reporting/note.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ use crate::ty::{self, Region};
44
use crate::ty::error::TypeError;
55
use errors::DiagnosticBuilder;
66

7+
use rustc_error_codes::*;
8+
79
impl<'a, 'tcx> InferCtxt<'a, 'tcx> {
810
pub(super) fn note_region_origin(&self,
911
err: &mut DiagnosticBuilder<'_>,

0 commit comments

Comments
 (0)