Skip to content
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

Rollup of 9 pull requests #109465

Closed
wants to merge 25 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
bdefcf5
Recognize AIX style archive kind
ecnelises Jan 11, 2023
ee0513c
Bump version of object and related crates
ecnelises Feb 1, 2023
27e9ee9
move Option::as_slice to intrinsic
llogiq Mar 15, 2023
2ec7f6c
refactor `fn bootstrap::builder::Builder::compiler_for`
onur-ozkan Mar 18, 2023
c9ddb73
refactor: refactor identifier parsing somewhat
Ezrashaw Mar 17, 2023
b4e17a5
refactor: improve "ident starts with number" error
Ezrashaw Mar 17, 2023
05b5046
feat: implement error recovery in `expected_ident_found`
Ezrashaw Mar 17, 2023
e4a4064
adapt tests/codegen/vec-shrink-panik for LLVM 17
krasimirgg Mar 20, 2023
12c1385
Update browser-ui-test version to 0.14.5
GuillaumeGomez Mar 20, 2023
ab1573a
Add GUI test for "Auto-hide item contents for large items" setting
GuillaumeGomez Mar 20, 2023
47f24a8
new solver cleanup + coherence
lcnr Mar 21, 2023
938434a
enable `intercrate` in the solver `InferCtxt`
lcnr Mar 21, 2023
a7ec045
disable global caching during coherence
lcnr Mar 21, 2023
f86b035
woops
lcnr Mar 21, 2023
7571808
Ignore the vendor directory for tidy tests.
jfgoog Mar 21, 2023
293f21c
iat selection: erase regions in self type
fmease Mar 21, 2023
e72ad51
Rollup merge of #106704 - ecnelises:big_archive, r=workingjubilee
matthiaskrgr Mar 21, 2023
98bc283
Rollup merge of #109179 - llogiq:intrinsically-option-as-slice, r=eholk
matthiaskrgr Mar 21, 2023
7ce2aab
Rollup merge of #109203 - Ezrashaw:refactor-ident-parsing, r=Nilstrieb
matthiaskrgr Mar 21, 2023
69d989b
Rollup merge of #109295 - ozkanonur:issue-109286, r=ozkanonur
matthiaskrgr Mar 21, 2023
0710ccb
Rollup merge of #109394 - krasimirgg:llvm-17-vec-panic, r=nikic
matthiaskrgr Mar 21, 2023
ad2ced5
Rollup merge of #109412 - GuillaumeGomez:add-gui-test, r=notriddle
matthiaskrgr Mar 21, 2023
689f694
Rollup merge of #109423 - fmease:iat-selection-erase-regions-in-self-…
matthiaskrgr Mar 21, 2023
1ead586
Rollup merge of #109447 - lcnr:coherence, r=compiler-errors
matthiaskrgr Mar 21, 2023
e3f31bc
Rollup merge of #109452 - jfgoog:ignore-vendor, r=ozkanonur
matthiaskrgr Mar 21, 2023
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
69 changes: 33 additions & 36 deletions Cargo.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ version = 3

[[package]]
name = "addr2line"
version = "0.17.0"
version = "0.19.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b9ecd88a8c8378ca913a680cd98f0f13ac67383d35993f86c90a70e3f137816b"
checksum = "a76fd60b23679b7d19bd066031410fb7e458ccc5e958eb5c325888ce4baedc97"
dependencies = [
"compiler_builtins",
"gimli",
"gimli 0.27.2",
"rustc-std-workspace-alloc",
"rustc-std-workspace-core",
]
Expand Down Expand Up @@ -106,11 +106,11 @@ checksum = "98161a4e3e2184da77bb14f02184cdd111e83bbbcc9979dfee3c44b9a85f5602"

[[package]]
name = "ar_archive_writer"
version = "0.1.1"
version = "0.1.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "276881980556fdadeb88aa1ffc667e4d2e8fe72531dfabcb7a82bb3c9ea9ba31"
checksum = "c2c584cce02ebcebfa2cf43e413e13dcb339bc17f7146be01fbd8d69d298c49c"
dependencies = [
"object 0.29.0",
"object",
]

[[package]]
Expand Down Expand Up @@ -188,16 +188,16 @@ checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa"

