diff options
| author | csmoe <35686186+csmoe@users.noreply.github.com> | 2018-10-09 19:49:18 +0800 |
|---|---|---|
| committer | csmoe <35686186+csmoe@users.noreply.github.com> | 2018-10-20 11:11:31 +0800 |
| commit | 30c669819342dc09d6bd29dc72d0ff85381b71d2 (patch) | |
| tree | 42a8aab73492697b9d14cab94fc9be455682b00e /src/libsyntax_ext | |
| parent | 2ed2d1a7e6a04896b6b0e30f2b07d0cd5f55afde (diff) | |
| download | rust-30c669819342dc09d6bd29dc72d0ff85381b71d2.tar.gz rust-30c669819342dc09d6bd29dc72d0ff85381b71d2.zip | |
handle errors based on parse_sess
Diffstat (limited to 'src/libsyntax_ext')
| -rw-r--r-- | src/libsyntax_ext/deriving/generic/mod.rs | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/libsyntax_ext/deriving/generic/mod.rs b/src/libsyntax_ext/deriving/generic/mod.rs index 28a2c11ceb1..002ecce58e6 100644 --- a/src/libsyntax_ext/deriving/generic/mod.rs +++ b/src/libsyntax_ext/deriving/generic/mod.rs @@ -202,8 +202,8 @@ use syntax::source_map::{self, respan}; use syntax::util::move_map::MoveMap; use syntax::ptr::P; use syntax::symbol::{Symbol, keywords}; +use syntax::parse::ParseSess; use syntax_pos::{DUMMY_SP, Span}; -use errors::Handler; use self::ty::{LifetimeBounds, Path, Ptr, PtrTy, Self_, Ty}; @@ -412,7 +412,7 @@ impl<'a> TraitDef<'a> { match *item { Annotatable::Item(ref item) => { let is_packed = item.attrs.iter().any(|attr| { - for r in attr::find_repr_attrs(&cx.parse_sess.span_diagnostic, attr) { + for r in attr::find_repr_attrs(&cx.parse_sess, attr) { if let attr::ReprPacked(_) = r { return true; } @@ -811,10 +811,10 @@ impl<'a> TraitDef<'a> { } } -fn find_repr_type_name(diagnostic: &Handler, type_attrs: &[ast::Attribute]) -> &'static str { +fn find_repr_type_name(sess: &ParseSess, type_attrs: &[ast::Attribute]) -> &'static str { let mut repr_type_name = "isize"; for a in type_attrs { - for r in &attr::find_repr_attrs(diagnostic, a) { + for r in &attr::find_repr_attrs(sess, a) { repr_type_name = match *r { attr::ReprPacked(_) | attr::ReprSimd | attr::ReprAlign(_) | attr::ReprTransparent => continue, @@ -1390,7 +1390,7 @@ impl<'a> MethodDef<'a> { // discriminant_test = __self0_vi == __self1_vi && __self0_vi == __self2_vi && ... let mut discriminant_test = cx.expr_bool(sp, true); - let target_type_name = find_repr_type_name(&cx.parse_sess.span_diagnostic, type_attrs); + let target_type_name = find_repr_type_name(&cx.parse_sess, type_attrs); let mut first_ident = None; for (&ident, self_arg) in vi_idents.iter().zip(&self_args) { |
