Skip to content

Rollup of 8 pull requests #120731

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 24 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
06a4168
Add unstable `-Z direct-access-external-data` cmdline flag for `rustc`
heiher Dec 14, 2023
f38489e
Enable `remove_storage_markers` MIR-opt test
JarlEvanson Jan 28, 2024
d1edc9d
Enable `simplify` MIR-opt test
JarlEvanson Jan 28, 2024
1031598
Enable `lifetimes` SROA MIR-opt test
JarlEvanson Jan 28, 2024
bae4f17
Enable `structs` SROA MIR-opt test
JarlEvanson Feb 4, 2024
8411eae
Assert that ParamTy and ParamConst have identical names for identical…
compiler-errors Feb 3, 2024
6c9a64f
Do not create param types that differ only by name when comparing int…
compiler-errors Feb 3, 2024
c80c836
Use correct param env when building and cleaning items in librustdoc
compiler-errors Feb 5, 2024
16cbdd0
Allow desugaring async fn in trait to compatible, concrete future types
compiler-errors Jan 18, 2024
e65abc0
Make the error message better
compiler-errors Jan 18, 2024
1a3214b
Make sure refinement still works
compiler-errors Jan 18, 2024
411967c
Zip together `place_ty` and `place_validity`
Nadrieril Jan 31, 2024
6cac1c4
Track `is_top_level` via `PlaceInfo`
Nadrieril Jan 31, 2024
a2ab48c
resolve: Unload speculatively resolved crates before freezing cstore
petrochenkov Jan 4, 2024
aef18c9
Mark "unused binding" suggestion as maybe incorrect
estebank Jan 29, 2024
14dda5f
Don't use bashism in checktools.sh
saethlin Feb 7, 2024
4e54eea
Rollup merge of #119162 - heiher:direct-access-external-data, r=petro…
matthiaskrgr Feb 7, 2024
0a8908b
Rollup merge of #119592 - petrochenkov:unload, r=compiler-errors
matthiaskrgr Feb 7, 2024
ce877d2
Rollup merge of #120103 - compiler-errors:concrete-afits, r=oli-obk
matthiaskrgr Feb 7, 2024
8bdae44
Rollup merge of #120455 - JarlEvanson:sroa-miri-tests, r=cjgillot
matthiaskrgr Feb 7, 2024
35c92ad
Rollup merge of #120470 - estebank:issue-54196, r=compiler-errors
matthiaskrgr Feb 7, 2024
5407d3b
Rollup merge of #120619 - compiler-errors:param, r=lcnr
matthiaskrgr Feb 7, 2024
18ff926
Rollup merge of #120633 - Nadrieril:place_info, r=compiler-errors
matthiaskrgr Feb 7, 2024
8924c26
Rollup merge of #120726 - saethlin:no-bashism, r=Mark-Simulacrum
matthiaskrgr Feb 7, 2024
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
Prev Previous commit
Next Next commit
Do not create param types that differ only by name when comparing int…
…rinsic signatures
  • Loading branch information
compiler-errors committed Feb 5, 2024
commit 6c9a64f19cef4f23bae2d92d630d91ceeeb8d93b
25 changes: 21 additions & 4 deletions compiler/rustc_hir_analysis/src/check/intrinsic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ use rustc_errors::{codes::*, struct_span_code_err, DiagnosticMessage};
use rustc_hir as hir;
use rustc_middle::traits::{ObligationCause, ObligationCauseCode};
use rustc_middle::ty::{self, Ty, TyCtxt};
use rustc_span::symbol::{kw, sym, Symbol};
use rustc_span::symbol::{kw, sym};
use rustc_target::spec::abi::Abi;

fn equate_intrinsic_type<'tcx>(
Expand Down Expand Up @@ -132,7 +132,17 @@ pub fn intrinsic_operation_unsafety(tcx: TyCtxt<'_>, intrinsic_id: DefId) -> hir
/// Remember to add all intrinsics here, in `compiler/rustc_codegen_llvm/src/intrinsic.rs`,
/// and in `library/core/src/intrinsics.rs`.
pub fn check_intrinsic_type(tcx: TyCtxt<'_>, it: &hir::ForeignItem<'_>) {
let param = |n| Ty::new_param(tcx, n, Symbol::intern(&format!("P{n}")));
let generics = tcx.generics_of(it.owner_id);
let param = |n| {
if let Some(&ty::GenericParamDef {
name, kind: ty::GenericParamDefKind::Type { .. }, ..
}) = generics.opt_param_at(n as usize, tcx)
{
Ty::new_param(tcx, n, name)
} else {
Ty::new_error_with_message(tcx, tcx.def_span(it.owner_id), "expected param")
}
};
let intrinsic_id = it.owner_id.to_def_id();
let intrinsic_name = tcx.item_name(intrinsic_id);
let name_str = intrinsic_name.as_str();
Expand Down Expand Up @@ -475,9 +485,16 @@ pub fn check_intrinsic_type(tcx: TyCtxt<'_>, it: &hir::ForeignItem<'_>) {

/// Type-check `extern "platform-intrinsic" { ... }` functions.
pub fn check_platform_intrinsic_type(tcx: TyCtxt<'_>, it: &hir::ForeignItem<'_>) {
let generics = tcx.generics_of(it.owner_id);
let param = |n| {
let name = Symbol::intern(&format!("P{n}"));
Ty::new_param(tcx, n, name)
if let Some(&ty::GenericParamDef {
name, kind: ty::GenericParamDefKind::Type { .. }, ..
}) = generics.opt_param_at(n as usize, tcx)
{
Ty::new_param(tcx, n, name)
} else {
Ty::new_error_with_message(tcx, tcx.def_span(it.owner_id), "expected param")
}
};

let name = it.ident.name;
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_middle/src/ty/relate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -438,7 +438,7 @@ pub fn structurally_relate_tys<'tcx, R: TypeRelation<'tcx>>(
(ty::Param(a_p), ty::Param(b_p)) if a_p.index == b_p.index => {
debug_assert_eq!(a_p.name, b_p.name, "param types with same index differ in name");
Ok(a)
},
}

(ty::Placeholder(p1), ty::Placeholder(p2)) if p1 == p2 => Ok(a),

Expand Down