diff --git a/compiler/rustc_hir_analysis/src/check/expr.rs b/compiler/rustc_hir_analysis/src/check/expr.rs index 71c6da862c94b..ccdfd3a056b83 100644 --- a/compiler/rustc_hir_analysis/src/check/expr.rs +++ b/compiler/rustc_hir_analysis/src/check/expr.rs @@ -1130,11 +1130,6 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> { } }; - self.check_lhs_assignable(lhs, "E0070", span, |err| { - let rhs_ty = self.check_expr(&rhs); - suggest_deref_binop(err, rhs_ty); - }); - // This is (basically) inlined `check_expr_coercable_to_type`, but we want // to suggest an additional fixup here in `suggest_deref_binop`. let rhs_ty = self.check_expr_with_hint(&rhs, lhs_ty); @@ -1145,6 +1140,12 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> { diag.emit(); } + self.check_lhs_assignable(lhs, "E0070", span, |err| { + if let Some(rhs_ty) = self.typeck_results.borrow().expr_ty_opt(rhs) { + suggest_deref_binop(err, rhs_ty); + } + }); + self.require_type_is_sized(lhs_ty, lhs.span, traits::AssignmentLhsSized); if lhs_ty.references_error() || rhs_ty.references_error() { diff --git a/compiler/rustc_passes/src/stability.rs b/compiler/rustc_passes/src/stability.rs index cfd6acd8d7cd0..9591aeb881f3d 100644 --- a/compiler/rustc_passes/src/stability.rs +++ b/compiler/rustc_passes/src/stability.rs @@ -891,8 +891,25 @@ impl<'tcx> Visitor<'tcx> for CheckTraitImplStable<'tcx> { if let TyKind::Never = t.kind { self.fully_stable = false; } + if let TyKind::BareFn(f) = t.kind { + if rustc_target::spec::abi::is_stable(f.abi.name()).is_err() { + self.fully_stable = false; + } + } intravisit::walk_ty(self, t) } + + fn visit_fn_decl(&mut self, fd: &'tcx hir::FnDecl<'tcx>) { + for ty in fd.inputs { + self.visit_ty(ty) + } + if let hir::FnRetTy::Return(output_ty) = fd.output { + match output_ty.kind { + TyKind::Never => {} // `-> !` is stable + _ => self.visit_ty(output_ty), + } + } + } } /// Given the list of enabled features that were not language features (i.e., that diff --git a/compiler/rustc_target/src/spec/abi.rs b/compiler/rustc_target/src/spec/abi.rs index c915124434b2d..ce45fa13970b4 100644 --- a/compiler/rustc_target/src/spec/abi.rs +++ b/compiler/rustc_target/src/spec/abi.rs @@ -109,175 +109,125 @@ pub enum AbiDisabled { Unrecognized, } -fn gate_feature_post( +pub fn is_enabled( features: &rustc_feature::Features, - feature: Symbol, span: Span, - explain: &'static str, + name: &str, ) -> Result<(), AbiDisabled> { - if !features.enabled(feature) && !span.allows_unstable(feature) { - Err(AbiDisabled::Unstable { feature, explain }) - } else { - Ok(()) + let s = is_stable(name); + if let Err(AbiDisabled::Unstable { feature, .. }) = s { + if features.enabled(feature) || span.allows_unstable(feature) { + return Ok(()); + } } + s } -pub fn is_enabled( - features: &rustc_feature::Features, - span: Span, - name: &str, -) -> Result<(), AbiDisabled> { +pub fn is_stable(name: &str) -> Result<(), AbiDisabled> { match name { // Stable "Rust" | "C" | "cdecl" | "stdcall" | "fastcall" | "aapcs" | "win64" | "sysv64" | "system" => Ok(()), - "rust-intrinsic" => { - gate_feature_post(features, sym::intrinsics, span, "intrinsics are subject to change") - } - "platform-intrinsic" => gate_feature_post( - features, - sym::platform_intrinsics, - span, - "platform intrinsics are experimental and possibly buggy", - ), - "vectorcall" => gate_feature_post( - features, - sym::abi_vectorcall, - span, - "vectorcall is experimental and subject to change", - ), - "thiscall" => gate_feature_post( - features, - sym::abi_thiscall, - span, - "thiscall is experimental and subject to change", - ), - "rust-call" => gate_feature_post( - features, - sym::unboxed_closures, - span, - "rust-call ABI is subject to change", - ), - "rust-cold" => gate_feature_post( - features, - sym::rust_cold_cc, - span, - "rust-cold is experimental and subject to change", - ), - "ptx-kernel" => gate_feature_post( - features, - sym::abi_ptx, - span, - "PTX ABIs are experimental and subject to change", - ), - "unadjusted" => gate_feature_post( - features, - sym::abi_unadjusted, - span, - "unadjusted ABI is an implementation detail and perma-unstable", - ), - "msp430-interrupt" => gate_feature_post( - features, - sym::abi_msp430_interrupt, - span, - "msp430-interrupt ABI is experimental and subject to change", - ), - "x86-interrupt" => gate_feature_post( - features, - sym::abi_x86_interrupt, - span, - "x86-interrupt ABI is experimental and subject to change", - ), - "amdgpu-kernel" => gate_feature_post( - features, - sym::abi_amdgpu_kernel, - span, - "amdgpu-kernel ABI is experimental and subject to change", - ), - "avr-interrupt" | "avr-non-blocking-interrupt" => gate_feature_post( - features, - sym::abi_avr_interrupt, - span, - "avr-interrupt and avr-non-blocking-interrupt ABIs are experimental and subject to change", - ), - "efiapi" => gate_feature_post( - features, - sym::abi_efiapi, - span, - "efiapi ABI is experimental and subject to change", - ), - "C-cmse-nonsecure-call" => gate_feature_post( - features, - sym::abi_c_cmse_nonsecure_call, - span, - "C-cmse-nonsecure-call ABI is experimental and subject to change", - ), - "C-unwind" => gate_feature_post( - features, - sym::c_unwind, - span, - "C-unwind ABI is experimental and subject to change", - ), - "stdcall-unwind" => gate_feature_post( - features, - sym::c_unwind, - span, - "stdcall-unwind ABI is experimental and subject to change", - ), - "system-unwind" => gate_feature_post( - features, - sym::c_unwind, - span, - "system-unwind ABI is experimental and subject to change", - ), - "thiscall-unwind" => gate_feature_post( - features, - sym::c_unwind, - span, - "thiscall-unwind ABI is experimental and subject to change", - ), - "cdecl-unwind" => gate_feature_post( - features, - sym::c_unwind, - span, - "cdecl-unwind ABI is experimental and subject to change", - ), - "fastcall-unwind" => gate_feature_post( - features, - sym::c_unwind, - span, - "fastcall-unwind ABI is experimental and subject to change", - ), - "vectorcall-unwind" => gate_feature_post( - features, - sym::c_unwind, - span, - "vectorcall-unwind ABI is experimental and subject to change", - ), - "aapcs-unwind" => gate_feature_post( - features, - sym::c_unwind, - span, - "aapcs-unwind ABI is experimental and subject to change", - ), - "win64-unwind" => gate_feature_post( - features, - sym::c_unwind, - span, - "win64-unwind ABI is experimental and subject to change", - ), - "sysv64-unwind" => gate_feature_post( - features, - sym::c_unwind, - span, - "sysv64-unwind ABI is experimental and subject to change", - ), - "wasm" => gate_feature_post( - features, - sym::wasm_abi, - span, - "wasm ABI is experimental and subject to change", - ), + "rust-intrinsic" => Err(AbiDisabled::Unstable { + feature: sym::intrinsics, + explain: "intrinsics are subject to change", + }), + "platform-intrinsic" => Err(AbiDisabled::Unstable { + feature: sym::platform_intrinsics, + explain: "platform intrinsics are experimental and possibly buggy", + }), + "vectorcall" => Err(AbiDisabled::Unstable { + feature: sym::abi_vectorcall, + explain: "vectorcall is experimental and subject to change", + }), + "thiscall" => Err(AbiDisabled::Unstable { + feature: sym::abi_thiscall, + explain: "thiscall is experimental and subject to change", + }), + "rust-call" => Err(AbiDisabled::Unstable { + feature: sym::unboxed_closures, + explain: "rust-call ABI is subject to change", + }), + "rust-cold" => Err(AbiDisabled::Unstable { + feature: sym::rust_cold_cc, + explain: "rust-cold is experimental and subject to change", + }), + "ptx-kernel" => Err(AbiDisabled::Unstable { + feature: sym::abi_ptx, + explain: "PTX ABIs are experimental and subject to change", + }), + "unadjusted" => Err(AbiDisabled::Unstable { + feature: sym::abi_unadjusted, + explain: "unadjusted ABI is an implementation detail and perma-unstable", + }), + "msp430-interrupt" => Err(AbiDisabled::Unstable { + feature: sym::abi_msp430_interrupt, + explain: "msp430-interrupt ABI is experimental and subject to change", + }), + "x86-interrupt" => Err(AbiDisabled::Unstable { + feature: sym::abi_x86_interrupt, + explain: "x86-interrupt ABI is experimental and subject to change", + }), + "amdgpu-kernel" => Err(AbiDisabled::Unstable { + feature: sym::abi_amdgpu_kernel, + explain: "amdgpu-kernel ABI is experimental and subject to change", + }), + "avr-interrupt" | "avr-non-blocking-interrupt" => Err(AbiDisabled::Unstable { + feature: sym::abi_avr_interrupt, + explain: "avr-interrupt and avr-non-blocking-interrupt ABIs are experimental and subject to change", + }), + "efiapi" => Err(AbiDisabled::Unstable { + feature: sym::abi_efiapi, + explain: "efiapi ABI is experimental and subject to change", + }), + "C-cmse-nonsecure-call" => Err(AbiDisabled::Unstable { + feature: sym::abi_c_cmse_nonsecure_call, + explain: "C-cmse-nonsecure-call ABI is experimental and subject to change", + }), + "C-unwind" => Err(AbiDisabled::Unstable { + feature: sym::c_unwind, + explain: "C-unwind ABI is experimental and subject to change", + }), + "stdcall-unwind" => Err(AbiDisabled::Unstable { + feature: sym::c_unwind, + explain: "stdcall-unwind ABI is experimental and subject to change", + }), + "system-unwind" => Err(AbiDisabled::Unstable { + feature: sym::c_unwind, + explain: "system-unwind ABI is experimental and subject to change", + }), + "thiscall-unwind" => Err(AbiDisabled::Unstable { + feature: sym::c_unwind, + explain: "thiscall-unwind ABI is experimental and subject to change", + }), + "cdecl-unwind" => Err(AbiDisabled::Unstable { + feature: sym::c_unwind, + explain: "cdecl-unwind ABI is experimental and subject to change", + }), + "fastcall-unwind" => Err(AbiDisabled::Unstable { + feature: sym::c_unwind, + explain: "fastcall-unwind ABI is experimental and subject to change", + }), + "vectorcall-unwind" => Err(AbiDisabled::Unstable { + feature: sym::c_unwind, + explain: "vectorcall-unwind ABI is experimental and subject to change", + }), + "aapcs-unwind" => Err(AbiDisabled::Unstable { + feature: sym::c_unwind, + explain: "aapcs-unwind ABI is experimental and subject to change", + }), + "win64-unwind" => Err(AbiDisabled::Unstable { + feature: sym::c_unwind, + explain: "win64-unwind ABI is experimental and subject to change", + }), + "sysv64-unwind" => Err(AbiDisabled::Unstable { + feature: sym::c_unwind, + explain: "sysv64-unwind ABI is experimental and subject to change", + }), + "wasm" => Err(AbiDisabled::Unstable { + feature: sym::wasm_abi, + explain: "wasm ABI is experimental and subject to change", + }), _ => Err(AbiDisabled::Unrecognized), } } diff --git a/src/bootstrap/tool.rs b/src/bootstrap/tool.rs index d6e7f7872703e..eec74b2675a1e 100644 --- a/src/bootstrap/tool.rs +++ b/src/bootstrap/tool.rs @@ -698,7 +698,7 @@ pub struct RustAnalyzer { impl Step for RustAnalyzer { type Output = Option; const DEFAULT: bool = true; - const ONLY_HOSTS: bool = false; + const ONLY_HOSTS: bool = true; fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> { let builder = run.builder; @@ -742,7 +742,7 @@ pub struct RustAnalyzerProcMacroSrv { impl Step for RustAnalyzerProcMacroSrv { type Output = Option; const DEFAULT: bool = true; - const ONLY_HOSTS: bool = false; + const ONLY_HOSTS: bool = true; fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> { let builder = run.builder; diff --git a/src/ci/docker/host-x86_64/x86_64-gnu-tools/browser-ui-test.version b/src/ci/docker/host-x86_64/x86_64-gnu-tools/browser-ui-test.version index 0ec9201397fe4..cc96715b28572 100644 --- a/src/ci/docker/host-x86_64/x86_64-gnu-tools/browser-ui-test.version +++ b/src/ci/docker/host-x86_64/x86_64-gnu-tools/browser-ui-test.version @@ -1 +1 @@ -0.12.6 \ No newline at end of file +0.12.7 \ No newline at end of file diff --git a/src/librustdoc/html/render/mod.rs b/src/librustdoc/html/render/mod.rs index cd56d73e7d47b..eeec6f8fee778 100644 --- a/src/librustdoc/html/render/mod.rs +++ b/src/librustdoc/html/render/mod.rs @@ -1884,7 +1884,7 @@ fn print_sidebar(cx: &Context<'_>, it: &clean::Item, buffer: &mut Buffer) { if !it.is_mod() { let path: String = cx.current.iter().map(|s| s.as_str()).intersperse("::").collect(); - write!(buffer, "

