Skip to content
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

Rollup of 19 pull requests #47513

Closed
wants to merge 63 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
63 commits
Select commit Hold shift + click to select a range
bdc34fd
fix faulty comment
andjo403 Jan 9, 2018
45cad04
rustdoc: Populate external_traits with traits only seen in impls
ollie27 Jan 10, 2018
f7b4877
Report errors instead of panic!()
Rantanen Jan 12, 2018
f18c52b
Start adding js tests
GuillaumeGomez Dec 12, 2017
53d8ec0
Prepare main.js for tests
GuillaumeGomez Jan 7, 2018
43acd23
Add tester and a few tests
GuillaumeGomez Jan 7, 2018
50bb6ba
Move forward to add rustdoc test
GuillaumeGomez Jan 8, 2018
6952199
End of rustdoc-js tool add into builder
GuillaumeGomez Jan 12, 2018
4cedbfc
fix mispositioned span
gaurikholkar Jan 13, 2018
eb1ada2
revert changes to ui test
gaurikholkar Jan 13, 2018
3c8c505
add ui test
gaurikholkar Jan 13, 2018
026c749
Only run rustdoc-js test suite when nodejs is available
GuillaumeGomez Jan 13, 2018
a22e716
Add a default directory for -Zmir-dump-dir
varkor Jan 14, 2018
2ccc82e
Make dump_mir_dir non-optional
varkor Jan 14, 2018
394b95f
Fix test
varkor Jan 15, 2018
ecd47a9
Don't include bang in macro replacement suggestion
etaoins Jan 14, 2018
b726204
incr.comp.: Cache type_of and some other queries.
michaelwoerister Jan 15, 2018
f9e1b9c
Add NLL test for #45045
chrisvittal Jan 15, 2018
c698496
Reexport -> re-export in documentation section headings
carols10cents Jan 12, 2018
90fcd44
Reexport -> re-export in error messages
carols10cents Jan 12, 2018
e168aa3
Reexport -> re-export in prose and documentation comments
carols10cents Jan 12, 2018
dc44d41
remove noop landing pads in cleanup shims
arielb1 Jan 15, 2018
bfde33f
Add "-lmsvcrt" twice to get rustc to build with the latest mingw64
segevfiner Jan 16, 2018
a4660df
Point at unused arguments for format string
estebank Jan 16, 2018
661e033
in which the private no-mangle lints receive a valued lesson in humility
zackmdavis Jan 16, 2018
fd075c6
implement "only-<platforms>" for test headers
Pulkit07 Jan 16, 2018
1e436eb
return the boolean value directly instead of using if-else
Pulkit07 Jan 16, 2018
567b07c
rename parse_cfg_prefix() to has_cfg_prefix()
Pulkit07 Jan 16, 2018
bd70f0f
add a comment about parsing only prefix in header.rs
Pulkit07 Jan 16, 2018
3a7e247
Fix for older JS versions
GuillaumeGomez Jan 16, 2018
24c3a6d
Add a Docker container for doing automated builds for CloudABI.
EdSchouten Jan 14, 2018
5801f95
Move dist-cloudabi/ into disabled/.
EdSchouten Jan 14, 2018
46c20c0
Remove incorrect `Default::default` links, add a new one
goffrie Jan 16, 2018
1dcfd14
Make non-found module name optional
dominikWin Jan 16, 2018
d769539
fix tidy checks
gaurikholkar Jan 16, 2018
a4e3f36
using tabs in ui tests
gaurikholkar Jan 16, 2018
efe3d69
fix minor errors
gaurikholkar Jan 16, 2018
ae4288f
Integrate dist-cloudabi into dist-various-2.
EdSchouten Jan 16, 2018
f81c2de
Allow a trailing comma in lint_array; fix #47428
mark-i-m Jan 15, 2018
dcf0cd0
Only enable CloudABI builds for x86-64 for now.
EdSchouten Jan 16, 2018
1606341
Document the mingw -lmsvcrt hack better
segevfiner Jan 16, 2018
6defae3
rustc: Spawn `cmd /c` for `.bat` scripts
alexcrichton Jan 16, 2018
eb3da09
Add secondary span pointing at the statement (error span)
estebank Jan 17, 2018
784cdd1
Rollup merge of #47250 - GuillaumeGomez:test-rustdoc-js, r=Mark-Simul…
kennytm Jan 17, 2018
3dc6f3c
Rollup merge of #47302 - andjo403:commentfix, r=michaelwoerister
kennytm Jan 17, 2018
41696f5
Rollup merge of #47313 - ollie27:rustdoc_record_extern_trait, r=Quiet…
kennytm Jan 17, 2018
67dac57
Rollup merge of #47387 - Rantanen:linkchecker-error-msg, r=steveklabnik
kennytm Jan 17, 2018
e8774b4
Rollup merge of #47404 - integer32llc:reexport-to-re-export, r=stevek…
kennytm Jan 17, 2018
9d5dc17
Rollup merge of #47407 - gaurikholkar:master, r=estebank
kennytm Jan 17, 2018
a37d098
Rollup merge of #47426 - varkor:default-mir-dump-dir, r=nikomatsakis
kennytm Jan 17, 2018
0a34e94
Rollup merge of #47427 - EdSchouten:cloudabi-ci, r=alexcrichton
kennytm Jan 17, 2018
2454799
Rollup merge of #47444 - etaoins:dont-include-bang-in-macro-suggestio…
kennytm Jan 17, 2018
b3ff458
Rollup merge of #47455 - michaelwoerister:cache-ty-collect, r=nikomat…
kennytm Jan 17, 2018
83c895a
Rollup merge of #47456 - chrisvittal:nll-tests, r=nikomatsakis
kennytm Jan 17, 2018
4b77463
Rollup merge of #47458 - mark-i-m:lint_array_comma, r=estebank
kennytm Jan 17, 2018
7c76dc0
Rollup merge of #47467 - arielb1:cleanup-shims, r=eddyb
kennytm Jan 17, 2018
73c06bf
Rollup merge of #47479 - zackmdavis:and_the_case_of_the_suggested_dou…
kennytm Jan 17, 2018
7d19bec
Rollup merge of #47481 - estebank:unused-args, r=arielb1
kennytm Jan 17, 2018
eaa7a1f
Rollup merge of #47483 - segevfiner:mingw64-build-hack, r=alexcrichton
kennytm Jan 17, 2018
ee636ed
Rollup merge of #47487 - Pulkit07:foo, r=kennytm
kennytm Jan 17, 2018
0af5b1d
Rollup merge of #47497 - goffrie:patch-1, r=dtolnay
kennytm Jan 17, 2018
6c3420b
Rollup merge of #47498 - dominikWin:missing-module-name, r=petrochenkov
kennytm Jan 17, 2018
5f5688a
Rollup merge of #47505 - alexcrichton:fix-bat-spawn-regression, r=est…
kennytm Jan 17, 2018
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
Allow a trailing comma in lint_array; fix #47428
  • Loading branch information
