Skip to content
Closed
Show file tree
Hide file tree
Changes from 2 commits
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
aef3d93
Add powerpc64-ibm-aix as Tier-3 target
ecnelises Aug 25, 2022
83701f5
Use ObligationCtxt intead of dyn TraitEngine
spastorino Nov 16, 2022
23422a8
Call fully_solve_obligations instead of repeating code
spastorino Nov 17, 2022
9864a63
Pass ObligationCtxt from enter_canonical_trait_query and use Obligati…
spastorino Nov 16, 2022
4e9ceef
Refactor `must_use` lint into two parts
Noratrieb Nov 13, 2022
644a5a3
enable fuzzy_provenance_casts lint in liballoc
RalfJung Nov 20, 2022
7f5addd
enable fuzzy_provenance_casts lint in libstd
RalfJung Nov 20, 2022
1a69666
dont attempt strict provenance in SGX
RalfJung Nov 21, 2022
2752e32
Allow opaque types in trait impl headers and rely on coherence to rej…
oli-obk Oct 24, 2022
94fe30f
Treat different opaque types of the same def id as equal during coher…
oli-obk Oct 27, 2022
ae80c76
Add an always-ambiguous predicate to make sure that we don't accident…
oli-obk Nov 2, 2022
9cd44f8
nit treat different opaque types
oli-obk Nov 14, 2022
9a8e1ee
Move a field around
oli-obk Nov 14, 2022
f42e490
Register obligations from type relation
oli-obk Nov 14, 2022
11ae334
Remove a function that doesn't actually do anything
oli-obk Nov 15, 2022
7301cd7
Type generalization should not look at opaque type in coherence
oli-obk Nov 17, 2022
11adf03
Add some more assertions for type relations not used during coherence
oli-obk Nov 17, 2022
c16a90f
Test generalization during coherence
oli-obk Nov 17, 2022
98cb7c8
Suggest `.clone()` or `ref binding` on E0382
estebank Nov 3, 2022
fface0c
Do not suggest `ref` multiple times for the same binding
estebank Nov 3, 2022
cca960d
Fix clippy code
estebank Nov 3, 2022
242dd83
Use `type_implements_trait`
estebank Nov 3, 2022
e88009b
Extract suggestion logic to its own method
estebank Nov 3, 2022
0994f8d
Remove logic duplication
estebank Nov 3, 2022
4918d4f
Tweak output in for loops
estebank Nov 3, 2022
33a6dc9
Fix wording
estebank Nov 3, 2022
6f77be4
Fix rustfmt
estebank Nov 3, 2022
a930d44
Tweak output to account for alternative bindings in the same pattern
estebank Nov 3, 2022
5bf1413
Fix rebase
estebank Nov 3, 2022
95a5beb
remove spurious commented out code
estebank Nov 4, 2022
2698d24
review comments: inline bindings and fix typo
estebank Nov 12, 2022
9a39012
Account for `x @ y` and suggest `ref x @ ref y`
estebank Nov 15, 2022
7cc4fb5
Account for closures
estebank Nov 16, 2022
3099dfd
Forbid inlining `thread_local!`'s `__getit` function on Windows
thomcc Sep 3, 2022
2d5d692
Add failing test for projections used as const generic
GuillaumeGomez Nov 22, 2022
04610ad
Fix `ClosureKind::to_def_id`
WaffleLapkin Nov 22, 2022
b80356a
Use `tcx.require_lang_item` instead of unwrapping
WaffleLapkin Nov 22, 2022
f2830f2
Speed up mpsc_stress test
Nov 22, 2022
90e8b94
Rollup merge of #101368 - thomcc:wintls-noinline, r=ChrisDenton
Manishearth Nov 22, 2022
ab6f755
Rollup merge of #102293 - ecnelises:aix.initial, r=davidtwco
Manishearth Nov 22, 2022
43eb708
Rollup merge of #103488 - oli-obk:impl_trait_for_tait, r=lcnr
Manishearth Nov 22, 2022
b3a2eea
Rollup merge of #103908 - estebank:consider-cloning, r=compiler-errors
Manishearth Nov 22, 2022
1e12a3a
Rollup merge of #104359 - Nilstrieb:plus-one, r=fee1-dead
Manishearth Nov 22, 2022
bbe1843
Rollup merge of #104509 - spastorino:use-obligation-ctxt, r=lcnr
Manishearth Nov 22, 2022
7c56974
Rollup merge of #104647 - RalfJung:alloc-strict-provenance, r=thomcc
Manishearth Nov 22, 2022
e105d05
Rollup merge of #104717 - GuillaumeGomez:test-projection-used-as-cons…
Manishearth Nov 22, 2022
60a07e1
Rollup merge of #104722 - mejrs:stress, r=ChrisDenton
Manishearth Nov 22, 2022
2078dbd
Rollup merge of #104724 - WaffleLapkin:to_def_idn't, r=compiler-errors
Manishearth Nov 22, 2022
0c626d4
Rollup merge of #104728 - WaffleLapkin:require-lang-items-politely, r…
Manishearth Nov 22, 2022
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
4 changes: 2 additions & 2 deletions compiler/rustc_borrowck/src/diagnostics/conflict_errors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use rustc_errors::{
};
use rustc_hir as hir;
use rustc_hir::intravisit::{walk_block, walk_expr, Visitor};
use rustc_hir::{AsyncGeneratorKind, GeneratorKind};
use rustc_hir::{AsyncGeneratorKind, GeneratorKind, LangItem};
use rustc_infer::infer::TyCtxtInferExt;
use rustc_infer::traits::ObligationCause;
use rustc_middle::mir::tcx::PlaceTy;
Expand Down Expand Up @@ -766,7 +766,7 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
else { return; };
// Try to find predicates on *generic params* that would allow copying `ty`
let infcx = tcx.infer_ctxt().build();
let copy_did = infcx.tcx.lang_items().copy_trait().unwrap();
let copy_did = infcx.tcx.require_lang_item(LangItem::Copy, Some(span));
let cause = ObligationCause::new(
span,
self.mir_hir_id(),
Expand Down
4 changes: 2 additions & 2 deletions compiler/rustc_const_eval/src/transform/check_consts/ops.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
//! Concrete error types for all operations which may be invalid in a certain const context.

use hir::def_id::LocalDefId;
use hir::ConstContext;
use hir::{ConstContext, LangItem};
use rustc_errors::{
error_code, struct_span_err, Applicability, DiagnosticBuilder, ErrorGuaranteed,
};
Expand Down Expand Up @@ -304,7 +304,7 @@ impl<'tcx> NonConstOp<'tcx> for FnCallNonConst<'tcx> {
err.span_note(deref_target, "deref defined here");
}

