Skip to content

Rollup of 7 pull requests #140613

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 19 commits into from
May 3, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
6f1a54b
Remove fragile equal-pointers-unequal tests.
m-ou-se May 2, 2025
2f2d3c8
forbidden target feature tests: consolidate multiple tests in a singl…
RalfJung Apr 28, 2025
7a2d51d
give the abi-relevant target feature tests better names
RalfJung Apr 28, 2025
6873a46
add more revisions to cover more architectures
RalfJung Apr 28, 2025
ce4d395
Update sysinfo version to `0.35.0`
GuillaumeGomez May 2, 2025
fbfc329
Update sysinfo to `0.35.0` in `src/tools/opt-dist`
GuillaumeGomez May 2, 2025
3eee3da
resolve: Support imports of associated types and glob imports from tr…
petrochenkov Mar 19, 2025
b7c933a
doc(std): fix typo lchown -> lchmod
lolbinarycat May 2, 2025
77876b5
zkvm: remove schmerik from maintainers list
SchmErik May 2, 2025
ad3c35b
add `ReverseSccGraph::compute`
lcnr May 3, 2025
27f83a5
TypeChecker take fields by ref
lcnr May 3, 2025
0be1ec1
`CreateResult` wrap more fields in `Frozen`
lcnr May 3, 2025
a1a23de
Rollup merge of #138712 - petrochenkov:impasst, r=fmease
matthiaskrgr May 3, 2025
d8b0347
Rollup merge of #140395 - RalfJung:target-feature-tests, r=petrochenkov
matthiaskrgr May 3, 2025
7b9fd9b
Rollup merge of #140576 - m-ou-se:fragile-tests, r=compiler-errors
matthiaskrgr May 3, 2025
ef33494
Rollup merge of #140582 - GuillaumeGomez:update-sysinfo, r=Kobzol
matthiaskrgr May 3, 2025
2820bdb
Rollup merge of #140595 - lolbinarycat:std-set_permissions-typo, r=cu…
matthiaskrgr May 3, 2025
14c424a
Rollup merge of #140597 - SchmErik:rm-schmerik, r=Urgau
matthiaskrgr May 3, 2025
4360fd7
Rollup merge of #140604 - lcnr:revealing-use-prep, r=compiler-errors
matthiaskrgr May 3, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
101 changes: 34 additions & 67 deletions Cargo.lock
Original file line number Diff line number Diff line change
Expand Up @@ -744,7 +744,7 @@ dependencies = [
"tracing-subscriber",
"unified-diff",
"walkdir",
"windows 0.59.0",
"windows",
]

[[package]]
Expand Down Expand Up @@ -2463,6 +2463,25 @@ version = "0.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "830b246a0e5f20af87141b25c173cd1b609bd7779a4617d6ec582abaf90870f3"

[[package]]
name = "objc2-core-foundation"
version = "0.3.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1c10c2894a6fed806ade6027bcd50662746363a9589d3ec9d9bef30a4e4bc166"
dependencies = [
"bitflags",
]

[[package]]
name = "objc2-io-kit"
version = "0.3.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "71c1c64d6120e51cd86033f67176b1cb66780c2efe34dec55176f77befd93c0a"
dependencies = [
"libc",
"objc2-core-foundation",
]

[[package]]
name = "object"
version = "0.32.2"
Expand Down Expand Up @@ -3466,7 +3485,7 @@ dependencies = [
"thorin-dwp",
"tracing",
"wasm-encoder 0.219.2",
"windows 0.59.0",
"windows",
]

[[package]]
Expand Down Expand Up @@ -3525,7 +3544,7 @@ dependencies = [
"tempfile",
"thin-vec",
"tracing",
"windows 0.59.0",
"windows",
]

[[package]]
Expand Down Expand Up @@ -3588,7 +3607,7 @@ dependencies = [
"serde_json",
"shlex",
"tracing",
"windows 0.59.0",
"windows",
]

[[package]]
Expand Down Expand Up @@ -3643,7 +3662,7 @@ dependencies = [
"termcolor",
"termize",
"tracing",
"windows 0.59.0",
"windows",
]

[[package]]
Expand Down Expand Up @@ -4386,7 +4405,7 @@ dependencies = [
"smallvec",
"termize",
"tracing",
"windows 0.59.0",
"windows",
]

