Skip to content

Rollup of 11 pull requests #77245

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 24 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
be3d8e5
Add missing code examples on HashMap types
GuillaumeGomez Sep 19, 2020
094d67a
Add accessors to Command.
ehuss Sep 21, 2020
90c7731
Enable const prop into operands at mir_opt_level=2
bugadani Sep 23, 2020
50d9663
Update cargo
ehuss Sep 24, 2020
74952b9
Fix FIXME in core::num test: Check sign of zero in min/max tests.
m-ou-se Sep 24, 2020
bfdb790
Link dynamic and static late_link_args before generic ones
mati865 Sep 25, 2020
939fd37
Rust vec bench import specific rand::RngCore
pickfire Sep 25, 2020
58d57f3
Fix documentation highlighting in ty::BorrowKind
jyn514 Sep 25, 2020
1b84389
Move `qualify_min_const_fn` out of rustc into clippy
oli-obk Sep 26, 2020
5d359db
Remove all unstable feature support in the `missing_const_for_fn` lint
oli-obk Sep 26, 2020
275bf62
pretty-print-reparse hack: Rename some variables for clarity
petrochenkov Sep 26, 2020
fe3e5aa
pretty-print-reparse hack: Remove an impossible case
petrochenkov Sep 26, 2020
a17175f
Test more attributes in test issue-75930-derive-cfg.rs
Aaron1011 Sep 26, 2020
5c93f2d
Rollup merge of #76917 - GuillaumeGomez:map-missing-code-examples, r=…
jonas-schievink Sep 26, 2020
fb044ef
Rollup merge of #77029 - ehuss:command-access, r=Mark-Simulacrum
jonas-schievink Sep 26, 2020
1ab7c2b
Rollup merge of #77107 - bugadani:perf, r=oli-obk
jonas-schievink Sep 26, 2020
61d8c1a
Rollup merge of #77129 - ehuss:update-cargo, r=ehuss
jonas-schievink Sep 26, 2020
46bde5a
Rollup merge of #77167 - fusion-engineering-forks:fix-fixme-min-max-s…
jonas-schievink Sep 26, 2020
29893b9
Rollup merge of #77184 - pickfire:patch-4, r=kennytm
jonas-schievink Sep 26, 2020
8916430
Rollup merge of #77208 - mati865:late-link-args-order, r=petrochenkov
jonas-schievink Sep 26, 2020
cc28516
Rollup merge of #77209 - jyn514:fix-docs, r=petrochenkov
jonas-schievink Sep 26, 2020
4597c56
Rollup merge of #77231 - oli-obk:clippy_const_fn, r=Manishearth
jonas-schievink Sep 26, 2020
b1a09de
Rollup merge of #77235 - petrochenkov:reparse, r=Aaron1011
jonas-schievink Sep 26, 2020
d0b22cf
Rollup merge of #77243 - Aaron1011:more-derive-test, r=petrochenkov
jonas-schievink Sep 26, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Test more attributes in test issue-75930-derive-cfg.rs
Split out from #76130

This tests our handling of combining derives, derive helper
attributes, attribute macros, and `cfg`/`cfg_attr`
  • Loading branch information
Aaron1011 committed Sep 26, 2020
commit a17175f4dd3b9c1b34e7afa09fa90b8e74ef45e3
42 changes: 39 additions & 3 deletions src/test/ui/proc-macro/issue-75930-derive-cfg.rs
Original file line number Diff line number Diff line change
@@ -1,29 +1,65 @@
// check-pass
// compile-flags: -Z span-debug
// compile-flags: -Z span-debug --error-format human
// aux-build:test-macros.rs

// Regression test for issue #75930
// Tests that we cfg-strip all targets before invoking
// a derive macro
// We need '--error-format human' to stop compiletest from
// trying to interpret proc-macro output as JSON messages
// (a pretty-printed struct may cause a line to start with '{' )
// FIXME: We currently lose spans here (see issue #43081)

#[macro_use]
extern crate test_macros;

#[print_helper(a)]
#[cfg_attr(not(FALSE), allow(dead_code))]
#[print_attr]
#[derive(Print)]
#[print_helper(b)]
struct Foo<#[cfg(FALSE)] A, B> {
#[cfg(FALSE)] first: String,
second: bool,
#[cfg_attr(FALSE, deny(warnings))] second: bool,
third: [u8; {
#[cfg(FALSE)] struct Bar;
#[cfg(not(FALSE))] struct Inner;
#[cfg(FALSE)] let a = 25;
match true {
#[cfg(FALSE)] true => {},
false => {},
#[cfg_attr(not(FALSE), allow(warnings))] false => {},
_ => {}
};

#[print_helper(should_be_removed)]
fn removed_fn() {
#![cfg(FALSE)]
}

#[print_helper(c)] #[cfg(not(FALSE))] fn kept_fn() {
#![cfg(not(FALSE))]
let my_val = true;
}

enum TupleEnum {
Foo(
#[cfg(FALSE)] u8,
#[cfg(FALSE)] bool,
#[cfg(not(FALSE))] i32,
#[cfg(FALSE)] String, u8
)
}

struct TupleStruct(
#[cfg(FALSE)] String,
#[cfg(not(FALSE))] i32,
#[cfg(FALSE)] bool,
u8
);

0
}],
#[print_helper(d)]
fourth: B
}

Expand Down
Loading