[[package]]
name = "backtrace"
version = "0.3.66"
version = "0.3.67"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "cab84319d616cfb654d03394f38ab7e6f0919e181b1b57e1fd15e7fb4077d9a7"
checksum = "233d376d6d185f2a3093e58f283f60f880315b6c60075b01f36b3b85154564ca"
dependencies = [
"addr2line",
"cc",
"cfg-if",
"libc",
"miniz_oxide",
"object 0.29.0",
"object",
"rustc-demangle",
]

Expand Down Expand Up @@ -1519,13 +1519,11 @@ checksum = "37ab347416e802de484e4d03c7316c48f1ecb56574dfd4a46a80f173ce1de04d"

[[package]]
name = "flate2"
version = "1.0.23"
version = "1.0.25"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b39522e96686d38f4bc984b9198e3a0613264abaebaff2c5c918bfa6b6da09af"
checksum = "a8a2db397cb1c8772f31494cb8917e48cd1e64f0fa7efac59fbd741a0a8ce841"
dependencies = [
"cfg-if",
"crc32fast",
"libc",
"libz-sys",
"miniz_oxide",
]
Expand Down Expand Up @@ -1775,12 +1773,20 @@ version = "0.26.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "22030e2c5a68ec659fde1e949a745124b48e6fa8b045b7ed5bd1fe4ccc5c4e5d"
dependencies = [
"compiler_builtins",
"fallible-iterator",
"indexmap",
"stable_deref_trait",
]

[[package]]
name = "gimli"
version = "0.27.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ad0a93d233ebf96623465aad4046a8d3aa4da22d4f4beba5388838c8a434bbb4"
dependencies = [
"compiler_builtins",
"rustc-std-workspace-alloc",
"rustc-std-workspace-core",
"stable_deref_trait",
]