[[package]]
Expand Down Expand Up @@ -5068,13 +5087,14 @@ dependencies = [

[[package]]
name = "sysinfo"
version = "0.31.4"
version = "0.35.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "355dbe4f8799b304b05e1b0f05fc59b2a18d36645cf169607da45bde2f69a1be"
checksum = "b897c8ea620e181c7955369a31be5f48d9a9121cb59fd33ecef9ff2a34323422"
dependencies = [
"core-foundation-sys",
"libc",
"windows 0.57.0",
"objc2-core-foundation",
"objc2-io-kit",
"windows",
]

[[package]]
Expand Down Expand Up @@ -5949,16 +5969,6 @@ version = "0.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f"

[[package]]
name = "windows"
version = "0.57.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "12342cb4d8e3b046f3d80effd474a7a02447231330ef77d71daa6fbc40681143"
dependencies = [
"windows-core 0.57.0",
"windows-targets 0.52.6",
]

[[package]]
name = "windows"
version = "0.59.0"
Expand All @@ -5980,27 +5990,15 @@ dependencies = [
"serde_json",
]

[[package]]
name = "windows-core"
version = "0.57.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d2ed2439a290666cd67ecce2b0ffaad89c2a56b976b736e6ece670297897832d"
dependencies = [
"windows-implement 0.57.0",
"windows-interface 0.57.0",
"windows-result 0.1.2",
"windows-targets 0.52.6",
]

[[package]]
name = "windows-core"
version = "0.59.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "810ce18ed2112484b0d4e15d022e5f598113e220c53e373fb31e67e21670c1ce"
dependencies = [
"windows-implement 0.59.0",
"windows-interface 0.59.1",
"windows-result 0.3.2",
"windows-interface",
"windows-result",
"windows-strings 0.3.1",
"windows-targets 0.53.0",
]
Expand All @@ -6012,23 +6010,12 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4763c1de310c86d75a878046489e2e5ba02c649d185f21c67d4cf8a56d098980"
dependencies = [
"windows-implement 0.60.0",
"windows-interface 0.59.1",
"windows-interface",
"windows-link",
"windows-result 0.3.2",
"windows-result",
"windows-strings 0.4.0",
]

[[package]]
name = "windows-implement"
version = "0.57.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9107ddc059d5b6fbfbffdfa7a7fe3e22a226def0b2608f72e9d552763d3e1ad7"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.100",
]

[[package]]
name = "windows-implement"
version = "0.59.0"
Expand All @@ -6051,17 +6038,6 @@ dependencies = [
"syn 2.0.100",
]

[[package]]
name = "windows-interface"
version = "0.57.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "29bee4b38ea3cde66011baa44dba677c432a78593e202392d1e9070cf2a7fca7"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.100",
]

[[package]]
name = "windows-interface"
version = "0.59.1"
Expand All @@ -6079,15 +6055,6 @@ version = "0.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "76840935b766e1b0a05c0066835fb9ec80071d4c09a16f6bd5f7e655e3c14c38"

[[package]]
name = "windows-result"
version = "0.1.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5e383302e8ec8515204254685643de10811af0ed97ea37210dc26fb0032647f8"
dependencies = [
"windows-targets 0.52.6",
]

[[package]]
name = "windows-result"
version = "0.3.2"
Expand Down
45 changes: 27 additions & 18 deletions compiler/rustc_borrowck/src/region_infer/reverse_sccs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ use rustc_middle::ty::RegionVid;

use crate::RegionInferenceContext;
use crate::constraints::ConstraintSccIndex;
use crate::region_infer::ConstraintSccs;
use crate::universal_regions::UniversalRegions;

