Skip to content

Commit 98b6d3a

Browse files
author
The Miri Cronjob Bot
committed
Merge from rustc
2 parents 5f3242c + 77e295c commit 98b6d3a

File tree

433 files changed

+8527
-5392
lines changed

Some content is hidden

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

433 files changed

+8527
-5392
lines changed

.github/workflows/ci.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,15 @@ jobs:
7373
needs: [ calculate_matrix ]
7474
runs-on: "${{ matrix.os }}"
7575
timeout-minutes: 360
76+
# The bors environment contains secrets required for elevated workflows (try and auto builds),
77+
# which need to access e.g. S3 and upload artifacts. We want to provide access to that
78+
# environment only on the try/auto branches, which are only accessible to bors.
79+
# This also ensures that PR CI (which doesn't get write access to S3) works, as it cannot
80+
# access the environment.
81+
#
82+
# We only enable the environment for the rust-lang/rust repository, so that rust-lang-ci/rust
83+
# CI works until we migrate off it (since that repository doesn't contain the environment).
84+
environment: ${{ ((github.repository == 'rust-lang/rust' && (github.ref == 'refs/heads/try' || github.ref == 'refs/heads/auto')) && 'bors') || '' }}
7685
env:
7786
CI_JOB_NAME: ${{ matrix.name }}
7887
CI_JOB_DOC_URL: ${{ matrix.doc_url }}

