Skip to content
This repository was archived by the owner on May 28, 2025. It is now read-only.

Commit 8c7ad16

Browse files
committed
Auto merge of rust-lang#109986 - JohnTitor:rollup-3aax38t, r=JohnTitor
Rollup of 7 pull requests Successful merges: - rust-lang#109909 (Deny `use`ing tool paths) - rust-lang#109921 (Don't ICE when encountering `dyn*` in statics or consts) - rust-lang#109922 (Disable `has_thread_local` on OpenHarmony) - rust-lang#109926 (write threads info into log only when debugging) - rust-lang#109968 (Add regression test for rust-lang#80409) - rust-lang#109969 (Add regression test for rust-lang#86351) - rust-lang#109973 (rustdoc: Improve logo display very small screen) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2 parents 2eaeb1e + 9960e9f commit 8c7ad16

File tree

17 files changed

+135
-16
lines changed

17 files changed

+135
-16
lines changed

compiler/rustc_const_eval/src/transform/check_consts/check.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -553,7 +553,7 @@ impl<'tcx> Visitor<'tcx> for Checker<'_, 'tcx> {
553553
}
554554

555555
Rvalue::Cast(CastKind::DynStar, _, _) => {
556-
unimplemented!()
556+
// `dyn*` coercion is implemented for CTFE.
557557
}
558558

559559
Rvalue::Cast(_, _, _) => {}

