Skip to content

Commit 08c113a

Browse files
committed
Deny bare trait objects in src/libsyntax_ext
1 parent c946c25 commit 08c113a

26 files changed

+37
-35
lines changed

src/libsyntax_ext/asm.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ const OPTIONS: &'static [&'static str] = &["volatile", "alignstack", "intel"];
5050
pub fn expand_asm<'cx>(cx: &'cx mut ExtCtxt,
5151
sp: Span,
5252
tts: &[tokenstream::TokenTree])
53-
-> Box<base::MacResult + 'cx> {
53+
-> Box<dyn base::MacResult + 'cx> {
5454
if !cx.ecfg.enable_asm() {
5555
feature_gate::emit_feature_err(&cx.parse_sess,
5656
"asm",

src/libsyntax_ext/assert.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ pub fn expand_assert<'cx>(
2222
cx: &'cx mut ExtCtxt,
2323
sp: Span,
2424
tts: &[TokenTree],
25-
) -> Box<MacResult + 'cx> {
25+
) -> Box<dyn MacResult + 'cx> {
2626
let mut parser = cx.new_parser_from_tts(tts);
2727
let cond_expr = panictry!(parser.parse_expr());
2828
let custom_msg_args = if parser.eat(&token::Comma) {

src/libsyntax_ext/cfg.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ use syntax_pos::Span;
2323
pub fn expand_cfg<'cx>(cx: &mut ExtCtxt,
2424
sp: Span,
2525
tts: &[tokenstream::TokenTree])
26-
-> Box<base::MacResult + 'static> {
26+
-> Box<dyn base::MacResult + 'static> {
2727
let sp = sp.apply_mark(cx.current_expansion.mark);
2828
let mut p = cx.new_parser_from_tts(tts);
2929
let cfg = panictry!(p.parse_meta_item());

src/libsyntax_ext/compile_error.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ use syntax::tokenstream;
1818
pub fn expand_compile_error<'cx>(cx: &'cx mut ExtCtxt,
1919
sp: Span,
2020
tts: &[tokenstream::TokenTree])
21-
-> Box<base::MacResult + 'cx> {
21+
-> Box<dyn base::MacResult + 'cx> {
2222
let var = match get_single_str_from_tts(cx, sp, tts, "compile_error!") {
2323
None => return DummyResult::expr(sp),
2424
Some(v) => v,

src/libsyntax_ext/concat.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ pub fn expand_syntax_ext(
2121
cx: &mut base::ExtCtxt,
2222
sp: syntax_pos::Span,
2323
tts: &[tokenstream::TokenTree],
24-
) -> Box<base::MacResult + 'static> {
24+
) -> Box<dyn base::MacResult + 'static> {
2525
let es = match base::get_exprs_from_tts(cx, sp, tts) {
2626
Some(e) => e,
2727
None => return base::DummyResult::expr(sp),

src/libsyntax_ext/concat_idents.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ use syntax::tokenstream::TokenTree;
2121
pub fn expand_syntax_ext<'cx>(cx: &'cx mut ExtCtxt,
2222
sp: Span,
2323
tts: &[TokenTree])
24-
-> Box<base::MacResult + 'cx> {
24+
-> Box<dyn base::MacResult + 'cx> {
2525
if !cx.ecfg.enable_concat_idents() {
2626
feature_gate::emit_feature_err(&cx.parse_sess,
2727
"concat_idents",

src/libsyntax_ext/deriving/bounds.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,15 @@ pub fn expand_deriving_unsafe_bound(cx: &mut ExtCtxt,
1919
span: Span,
2020
_: &MetaItem,
2121
_: &Annotatable,
22-
_: &mut FnMut(Annotatable)) {
22+
_: &mut dyn FnMut(Annotatable)) {
2323
cx.span_err(span, "this unsafe trait should be implemented explicitly");
2424
}
2525

2626
pub fn expand_deriving_copy(cx: &mut ExtCtxt,
2727
span: Span,
2828
mitem: &MetaItem,
2929
item: &Annotatable,
30-
push: &mut FnMut(Annotatable)) {
30+
push: &mut dyn FnMut(Annotatable)) {
3131
let trait_def = TraitDef {
3232
span,
3333
attributes: Vec::new(),

src/libsyntax_ext/deriving/clone.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ pub fn expand_deriving_clone(cx: &mut ExtCtxt,
2525
span: Span,
2626
mitem: &MetaItem,
2727
item: &Annotatable,
28-
push: &mut FnMut(Annotatable)) {
28+
push: &mut dyn FnMut(Annotatable)) {
2929
// check if we can use a short form
3030
//
3131
// the short form is `fn clone(&self) -> Self { *self }`

src/libsyntax_ext/deriving/cmp/eq.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ pub fn expand_deriving_eq(cx: &mut ExtCtxt,
2323
span: Span,
2424
mitem: &MetaItem,
2525
item: &Annotatable,
26-
push: &mut FnMut(Annotatable)) {
26+
push: &mut dyn FnMut(Annotatable)) {
2727
let inline = cx.meta_word(span, Symbol::intern("inline"));
2828
let hidden = cx.meta_list_item_word(span, Symbol::intern("hidden"));
2929
let doc = cx.meta_list(span, Symbol::intern("doc"), vec![hidden]);

src/libsyntax_ext/deriving/cmp/ord.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ pub fn expand_deriving_ord(cx: &mut ExtCtxt,
2323
span: Span,
2424
mitem: &MetaItem,
2525
item: &Annotatable,
26-
push: &mut FnMut(Annotatable)) {
26+
push: &mut dyn FnMut(Annotatable)) {
2727
let inline = cx.meta_word(span, Symbol::intern("inline"));
2828
let attrs = vec![cx.attribute(span, inline)];
2929
let trait_def = TraitDef {

0 commit comments

Comments
 (0)