Skip to content

Rollup of 8 pull requests #127278

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 34 commits into from
Jul 3, 2024
Merged
Changes from 1 commit
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
c54a2a5
Make mtime of reproducible tarball dependent on git commit
Kobzol Jun 27, 2024
e1999f9
Add support for mtime override to `generate` and `combine` rust-insta…
Kobzol Jun 29, 2024
61963fa
Avoid an ICE reachable through const eval shenanigans
oli-obk Jul 1, 2024
9d5da39
Revert some ICE avoiding logic that is not necessary anymore
oli-obk Jul 1, 2024
a5d3723
Prefer item-local tainting checks over global error count checks
oli-obk Jul 1, 2024
814bfe9
This check should now be unreachable
oli-obk Jul 1, 2024
1680b79
Simplify `CfgEval`.
nnethercote Jun 27, 2024
d6c0b81
Fix a typo in a comment.
nnethercote Jun 27, 2024
f852568
Change `AttrTokenStream::to_tokenstream` to `to_token_trees`.
nnethercote Jun 27, 2024
0cfd247
Rename `TokenStream::new` argument.
nnethercote Jun 27, 2024
7416c20
Just `push` in `AttrTokenStream::to_token_trees`.
nnethercote Jun 27, 2024
36c30a9
Fix comment.
nnethercote Jul 1, 2024
2342770
Flip an if/else in `AttrTokenStream::to_attr_token_stream`.
nnethercote Jul 1, 2024
8b5a7eb
Move things around in `collect_tokens_trailing_token`.
nnethercote Jul 1, 2024
f5b2896
Move more things around in `collect_tokens_trailing_token`.
nnethercote Jul 1, 2024
3d750e2
Shrink parser positions from `usize` to `u32`.
nnethercote Jul 2, 2024
6f60156
Rename `make_token_stream`.
nnethercote Jul 2, 2024
edeebe6
Import `std::{iter,mem}`.
nnethercote Jul 2, 2024
a21ba34
add TyCtxt::as_lang_item, use in new solver
compiler-errors Jun 30, 2024
5a83751
Make fn traits into first-class TraitSolverLangItems to avoid needing…
compiler-errors Jun 30, 2024
64a3bd8
Always preserve user-written comments in assembly
tgross35 Jun 21, 2024
c15a698
Rename the `asm-comments` compiler flag to `verbose-asm`
tgross35 Jun 21, 2024
1a6893e
Add documentation for -Zverbose-asm
tgross35 Jun 21, 2024
9e71c7b
Small `run-make-support` API improvements
GuillaumeGomez Jul 3, 2024
bcbcbff
bootstrap: pass correct struct size to winapi
klensy Jul 3, 2024
8b6435d
Add parse fail test using safe trait/impl trait
spastorino Jul 2, 2024
c74d620
Rollup merge of #126803 - tgross35:verbose-asm, r=Amanieu
matthiaskrgr Jul 3, 2024
444a0ff
Rollup merge of #127050 - Kobzol:reproducibility-git, r=onur-ozkan
matthiaskrgr Jul 3, 2024
02916a3
Rollup merge of #127145 - compiler-errors:as_lang_item, r=lcnr
matthiaskrgr Jul 3, 2024
9b05e7b
Rollup merge of #127202 - oli-obk:do_not_count_errors, r=wesleywiser
matthiaskrgr Jul 3, 2024
7fdb2f5
Rollup merge of #127233 - nnethercote:parser-cleanups, r=petrochenkov
matthiaskrgr Jul 3, 2024
ce991da
Rollup merge of #127248 - spastorino:unsafe-extern-tests, r=compiler-…
matthiaskrgr Jul 3, 2024
06fba4f
Rollup merge of #127264 - GuillaumeGomez:run-make-support-api-improve…
matthiaskrgr Jul 3, 2024
b212cd0
Rollup merge of #127270 - klensy:PROCESS_MEMORY_COUNTERS, r=Kobzol
matthiaskrgr Jul 3, 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
Make fn traits into first-class TraitSolverLangItems to avoid needing…
… fn_trait_kind_from_def_id
compiler-errors committed Jul 2, 2024
commit 5a837515f28eed106dd031b0243d6476eba58dd9
16 changes: 7 additions & 9 deletions compiler/rustc_middle/src/ty/context.rs
Original file line number Diff line number Diff line change
@@ -537,14 +537,6 @@ impl<'tcx> Interner for TyCtxt<'tcx> {
self.trait_def(trait_def_id).implement_via_object
}

fn fn_trait_kind_from_def_id(self, trait_def_id: DefId) -> Option<ty::ClosureKind> {
self.fn_trait_kind_from_def_id(trait_def_id)
}