mark-i-m committed Jan 16, 2018
commit f81c2ded5e7f8d3288fa0daccb8c92396e9b7e14
13 changes: 7 additions & 6 deletions src/librustc/lint/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -97,12 +97,13 @@ macro_rules! declare_lint {

/// Declare a static `LintArray` and return it as an expression.
#[macro_export]
macro_rules! lint_array { ($( $lint:expr ),*) => (
{
static ARRAY: LintArray = &[ $( &$lint ),* ];
ARRAY
}
) }
macro_rules! lint_array {
($( $lint:expr ),*,) => { lint_array!( $( $lint ),* ) };
($( $lint:expr ),*) => {{
static ARRAY: LintArray = &[ $( &$lint ),* ];
ARRAY
}}
}

pub type LintArray = &'static [&'static &'static Lint];

Expand Down
57 changes: 44 additions & 13 deletions src/test/run-pass-fulldeps/auxiliary/lint_for_crate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,26 +23,57 @@ use rustc_plugin::Registry;
use rustc::hir;
use syntax::attr;

declare_lint!(CRATE_NOT_OKAY, Warn, "crate not marked with #![crate_okay]");
macro_rules! fake_lint_pass {
($struct:ident, $lints:expr, $($attr:expr),*) => {
struct $struct;

impl LintPass for $struct {
fn get_lints(&self) -> LintArray {
$lints
}
}

struct Pass;
impl<'a, 'tcx> LateLintPass<'a, 'tcx> for $struct {
fn check_crate(&mut self, cx: &LateContext, krate: &hir::Crate) {
$(
if !attr::contains_name(&krate.attrs, $attr) {
cx.span_lint(CRATE_NOT_OKAY, krate.span,
&format!("crate is not marked with #![{}]", $attr));
}
)*
}
}

impl LintPass for Pass {
fn get_lints(&self) -> LintArray {
lint_array!(CRATE_NOT_OKAY)
}
}

impl<'a, 'tcx> LateLintPass<'a, 'tcx> for Pass {
fn check_crate(&mut self, cx: &LateContext, krate: &hir::Crate) {
if !attr::contains_name(&krate.attrs, "crate_okay") {
cx.span_lint(CRATE_NOT_OKAY, krate.span,
"crate is not marked with #![crate_okay]");
}
}
declare_lint!(CRATE_NOT_OKAY, Warn, "crate not marked with #![crate_okay]");
declare_lint!(CRATE_NOT_RED, Warn, "crate not marked with #![crate_red]");
declare_lint!(CRATE_NOT_BLUE, Warn, "crate not marked with #![crate_blue]");
declare_lint!(CRATE_NOT_GREY, Warn, "crate not marked with #![crate_grey]");
declare_lint!(CRATE_NOT_GREEN, Warn, "crate not marked with #![crate_green]");

fake_lint_pass! {
PassOkay,
lint_array!(CRATE_NOT_OKAY), // Single lint
"crate_okay"
}

fake_lint_pass! {
PassRedBlue,
lint_array!(CRATE_NOT_RED, CRATE_NOT_BLUE), // Multiple lints
"crate_red", "crate_blue"
}

fake_lint_pass! {
PassGreyGreen,
lint_array!(CRATE_NOT_GREY, CRATE_NOT_GREEN, ), // Trailing comma
"crate_grey", "crate_green"
}

#[plugin_registrar]
pub fn plugin_registrar(reg: &mut Registry) {
reg.register_late_lint_pass(box Pass);
reg.register_late_lint_pass(box PassOkay);
reg.register_late_lint_pass(box PassRedBlue);
reg.register_late_lint_pass(box PassGreyGreen);
}
4 changes: 4 additions & 0 deletions src/test/run-pass-fulldeps/issue-15778-pass.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,9 @@
#![feature(plugin, custom_attribute)]
#![plugin(lint_for_crate)]
#![crate_okay]
#![crate_blue]
#![crate_red]
#![crate_grey]
#![crate_green]

pub fn main() { }