From 0567fec8e47f83ddda623f93deccddddd3f6744f Mon Sep 17 00:00:00 2001 From: Peter Collingbourne Date: Wed, 5 Oct 2022 21:37:23 -0700 Subject: test: run-make: skip when cross-compiling This test fails when targeting aarch64 Android. Instead of adding yet another architecture here (and one that's increasingly more common as the host), let's replace the growing list of architectures with ignore-cross-compile. --- src/test/run-make/issue-36710/Makefile | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'src/test') diff --git a/src/test/run-make/issue-36710/Makefile b/src/test/run-make/issue-36710/Makefile index b5270ad2ba9..986a3f4e64b 100644 --- a/src/test/run-make/issue-36710/Makefile +++ b/src/test/run-make/issue-36710/Makefile @@ -1,10 +1,6 @@ -# ignore-riscv64 $(call RUN,foo) expects to run the target executable natively +# ignore-cross-compile $(call RUN,foo) expects to run the target executable natively # so it won't work with remote-test-server -# ignore-arm Another build using remote-test-server # ignore-none no-std is not supported -# ignore-wasm32 FIXME: don't attempt to compile C++ to WASM -# ignore-wasm64 FIXME: don't attempt to compile C++ to WASM -# ignore-nvptx64-nvidia-cuda FIXME: can't find crate for `std` # ignore-musl FIXME: this makefile needs teaching how to use a musl toolchain # (see dist-i586-gnu-i586-i686-musl Dockerfile) -- cgit 1.4.1-3-g733a5 From d2e14e2d114bd3f7b56afdb4f6171577b13272c5 Mon Sep 17 00:00:00 2001 From: Michael Howell Date: Sat, 8 Oct 2022 10:43:23 -0700 Subject: rustdoc: remove mobile topbar from source pages instead of hiding it --- src/librustdoc/html/static/css/rustdoc.css | 4 ---- src/librustdoc/html/static/js/main.js | 14 ++++++++------ src/librustdoc/html/templates/page.html | 2 ++ src/test/rustdoc-gui/sidebar-source-code.goml | 2 +- 4 files changed, 11 insertions(+), 11 deletions(-) (limited to 'src/test') diff --git a/src/librustdoc/html/static/css/rustdoc.css b/src/librustdoc/html/static/css/rustdoc.css index e29abbec69c..4b96ed20487 100644 --- a/src/librustdoc/html/static/css/rustdoc.css +++ b/src/librustdoc/html/static/css/rustdoc.css @@ -1807,10 +1807,6 @@ in storage.js plus the media query with (min-width: 701px) top: 0; } - .source .mobile-topbar { - display: none; - } - .sidebar-menu-toggle { width: 45px; /* Rare exception to specifying font sizes in rem. Since this is acting diff --git a/src/librustdoc/html/static/js/main.js b/src/librustdoc/html/static/js/main.js index 6d21ffdc792..359dd41b13f 100644 --- a/src/librustdoc/html/static/js/main.js +++ b/src/librustdoc/html/static/js/main.js @@ -735,14 +735,15 @@ function loadCss(cssFileName) { let oldSidebarScrollPosition = null; function showSidebar() { - if (window.innerWidth < window.RUSTDOC_MOBILE_BREAKPOINT) { + const mobile_topbar = document.querySelector(".mobile-topbar"); + if (window.innerWidth < window.RUSTDOC_MOBILE_BREAKPOINT && mobile_topbar) { // This is to keep the scroll position on mobile. oldSidebarScrollPosition = window.scrollY; document.body.style.width = `${document.body.offsetWidth}px`; document.body.style.position = "fixed"; document.body.style.top = `-${oldSidebarScrollPosition}px`; - document.querySelector(".mobile-topbar").style.top = `${oldSidebarScrollPosition}px`; - document.querySelector(".mobile-topbar").style.position = "relative"; + mobile_topbar.style.top = `${oldSidebarScrollPosition}px`; + mobile_topbar.style.position = "relative"; } else { oldSidebarScrollPosition = null; } @@ -751,13 +752,14 @@ function loadCss(cssFileName) { } function hideSidebar() { - if (oldSidebarScrollPosition !== null) { + const mobile_topbar = document.querySelector(".mobile-topbar"); + if (oldSidebarScrollPosition !== null && mobile_topbar) { // This is to keep the scroll position on mobile. document.body.style.width = ""; document.body.style.position = ""; document.body.style.top = ""; - document.querySelector(".mobile-topbar").style.top = ""; - document.querySelector(".mobile-topbar").style.position = ""; + mobile_topbar.style.top = ""; + mobile_topbar.style.position = ""; // The scroll position is lost when resetting the style, hence why we store it in // `oldSidebarScrollPosition`. window.scrollTo(0, oldSidebarScrollPosition); diff --git a/src/librustdoc/html/templates/page.html b/src/librustdoc/html/templates/page.html index 7caffeae3d6..01a2ea6c2ec 100644 --- a/src/librustdoc/html/templates/page.html +++ b/src/librustdoc/html/templates/page.html @@ -73,6 +73,7 @@ {#- -#} {#- -#} {{- layout.external_html.before_content|safe -}} + {%- if page.css_class != "source" -%} {#- -#} + {%- endif -%}