compiler/rustc_log/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ pub fn init_env_logger(env: &str) -> Result<(), Error> {
8383
.with_verbose_exit(verbose_entry_exit)
8484
.with_verbose_entry(verbose_entry_exit)
8585
.with_indent_amount(2);
86-
#[cfg(parallel_compiler)]
86+
#[cfg(all(parallel_compiler, debug_assertions))]
8787
let layer = layer.with_thread_ids(true).with_thread_names(true);
8888

8989
let subscriber = tracing_subscriber::Registry::default().with(filter).with(layer);

compiler/rustc_resolve/messages.ftl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -207,5 +207,9 @@ resolve_expected_found =
207207
resolve_indeterminate =
208208
cannot determine resolution for the visibility
209209
210+
resolve_tool_module_imported =
211+
cannot use a tool module through an import
212+
.note = the tool module imported here
213+
210214
resolve_module_only =
211215
visibility must resolve to a module

compiler/rustc_resolve/src/errors.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -469,6 +469,15 @@ pub(crate) struct ExpectedFound {
469469
#[diag(resolve_indeterminate, code = "E0578")]
470470
pub(crate) struct Indeterminate(#[primary_span] pub(crate) Span);
471471

472+
#[derive(Diagnostic)]
473+
#[diag(resolve_tool_module_imported)]
474+
pub(crate) struct ToolModuleImported {
475+
#[primary_span]
476+
pub(crate) span: Span,
477+
#[note]
478+
pub(crate) import: Span,
479+
}
480+
472481
#[derive(Diagnostic)]
473482
#[diag(resolve_module_only)]
474483
pub(crate) struct ModuleOnly(#[primary_span] pub(crate) Span);

compiler/rustc_resolve/src/ident.rs

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ use crate::late::{
1717
ConstantHasGenerics, ConstantItemKind, HasGenericParams, PathSource, Rib, RibKind,
1818
};
1919
use crate::macros::{sub_namespace_match, MacroRulesScope};
20-
use crate::{AmbiguityError, AmbiguityErrorMisc, AmbiguityKind, Determinacy, Finalize};
20+
use crate::{errors, AmbiguityError, AmbiguityErrorMisc, AmbiguityKind, Determinacy, Finalize};
2121
use crate::{Import, ImportKind, LexicalScopeBinding, Module, ModuleKind, ModuleOrUniformRoot};
2222
use crate::{NameBinding, NameBindingKind, ParentScope, PathResult, PrivacyError, Res};
2323
use crate::{ResolutionError, Resolver, Scope, ScopeSet, Segment, ToNameBinding, Weak};
@@ -1364,7 +1364,7 @@ impl<'a, 'tcx> Resolver<'a, 'tcx> {
13641364
}
13651365
};
13661366

1367-
let is_last = i == path.len() - 1;
1367+
let is_last = i + 1 == path.len();
13681368
let ns = if is_last { opt_ns.unwrap_or(TypeNS) } else { TypeNS };
13691369
let name = ident.name;
13701370

@@ -1501,16 +1501,12 @@ impl<'a, 'tcx> Resolver<'a, 'tcx> {
15011501
if let Some(next_module) = binding.module() {
15021502
module = Some(ModuleOrUniformRoot::Module(next_module));
15031503
record_segment_res(self, res);
1504-
} else if res == Res::ToolMod && i + 1 != path.len() {
1504+
} else if res == Res::ToolMod && !is_last && opt_ns.is_some() {
15051505
if binding.is_import() {
1506-
self.tcx
1507-
.sess
1508-
.struct_span_err(
1509-
ident.span,
1510-
"cannot use a tool module through an import",
1511-
)
1512-
.span_note(binding.span, "the tool module imported here")
1513-
.emit();
1506+
self.tcx.sess.emit_err(errors::ToolModuleImported {
1507+
span: ident.span,
1508+
import: binding.span,
1509+
});
15141510
}
15151511
let res = Res::NonMacroAttr(NonMacroAttrKind::Tool);
15161512
return PathResult::NonModule(PartialRes::new(res));

compiler/rustc_target/src/spec/aarch64_unknown_linux_ohos.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ pub fn target() -> Target {
1818
features: "+reserve-x18".into(),
1919
mcount: "\u{1}_mcount".into(),
2020
force_emulated_tls: true,
21+
has_thread_local: false,
2122
supported_sanitizers: SanitizerSet::ADDRESS
2223
| SanitizerSet::CFI
2324
| SanitizerSet::LEAK

compiler/rustc_target/src/spec/armv7_unknown_linux_ohos.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ pub fn target() -> Target {
2121
crt_static_default: false,
2222
mcount: "\u{1}mcount".into(),
2323
force_emulated_tls: true,
24+
has_thread_local: false,
2425
..super::linux_musl_base::opts()
2526
},
2627
}

src/librustdoc/html/static/css/rustdoc.css

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@
66
3. Copy the filenames with updated suffixes from the directory.
77
*/
88

9+
:root {
10+
--nav-sub-mobile-padding: 8px;
11+
}
12+
913
/* See FiraSans-LICENSE.txt for the Fira Sans license. */
1014
@font-face {
1115
font-family: 'Fira Sans';
@@ -1726,7 +1730,7 @@ in main.js
17261730

17271731
.source nav.sub {
17281732
margin: 0;
1729-
padding: 8px;
1733+
padding: var(--nav-sub-mobile-padding);
17301734
}
17311735
}
17321736

@@ -1783,6 +1787,7 @@ in main.js
17831787
.sub-logo-container > img {
17841788
height: 35px;
17851789
width: 35px;
1790+
margin-bottom: var(--nav-sub-mobile-padding);
17861791
}
17871792
}
17881793

src/librustdoc/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ fn init_logging() {
203203
.with_verbose_exit(true)
204204
.with_verbose_entry(true)
205205
.with_indent_amount(2);
206-
#[cfg(parallel_compiler)]
206+
#[cfg(all(parallel_compiler, debug_assertions))]
207207
let layer = layer.with_thread_ids(true).with_thread_names(true);
208208

209209
use tracing_subscriber::layer::SubscriberExt;

tests/rustdoc-gui/huge-logo.goml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,6 @@ size: (1280, 1024)
1818
assert-property: (".sub-logo-container", {"offsetWidth": "60", "offsetHeight": 60})
1919

2020
size: (400, 600)
21-
assert-property: (".sub-logo-container", {"offsetWidth": "35", "offsetHeight": 35})
21+
// 43 because 35px + 8px of margin
22+
assert-css: (".sub-logo-container > img", {"margin-bottom": "8px"})
23+
assert-property: (".sub-logo-container", {"offsetWidth": "35", "offsetHeight": 43})

0 commit comments

Comments
 (0)