fn async_fn_trait_kind_from_def_id(self, trait_def_id: DefId) -> Option<ty::ClosureKind> {
self.async_fn_trait_kind_from_def_id(trait_def_id)
}

fn supertrait_def_ids(self, trait_def_id: DefId) -> impl IntoIterator<Item = DefId> {
self.supertrait_def_ids(trait_def_id)
}
@@ -608,8 +600,11 @@ macro_rules! bidirectional_lang_item_map {
bidirectional_lang_item_map! {
// tidy-alphabetical-start
AsyncDestruct,
AsyncFn,
AsyncFnKindHelper,
AsyncFnKindUpvars,
AsyncFnMut,
AsyncFnOnce,
AsyncFnOnceOutput,
AsyncIterator,
CallOnceFuture,
@@ -622,11 +617,14 @@ bidirectional_lang_item_map! {
Destruct,
DiscriminantKind,
DynMetadata,
EffectsMaybe,
EffectsIntersection,
EffectsIntersectionOutput,
EffectsMaybe,
EffectsNoRuntime,
EffectsRuntime,
Fn,
FnMut,
FnOnce,
FnPtrTrait,
FusedIterator,
Future,
30 changes: 26 additions & 4 deletions compiler/rustc_next_trait_solver/src/solve/assembly/mod.rs
Original file line number Diff line number Diff line change
@@ -387,16 +387,38 @@ where
G::consider_auto_trait_candidate(self, goal)
} else if cx.trait_is_alias(trait_def_id) {
G::consider_trait_alias_candidate(self, goal)
} else if let Some(kind) = self.cx().fn_trait_kind_from_def_id(trait_def_id) {
G::consider_builtin_fn_trait_candidates(self, goal, kind)
} else if let Some(kind) = self.cx().async_fn_trait_kind_from_def_id(trait_def_id) {
G::consider_builtin_async_fn_trait_candidates(self, goal, kind)
} else {
match cx.as_lang_item(trait_def_id) {
Some(TraitSolverLangItem::Sized) => G::consider_builtin_sized_candidate(self, goal),
Some(TraitSolverLangItem::Copy | TraitSolverLangItem::Clone) => {
G::consider_builtin_copy_clone_candidate(self, goal)
}
Some(TraitSolverLangItem::Fn) => {
G::consider_builtin_fn_trait_candidates(self, goal, ty::ClosureKind::Fn)
}
Some(TraitSolverLangItem::FnMut) => {
G::consider_builtin_fn_trait_candidates(self, goal, ty::ClosureKind::FnMut)
}
Some(TraitSolverLangItem::FnOnce) => {
G::consider_builtin_fn_trait_candidates(self, goal, ty::ClosureKind::FnOnce)
}
Some(TraitSolverLangItem::AsyncFn) => {
G::consider_builtin_async_fn_trait_candidates(self, goal, ty::ClosureKind::Fn)
}
Some(TraitSolverLangItem::AsyncFnMut) => {
G::consider_builtin_async_fn_trait_candidates(
self,
goal,
ty::ClosureKind::FnMut,
)
}
Some(TraitSolverLangItem::AsyncFnOnce) => {
G::consider_builtin_async_fn_trait_candidates(
self,
goal,
ty::ClosureKind::FnOnce,
)
}
Some(TraitSolverLangItem::PointerLike) => {
G::consider_builtin_pointer_like_candidate(self, goal)
}
4 changes: 0 additions & 4 deletions compiler/rustc_type_ir/src/interner.rs
Original file line number Diff line number Diff line change
@@ -254,10 +254,6 @@ pub trait Interner:

fn trait_may_be_implemented_via_object(self, trait_def_id: Self::DefId) -> bool;

fn fn_trait_kind_from_def_id(self, trait_def_id: Self::DefId) -> Option<ty::ClosureKind>;

fn async_fn_trait_kind_from_def_id(self, trait_def_id: Self::DefId) -> Option<ty::ClosureKind>;

fn supertrait_def_ids(self, trait_def_id: Self::DefId)
-> impl IntoIterator<Item = Self::DefId>;

6 changes: 6 additions & 0 deletions compiler/rustc_type_ir/src/lang_items.rs
Original file line number Diff line number Diff line change
@@ -3,8 +3,11 @@
pub enum TraitSolverLangItem {
// tidy-alphabetical-start
AsyncDestruct,
AsyncFn,
AsyncFnKindHelper,
AsyncFnKindUpvars,
AsyncFnMut,
AsyncFnOnce,
AsyncFnOnceOutput,
AsyncIterator,
CallOnceFuture,
@@ -22,6 +25,9 @@ pub enum TraitSolverLangItem {
EffectsMaybe,
EffectsNoRuntime,
EffectsRuntime,
Fn,
FnMut,
FnOnce,
FnPtrTrait,
FusedIterator,
Future,