Rollup merge of #62730 - matthewjasper:hygiene-tests, r=petrochenkov

Consolidate hygiene tests

Some general clean-up extracted out from another PR
This commit is contained in:
Mark Rousskov 2019-07-18 11:29:43 -04:00 committed by GitHub
commit aa31ca7128
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
29 changed files with 26 additions and 42 deletions

View file

@ -1,21 +0,0 @@
-include ../tools.mk
REPLACEMENT := s/[0-9][0-9]*\#[0-9][0-9]*/$(shell date)/g
all:
$(RUSTC) -o $(TMPDIR)/input.out -Z unstable-options \
--pretty expanded,hygiene input.rs
# the name/ctxt numbers are very internals-dependent and thus
# change relatively frequently, and testing for their exact values
# them will fail annoyingly, so we just check their positions
# (using a non-constant replacement like this will make it less
# likely the compiler matches whatever other dummy value we
# choose).
#
# (These need to be out-of-place because OSX/BSD & GNU sed
# differ.)
sed "$(REPLACEMENT)" input.pp.rs > $(TMPDIR)/input.pp.rs
sed "$(REPLACEMENT)" $(TMPDIR)/input.out > $(TMPDIR)/input.out.replaced
diff -u $(TMPDIR)/input.out.replaced $(TMPDIR)/input.pp.rs

View file

@ -1,4 +1,3 @@
// run-pass
// ignore-pretty pretty-printing is unhygienic
#[macro_export]

View file

@ -1,4 +1,3 @@
// run-pass
#![crate_type = "lib"]
extern crate my_crate;

View file

@ -1,4 +1,3 @@
// run-pass
#![feature(decl_macro)]
#![allow(unused)]

View file

@ -1,6 +1,6 @@
// Make sure `$crate` and `crate` work in for basic cases of nested macros.
// build-pass (FIXME(62277): could be check-pass?)
// check-pass
// aux-build:intercrate.rs
#![feature(decl_macro, crate_in_paths)]

View file

@ -1,6 +1,3 @@
// FIXME: Investigate why expansion info for a single expansion id is reset from
// `MacroBang(format_args)` to `MacroAttribute(derive(Clone))` (issue #52363).
fn main() {
format_args!({ #[derive(Clone)] struct S; });
//~^ ERROR format argument must be a string literal

View file

@ -1,5 +1,5 @@
error: format argument must be a string literal
--> $DIR/expansion-info-reset.rs:5:18
--> $DIR/expansion-info-reset.rs:2:18
|
LL | format_args!({ #[derive(Clone)] struct S; });
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

View file

@ -1,4 +1,4 @@
// run-pass
// check-pass
#![allow(unused_must_use)]
#![feature(decl_macro)]

View file

@ -1,4 +1,4 @@
// run-pass
// check-pass
// ignore-pretty pretty-printing is unhygienic
#![feature(decl_macro)]

View file

@ -1,4 +1,4 @@
// run-pass
// check-pass
// ignore-pretty pretty-printing is unhygienic
#![feature(decl_macro)]

View file

@ -1,4 +1,4 @@
// run-pass
// check-pass
// ignore-pretty pretty-printing is unhygienic
#![feature(decl_macro)]

View file

@ -1,4 +1,4 @@
// run-pass
// check-pass
#![allow(dead_code)]
// ignore-pretty pretty-printing is unhygienic
@ -12,7 +12,7 @@ extern crate legacy_interaction;
// ```rust
// macro_rules! m {
// () => {
// fn f() // (1)
// fn f() {} // (1)
// g() // (2)
// }
// }

View file

@ -1,4 +1,4 @@
// run-pass
// check-pass
// ignore-pretty pretty-printing is unhygienic
#![feature(decl_macro)]

View file

@ -1,4 +1,4 @@
// build-pass (FIXME(62277): could be check-pass?)
// check-pass
// aux-build:local_inner_macros.rs
extern crate local_inner_macros;

View file

@ -1,4 +1,4 @@
// run-pass
// check-pass
// ignore-pretty pretty-printing is unhygienic
#![feature(decl_macro)]

View file

@ -1,4 +1,4 @@
// build-pass (FIXME(62277): could be check-pass?)
// check-pass
// aux-build:transparent-basic.rs
#![feature(decl_macro, rustc_attrs)]

View file

@ -1,4 +1,4 @@
// run-pass
// check-pass
// ignore-pretty pretty-printing is unhygienic
#![feature(decl_macro)]

View file

@ -1,3 +1,9 @@
// check-pass
// compile-flags: -Zunpretty=expanded,hygiene
// Don't break whenever Symbol numbering changes
// normalize-stdout-test "\d+#" -> "0#"
// minimal junk
#![feature(no_core)]
#![no_core]

View file

@ -1,3 +1,9 @@
// check-pass
// compile-flags: -Zunpretty=expanded,hygiene
// Don't break whenever Symbol numbering changes
// normalize-stdout-test "\d+#" -> "0#"
// minimal junk
#![feature /* 0#0 */(no_core)]
#![no_core /* 0#0 */]

View file

@ -1,4 +1,4 @@
// run-pass
// check-pass
// ignore-pretty pretty-printing is unhygienic
// aux-build:my_crate.rs