pub(crate) struct ReverseSccGraph {
graph: VecGraph<ConstraintSccIndex>,
Expand All @@ -19,6 +21,29 @@ pub(crate) struct ReverseSccGraph {
}

impl ReverseSccGraph {
pub(super) fn compute(
constraint_sccs: &ConstraintSccs,
universal_regions: &UniversalRegions<'_>,
) -> Self {
let graph = constraint_sccs.reverse();
let mut paired_scc_regions = universal_regions
.universal_regions_iter()
.map(|region| (constraint_sccs.scc(region), region))
.collect::<Vec<_>>();
paired_scc_regions.sort();
let universal_regions = paired_scc_regions.iter().map(|&(_, region)| region).collect();

let mut scc_regions = FxIndexMap::default();
let mut start = 0;
for chunk in paired_scc_regions.chunk_by(|&(scc1, _), &(scc2, _)| scc1 == scc2) {
let (scc, _) = chunk[0];

scc_regions.insert(scc, start..start + chunk.len());
start += chunk.len();
}
ReverseSccGraph { graph, scc_regions, universal_regions }
}

/// Find all universal regions that are required to outlive the given SCC.
pub(super) fn upper_bounds(&self, scc0: ConstraintSccIndex) -> impl Iterator<Item = RegionVid> {
let mut duplicates = FxIndexSet::default();
Expand All @@ -40,23 +65,7 @@ impl RegionInferenceContext<'_> {
return;
}

let graph = self.constraint_sccs.reverse();
let mut paired_scc_regions = self
.universal_regions()
.universal_regions_iter()
.map(|region| (self.constraint_sccs.scc(region), region))
.collect::<Vec<_>>();
paired_scc_regions.sort();
let universal_regions = paired_scc_regions.iter().map(|&(_, region)| region).collect();

let mut scc_regions = FxIndexMap::default();
let mut start = 0;
for chunk in paired_scc_regions.chunk_by(|&(scc1, _), &(scc2, _)| scc1 == scc2) {
let (scc, _) = chunk[0];
scc_regions.insert(scc, start..start + chunk.len());
start += chunk.len();
}

self.rev_scc_graph = Some(ReverseSccGraph { graph, scc_regions, universal_regions });
self.rev_scc_graph =
Some(ReverseSccGraph::compute(&self.constraint_sccs, self.universal_regions()));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ type NormalizedInputsAndOutput<'tcx> = Vec<Ty<'tcx>>;

pub(crate) struct CreateResult<'tcx> {
pub(crate) universal_region_relations: Frozen<UniversalRegionRelations<'tcx>>,
pub(crate) region_bound_pairs: RegionBoundPairs<'tcx>,
pub(crate) known_type_outlives_obligations: Vec<ty::PolyTypeOutlivesPredicate<'tcx>>,
pub(crate) region_bound_pairs: Frozen<RegionBoundPairs<'tcx>>,
pub(crate) known_type_outlives_obligations: Frozen<Vec<ty::PolyTypeOutlivesPredicate<'tcx>>>,
pub(crate) normalized_inputs_and_output: NormalizedInputsAndOutput<'tcx>,
}

Expand Down Expand Up @@ -333,8 +333,8 @@ impl<'tcx> UniversalRegionRelationsBuilder<'_, 'tcx> {
outlives: self.outlives.freeze(),
inverse_outlives: self.inverse_outlives.freeze(),
}),
known_type_outlives_obligations,
region_bound_pairs: self.region_bound_pairs,
known_type_outlives_obligations: Frozen::freeze(known_type_outlives_obligations),
region_bound_pairs: Frozen::freeze(self.region_bound_pairs),
normalized_inputs_and_output,
}
}
Expand Down
16 changes: 8 additions & 8 deletions compiler/rustc_borrowck/src/type_check/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -151,8 +151,8 @@ pub(crate) fn type_check<'a, 'tcx>(
body,
promoted,
user_type_annotations: &body.user_type_annotations,
region_bound_pairs,
known_type_outlives_obligations,
region_bound_pairs: &region_bound_pairs,
known_type_outlives_obligations: &known_type_outlives_obligations,
reported_errors: Default::default(),
universal_regions: &universal_region_relations.universal_regions,
location_table,
Expand Down Expand Up @@ -216,8 +216,8 @@ struct TypeChecker<'a, 'tcx> {
/// User type annotations are shared between the main MIR and the MIR of
/// all of the promoted items.
user_type_annotations: &'a CanonicalUserTypeAnnotations<'tcx>,
region_bound_pairs: RegionBoundPairs<'tcx>,
known_type_outlives_obligations: Vec<ty::PolyTypeOutlivesPredicate<'tcx>>,
region_bound_pairs: &'a RegionBoundPairs<'tcx>,
known_type_outlives_obligations: &'a [ty::PolyTypeOutlivesPredicate<'tcx>],
reported_errors: FxIndexSet<(Ty<'tcx>, Span)>,
universal_regions: &'a UniversalRegions<'tcx>,
location_table: &'a PoloniusLocationTable,
Expand Down Expand Up @@ -412,9 +412,9 @@ impl<'a, 'tcx> TypeChecker<'a, 'tcx> {
constraint_conversion::ConstraintConversion::new(
self.infcx,
self.universal_regions,
&self.region_bound_pairs,
self.region_bound_pairs,
self.infcx.param_env,
&self.known_type_outlives_obligations,
self.known_type_outlives_obligations,
locations,
locations.span(self.body),
category,
Expand Down Expand Up @@ -2506,9 +2506,9 @@ impl<'a, 'tcx> TypeChecker<'a, 'tcx> {
constraint_conversion::ConstraintConversion::new(
self.infcx,
self.universal_regions,
&self.region_bound_pairs,
self.region_bound_pairs,
self.infcx.param_env,
&self.known_type_outlives_obligations,
self.known_type_outlives_obligations,
locations,
self.body.span, // irrelevant; will be overridden.
ConstraintCategory::Boring, // same as above.
Expand Down
6 changes: 5 additions & 1 deletion compiler/rustc_error_codes/src/error_codes/E0253.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
#### Note: this error code is no longer emitted by the compiler.

Attempt was made to import an unimportable type. This can happen when trying
to import a type from a trait.

Erroneous code example:

```compile_fail,E0253
```
#![feature(import_trait_associated_functions)]

mod foo {
pub trait MyTrait {
type SomeType;
Expand Down
Loading
Loading