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

Commit 4c57de4

Browse files
committed
Auto merge of rust-lang#120448 - matthiaskrgr:rollup-j30dzmw, r=matthiaskrgr
Rollup of 8 pull requests Successful merges: - rust-lang#116677 (References refer to allocated objects) - rust-lang#118533 (Suppress unhelpful diagnostics for unresolved top level attributes) - rust-lang#119991 (Reject infinitely-sized reads from io::Repeat) - rust-lang#120232 (Add support for custom JSON targets when using build-std.) - rust-lang#120358 (Bump Fuchsia, build tests, and use 8 core bots) - rust-lang#120424 (raw pointer metadata API: data address -> data pointer) - rust-lang#120434 (Revert outdated version of "Add the wasm32-wasi-preview2 target") - rust-lang#120443 (Fixes footnote handling in rustdoc) r? `@ghost` `@rustbot` modify labels: rollup
2 parents 6351247 + 1ff326d commit 4c57de4

File tree

66 files changed

+357
-601
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

66 files changed

+357
-601
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,7 @@ jobs:
291291
- name: x86_64-gnu-integration
292292
env:
293293
CI_ONLY_WHEN_CHANNEL: nightly
294-
os: ubuntu-20.04-16core-64gb
294+
os: ubuntu-20.04-8core-32gb
295295
- name: x86_64-gnu-debug
296296
os: ubuntu-20.04-8core-32gb
297297
env: {}