In {}

", path); + write!(buffer, "

In {}

", path); } // Closes sidebar-elems div. diff --git a/src/librustdoc/html/static/css/rustdoc.css b/src/librustdoc/html/static/css/rustdoc.css index 7b6f52b0acf69..4a0b583054fb8 100644 --- a/src/librustdoc/html/static/css/rustdoc.css +++ b/src/librustdoc/html/static/css/rustdoc.css @@ -171,7 +171,7 @@ h1.fqn { Rustdoc-generated h2 section headings (e.g. "Implementations", "Required Methods", etc) Underlines elsewhere in the documentation break up visual flow and tend to invert section hierarchies. */ -h2, +.content h2, .top-doc .docblock > h3, .top-doc .docblock > h4 { border-bottom: 1px solid var(--headings-border-bottom-color); @@ -397,15 +397,6 @@ img { left: 0; } -.sidebar-elems, -.sidebar > .location { - padding-left: 24px; -} - -.sidebar .location { - overflow-wrap: anywhere; -} - .rustdoc.source .sidebar { width: 50px; min-width: 0px; @@ -505,8 +496,8 @@ ul.block, .block li { } .block a, -.sidebar h3 a, -h2.location a { +.sidebar h2 a, +.sidebar h3 a { display: block; padding: 0.25rem; margin-left: -0.25rem; @@ -516,8 +507,7 @@ h2.location a { } .sidebar h2 { - border-bottom: none; - font-weight: 500; + overflow-wrap: anywhere; padding: 0; margin: 0; margin-top: 0.7rem; @@ -526,11 +516,15 @@ h2.location a { .sidebar h3 { font-size: 1.125rem; /* 18px */ - font-weight: 500; padding: 0; margin: 0; } +.sidebar-elems, +.sidebar > h2 { + padding-left: 24px; +} + .sidebar a, .sidebar .current { color: var(--sidebar-link-color); } @@ -1474,25 +1468,6 @@ h3.variant { animation: rotating 2s linear infinite; } -.setting-line .radio-line input:checked { - box-shadow: inset 0 0 0 3px var(--main-background-color); - background-color: var(--settings-input-color); -} -.setting-line .radio-line input:focus { - box-shadow: 0 0 1px 1px var(--settings-input-color); -} -/* In here we combine both `:focus` and `:checked` properties. */ -.setting-line .radio-line input:checked:focus { - box-shadow: inset 0 0 0 3px var(--main-background-color), - 0 0 2px 2px var(--settings-input-color); -} -.setting-line .radio-line input:hover { - border-color: var(--settings-input-color) !important; -} -input:checked + .slider { - background-color: var(--settings-input-color); -} - #help-button > a { text-align: center; /* Rare exception to specifying font sizes in rem. Since this is acting @@ -1788,18 +1763,10 @@ in storage.js width: 0; } - .mobile-topbar .location a { - padding: 0; - margin: 0; - } - - .mobile-topbar .location { - border: none; - padding: 0; + .mobile-topbar h2 { + padding-bottom: 0; margin: auto 0.5em auto auto; - text-overflow: ellipsis; overflow: hidden; - white-space: nowrap; /* Rare exception to specifying font sizes in rem. Since the topbar height is specified in pixels, this also has to be specified in pixels to avoid overflowing the topbar when the user sets a bigger @@ -1807,6 +1774,13 @@ in storage.js font-size: 24px; } + .mobile-topbar h2 a { + display: block; + text-overflow: ellipsis; + overflow: hidden; + white-space: nowrap; + } + .mobile-topbar .logo-container { max-height: 45px; } diff --git a/src/librustdoc/html/static/css/settings.css b/src/librustdoc/html/static/css/settings.css index 821c4e978e8f5..83939f63b4e85 100644 --- a/src/librustdoc/html/static/css/settings.css +++ b/src/librustdoc/html/static/css/settings.css @@ -89,3 +89,22 @@ input:checked + .slider:before { #settings .setting-line { margin: 1.2em 0.6em; } + +.setting-line .radio-line input:checked { + box-shadow: inset 0 0 0 3px var(--main-background-color); + background-color: var(--settings-input-color); +} +.setting-line .radio-line input:focus { + box-shadow: 0 0 1px 1px var(--settings-input-color); +} +/* In here we combine both `:focus` and `:checked` properties. */ +.setting-line .radio-line input:checked:focus { + box-shadow: inset 0 0 0 3px var(--main-background-color), + 0 0 2px 2px var(--settings-input-color); +} +.setting-line .radio-line input:hover { + border-color: var(--settings-input-color) !important; +} +input:checked + .slider { + background-color: var(--settings-input-color); +} diff --git a/src/librustdoc/html/static/js/main.js b/src/librustdoc/html/static/js/main.js index 1251d6bfda352..d8f4bc2db22e1 100644 --- a/src/librustdoc/html/static/js/main.js +++ b/src/librustdoc/html/static/js/main.js @@ -55,7 +55,7 @@ function blurHandler(event, parentElem, hideCallback) { function setMobileTopbar() { // FIXME: It would be nicer to generate this text content directly in HTML, // but with the current code it's hard to get the right information in the right place. - const mobileLocationTitle = document.querySelector(".mobile-topbar h2.location"); + const mobileLocationTitle = document.querySelector(".mobile-topbar h2"); const locationTitle = document.querySelector(".sidebar h2.location"); if (mobileLocationTitle && locationTitle) { mobileLocationTitle.innerHTML = locationTitle.innerHTML; diff --git a/src/librustdoc/html/templates/page.html b/src/librustdoc/html/templates/page.html index 123bd576d6463..20a314a1c00e3 100644 --- a/src/librustdoc/html/templates/page.html +++ b/src/librustdoc/html/templates/page.html @@ -85,7 +85,7 @@ {%- endif -%} {#- -#} {#- -#} -

{#- -#} +

{#- -#} {#- -#} {%- endif -%}