[[package]]
Expand Down Expand Up @@ -2961,9 +2967,9 @@ dependencies = [

[[package]]
name = "libz-sys"
version = "1.1.3"
version = "1.1.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "de5435b8549c16d423ed0c03dbaafe57cf6c3344744f1242520d59c9d8ecec66"
checksum = "9702761c3935f8cc2f101793272e202c72b99da8f4224a19ddcf1279a6450bbf"
dependencies = [
"cc",
"libc",
Expand Down Expand Up @@ -3223,9 +3229,9 @@ checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a"

[[package]]
name = "miniz_oxide"
version = "0.5.3"
version = "0.6.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6f5c75688da582b8ffc1f1799e9db273f32133c49e048f614d22ec3256773ccc"
checksum = "b275950c28b37e794e8c55d88aeb5e139d0ce23fdbbeda68f8d7174abdf9e8fa"
dependencies = [
"adler",
"compiler_builtins",
Expand Down Expand Up @@ -3361,29 +3367,20 @@ dependencies = [
"libc",
]

[[package]]
name = "object"
version = "0.29.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "21158b2c33aa6d4561f1c0a6ea283ca92bc54802a93b263e910746d679a7eb53"
dependencies = [
"compiler_builtins",
"memchr",
"rustc-std-workspace-alloc",
"rustc-std-workspace-core",
]

[[package]]
name = "object"
version = "0.30.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8d864c91689fdc196779b98dba0aceac6118594c2df6ee5d943eb6a8df4d107a"
dependencies = [
"compiler_builtins",
"crc32fast",
"flate2",
"hashbrown 0.13.1",
"indexmap",
"memchr",
"rustc-std-workspace-alloc",
"rustc-std-workspace-core",
]

[[package]]
Expand Down Expand Up @@ -4411,7 +4408,7 @@ dependencies = [
"cstr",
"libc",
"measureme",
"object 0.30.1",
"object",
"rustc-demangle",
"rustc_ast",
"rustc_attr",
Expand Down Expand Up @@ -4447,7 +4444,7 @@ dependencies = [
"itertools",
"jobserver",
"libc",
"object 0.30.1",
"object",
"pathdiff",
"regex",
"rustc_arena",
Expand Down Expand Up @@ -5943,7 +5940,7 @@ dependencies = [
"hermit-abi 0.3.0",
"libc",
"miniz_oxide",
"object 0.29.0",
"object",
"panic_abort",
"panic_unwind",
"profiler_builtins",
Expand Down Expand Up @@ -6194,9 +6191,9 @@ version = "0.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "da8fbf660a019b6bf11ea95762041464aa9099cc293b6a66d77cea5107619671"
dependencies = [
"gimli",
"gimli 0.26.2",
"hashbrown 0.12.3",
"object 0.30.1",
"object",
"tracing",
]

Expand Down
1 change: 1 addition & 0 deletions compiler/rustc_codegen_llvm/src/llvm/ffi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -552,6 +552,7 @@ pub enum ArchiveKind {
K_BSD,
K_DARWIN,
K_COFF,
K_AIXBIG,
}

// LLVMRustThinLTOData
Expand Down
1 change: 1 addition & 0 deletions compiler/rustc_codegen_llvm/src/llvm/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@ impl FromStr for ArchiveKind {
"bsd" => Ok(ArchiveKind::K_BSD),
"darwin" => Ok(ArchiveKind::K_DARWIN),
"coff" => Ok(ArchiveKind::K_COFF),
"aix_big" => Ok(ArchiveKind::K_AIXBIG),
_ => Err(()),
}
}
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_codegen_ssa/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ edition = "2021"
test = false

[dependencies]
ar_archive_writer = "0.1.1"
ar_archive_writer = "0.1.2"
bitflags = "1.2.1"
cc = "1.0.69"
itertools = "0.10.1"
Expand Down
1 change: 1 addition & 0 deletions compiler/rustc_codegen_ssa/src/back/archive.rs
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,7 @@ impl<'a> ArArchiveBuilder<'a> {
"bsd" => ArchiveKind::Bsd,
"darwin" => ArchiveKind::Darwin,
"coff" => ArchiveKind::Coff,
"aix_big" => ArchiveKind::AixBig,
kind => {
self.sess.emit_fatal(UnknownArchiveKind { kind });
}
Expand Down
1 change: 1 addition & 0 deletions compiler/rustc_hir/src/lang_items.rs
Original file line number Diff line number Diff line change
Expand Up @@ -301,6 +301,7 @@ language_item_table! {
Context, sym::Context, context, Target::Struct, GenericRequirement::None;
FuturePoll, sym::poll, future_poll_fn, Target::Method(MethodKind::Trait { body: false }), GenericRequirement::None;

Option, sym::Option, option_type, Target::Enum, GenericRequirement::None;
OptionSome, sym::Some, option_some_variant, Target::Variant, GenericRequirement::None;
OptionNone, sym::None, option_none_variant, Target::Variant, GenericRequirement::None;

Expand Down
82 changes: 51 additions & 31 deletions compiler/rustc_hir_analysis/src/astconv/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ use rustc_infer::infer::{InferCtxt, TyCtxtInferExt};
use rustc_infer::traits::ObligationCause;
use rustc_middle::infer::unify_key::{ConstVariableOrigin, ConstVariableOriginKind};
use rustc_middle::middle::stability::AllowUnstable;
use rustc_middle::ty::fold::FnMutDelegate;
use rustc_middle::ty::subst::{self, GenericArgKind, InternalSubsts, SubstsRef};
use rustc_middle::ty::DynKind;
use rustc_middle::ty::GenericParamDefKind;
Expand Down Expand Up @@ -2225,47 +2226,66 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {

let param_env = tcx.param_env(block.owner.to_def_id());
let cause = ObligationCause::misc(span, block.owner.def_id);

let mut fulfillment_errors = Vec::new();
let mut applicable_candidates: Vec<_> = candidates
.iter()
.filter_map(|&(impl_, (assoc_item, def_scope))| {
infcx.probe(|_| {
let ocx = ObligationCtxt::new_in_snapshot(&infcx);
let mut applicable_candidates: Vec<_> = infcx.probe(|_| {
let universe = infcx.create_next_universe();

// Regions are not considered during selection.
let self_ty = tcx.replace_escaping_bound_vars_uncached(
self_ty,
FnMutDelegate {
regions: &mut |_| tcx.lifetimes.re_erased,
types: &mut |bv| {
tcx.mk_placeholder(ty::PlaceholderType { universe, name: bv.kind })
},
consts: &mut |bv, ty| {
tcx.mk_const(ty::PlaceholderConst { universe, name: bv }, ty)
},
},
);

let impl_ty = tcx.type_of(impl_);
let impl_substs = infcx.fresh_item_substs(impl_);
let impl_ty = impl_ty.subst(tcx, impl_substs);
let impl_ty = ocx.normalize(&cause, param_env, impl_ty);
candidates
.iter()
.filter_map(|&(impl_, (assoc_item, def_scope))| {
infcx.probe(|_| {
let ocx = ObligationCtxt::new_in_snapshot(&infcx);

// Check that the Self-types can be related.
// FIXME(fmease): Should we use `eq` here?
ocx.sup(&ObligationCause::dummy(), param_env, impl_ty, self_ty).ok()?;
let impl_ty = tcx.type_of(impl_);
let impl_substs = infcx.fresh_item_substs(impl_);
let impl_ty = impl_ty.subst(tcx, impl_substs);
let impl_ty = ocx.normalize(&cause, param_env, impl_ty);

// Check whether the impl imposes obligations we have to worry about.
let impl_bounds = tcx.predicates_of(impl_);
let impl_bounds = impl_bounds.instantiate(tcx, impl_substs);
// Check that the Self-types can be related.
// FIXME(fmease): Should we use `eq` here?
ocx.sup(&ObligationCause::dummy(), param_env, impl_ty, self_ty).ok()?;

let impl_bounds = ocx.normalize(&cause, param_env, impl_bounds);
// Check whether the impl imposes obligations we have to worry about.
let impl_bounds = tcx.predicates_of(impl_);
let impl_bounds = impl_bounds.instantiate(tcx, impl_substs);

let impl_obligations = traits::predicates_for_generics(
|_, _| cause.clone(),
param_env,
impl_bounds,
);
let impl_bounds = ocx.normalize(&cause, param_env, impl_bounds);

ocx.register_obligations(impl_obligations);
let impl_obligations = traits::predicates_for_generics(
|_, _| cause.clone(),
param_env,
impl_bounds,
);

let mut errors = ocx.select_where_possible();
if !errors.is_empty() {
fulfillment_errors.append(&mut errors);
return None;
}
ocx.register_obligations(impl_obligations);

let mut errors = ocx.select_where_possible();
if !errors.is_empty() {
fulfillment_errors.append(&mut errors);
return None;
}

// FIXME(fmease): Unsolved vars can escape this InferCtxt snapshot.
Some((assoc_item, def_scope, infcx.resolve_vars_if_possible(impl_substs)))
// FIXME(fmease): Unsolved vars can escape this InferCtxt snapshot.
Some((assoc_item, def_scope, infcx.resolve_vars_if_possible(impl_substs)))
})
})
})
.collect();
.collect()
});

if applicable_candidates.len() > 1 {
return Err(self.complain_about_ambiguous_inherent_assoc_type(
Expand Down
15 changes: 15 additions & 0 deletions compiler/rustc_hir_analysis/src/check/intrinsic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,21 @@ pub fn check_intrinsic_type(tcx: TyCtxt<'_>, it: &hir::ForeignItem<'_>) {
],
tcx.mk_ptr(ty::TypeAndMut { ty: param(0), mutbl: hir::Mutability::Not }),
),
sym::option_payload_ptr => {
let option_def_id = tcx.require_lang_item(hir::LangItem::Option, None);
let p0 = param(0);
(
1,
vec![tcx.mk_ptr(ty::TypeAndMut {
ty: tcx.mk_adt(
tcx.adt_def(option_def_id),
tcx.mk_substs_from_iter([ty::GenericArg::from(p0)].into_iter()),
),
mutbl: hir::Mutability::Not,
})],
tcx.mk_ptr(ty::TypeAndMut { ty: p0, mutbl: hir::Mutability::Not }),
)
}
sym::ptr_mask => (
1,
vec![
Expand Down
4 changes: 2 additions & 2 deletions compiler/rustc_infer/src/infer/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -585,8 +585,8 @@ impl<'tcx> InferCtxtBuilder<'tcx> {
self
}

pub fn intercrate(mut self) -> Self {
self.intercrate = true;
pub fn intercrate(mut self, intercrate: bool) -> Self {
self.intercrate = intercrate;
self
}

Expand Down
3 changes: 3 additions & 0 deletions compiler/rustc_llvm/llvm-wrapper/ArchiveWrapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ enum class LLVMRustArchiveKind {
BSD,
DARWIN,
COFF,
AIX_BIG,
};

static Archive::Kind fromRust(LLVMRustArchiveKind Kind) {
Expand All @@ -51,6 +52,8 @@ static Archive::Kind fromRust(LLVMRustArchiveKind Kind) {
return Archive::K_DARWIN;
case LLVMRustArchiveKind::COFF:
return Archive::K_COFF;
case LLVMRustArchiveKind::AIX_BIG:
return Archive::K_AIXBIG;
default:
report_fatal_error("Bad ArchiveKind.");
}
Expand Down
Loading