From 025d01432fbdbefe24f7d3b4b487d040732f67fa Mon Sep 17 00:00:00 2001 From: Ariel Ben-Yehuda Date: Sun, 26 Aug 2018 15:13:47 +0300 Subject: use an incremental-fulldeps test instead of a run-make test --- .../auxiliary/issue_49482_macro_def.rs | 49 ++++++++++++++++++++++ .../auxiliary/issue_49482_reexport.rs | 16 +++++++ src/test/incremental-fulldeps/issue-49482.rs | 41 ++++++++++++++++++ src/test/run-make-fulldeps/issue-49482/Makefile | 13 ------ .../run-make-fulldeps/issue-49482/macro_def.rs | 47 --------------------- src/test/run-make-fulldeps/issue-49482/main.rs | 33 --------------- src/test/run-make-fulldeps/issue-49482/reexport.rs | 16 ------- 7 files changed, 106 insertions(+), 109 deletions(-) create mode 100644 src/test/incremental-fulldeps/auxiliary/issue_49482_macro_def.rs create mode 100644 src/test/incremental-fulldeps/auxiliary/issue_49482_reexport.rs create mode 100644 src/test/incremental-fulldeps/issue-49482.rs delete mode 100644 src/test/run-make-fulldeps/issue-49482/Makefile delete mode 100644 src/test/run-make-fulldeps/issue-49482/macro_def.rs delete mode 100644 src/test/run-make-fulldeps/issue-49482/main.rs delete mode 100644 src/test/run-make-fulldeps/issue-49482/reexport.rs (limited to 'src') diff --git a/src/test/incremental-fulldeps/auxiliary/issue_49482_macro_def.rs b/src/test/incremental-fulldeps/auxiliary/issue_49482_macro_def.rs new file mode 100644 index 00000000000..763c9eb138e --- /dev/null +++ b/src/test/incremental-fulldeps/auxiliary/issue_49482_macro_def.rs @@ -0,0 +1,49 @@ +// Copyright 2018 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +// no-prefer-dynamic + +#![crate_type="proc-macro"] +#![allow(non_snake_case)] + +extern crate proc_macro; + +macro_rules! proc_macro_expr_impl { + ($( + $( #[$attr:meta] )* + pub fn $func:ident($input:ident: &str) -> String; + )+) => { + $( + $( #[$attr] )* + #[proc_macro_derive($func)] + pub fn $func(_input: ::proc_macro::TokenStream) -> ::proc_macro::TokenStream { + panic!() + } + )+ + }; +} + +proc_macro_expr_impl! { + pub fn f1(input: &str) -> String; + pub fn f2(input: &str) -> String; + pub fn f3(input: &str) -> String; + pub fn f4(input: &str) -> String; + pub fn f5(input: &str) -> String; + pub fn f6(input: &str) -> String; + pub fn f7(input: &str) -> String; + pub fn f8(input: &str) -> String; + pub fn f9(input: &str) -> String; + pub fn fA(input: &str) -> String; + pub fn fB(input: &str) -> String; + pub fn fC(input: &str) -> String; + pub fn fD(input: &str) -> String; + pub fn fE(input: &str) -> String; + pub fn fF(input: &str) -> String; +} diff --git a/src/test/incremental-fulldeps/auxiliary/issue_49482_reexport.rs b/src/test/incremental-fulldeps/auxiliary/issue_49482_reexport.rs new file mode 100644 index 00000000000..aa9aa3b58b9 --- /dev/null +++ b/src/test/incremental-fulldeps/auxiliary/issue_49482_reexport.rs @@ -0,0 +1,16 @@ +// Copyright 2018 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +#[macro_use] +extern crate issue_49482_macro_def; + +pub use issue_49482_macro_def::*; + +pub fn foo() {} diff --git a/src/test/incremental-fulldeps/issue-49482.rs b/src/test/incremental-fulldeps/issue-49482.rs new file mode 100644 index 00000000000..3261b5ae092 --- /dev/null +++ b/src/test/incremental-fulldeps/issue-49482.rs @@ -0,0 +1,41 @@ +// Copyright 2018 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +// aux-build:issue_49482_macro_def.rs +// aux-build:issue_49482_reexport.rs +// ignore-stage1 +// revisions: rpass1 + +extern crate issue_49482_reexport; + +pub trait KvStorage +{ + fn get(&self); +} + +impl KvStorage for Box +where + K: KvStorage + ?Sized, +{ + fn get(&self) { + (**self).get() + } +} + +impl KvStorage for u32 { + fn get(&self) {} +} + +fn main() { + /* force issue_49482_reexport to be loaded */ + issue_49482_reexport::foo(); + + Box::new(2).get(); +} diff --git a/src/test/run-make-fulldeps/issue-49482/Makefile b/src/test/run-make-fulldeps/issue-49482/Makefile deleted file mode 100644 index baf66c9f5d6..00000000000 --- a/src/test/run-make-fulldeps/issue-49482/Makefile +++ /dev/null @@ -1,13 +0,0 @@ --include ../tools.mk - -ifeq ($(findstring stage1,$(RUST_BUILD_STAGE)),stage1) -# ignore stage1 -all: - -else -all: - mkdir $(TMPDIR)/incremental-dir - $(RUSTC) macro_def.rs - $(RUSTC) reexport.rs - $(RUSTC) main.rs -C incremental=$(TMPDIR)/incremental-dir -endif diff --git a/src/test/run-make-fulldeps/issue-49482/macro_def.rs b/src/test/run-make-fulldeps/issue-49482/macro_def.rs deleted file mode 100644 index 8a9c985a3e4..00000000000 --- a/src/test/run-make-fulldeps/issue-49482/macro_def.rs +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright 2018 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -#![crate_type="proc-macro"] -#![allow(non_snake_case)] - -extern crate proc_macro; - -macro_rules! proc_macro_expr_impl { - ($( - $( #[$attr:meta] )* - pub fn $func:ident($input:ident: &str) -> String; - )+) => { - $( - $( #[$attr] )* - #[proc_macro_derive($func)] - pub fn $func(_input: ::proc_macro::TokenStream) -> ::proc_macro::TokenStream { - panic!() - } - )+ - }; -} - -proc_macro_expr_impl! { - pub fn f1(input: &str) -> String; - pub fn f2(input: &str) -> String; - pub fn f3(input: &str) -> String; - pub fn f4(input: &str) -> String; - pub fn f5(input: &str) -> String; - pub fn f6(input: &str) -> String; - pub fn f7(input: &str) -> String; - pub fn f8(input: &str) -> String; - pub fn f9(input: &str) -> String; - pub fn fA(input: &str) -> String; - pub fn fB(input: &str) -> String; - pub fn fC(input: &str) -> String; - pub fn fD(input: &str) -> String; - pub fn fE(input: &str) -> String; - pub fn fF(input: &str) -> String; -} diff --git a/src/test/run-make-fulldeps/issue-49482/main.rs b/src/test/run-make-fulldeps/issue-49482/main.rs deleted file mode 100644 index b4505730920..00000000000 --- a/src/test/run-make-fulldeps/issue-49482/main.rs +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright 2018 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -extern crate reexport; - -pub trait KvStorage -{ - fn get(&self); -} - -impl KvStorage for Box -where - K: KvStorage + ?Sized, -{ - fn get(&self) { - (**self).get() - } -} - -impl KvStorage for u32 { - fn get(&self) {} -} - -fn main() { - Box::new(2).get(); -} diff --git a/src/test/run-make-fulldeps/issue-49482/reexport.rs b/src/test/run-make-fulldeps/issue-49482/reexport.rs deleted file mode 100644 index 0a04d5a023f..00000000000 --- a/src/test/run-make-fulldeps/issue-49482/reexport.rs +++ /dev/null @@ -1,16 +0,0 @@ -// Copyright 2018 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -#![crate_type="rlib"] - -#[macro_use] -extern crate macro_def; - -pub use macro_def::*; -- cgit 1.4.1-3-g733a5