Skip to content
This repository was archived by the owner on Jul 6, 2019. It is now read-only.

Commit 774538a

Browse files
bharrisaufarcaller
authored andcommitted
Change to fix build error in ioreg
Addition of where clause to Rust.
1 parent be654f4 commit 774538a

File tree

3 files changed

+4
-10
lines changed

3 files changed

+4
-10
lines changed

ioreg/builder/register.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ use std::gc::GC;
1717
use std::iter::FromIterator;
1818
use syntax::ast;
1919
use syntax::ast::P;
20+
use syntax::ast_util::empty_generics;
2021
use syntax::codemap::{respan, mk_sp};
2122
use syntax::ext::base::ExtCtxt;
2223
use syntax::ext::build::AstBuilder;
@@ -80,7 +81,7 @@ fn build_field_type<'a>(cx: &'a ExtCtxt, path: &Vec<String>,
8081
let item: P<ast::Item> = box(GC) ast::Item {
8182
ident: name,
8283
id: ast::DUMMY_NODE_ID,
83-
node: ast::ItemEnum(enum_def, utils::no_generics()),
84+
node: ast::ItemEnum(enum_def, empty_generics()),
8485
vis: ast::Public,
8586
attrs: attrs,
8687
span: field.ty.span,

ioreg/builder/union.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ use std::gc::{Gc, GC};
1717
use std::iter::FromIterator;
1818
use syntax::ast;
1919
use syntax::ast::P;
20+
use syntax::ast_util::empty_generics;
2021
use syntax::codemap::{DUMMY_SP, dummy_spanned};
2122
use syntax::ext::base::ExtCtxt;
2223
use syntax::ext::build::AstBuilder;
@@ -193,7 +194,7 @@ impl<'a, 'b, 'c> BuildUnionTypes<'a, 'b, 'c> {
193194
ident: self.cx.ident_of(name.node.as_slice()),
194195
attrs: attrs,
195196
id: ast::DUMMY_NODE_ID,
196-
node: ast::ItemStruct(box(GC) struct_def, utils::no_generics()),
197+
node: ast::ItemStruct(box(GC) struct_def, empty_generics()),
197198
vis: ast::Public,
198199
span: name.span,
199200
}

ioreg/builder/utils.rs

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,18 +18,10 @@ use syntax::ast;
1818
use syntax::ast::P;
1919
use syntax::codemap::DUMMY_SP;
2020
use syntax::ext::build::AstBuilder;
21-
use syntax::owned_slice::OwnedSlice;
2221
use syntax::parse::token;
2322

2423
use super::super::node;
2524

26-
pub fn no_generics() -> ast::Generics {
27-
ast::Generics {
28-
lifetimes: Vec::new(),
29-
ty_params: OwnedSlice::empty()
30-
}
31-
}
32-
3325
/// Generate an unsuffixed integer literal expression with a dummy span
3426
pub fn expr_int<'a>(cx: &'a ExtCtxt, n: i64) -> P<ast::Expr> {
3527
let sign = if n < 0 {ast::Minus} else {ast::Plus};

0 commit comments

Comments
 (0)