Skip to content

Emit a warning if the doctest main function will not be run #140527

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

Merged
merged 3 commits into from
May 22, 2025

Conversation

GuillaumeGomez
Copy link
Member

Fixes #140310.

I think we could try to go much further like adding a "link" (ie UI annotations) on the main function in the doctest. However that will require some more computation, not sure if it's worth it or not. Can still be done in a follow-up if we want it.

For now, this PR does two things:

  1. Pass the DiagCtxt to the doctest parser to emit the warning.
  2. Correctly generate the Span to where the doctest is starting (I hope the way I did it isn't too bad either...).

cc @fmease
r? @notriddle

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. T-rustdoc-frontend Relevant to the rustdoc-frontend team, which will review and decide on the web UI/UX output. labels Apr 30, 2025
@@ -303,7 +303,9 @@ impl<'a, I: Iterator<Item = Event<'a>>> Iterator for CodeBlocks<'_, 'a, I> {
attrs: vec![],
args_file: PathBuf::new(),
};
let doctest = doctest::DocTestBuilder::new(&test, krate, edition, false, None, None);
let doctest = doctest::DocTestBuilder::new(
&test, krate, edition, false, None, None, None, DUMMY_SP,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This needs a builder pattern, badly.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep. Do you want it in this PR or in a follow-up?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Either way is fine, as long as it actually gets done.

let line = self.get_base_line() + rel_line.offset();
let base_line = self.get_base_line();
let line = base_line + rel_line.offset();
let count = AtomicUsize::new(base_line);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is an atomic needed here? This code isn't multithreaded.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hum right, a Cell might be enough. Force of habit...

@GuillaumeGomez
Copy link
Member Author

Added the builder type. For setters, I wondered if I should allow generics for Into<Option<>> to avoid avoid some if let conditions. I finally decided to go to the simplest path and not use generics but please tell me if you prefer otherwise.

@rust-log-analyzer

This comment has been minimized.

@GuillaumeGomez
Copy link
Member Author

Forgot to remove some imports...

@rust-log-analyzer

This comment has been minimized.

@GuillaumeGomez
Copy link
Member Author

And rebased on master.

@GuillaumeGomez
Copy link
Member Author

@notriddle: Is there anything else to be done here?

@notriddle
Copy link
Contributor

Not AFAIK.

@bors r+

@bors
Copy link
Collaborator

bors commented May 20, 2025

📌 Commit f4d41a5 has been approved by notriddle

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels May 20, 2025
@bors
Copy link
Collaborator

bors commented May 22, 2025

⌛ Testing commit f4d41a5 with merge 1d67944...

@bors
Copy link
Collaborator

bors commented May 22, 2025

☀️ Test successful - checks-actions
Approved by: notriddle
Pushing 1d67944 to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label May 22, 2025
@bors bors merged commit 1d67944 into rust-lang:master May 22, 2025
7 checks passed
@rustbot rustbot added this to the 1.89.0 milestone May 22, 2025
Copy link

What is this? This is an experimental post-merge analysis report that shows differences in test outcomes between the merged PR and its parent PR.

Comparing 2cd3783 (parent) -> 1d67944 (this PR)

Test differences

Show 33262 test diffs

Stage 1

  • sort::tests::stable::correct_dyn_val_random_s95: ignore -> [missing] (J0)
  • sort::tests::stable::stability_i32_random_s95: ignore -> [missing] (J0)
  • sort::tests::unstable::correct_1k_ascending: ignore -> [missing] (J0)
  • sort::tests::unstable::violate_ord_retain_orig_set_cell_i32_random_d20: ignore -> [missing] (J0)
  • errors::verify_codegen_ssa_bare_instruction_set_22: pass -> [missing] (J1)
  • errors::verify_codegen_ssa_invalid_monomorphization_simd_first_97: pass -> [missing] (J1)
  • errors::verify_expand_not_a_meta_item_11: pass -> [missing] (J1)
  • errors::verify_incremental_not_loaded_12: pass -> [missing] (J1)
  • errors::verify_passes_continue_labeled_block_127: pass -> [missing] (J1)
  • errors::verify_passes_useless_stability_153: pass -> [missing] (J1)
  • errors::verify_trait_selection_lf_bound_not_satisfied_26: pass -> [missing] (J1)
  • markdown::parse::tests::test_parse_code_block: pass -> [missing] (J1)
  • session_diagnostics::verify_driver_impl_rlink_wrong_file_type_2: pass -> [missing] (J1)
  • session_diagnostics::verify_driver_impl_unstable_feature_usage_16: pass -> [missing] (J1)
  • spec::tests::armv7_unknown_linux_musleabi: pass -> [missing] (J1)
  • spec::tests::x86_64_uwp_windows_msvc: pass -> [missing] (J1)
  • alloc::layout_debug_shows_log2_of_alignment: pass -> [missing] (J2)
  • char::test_encode_utf16: pass -> [missing] (J2)
  • collections::binary_heap::test_iter_rev_cloned_collect: pass -> [missing] (J2)
  • collections::btree::set::tests::test_from_iter: pass -> [missing] (J2)
  • collections::hash::set::tests::test_zero_capacities: pass -> [missing] (J2)
  • collections::linked_list::tests::test_split_off_2: pass -> [missing] (J2)
  • f64::test_log2: pass -> [missing] (J2)
  • floats::f16::test_next_up: pass -> [missing] (J2)
  • heap::alloc_system_overaligned_request: pass -> [missing] (J2)
  • num::test_i8i32: pass -> [missing] (J2)
  • num::test_u32f64: pass -> [missing] (J2)
  • num::u8::test_unbounded_shr: pass -> [missing] (J2)
  • slice::test_get_disjoint_mut_range_oob: pass -> [missing] (J2)
  • str::test_utf16_code_units: pass -> [missing] (J2)
  • sync::test_clone_from_slice_panic: pass -> [missing] (J2)
  • test_checked_next_power_of_two_u8: pass -> [missing] (J2)
  • vec::test_into_iter_clone: pass -> [missing] (J2)
  • vec_deque::test_append_permutations: pass -> [missing] (J2)
  • array::map_8byte_256byte_256: pass -> [missing] (J3)
  • btree::map::iteration_1000: pass -> [missing] (J3)
  • btree::set::intersection_random_10k_vs_100: pass -> [missing] (J3)
  • char::methods::bench_to_ascii_lowercase: pass -> [missing] (J3)
  • net::tcp::tests::test_read_with_timeout: pass -> [missing] (J3)
  • num::bench_u16_from_str: pass -> [missing] (J3)
  • os::unix::fs::tests::read_vectored_at: pass -> [missing] (J3)
  • path::bench_path_cmp_fast_path_buf_sort: pass -> [missing] (J3)
  • path::bench_path_hashset: pass -> [missing] (J3)
  • slice::split_off_in_bounds_max_range_from: pass -> [missing] (J3)
  • sort::tests::stable::deterministic_i32_descending: pass -> [missing] (J3)
  • sort::tests::unstable::correct_dyn_val_random_d2: pass -> [missing] (J3)
  • sort::tests::unstable::correct_u64_random_s95: pass -> [missing] (J3)
  • sort::tests::unstable::panic_observable_is_less_ascending: pass -> [missing] (J3)
  • sort::tests::unstable::stability_string_random: pass -> [missing] (J3)
  • stats::tests::test_exp10c: pass -> [missing] (J3)
  • str::char_count::ru_small::case03_manual_char_len: pass -> [missing] (J3)
  • str::split_terminator_space_char::short_pile_of_poo: pass -> [missing] (J3)
  • str::splitn_space_char::short_mixed: pass -> [missing] (J3)
  • vec::bench_clone_from_01_0000_1000: pass -> [missing] (J3)

Stage 2

  • sort::tests::stable::correct_i32_random_d1024: [missing] -> ignore (J0)
  • sort::tests::stable::deterministic_string_random_d20: [missing] -> ignore (J0)
  • sort::tests::stable::panic_retain_orig_set_string_descending: [missing] -> ignore (J0)
  • sort::tests::stable::stability_i32_random_s95: [missing] -> ignore (J0)
  • sort::tests::stable::stability_string_descending: [missing] -> ignore (J0)
  • sort::tests::unstable::violate_ord_retain_orig_set_cell_i32_random: [missing] -> ignore (J0)
  • coverage::tests::test_covgraph_switchint_loop_then_inner_loop_else_break: [missing] -> pass (J1)
  • errors::verify_codegen_ssa_mixed_export_name_and_no_mangle_138: [missing] -> pass (J1)
  • errors::verify_hir_typeck_register_type_unstable_25: [missing] -> pass (J1)
  • errors::verify_incremental_not_clean_11: [missing] -> pass (J1)
  • errors::verify_metadata_link_modifiers_form_11: [missing] -> pass (J1)
  • errors::verify_mir_dataflow_peek_must_be_not_temporary_6: [missing] -> pass (J1)
  • errors::verify_parse_invalid_attr_unsafe_171: [missing] -> pass (J1)
  • errors::verify_session_sanitizer_kcfi_arity_requires_kcfi_17: [missing] -> pass (J1)
  • html::length_limit::tests::forgot_to_close_tags: [missing] -> pass (J1)
  • html::render::ordered_json::tests::string: [missing] -> pass (J1)
  • lints::verify_lint_macro_rule_never_used_111: [missing] -> pass (J1)
  • lints::verify_lint_unused_coroutine_95: [missing] -> pass (J1)
  • maybe_transmutable::tests::r#ref::should_permit_identity_transmutation: [missing] -> pass (J1)
  • obligation_forest::tests::success_in_grandchildren: [missing] -> pass (J1)
  • parser::tests::multiple_labels_primary_without_message_2: [missing] -> pass (J1)
  • small_c_str::tests::long: [missing] -> pass (J1)
  • tests::rustc_bootstrap_parsing: [missing] -> pass (J1)
  • transitive_relation::tests::pdub_lub: [missing] -> pass (J1)
  • alloc::layout_debug_shows_log2_of_alignment: [missing] -> pass (J2)
  • args_debug: [missing] -> pass (J2)
  • atomic::uint_nand: [missing] -> pass (J2)
  • collections::btree::set::tests::test_extend_ref: [missing] -> pass (J2)
  • collections::linked_list::tests::extract_if_true: [missing] -> pass (J2)
  • floats::f64::test_to_radians: [missing] -> pass (J2)
  • io::buffered::tests::dont_panic_in_drop_on_panicked_flush: [missing] -> pass (J2)
  • io::tests::test_read_to_end_capacity: [missing] -> pass (J2)
  • iter::range::test_range_inclusive_last_max: [missing] -> pass (J2)
  • iter::traits::iterator::test_iterator_size_hint: [missing] -> pass (J2)
  • mpmc::test_recv_into_iter_borrowed: [missing] -> pass (J2)
  • num::ops::test_not_defined_bool: [missing] -> pass (J2)
  • rc::test_unsized: [missing] -> pass (J2)
  • slice::test_windows_zip: [missing] -> pass (J2)
  • sync::test_into_from_raw_unsized: [missing] -> pass (J2)
  • thin_box::align2zst: [missing] -> pass (J2)
  • time::constructor_days: [missing] -> pass (J2)
  • btree::map::clone_slim_10k_and_clear: [missing] -> pass (J3)
  • iter::bench_filter_chain_count: [missing] -> pass (J3)
  • sort::tests::unstable::correct_cell_i32_random_d2: [missing] -> pass (J3)
  • sort::tests::unstable::correct_string_random_d20: [missing] -> pass (J3)
  • str::char_count::emoji_large::case02_iter_increment: [missing] -> pass (J3)

(and 16558 additional test diffs)

Additionally, 16604 doctest diffs were found. These are ignored, as they are noisy.

Job group index

Test dashboard

Run

cargo run --manifest-path src/ci/citool/Cargo.toml -- \
    test-dashboard 1d679446b01e65f9bc9ae609d0ae1e4a9c0ccaa3 --output-dir test-dashboard

And then open test-dashboard/index.html in your browser to see an overview of all executed tests.

Job duration changes

  1. x86_64-apple-2: 4865.5s -> 1417.0s (-70.9%)
  2. test-various: 4192.1s -> 2382.6s (-43.2%)
  3. x86_64-gnu-aux: 6060.2s -> 4664.2s (-23.0%)
  4. dist-apple-various: 6063.4s -> 7380.0s (21.7%)
  5. x86_64-apple-1: 6752.8s -> 5509.1s (-18.4%)
  6. aarch64-apple: 3923.2s -> 3516.4s (-10.4%)
  7. dist-various-1: 4905.2s -> 4433.5s (-9.6%)
  8. dist-aarch64-apple: 5343.9s -> 5845.0s (9.4%)
  9. x86_64-gnu-tools: 6542.3s -> 6087.8s (-6.9%)
  10. dist-powerpc64le-linux-gnu: 5399.0s -> 5714.8s (5.8%)
How to interpret the job duration changes?

Job durations can vary a lot, based on the actual runner instance
that executed the job, system noise, invalidated caches, etc. The table above is provided
mostly for t-infra members, for simpler debugging of potential CI slow-downs.

@GuillaumeGomez GuillaumeGomez deleted the doctest-main-fn branch May 22, 2025 12:15
@rust-log-analyzer
Copy link
Collaborator

The job dist-x86_64-linux failed! Check out the build log: (web) (plain)

Click to see the possible cause of the failure (guessed by this bot)
file:.git/config remote.origin.url=https://github.com/rust-lang/rust
file:.git/config remote.origin.fetch=+refs/heads/*:refs/remotes/origin/*
file:.git/config gc.auto=0
file:.git/config http.https://github.com/.extraheader=AUTHORIZATION: basic ***
file:.git/config branch.try.remote=origin
file:.git/config branch.try.merge=refs/heads/try
file:.git/config submodule.library/backtrace.active=true
file:.git/config submodule.library/backtrace.url=https://github.com/rust-lang/backtrace-rs.git
file:.git/config submodule.library/stdarch.active=true
file:.git/config submodule.library/stdarch.url=https://github.com/rust-lang/stdarch.git
file:.git/config submodule.src/doc/book.active=true
---
  local time: Thu May 22 13:26:29 UTC 2025
  network time: Thu, 22 May 2025 13:26:29 GMT
##[endgroup]
sccache: Starting the server...
sccache: error: Server startup failed: cache storage failed to read: PermissionDenied (permanent) at read => S3Error { code: "SignatureDoesNotMatch", message: "The request signature we calculated does not match the signature you provided. Check your key and signing method.", resource: "", request_id: "D4T54BQVGHPFHFFD" }

Context:
   uri: https://s3.us-west-1.amazonaws.com/rust-lang-ci-sccache2/.sccache_check
   response: Parts { status: 403, version: HTTP/1.1, headers: {"x-amz-request-id": "D4T54BQVGHPFHFFD", "x-amz-id-2": "lP0Z4kXrs3rzF+hBsFM90UsVfWPszyCh5Iz0fsdoQqWEg502b0lRr5IDqmReWzdDPyVymT3tRcC5B+UiKRBsPUb3CREW/t8RQEG1BRpjOCQ=", "content-type": "application/xml", "transfer-encoding": "chunked", "date": "Thu, 22 May 2025 13:26:29 GMT", "server": "AmazonS3"} }
   service: s3
   path: .sccache_check
   range: 0-

Backtrace:
---
[RUSTC-TIMING] build_script_build test:false 0.237
   Compiling xattr v1.5.0
   Compiling tempfile v3.20.0
[RUSTC-TIMING] glob test:false 1.123
warning: lzma-sys@0.1.20: sccache: error: Server startup failed: cache storage failed to read: PermissionDenied (permanent) at read => S3Error { code: "SignatureDoesNotMatch", message: "The request signature we calculated does not match the signature you provided. Check your key and signing method.", resource: "", request_id: "EHX0VCS9NW4T1JBW" }
warning: lzma-sys@0.1.20: 
warning: lzma-sys@0.1.20: Context:
warning: lzma-sys@0.1.20:    uri: https://s3.us-west-1.amazonaws.com/rust-lang-ci-sccache2/.sccache_check
warning: lzma-sys@0.1.20:    response: Parts { status: 403, version: HTTP/1.1, headers: {"x-amz-request-id": "EHX0VCS9NW4T1JBW", "x-amz-id-2": "cu1rwPlLqvoOsvV338vdM+ArhB2dr+HWI0kH3d9tnEFx3OrpA9YsNPtOkAERvl45Llf+W8KNptM=", "content-type": "application/xml", "transfer-encoding": "chunked", "date": "Thu, 22 May 2025 13:27:18 GMT", "server": "AmazonS3"} }
warning: lzma-sys@0.1.20:    service: s3
warning: lzma-sys@0.1.20:    path: .sccache_check
warning: lzma-sys@0.1.20:    range: 0-
warning: lzma-sys@0.1.20: 
warning: lzma-sys@0.1.20: Backtrace:
warning: lzma-sys@0.1.20:    0: <unknown>
warning: lzma-sys@0.1.20:    1: <unknown>
warning: lzma-sys@0.1.20:    2: <unknown>
warning: lzma-sys@0.1.20:    3: <unknown>
warning: lzma-sys@0.1.20:    4: <unknown>
warning: lzma-sys@0.1.20:    5: <unknown>
warning: lzma-sys@0.1.20:    6: <unknown>
warning: lzma-sys@0.1.20:    7: <unknown>
warning: lzma-sys@0.1.20:    8: <unknown>
warning: lzma-sys@0.1.20:    9: <unknown>
warning: lzma-sys@0.1.20:   10: <unknown>
warning: lzma-sys@0.1.20:   11: <unknown>
warning: lzma-sys@0.1.20:   12: <unknown>
warning: lzma-sys@0.1.20: 
warning: lzma-sys@0.1.20: 
warning: lzma-sys@0.1.20: Run with SCCACHE_LOG=debug SCCACHE_NO_DAEMON=1 to get more information
error: failed to run custom build command for `lzma-sys v0.1.20`

Caused by:
  process didn't exit successfully: `/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-bootstrap-tools/release/build/lzma-sys-457aad2bf834cb61/build-script-build` (exit status: 1)
  --- stdout
  cargo:rerun-if-changed=build.rs
  cargo:rerun-if-env-changed=LZMA_API_STATIC
  cargo:root=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-bootstrap-tools/x86_64-unknown-linux-gnu/release/build/lzma-sys-c4cac70b067a1048/out
  cargo:include=/cargo/registry/src/index.crates.io-1949cf8c6b5b557f/lzma-sys-0.1.20/xz-5.2/src/liblzma/api
  OUT_DIR = Some(/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-bootstrap-tools/x86_64-unknown-linux-gnu/release/build/lzma-sys-c4cac70b067a1048/out)
  OPT_LEVEL = Some(3)
  TARGET = Some(x86_64-unknown-linux-gnu)
  HOST = Some(x86_64-unknown-linux-gnu)
  cargo:rerun-if-env-changed=CC_x86_64-unknown-linux-gnu
  CC_x86_64-unknown-linux-gnu = None
  cargo:rerun-if-env-changed=CC_x86_64_unknown_linux_gnu
  CC_x86_64_unknown_linux_gnu = Some(sccache clang)
  cargo:rerun-if-env-changed=CC_KNOWN_WRAPPER_CUSTOM
  CC_KNOWN_WRAPPER_CUSTOM = None
  cargo:rerun-if-env-changed=CC_ENABLE_DEBUG_OUTPUT
  cargo:rerun-if-env-changed=CRATE_CC_NO_DEFAULTS
  CRATE_CC_NO_DEFAULTS = None
  DEBUG = Some(true)
  cargo:rerun-if-env-changed=CFLAGS
  CFLAGS = None
---
  cargo:rerun-if-env-changed=CC_SHELL_ESCAPED_FLAGS
  CC_SHELL_ESCAPED_FLAGS = None
  cargo:rerun-if-env-changed=CFLAGS_x86_64-unknown-linux-gnu
  CFLAGS_x86_64-unknown-linux-gnu = None
  CARGO_ENCODED_RUSTFLAGS = Some(--cfg=bootstrap--cfg=windows_raw_dylib-Csymbol-mangling-version=v0-Zunstable-options--check-cfg=cfg(bootstrap)-Zmacro-backtrace-Csplit-debuginfo=off-Clink-args=-Wl,-z,origin-Clink-args=-Wl,-rpath,$ORIGIN/../lib-Zlinker-features=+lld-Zunstable-options-Alinker-messages-Zunstable-options)
  cargo:warning=sccache: error: Server startup failed: cache storage failed to read: PermissionDenied (permanent) at read => S3Error { code: "SignatureDoesNotMatch", message: "The request signature we calculated does not match the signature you provided. Check your key and signing method.", resource: "", request_id: "EHX0VCS9NW4T1JBW" }
  cargo:warning=
  cargo:warning=Context:
  cargo:warning=   uri: https://s3.us-west-1.amazonaws.com/rust-lang-ci-sccache2/.sccache_check
  cargo:warning=   response: Parts { status: 403, version: HTTP/1.1, headers: {"x-amz-request-id": "EHX0VCS9NW4T1JBW", "x-amz-id-2": "cu1rwPlLqvoOsvV338vdM+ArhB2dr+HWI0kH3d9tnEFx3OrpA9YsNPtOkAERvl45Llf+W8KNptM=", "content-type": "application/xml", "transfer-encoding": "chunked", "date": "Thu, 22 May 2025 13:27:18 GMT", "server": "AmazonS3"} }
  cargo:warning=   service: s3
  cargo:warning=   path: .sccache_check
  cargo:warning=   range: 0-
  cargo:warning=
  cargo:warning=Backtrace:
  cargo:warning=   0: <unknown>
  cargo:warning=   1: <unknown>
  cargo:warning=   2: <unknown>
---
  cargo:warning=  11: <unknown>
  cargo:warning=  12: <unknown>
  cargo:warning=
  cargo:warning=
  cargo:warning=Run with SCCACHE_LOG=debug SCCACHE_NO_DAEMON=1 to get more information

  --- stderr


  error occurred in cc-rs: command did not execute successfully (status code exit status: 2): LC_ALL="C" "sccache" "clang" "-O3" "-ffunction-sections" "-fdata-sections" "-fPIC" "-gdwarf-4" "-fno-omit-frame-pointer" "-m64" "--target=x86_64-unknown-linux-gnu" "-I" "xz-5.2/src/liblzma/api" "-I" "xz-5.2/src/liblzma/lzma" "-I" "xz-5.2/src/liblzma/lz" "-I" "xz-5.2/src/liblzma/check" "-I" "xz-5.2/src/liblzma/simple" "-I" "xz-5.2/src/liblzma/delta" "-I" "xz-5.2/src/liblzma/common" "-I" "xz-5.2/src/liblzma/rangecoder" "-I" "xz-5.2/src/common" "-I" "/cargo/registry/src/index.crates.io-1949cf8c6b5b557f/lzma-sys-0.1.20" "-std=c99" "-pthread" "-DHAVE_CONFIG_H=1" "-fdebug-prefix-map=/checkout=/rustc/1d679446b01e65f9bc9ae609d0ae1e4a9c0ccaa3" "-o" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-bootstrap-tools/x86_64-unknown-linux-gnu/release/build/lzma-sys-c4cac70b067a1048/out/af5978f7ddeedb57-tuklib_cpucores.o" "-c" "xz-5.2/src/common/tuklib_cpucores.c"


warning: build failed, waiting for other jobs to finish...
[RUSTC-TIMING] sysinfo test:false 1.348
[RUSTC-TIMING] xattr test:false 0.395

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (1d67944): comparison URL.

Overall result: ❌ regressions - no action needed

@rustbot label: -perf-regression

Instruction count

This is the most reliable metric that we have; it was used to determine the overall result at the top of this comment. However, even this metric can sometimes exhibit noise.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
0.2% [0.2%, 0.2%] 1
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) - - 0

Max RSS (memory usage)

Results (primary 2.1%)

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
2.1% [2.1%, 2.1%] 1
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 2.1% [2.1%, 2.1%] 1

Cycles

Results (primary -0.9%)

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-0.9% [-0.9%, -0.9%] 1
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) -0.9% [-0.9%, -0.9%] 1

Binary size

This benchmark run did not return any relevant results for this metric.

Bootstrap: 775.776s -> 777.175s (0.18%)
Artifact size: 365.58 MiB -> 365.63 MiB (0.01%)

@GuillaumeGomez
Copy link
Member Author

This code is wrong:

/// ```
/// struct Question;
///
/// fn main() {
///   assert!(false);
/// }
/// ```
pub struct Answer;

Running this panics. What should be checked is if there is one non-main function instead. Gonna work on that tomorrow.

@fmease
Copy link
Member

fmease commented May 22, 2025

Right it panics … but that's correct. I'm not sure what issue you're trying to point out here. Master doesn't emit a warning for this code (good), main gets executed (good) and panics (good) and thus the test fails (good).

@GuillaumeGomez
Copy link
Member Author

Nah all good. Just my brain at late times...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merged-by-bors This PR was explicitly merged by bors. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. T-rustdoc-frontend Relevant to the rustdoc-frontend team, which will review and decide on the web UI/UX output.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Rustdoc should emit a warning if a main function is surrounded by non-items in a doctest
7 participants