Cargo.lock

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3004,11 +3004,11 @@ dependencies = [
30043004

30053005
[[package]]
30063006
name = "pulldown-cmark"
3007-
version = "0.9.3"
3007+
version = "0.9.5"
30083008
source = "registry+https://github.com/rust-lang/crates.io-index"
3009-
checksum = "77a1a2f1f0a7ecff9c31abbe177637be0e97a0aef46cf8738ece09327985d998"
3009+
checksum = "80eb9f69aec5cd8828765a75f739383fbbe3e8b9d84370bde1cc90487700794a"
30103010
dependencies = [
3011-
"bitflags 1.3.2",
3011+
"bitflags 2.4.1",
30123012
"memchr",
30133013
"unicase",
30143014
]

compiler/rustc_errors/src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -509,6 +509,7 @@ pub enum StashKey {
509509
MaybeForgetReturn,
510510
/// Query cycle detected, stashing in favor of a better error.
511511
Cycle,
512+
UndeterminedMacroResolution,
512513
}
513514

514515
fn default_track_diagnostic(diag: Diagnostic, f: &mut dyn FnMut(Diagnostic)) {

compiler/rustc_passes/src/check_attr.rs

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,10 @@
55
//! item.
66
77
use crate::{errors, fluent_generated as fluent};
8-
use rustc_ast::{ast, AttrStyle, Attribute, LitKind, MetaItemKind, MetaItemLit, NestedMetaItem};
8+
use rustc_ast::{ast, AttrKind, AttrStyle, Attribute, LitKind};
9+
use rustc_ast::{MetaItemKind, MetaItemLit, NestedMetaItem};
910
use rustc_data_structures::fx::FxHashMap;
11+
use rustc_errors::StashKey;
1012
use rustc_errors::{Applicability, DiagCtxt, IntoDiagnosticArg, MultiSpan};
1113
use rustc_feature::{AttributeDuplicates, AttributeType, BuiltinAttribute, BUILTIN_ATTRIBUTE_MAP};
1214
use rustc_hir as hir;
@@ -2530,6 +2532,14 @@ fn check_invalid_crate_level_attr(tcx: TyCtxt<'_>, attrs: &[Attribute]) {
25302532
if attr.style == AttrStyle::Inner {
25312533
for attr_to_check in ATTRS_TO_CHECK {
25322534
if attr.has_name(*attr_to_check) {
2535+
if let AttrKind::Normal(ref p) = attr.kind
2536+
&& let Some(diag) = tcx.dcx().steal_diagnostic(
2537+
p.item.path.span,
2538+
StashKey::UndeterminedMacroResolution,
2539+
)
2540+
{
2541+
diag.cancel();
2542+
}
25332543
let item = tcx
25342544
.hir()
25352545
.items()

compiler/rustc_resolve/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ edition = "2021"
66
[dependencies]
77
# tidy-alphabetical-start
88
bitflags = "2.4.1"
9-
pulldown-cmark = { version = "0.9.3", default-features = false }
9+
pulldown-cmark = { version = "0.9.5", default-features = false }
1010
rustc_arena = { path = "../rustc_arena" }
1111
rustc_ast = { path = "../rustc_ast" }
1212
rustc_ast_pretty = { path = "../rustc_ast_pretty" }

compiler/rustc_resolve/src/macros.rs

Lines changed: 15 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
//! A bunch of methods and structures more or less related to resolving macros and
22
//! interface provided by `Resolver` to macro expander.
33
4-
use crate::errors::{
5-
self, AddAsNonDerive, CannotDetermineMacroResolution, CannotFindIdentInThisScope,
6-
MacroExpectedFound, RemoveSurroundingDerive,
7-
};
4+
use crate::errors::CannotDetermineMacroResolution;
5+
use crate::errors::{self, AddAsNonDerive, CannotFindIdentInThisScope};
6+
use crate::errors::{MacroExpectedFound, RemoveSurroundingDerive};
87
use crate::Namespace::*;
98
use crate::{BuiltinMacroState, Determinacy, MacroData};
109
use crate::{DeriveData, Finalize, ParentScope, ResolutionError, Resolver, ScopeSet};
@@ -15,6 +14,7 @@ use rustc_ast_pretty::pprust;
1514
use rustc_attr::StabilityLevel;
1615
use rustc_data_structures::intern::Interned;
1716
use rustc_data_structures::sync::Lrc;
17+
use rustc_errors::StashKey;
1818
use rustc_errors::{struct_span_code_err, Applicability};
1919
use rustc_expand::base::{Annotatable, DeriveResolutions, Indeterminate, ResolverExpand};
2020
use rustc_expand::base::{SyntaxExtension, SyntaxExtensionKind};
@@ -25,9 +25,8 @@ use rustc_hir::def_id::{CrateNum, DefId, LocalDefId};
2525
use rustc_middle::middle::stability;
2626
use rustc_middle::ty::RegisteredTools;
2727
use rustc_middle::ty::{TyCtxt, Visibility};
28-
use rustc_session::lint::builtin::{
29-
LEGACY_DERIVE_HELPERS, SOFT_UNSTABLE, UNKNOWN_OR_MALFORMED_DIAGNOSTIC_ATTRIBUTES,
30-
};
28+
use rustc_session::lint::builtin::UNKNOWN_OR_MALFORMED_DIAGNOSTIC_ATTRIBUTES;
29+
use rustc_session::lint::builtin::{LEGACY_DERIVE_HELPERS, SOFT_UNSTABLE};
3130
use rustc_session::lint::builtin::{UNUSED_MACROS, UNUSED_MACRO_RULES};
3231
use rustc_session::lint::BuiltinLintDiagnostics;
3332
use rustc_session::parse::feature_err;
@@ -703,21 +702,21 @@ impl<'a, 'tcx> Resolver<'a, 'tcx> {
703702
// situations should be reported as errors, so this is a bug.
704703
this.dcx().span_delayed_bug(span, "inconsistent resolution for a macro");
705704
}
706-
} else {
705+
} else if this.tcx.dcx().has_errors().is_none() && this.privacy_errors.is_empty() {
707706
// It's possible that the macro was unresolved (indeterminate) and silently
708707
// expanded into a dummy fragment for recovery during expansion.
709708
// Now, post-expansion, the resolution may succeed, but we can't change the
710709
// past and need to report an error.
711710
// However, non-speculative `resolve_path` can successfully return private items
712711
// even if speculative `resolve_path` returned nothing previously, so we skip this
713-
// less informative error if the privacy error is reported elsewhere.
714-
if this.privacy_errors.is_empty() {
715-
this.dcx().emit_err(CannotDetermineMacroResolution {
716-
span,
717-
kind: kind.descr(),
718-
path: Segment::names_to_string(path),
719-
});
720-
}
712+
// less informative error if no other error is reported elsewhere.
713+
714+
let err = this.dcx().create_err(CannotDetermineMacroResolution {
715+
span,
716+
kind: kind.descr(),
717+
path: Segment::names_to_string(path),
718+
});
719+
err.stash(span, StashKey::UndeterminedMacroResolution);
721720
}
722721
};
723722

compiler/rustc_span/src/symbol.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1799,7 +1799,6 @@ symbols! {
17991799
warn,
18001800
wasm_abi,
18011801
wasm_import_module,
1802-
wasm_preview2,
18031802
wasm_target_feature,
18041803
while_let,
18051804
windows,

compiler/rustc_target/src/spec/mod.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1574,7 +1574,6 @@ supported_targets! {
15741574
("wasm32-unknown-emscripten", wasm32_unknown_emscripten),
15751575
("wasm32-unknown-unknown", wasm32_unknown_unknown),
15761576
("wasm32-wasi", wasm32_wasi),
1577-
("wasm32-wasi-preview2", wasm32_wasi_preview2),
15781577
("wasm32-wasi-preview1-threads", wasm32_wasi_preview1_threads),
15791578
("wasm64-unknown-unknown", wasm64_unknown_unknown),
15801579

compiler/rustc_target/src/spec/targets/wasm32_wasi_preview1_threads.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,12 +72,11 @@
7272
//! best we can with this target. Don't start relying on too much here unless
7373
//! you know what you're getting in to!
7474
75-
use crate::spec::{base, crt_objects, cvs, Cc, LinkSelfContainedDefault, LinkerFlavor, Target};
75+
use crate::spec::{base, crt_objects, Cc, LinkSelfContainedDefault, LinkerFlavor, Target};
7676

7777
pub fn target() -> Target {
7878
let mut options = base::wasm::options();
7979

80-
options.families = cvs!["wasm", "wasi"];
8180
options.os = "wasi".into();
8281

8382
options.add_pre_link_args(

compiler/rustc_target/src/spec/targets/wasm32_wasi_preview2.rs

Lines changed: 0 additions & 64 deletions
This file was deleted.

0 commit comments

Comments
 (0)