diag_trait(&mut err, self_ty, tcx.lang_items().deref_trait().unwrap());
diag_trait(&mut err, self_ty, tcx.require_lang_item(LangItem::Deref, Some(span)));
err
}
_ if tcx.opt_parent(callee) == tcx.get_diagnostic_item(sym::ArgumentV1Methods) => {
Expand Down
4 changes: 2 additions & 2 deletions compiler/rustc_const_eval/src/util/call_kind.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
//! context.

use rustc_hir::def_id::DefId;
use rustc_hir::lang_items;
use rustc_hir::{lang_items, LangItem};
use rustc_middle::ty::subst::SubstsRef;
use rustc_middle::ty::{self, AssocItemContainer, DefIdTree, Instance, ParamEnv, Ty, TyCtxt};
use rustc_span::symbol::Ident;
Expand All @@ -26,7 +26,7 @@ impl CallDesugaringKind {
match self {
Self::ForLoopIntoIter => tcx.get_diagnostic_item(sym::IntoIterator).unwrap(),
Self::QuestionBranch | Self::TryBlockFromOutput => {
tcx.lang_items().try_trait().unwrap()
tcx.require_lang_item(LangItem::Try, None)
}
Self::QuestionFromResidual => tcx.get_diagnostic_item(sym::FromResidual).unwrap(),
}
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_hir_analysis/src/coherence/builtin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ fn visit_implementation_of_copy(tcx: TyCtxt<'_>, impl_did: LocalDefId) {
traits::ObligationCause::dummy_with_span(field_ty_span),
param_env,
ty,
tcx.lang_items().copy_trait().unwrap(),
tcx.require_lang_item(LangItem::Copy, Some(span)),
) {
let error_predicate = error.obligation.predicate;
// Only note if it's not the root obligation, otherwise it's trivial and
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_hir_typeck/src/expr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1118,7 +1118,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
let lhs_deref_ty_is_sized = self
.infcx
.type_implements_trait(
self.tcx.lang_items().sized_trait().unwrap(),
self.tcx.require_lang_item(LangItem::Sized, None),
[lhs_deref_ty],
self.param_env,
)
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_middle/src/ty/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2293,7 +2293,7 @@ impl<'tcx> TyCtxt<'tcx> {
/// Given a `ty`, return whether it's an `impl Future<...>`.
pub fn ty_is_opaque_future(self, ty: Ty<'_>) -> bool {
let ty::Opaque(def_id, _) = ty.kind() else { return false };
let future_trait = self.lang_items().future_trait().unwrap();
let future_trait = self.require_lang_item(LangItem::Future, None);

self.explicit_item_bounds(def_id).iter().any(|(predicate, _)| {
let ty::PredicateKind::Trait(trait_predicate) = predicate.kind().skip_binder() else {
Expand Down
3 changes: 2 additions & 1 deletion compiler/rustc_middle/src/ty/print/pretty.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ use rustc_hir as hir;
use rustc_hir::def::{self, CtorKind, DefKind, Namespace};
use rustc_hir::def_id::{DefId, DefIdSet, CRATE_DEF_ID, LOCAL_CRATE};
use rustc_hir::definitions::{DefPathData, DefPathDataName, DisambiguatedDefPathData};
use rustc_hir::LangItem;
use rustc_session::config::TrimmedDefPaths;
use rustc_session::cstore::{ExternCrate, ExternCrateSource};
use rustc_session::Limit;
Expand Down Expand Up @@ -889,7 +890,7 @@ pub trait PrettyPrinter<'tcx>:
// Group the return ty with its def id, if we had one.
entry
.return_ty
.map(|ty| (tcx.lang_items().fn_once_output().unwrap(), ty)),
.map(|ty| (tcx.require_lang_item(LangItem::FnOnce, None), ty)),
);
}
if let Some(trait_ref) = entry.fn_mut_trait_ref {
Expand Down
3 changes: 2 additions & 1 deletion compiler/rustc_middle/src/ty/sty.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ use rustc_data_structures::captures::Captures;
use rustc_data_structures::intern::Interned;
use rustc_hir as hir;
use rustc_hir::def_id::DefId;
use rustc_hir::LangItem;
use rustc_index::vec::Idx;
use rustc_macros::HashStable;
use rustc_span::symbol::{kw, sym, Symbol};
Expand Down Expand Up @@ -2108,7 +2109,7 @@ impl<'tcx> Ty<'tcx> {

ty::Str | ty::Slice(_) => (tcx.types.usize, false),
ty::Dynamic(..) => {
let dyn_metadata = tcx.lang_items().dyn_metadata().unwrap();
let dyn_metadata = tcx.require_lang_item(LangItem::DynMetadata, None);
(tcx.bound_type_of(dyn_metadata).subst(tcx, &[tail.into()]), false)
},

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2625,7 +2625,7 @@ impl<'tcx> TypeErrCtxtExt<'tcx> for TypeErrCtxt<'_, 'tcx> {
}
};

let from_generator = tcx.lang_items().from_generator_fn().unwrap();
let from_generator = tcx.require_lang_item(LangItem::FromGenerator, None);

// Don't print the tuple of capture types
'print: {
Expand Down