Skip to content
Merged
Changes from 1 commit
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
cfb7841
implement checks for tail calls
WaffleLapkin May 11, 2023
3208b86
use `expect(incomplete_feature)` instead of `allow` in tail call tests
WaffleLapkin Nov 29, 2024
d93ea6b
simplify things by using `tcx.fn_trait_kind_from_def_id`
WaffleLapkin Nov 29, 2024
ef5808a
add a fixme for tailcalls with opaque types
WaffleLapkin Nov 29, 2024
c6454dd
don't polymorphize without a reason to
WaffleLapkin Nov 29, 2024
144d6cc
simplify things using `tcx.as_lang_item`
WaffleLapkin Nov 29, 2024
b81391e
CI: use free runners for i686-gnu jobs
marcoieni Dec 3, 2024
7338710
Fix typo
Kobzol Dec 3, 2024
f676ed2
Fix copy-pasted tool name
Kobzol Dec 3, 2024
b24d608
Replace `black` with `ruff` for formatting Python code
Kobzol Dec 3, 2024
d5eb93b
Remove dependency on `black`
Kobzol Dec 3, 2024
7cc6f4d
CI: rfl: move job forward to Linux v6.13-rc1
ojeda Dec 3, 2024
0b737a1
Exclude additional subtrees in `ruff` config
Kobzol Dec 4, 2024
536516f
Reformat Python code with `ruff`
Kobzol Dec 4, 2024
62c7ce4
Avoid fetching the anon const hir node that is already available
oli-obk Dec 5, 2024
9aa4be0
Normalize target-cpus.rs stdout test for LLVM changes
TimNN Dec 5, 2024
8f0ea9a
Adapt codegen tests for NUW inference
TimNN Dec 5, 2024
fad5f51
Always display first line of impl blocks even when collapsed
GuillaumeGomez Oct 25, 2024
32e6826
Update browser-ui-test version to 0.18.2
GuillaumeGomez Oct 25, 2024
5d26acc
Add GUI test for impl block doc display
GuillaumeGomez Oct 25, 2024
abcd094
Update GUI tests
GuillaumeGomez Oct 25, 2024
6e0dabd
Turn `markdown_split_summary_and_content` into a method of `Markdown`
GuillaumeGomez Oct 28, 2024
448d9ad
Use text ellipsis instead of bottom blurring
GuillaumeGomez Oct 29, 2024
90feb9a
Improve positioning of "..." in collapsed impl block
GuillaumeGomez Nov 19, 2024
854ebe7
Update GUI test after rebase
GuillaumeGomez Dec 2, 2024
a424813
Rollup merge of #132155 - GuillaumeGomez:impl-block-doc, r=rustdoc
GuillaumeGomez Dec 5, 2024
7416c33
Rollup merge of #133256 - MarcoIeni:use-linux-free-runners, r=Kobzol
GuillaumeGomez Dec 5, 2024
e941e73
Rollup merge of #133607 - WaffleLapkin:tail-call-checks, r=compiler-e…
GuillaumeGomez Dec 5, 2024
5a9c9ef
Rollup merge of #133821 - Kobzol:replace-black-with-ruff, r=onur-ozkan
GuillaumeGomez Dec 5, 2024
9765a4e
Rollup merge of #133827 - ojeda:ci-rfl, r=lqd
GuillaumeGomez Dec 5, 2024
e82ee96
Rollup merge of #133910 - TimNN:llvm-target-cpus, r=jieyouxu
GuillaumeGomez Dec 5, 2024
beb9b24
Rollup merge of #133921 - TimNN:nuw-infer, r=nikic
GuillaumeGomez Dec 5, 2024
5dc05a8
Rollup merge of #133936 - oli-obk:push-qmvqsmwqrtqr, r=lqd
GuillaumeGomez Dec 5, 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
simplify things using tcx.as_lang_item
  • Loading branch information
WaffleLapkin committed Nov 29, 2024
commit 144d6cc65ba5d3ebdf1e20cc1a27bd3964402921
52 changes: 25 additions & 27 deletions compiler/rustc_mir_build/src/check_tail_calls.rs
Original file line number Diff line number Diff line change
Expand Up @@ -354,33 +354,31 @@ impl<'a, 'tcx> Visitor<'a, 'tcx> for TailCallCkVisitor<'a, 'tcx> {
}

fn op_trait_as_method_name(tcx: TyCtxt<'_>, trait_did: DefId) -> Option<&'static str> {
let trait_did = Some(trait_did);
let items = tcx.lang_items();
let m = match () {
_ if trait_did == items.get(LangItem::Add) => "add",
_ if trait_did == items.get(LangItem::Sub) => "sub",
_ if trait_did == items.get(LangItem::Mul) => "mul",
_ if trait_did == items.get(LangItem::Div) => "div",
_ if trait_did == items.get(LangItem::Rem) => "rem",
_ if trait_did == items.get(LangItem::Neg) => "neg",
_ if trait_did == items.get(LangItem::Not) => "not",
_ if trait_did == items.get(LangItem::BitXor) => "bitxor",
_ if trait_did == items.get(LangItem::BitAnd) => "bitand",
_ if trait_did == items.get(LangItem::BitOr) => "bitor",
_ if trait_did == items.get(LangItem::Shl) => "shl",
_ if trait_did == items.get(LangItem::Shr) => "shr",
_ if trait_did == items.get(LangItem::AddAssign) => "add_assign",
_ if trait_did == items.get(LangItem::SubAssign) => "sub_assign",
_ if trait_did == items.get(LangItem::MulAssign) => "mul_assign",
_ if trait_did == items.get(LangItem::DivAssign) => "div_assign",
_ if trait_did == items.get(LangItem::RemAssign) => "rem_assign",
_ if trait_did == items.get(LangItem::BitXorAssign) => "bitxor_assign",
_ if trait_did == items.get(LangItem::BitAndAssign) => "bitand_assign",
_ if trait_did == items.get(LangItem::BitOrAssign) => "bitor_assign",
_ if trait_did == items.get(LangItem::ShlAssign) => "shl_assign",
_ if trait_did == items.get(LangItem::ShrAssign) => "shr_assign",
_ if trait_did == items.get(LangItem::Index) => "index",
_ if trait_did == items.get(LangItem::IndexMut) => "index_mut",
let m = match tcx.as_lang_item(trait_did)? {
LangItem::Add => "add",
LangItem::Sub => "sub",
LangItem::Mul => "mul",
LangItem::Div => "div",
LangItem::Rem => "rem",
LangItem::Neg => "neg",
LangItem::Not => "not",
LangItem::BitXor => "bitxor",
LangItem::BitAnd => "bitand",
LangItem::BitOr => "bitor",
LangItem::Shl => "shl",
LangItem::Shr => "shr",
LangItem::AddAssign => "add_assign",
LangItem::SubAssign => "sub_assign",
LangItem::MulAssign => "mul_assign",
LangItem::DivAssign => "div_assign",
LangItem::RemAssign => "rem_assign",
LangItem::BitXorAssign => "bitxor_assign",
LangItem::BitAndAssign => "bitand_assign",
LangItem::BitOrAssign => "bitor_assign",
LangItem::ShlAssign => "shl_assign",
LangItem::ShrAssign => "shr_assign",
LangItem::Index => "index",
LangItem::IndexMut => "index_mut",
_ => return None,
};

Expand Down
Loading