Skip to content

Rollup of 11 pull requests #139838

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

Closed
wants to merge 41 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
5cda2a9
run all 'thread' tests on FreeBSD, and also on 32bit
RalfJung Apr 10, 2025
f254ab2
Merge pull request #4266 from RalfJung/freebsd
RalfJung Apr 10, 2025
2d37173
Bump crossbeam-channel from 0.5.14 to 0.5.15
dependabot[bot] Apr 10, 2025
d1f901a
Merge pull request #4267 from rust-lang/dependabot/cargo/crossbeam-ch…
RalfJung Apr 10, 2025
f243cb8
Implement RtlNtStatusToDosError and shim test for it
CraftSpider Apr 10, 2025
7284100
Merge pull request #4261 from CraftSpider/windows-rtl-to-dos
RalfJung Apr 10, 2025
49cc860
fix build fail on macos bacause of libffi-sys 2.3.0; This updates lib…
LorrensP-2158466 Apr 11, 2025
6788ce7
Remove proc_macro::SourceFile::is_real().
m-ou-se Apr 11, 2025
3962069
Replace proc_macro::SourceFile by Span::{file, local_file}.
m-ou-se Apr 11, 2025
52b204e
Merge pull request #4268 from LorrensP-2158466/update-libffi
saethlin Apr 11, 2025
5113f5e
Update rust-analyzer for new proc_macro span api.
m-ou-se Apr 11, 2025
c462002
Preparing for merge from rustc
Apr 12, 2025
352545f
Merge from rustc
Apr 12, 2025
59a3730
fmt
Apr 12, 2025
1f8cb69
Merge pull request #4270 from rust-lang/rustup-2025-04-12
oli-obk Apr 12, 2025
15a93c5
std/thread: Use default stack size from menuconfig for NuttX
no1wudi Apr 13, 2025
abce592
Use `Symbol` in `LateContext::get_associated_type`.
nnethercote Apr 11, 2025
ce2aa97
Move `has_self` field to `hir::AssocKind::Fn`.
nnethercote Apr 10, 2025
1ac3d6b
Let CStrings be either 1 or 2 byte aligned.
fneddy Apr 14, 2025
9c88eb6
normalize: prefer ParamEnv over AliasBound
lcnr Apr 14, 2025
1b46969
Specify `--print info=file` syntax in `--help`
clubby789 Apr 14, 2025
1f3199c
Disable some r-a tests in bootstrap.
m-ou-se Apr 14, 2025
758e99a
update lockfile
RalfJung Apr 14, 2025
4b63362
Use `newtype_index!`-generated types more idiomatically
yotamofek Apr 14, 2025
188d44d
Fix: Map EOPNOTSUPP to ErrorKind::Unsupported on Unix
0x79de Apr 14, 2025
cb22c1d
Allow (but don't require) `#[unsafe(naked)]` so that `compiler-builti…
folkertdev Apr 14, 2025
b26f3d4
Move `opt_rpitit_info` field to `hir::AssocKind::Type`.
nnethercote Apr 11, 2025
89e93a5
Move two methods from `AssocKind` to `AssocItem`.
nnethercote Apr 14, 2025
78599d8
Move `name` field from `AssocItem` to `AssocKind` variants.
nnethercote Apr 14, 2025
1376810
Basic tests of MPMC receiver cloning
glyn Apr 15, 2025
9b071ca
Rollup merge of #139669 - nnethercote:overhaul-AssocItem, r=oli-obk
Zalathar Apr 15, 2025
ea3b1d3
Rollup merge of #139671 - m-ou-se:proc-macro-span, r=dtolnay
Zalathar Apr 15, 2025
a56dbf1
Rollup merge of #139750 - no1wudi:fix, r=tgross35
Zalathar Apr 15, 2025
432f04b
Rollup merge of #139785 - fneddy:fix_test_cstring_merging_alignment, …
Zalathar Apr 15, 2025
312325b
Rollup merge of #139797 - folkertdev:naked-allow-unsafe, r=tgross35
Zalathar Apr 15, 2025
e065a00
Rollup merge of #139798 - lcnr:where-bounds-gt-alias-bound, r=compile…
Zalathar Apr 15, 2025
9551264
Rollup merge of #139799 - clubby789:print=file, r=jieyouxu
Zalathar Apr 15, 2025
813d67e
Rollup merge of #139811 - yotamofek:pr/newtype_cleanups, r=oli-obk
Zalathar Apr 15, 2025
2269731
Rollup merge of #139813 - RalfJung:miri-sync, r=RalfJung
Zalathar Apr 15, 2025
35fb2d3
Rollup merge of #139822 - 0x79de:fix-eopnotsupp-mapping, r=dtolnay
Zalathar Apr 15, 2025
55d9581
Rollup merge of #139836 - glyn:test-mpmc-receiver-cloning, r=jhpratt
Zalathar Apr 15, 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
8 changes: 4 additions & 4 deletions Cargo.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2038,19 +2038,19 @@ dependencies = [

[[package]]
name = "libffi"
version = "3.2.0"
version = "4.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ce826c243048e3d5cec441799724de52e2d42f820468431fc3fceee2341871e2"
checksum = "4a9434b6fc77375fb624698d5f8c49d7e80b10d59eb1219afda27d1f824d4074"
dependencies = [
"libc",
"libffi-sys",
]

[[package]]
name = "libffi-sys"
version = "2.3.0"
version = "3.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f36115160c57e8529781b4183c2bb51fdc1f6d6d1ed345591d84be7703befb3c"
checksum = "ead36a2496acfc8edd6cc32352110e9478ac5b9b5f5b9856ebd3d28019addb84"
dependencies = [
"cc",
]
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_ast_lowering/src/delegation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ impl<'hir> LoweringContext<'_, 'hir> {
.delegation_fn_sigs
.get(&local_def_id)
.is_some_and(|sig| sig.has_self),
None => self.tcx.associated_item(def_id).fn_has_self_parameter,
None => self.tcx.associated_item(def_id).is_method(),
},
_ => span_bug!(span, "unexpected DefKind for delegation item"),
}
Expand Down
3 changes: 1 addition & 2 deletions compiler/rustc_ast_lowering/src/path.rs
Original file line number Diff line number Diff line change
Expand Up @@ -448,8 +448,7 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {

generic_args.args.insert_many(
0,
(start.as_u32()..end.as_u32()).map(|i| {
let id = NodeId::from_u32(i);
(start..end).map(|id| {
let l = self.lower_lifetime_anon_in_path(id, elided_lifetime_span);
GenericArg::Lifetime(l)
}),
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_borrowck/src/diagnostics/conflict_errors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -647,7 +647,7 @@ impl<'infcx, 'tcx> MirBorrowckCtxt<'_, 'infcx, 'tcx> {
&& tc.polarity() == ty::PredicatePolarity::Positive
&& supertrait_def_ids(tcx, tc.def_id())
.flat_map(|trait_did| tcx.associated_items(trait_did).in_definition_order())
.any(|item| item.fn_has_self_parameter)
.any(|item| item.is_method())
})
}) {
return None;
Expand Down
3 changes: 1 addition & 2 deletions compiler/rustc_borrowck/src/region_infer/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -338,8 +338,7 @@ fn sccs_info<'tcx>(infcx: &BorrowckInferCtxt<'tcx>, sccs: &ConstraintSccs) {
let num_components = sccs.num_sccs();
let mut components = vec![FxIndexSet::default(); num_components];

for (reg_var_idx, scc_idx) in sccs.scc_indices().iter().enumerate() {
let reg_var = ty::RegionVid::from_usize(reg_var_idx);
for (reg_var, scc_idx) in sccs.scc_indices().iter_enumerated() {
let origin = var_to_origin.get(&reg_var).unwrap_or(&RegionCtxt::Unknown);
components[scc_idx.as_usize()].insert((reg_var, *origin));
}
Expand Down
4 changes: 2 additions & 2 deletions compiler/rustc_codegen_cranelift/src/main_shim.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use cranelift_frontend::{FunctionBuilder, FunctionBuilderContext};
use rustc_hir::LangItem;
use rustc_middle::ty::{AssocKind, GenericArg};
use rustc_middle::ty::{AssocTag, GenericArg};
use rustc_session::config::EntryFnType;
use rustc_span::{DUMMY_SP, Ident};

Expand Down Expand Up @@ -107,7 +107,7 @@ pub(crate) fn maybe_create_entry_wrapper(
.find_by_ident_and_kind(
tcx,
Ident::from_str("report"),
AssocKind::Fn,
AssocTag::Fn,
termination_trait,
)
.unwrap();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ use std::collections::hash_map::Entry;
use rustc_codegen_ssa::mir::debuginfo::{DebugScope, FunctionDebugContext};
use rustc_codegen_ssa::traits::*;
use rustc_data_structures::fx::FxHashMap;
use rustc_index::Idx;
use rustc_index::bit_set::DenseBitSet;
use rustc_middle::mir::{Body, SourceScope};
use rustc_middle::ty::layout::{FnAbiOf, HasTypingEnv};
Expand Down Expand Up @@ -43,8 +42,7 @@ pub(crate) fn compute_mir_scopes<'ll, 'tcx>(
let mut instantiated = DenseBitSet::new_empty(mir.source_scopes.len());
let mut discriminators = FxHashMap::default();
// Instantiate all scopes.
for idx in 0..mir.source_scopes.len() {
let scope = SourceScope::new(idx);
for scope in mir.source_scopes.indices() {
make_mir_scope(
cx,
instance,
Expand Down
51 changes: 24 additions & 27 deletions compiler/rustc_expand/src/proc_macro_server.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
use std::ops::{Bound, Range};
use std::sync::Arc;

use ast::token::IdentIsRaw;
use pm::bridge::{
Expand All @@ -18,7 +17,7 @@ use rustc_parse::parser::Parser;
use rustc_parse::{exp, new_parser_from_source_str, source_str_to_stream, unwrap_or_emit_fatal};
use rustc_session::parse::ParseSess;
use rustc_span::def_id::CrateNum;
use rustc_span::{BytePos, FileName, Pos, SourceFile, Span, Symbol, sym};
use rustc_span::{BytePos, FileName, Pos, Span, Symbol, sym};
use smallvec::{SmallVec, smallvec};

use crate::base::ExtCtxt;
Expand Down Expand Up @@ -458,7 +457,6 @@ impl<'a, 'b> Rustc<'a, 'b> {
impl server::Types for Rustc<'_, '_> {
type FreeFunctions = FreeFunctions;
type TokenStream = TokenStream;
type SourceFile = Arc<SourceFile>;
type Span = Span;
type Symbol = Symbol;
}
Expand Down Expand Up @@ -664,28 +662,6 @@ impl server::TokenStream for Rustc<'_, '_> {
}
}

impl server::SourceFile for Rustc<'_, '_> {
fn eq(&mut self, file1: &Self::SourceFile, file2: &Self::SourceFile) -> bool {
Arc::ptr_eq(file1, file2)
}

fn path(&mut self, file: &Self::SourceFile) -> String {
match &file.name {
FileName::Real(name) => name
.local_path()
.expect("attempting to get a file path in an imported file in `proc_macro::SourceFile::path`")
.to_str()
.expect("non-UTF8 file path in `proc_macro::SourceFile::path`")
.to_string(),
_ => file.name.prefer_local().to_string(),
}
}

fn is_real(&mut self, file: &Self::SourceFile) -> bool {
file.is_real_file()
}
}

impl server::Span for Rustc<'_, '_> {
fn debug(&mut self, span: Self::Span) -> String {
if self.ecx.ecfg.span_debug {
Expand All @@ -695,8 +671,29 @@ impl server::Span for Rustc<'_, '_> {
}
}

fn source_file(&mut self, span: Self::Span) -> Self::SourceFile {
self.psess().source_map().lookup_char_pos(span.lo()).file
fn file(&mut self, span: Self::Span) -> String {
self.psess()
.source_map()
.lookup_char_pos(span.lo())
.file
.name
.prefer_remapped_unconditionaly()
.to_string()
}

fn local_file(&mut self, span: Self::Span) -> Option<String> {
self.psess()
.source_map()
.lookup_char_pos(span.lo())
.file
.name
.clone()
.into_local_path()
.map(|p| {
p.to_str()
.expect("non-UTF8 file path in `proc_macro::SourceFile::path`")
.to_string()
})
}

fn parent(&mut self, span: Self::Span) -> Option<Self::Span> {
Expand Down
3 changes: 3 additions & 0 deletions compiler/rustc_fluent_macro/src/fluent.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,10 @@ fn invocation_relative_path_to_absolute(span: Span, path: &str) -> PathBuf {
path.to_path_buf()
} else {
// `/a/b/c/foo/bar.rs` contains the current macro invocation
#[cfg(bootstrap)]
let mut source_file_path = span.source_file().path();
#[cfg(not(bootstrap))]
let mut source_file_path = span.local_file().unwrap();
// `/a/b/c/foo/`
source_file_path.pop();
// `/a/b/c/foo/../locales/en-US/example.ftl`
Expand Down
9 changes: 3 additions & 6 deletions compiler/rustc_hir/src/definitions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,9 @@ impl DefPathTable {
debug_assert_eq!(self.stable_crate_id, def_path_hash.stable_crate_id());
let local_hash = def_path_hash.local_hash();

let index = {
let index = DefIndex::from(self.index_to_key.len());
debug!("DefPathTable::insert() - {:?} <-> {:?}", key, index);
self.index_to_key.push(key);
index
};
let index = self.index_to_key.push(key);
debug!("DefPathTable::insert() - {key:?} <-> {index:?}");

self.def_path_hashes.push(local_hash);
debug_assert!(self.def_path_hashes.len() == self.index_to_key.len());

Expand Down
12 changes: 6 additions & 6 deletions compiler/rustc_hir_analysis/src/check/check.rs
Original file line number Diff line number Diff line change
Expand Up @@ -443,13 +443,13 @@ fn best_definition_site_of_opaque<'tcx>(
let impl_def_id = tcx.local_parent(parent);
for assoc in tcx.associated_items(impl_def_id).in_definition_order() {
match assoc.kind {
ty::AssocKind::Const | ty::AssocKind::Fn => {
ty::AssocKind::Const { .. } | ty::AssocKind::Fn { .. } => {
if let ControlFlow::Break(span) = locator.check(assoc.def_id.expect_local())
{
return Some(span);
}
}
ty::AssocKind::Type => {}
ty::AssocKind::Type { .. } => {}
}
}

Expand Down Expand Up @@ -740,7 +740,7 @@ pub(crate) fn check_item_type(tcx: TyCtxt<'_>, def_id: LocalDefId) {

for &assoc_item in assoc_items.in_definition_order() {
match assoc_item.kind {
ty::AssocKind::Type if assoc_item.defaultness(tcx).has_value() => {
ty::AssocKind::Type { .. } if assoc_item.defaultness(tcx).has_value() => {
let trait_args = GenericArgs::identity_for_item(tcx, def_id);
let _: Result<_, rustc_errors::ErrorGuaranteed> = check_type_bounds(
tcx,
Expand Down Expand Up @@ -942,7 +942,7 @@ fn check_impl_items_against_trait<'tcx>(

if res.is_ok() {
match ty_impl_item.kind {
ty::AssocKind::Fn => {
ty::AssocKind::Fn { .. } => {
compare_impl_item::refine::check_refining_return_position_impl_trait_in_trait(
tcx,
ty_impl_item,
Expand All @@ -952,8 +952,8 @@ fn check_impl_items_against_trait<'tcx>(
.instantiate_identity(),
);
}
ty::AssocKind::Const => {}
ty::AssocKind::Type => {}
ty::AssocKind::Const { .. } => {}
ty::AssocKind::Type { .. } => {}
}
}

Expand Down
Loading
Loading