From 7bf33f00bf4ece4a98c6ea5d8bb9331f2445004b Mon Sep 17 00:00:00 2001 From: Alexey Shmalko Date: Wed, 17 Apr 2019 12:02:04 +0300 Subject: [PATCH 1/2] Fix comments around test harness generation --- src/libsyntax/test.rs | 2 +- src/libsyntax_ext/test.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/libsyntax/test.rs b/src/libsyntax/test.rs index 6f03c5854036c..03d0eff266e75 100644 --- a/src/libsyntax/test.rs +++ b/src/libsyntax/test.rs @@ -327,7 +327,7 @@ fn mk_main(cx: &mut TestCtxt<'_>) -> P { // Writing this out by hand with 'ignored_span': // pub fn main() { // #![main] - // test::test_main_static(::std::os::args().as_slice(), &[..tests]); + // test::test_main_static(&[..tests]); // } let sp = ignored_span(cx, DUMMY_SP); let ecx = &cx.ext_cx; diff --git a/src/libsyntax_ext/test.rs b/src/libsyntax_ext/test.rs index 0dbcb7ce0b7e2..0fa5cd64360c0 100644 --- a/src/libsyntax_ext/test.rs +++ b/src/libsyntax_ext/test.rs @@ -86,7 +86,7 @@ pub fn expand_test_or_bench( cx.path(sp, vec![test_id, cx.ident_of(name)]) }; - // creates test::$name + // creates test::ShouldPanic::$name let should_panic_path = |name| { cx.path(sp, vec![test_id, cx.ident_of("ShouldPanic"), cx.ident_of(name)]) }; From 56c01255686ea66e04835447aa3971fd0d9807f5 Mon Sep 17 00:00:00 2001 From: Alexey Shmalko Date: Wed, 17 Apr 2019 12:03:39 +0300 Subject: [PATCH 2/2] Promote regular comments to rustdoc comments --- src/librustc_errors/lib.rs | 12 ++++++------ src/librustc_macros/src/query.rs | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/librustc_errors/lib.rs b/src/librustc_errors/lib.rs index cb45e13c4d2dc..7da1a6525537e 100644 --- a/src/librustc_errors/lib.rs +++ b/src/librustc_errors/lib.rs @@ -304,17 +304,17 @@ pub struct Handler { continue_after_error: AtomicBool, delayed_span_bugs: Lock>, - // This set contains the `DiagnosticId` of all emitted diagnostics to avoid - // emitting the same diagnostic with extended help (`--teach`) twice, which - // would be uneccessary repetition. + /// This set contains the `DiagnosticId` of all emitted diagnostics to avoid + /// emitting the same diagnostic with extended help (`--teach`) twice, which + /// would be uneccessary repetition. taught_diagnostics: Lock>, /// Used to suggest rustc --explain emitted_diagnostic_codes: Lock>, - // This set contains a hash of every diagnostic that has been emitted by - // this handler. These hashes is used to avoid emitting the same error - // twice. + /// This set contains a hash of every diagnostic that has been emitted by + /// this handler. These hashes is used to avoid emitting the same error + /// twice. emitted_diagnostics: Lock>, } diff --git a/src/librustc_macros/src/query.rs b/src/librustc_macros/src/query.rs index e4a6dfcd4e85e..8eacbfbaccea2 100644 --- a/src/librustc_macros/src/query.rs +++ b/src/librustc_macros/src/query.rs @@ -55,7 +55,7 @@ enum QueryModifier { /// Generate a dep node based on the dependencies of the query Anon, - // Always evaluate the query, ignoring its depdendencies + /// Always evaluate the query, ignoring its depdendencies EvalAlways, }