Cargo.lock

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -582,13 +582,11 @@ dependencies = [
582582
name = "clippy_dev"
583583
version = "0.0.1"
584584
dependencies = [
585-
"aho-corasick",
586585
"chrono",
587586
"clap",
588587
"indoc",
589588
"itertools",
590589
"opener",
591-
"shell-escape",
592590
"walkdir",
593591
]
594592

@@ -3809,6 +3807,7 @@ dependencies = [
38093807
"rustc_abi",
38103808
"rustc_ast",
38113809
"rustc_attr_data_structures",
3810+
"rustc_attr_parsing",
38123811
"rustc_data_structures",
38133812
"rustc_errors",
38143813
"rustc_fluent_macro",
@@ -4887,12 +4886,6 @@ dependencies = [
48874886
"lazy_static",
48884887
]
48894888

4890-
[[package]]
4891-
name = "shell-escape"
4892-
version = "0.1.5"
4893-
source = "registry+https://github.com/rust-lang/crates.io-index"
4894-
checksum = "45bb67a18fa91266cc7807181f62f9178a6873bfad7dc788c42e6430db40184f"
4895-
48964889
[[package]]
48974890
name = "shlex"
48984891
version = "1.3.0"

compiler/rustc_attr_parsing/src/attributes/util.rs

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,3 +26,33 @@ pub fn is_builtin_attr(attr: &impl AttributeExt) -> bool {
2626
pub fn find_crate_name(attrs: &[impl AttributeExt]) -> Option<Symbol> {
2727
first_attr_value_str_by_name(attrs, sym::crate_name)
2828
}
29+
30+
pub fn is_doc_alias_attrs_contain_symbol<'tcx, T: AttributeExt + 'tcx>(
31+
attrs: impl Iterator<Item = &'tcx T>,
32+
symbol: Symbol,
33+
) -> bool {
34+
let doc_attrs = attrs.filter(|attr| attr.has_name(sym::doc));
35+
for attr in doc_attrs {
36+
let Some(values) = attr.meta_item_list() else {
37+
continue;
38+
};
39+
let alias_values = values.iter().filter(|v| v.has_name(sym::alias));
40+
for v in alias_values {
41+
if let Some(nested) = v.meta_item_list() {
42+
// #[doc(alias("foo", "bar"))]
43+
let mut iter = nested.iter().filter_map(|item| item.lit()).map(|item| item.symbol);
44+
if iter.any(|s| s == symbol) {
45+
return true;
46+
}
47+
} else if let Some(meta) = v.meta_item()
48+
&& let Some(lit) = meta.name_value_literal()
49+
{
50+
// #[doc(alias = "foo")]
51+
if lit.symbol == symbol {
52+
return true;
53+
}
54+
}
55+
}
56+
}
57+
false
58+
}

compiler/rustc_attr_parsing/src/lib.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,9 @@ pub mod parser;
9090
mod session_diagnostics;
9191

9292
pub use attributes::cfg::*;
93-
pub use attributes::util::{find_crate_name, is_builtin_attr, parse_version};
93+
pub use attributes::util::{
94+
find_crate_name, is_builtin_attr, is_doc_alias_attrs_contain_symbol, parse_version,
95+
};
9496
pub use context::{AttributeParser, OmitDoc};
9597

9698
rustc_fluent_macro::fluent_messages! { "../messages.ftl" }

compiler/rustc_codegen_cranelift/patches/0027-sysroot_tests-128bit-atomic-operations.patch

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ index 1e336bf..35e6f54 100644
1717
@@ -2,5 +2,4 @@
1818
// tidy-alphabetical-start
1919
-#![cfg_attr(target_has_atomic = "128", feature(integer_atomics))]
20-
#![cfg_attr(test, feature(cfg_match))]
20+
#![cfg_attr(test, feature(cfg_select))]
2121
#![feature(alloc_layout_extra)]
2222
#![feature(array_chunks)]
2323
diff --git a/coretests/tests/atomic.rs b/coretests/tests/atomic.rs

compiler/rustc_data_structures/src/flock.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
//! green/native threading. This is just a bare-bones enough solution for
55
//! librustdoc, it is not production quality at all.
66
7-
cfg_match! {
7+
cfg_select! {
88
target_os = "linux" => {
99
mod linux;
1010
use linux as imp;

compiler/rustc_data_structures/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
#![feature(ascii_char_variants)]
2020
#![feature(assert_matches)]
2121
#![feature(auto_traits)]
22-
#![feature(cfg_match)]
22+
#![feature(cfg_select)]
2323
#![feature(core_intrinsics)]
2424
#![feature(dropck_eyepatch)]
2525
#![feature(extend_one)]

compiler/rustc_data_structures/src/profiling.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -860,7 +860,7 @@ fn get_thread_id() -> u32 {
860860
}
861861

862862
// Memory reporting
863-
cfg_match! {
863+
cfg_select! {
864864
windows => {
865865
pub fn get_resident_set_size() -> Option<usize> {
866866
use windows::{

compiler/rustc_hir_typeck/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ itertools = "0.12"
99
rustc_abi = { path = "../rustc_abi" }
1010
rustc_ast = { path = "../rustc_ast" }
1111
rustc_attr_data_structures = { path = "../rustc_attr_data_structures" }
12+
rustc_attr_parsing = { path = "../rustc_attr_parsing" }
1213
rustc_data_structures = { path = "../rustc_data_structures" }
1314
rustc_errors = { path = "../rustc_errors" }
1415
rustc_fluent_macro = { path = "../rustc_fluent_macro" }

compiler/rustc_hir_typeck/src/coercion.rs

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1190,9 +1190,23 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
11901190
(ty::FnDef(..), ty::FnDef(..)) => {
11911191
// Don't reify if the function types have a LUB, i.e., they
11921192
// are the same function and their parameters have a LUB.
1193-
match self
1194-
.commit_if_ok(|_| self.at(cause, self.param_env).lub(prev_ty, new_ty))
1195-
{
1193+
match self.commit_if_ok(|_| {
1194+
// We need to eagerly handle nested obligations due to lazy norm.
1195+
if self.next_trait_solver() {
1196+
let ocx = ObligationCtxt::new(self);
1197+
let value = ocx.lub(cause, self.param_env, prev_ty, new_ty)?;
1198+
if ocx.select_where_possible().is_empty() {
1199+
Ok(InferOk {
1200+
value,
1201+
obligations: ocx.into_pending_obligations(),
1202+
})
1203+
} else {
1204+
Err(TypeError::Mismatch)
1205+
}
1206+
} else {
1207+
self.at(cause, self.param_env).lub(prev_ty, new_ty)
1208+
}
1209+
}) {
11961210
// We have a LUB of prev_ty and new_ty, just return it.
11971211
Ok(ok) => return Ok(self.register_infer_ok_obligations(ok)),
11981212
Err(_) => {

0 commit comments

Comments
 (0)