Skip to content
Closed
Show file tree
Hide file tree
Changes from 2 commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
870f848
Add support for trait associated items
GuillaumeGomez Jan 20, 2025
ef39e42
Better handling of paths in link to def feature
GuillaumeGomez Jan 26, 2025
9457a32
Update to last rustc_hir Visitor changes
GuillaumeGomez Jan 26, 2025
687ac3f
Fix panic if an item does not have a body
GuillaumeGomez May 4, 2025
45231fa
[rustdoc] Display unsafe attrs with edition 2024 `unsafe()` wrappers.
obi1kenobi Jul 23, 2025
5ae2d42
get rid of some false negatives in rustdoc::broken_intra_doc_links
lolbinarycat Nov 7, 2024
87d7d80
adjust more unit tests to reflect more aggressive intra-doc linting
lolbinarycat Nov 8, 2024
a7da4b8
rustdoc::broken_intra_doc_links: no backticks = use old behavior
lolbinarycat Apr 18, 2025
0413481
rustdoc: update tests to match new lint behavior
lolbinarycat Apr 18, 2025
6a7d488
rustdoc::broken_intra_doc_links: only be lenient with shortcut links
lolbinarycat Apr 19, 2025
bd85df1
move bad-intra-doc test into intra-doc dir
lolbinarycat Apr 19, 2025
a73d7e3
fix up issues with internal compiler docs revealed by stricter lint
lolbinarycat Jul 24, 2025
0e53d85
Fortify RemoveUnneededDrops test.
cjgillot Jun 16, 2025
ee0118f
[test][AIX] ignore extern_weak linkage test
daltenty Jul 30, 2025
38d5f43
Correctly handle `--no-run` rustdoc test option
GuillaumeGomez Jul 13, 2025
234b8ac
Correctly handle `should_panic` doctest attribute
GuillaumeGomez Jul 7, 2025
631ade8
Add regression test for #143009
GuillaumeGomez Jul 4, 2025
3f7b989
Update std doctests
GuillaumeGomez Jul 7, 2025
c365e6e
Add regression test for #143858
GuillaumeGomez Jul 13, 2025
5aec437
detect infinite recursion with tail calls in ctfe
WaffleLapkin Jul 31, 2025
040f71e
loop match: error on `#[const_continue]` outside `#[loop_match]`
folkertdev Jul 25, 2025
f909918
Add human readable name "Cygwin"
Berrysoft Aug 1, 2025
dbf52ba
Remove the omit_gdb_pretty_printer_section attribute
bjorn3 Jul 31, 2025
61c5343
Add FIXME comments to use `test::ERROR_EXIT_CODE` once public and fix…
GuillaumeGomez Aug 1, 2025
dd9eb3d
Rollup merge of #132748 - lolbinarycat:rustdoc-intra-doc-link-warn-mo…
GuillaumeGomez Aug 1, 2025
5fe6fa4
Rollup merge of #135771 - GuillaumeGomez:jump-to-def-perf, r=fmease
GuillaumeGomez Aug 1, 2025
5b47d0e
Rollup merge of #143360 - folkertdev:const-continue-outside-loop-matc…
GuillaumeGomez Aug 1, 2025
7262030
Rollup merge of #143662 - obi1kenobi:pg/unsafe-attribute-wrappers, r=…
GuillaumeGomez Aug 1, 2025
08058ee
Rollup merge of #143900 - GuillaumeGomez:fix-no-run, r=lolbinarycat,f…
GuillaumeGomez Aug 1, 2025
9d5bd91
Rollup merge of #144614 - cjgillot:fortify-unneeded, r=scottmcm
GuillaumeGomez Aug 1, 2025
7250ce7
Rollup merge of #144703 - daltenty:daltenty/extern-weak, r=Noratrieb
GuillaumeGomez Aug 1, 2025
1888740
Rollup merge of #144738 - bjorn3:remove_omit_gdb_pretty_printer_secti…
GuillaumeGomez Aug 1, 2025
939dee5
Rollup merge of #144756 - WaffleLapkin:inf-rec-etc-ctfe, r=lqd
GuillaumeGomez Aug 1, 2025
55bffb4
Rollup merge of #144766 - Berrysoft:patch-1, r=GuillaumeGomez
GuillaumeGomez Aug 1, 2025
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
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
- // MIR for `cannot_opt_generic` before RemoveUnneededDrops
+ // MIR for `cannot_opt_generic` after RemoveUnneededDrops

fn cannot_opt_generic(_1: T) -> () {
let mut _0: ();

bb0: {
drop(_1) -> [return: bb1, unwind unreachable];
}

bb1: {
return;
}
}

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
- // MIR for `dont_opt` before RemoveUnneededDrops
+ // MIR for `dont_opt` after RemoveUnneededDrops

fn dont_opt(_1: Vec<bool>) -> () {
let mut _0: ();

bb0: {
drop(_1) -> [return: bb1, unwind unreachable];
}

bb1: {
return;
}
}

This file was deleted.

This file was deleted.

15 changes: 15 additions & 0 deletions tests/mir-opt/remove_unneeded_drops.opt.RemoveUnneededDrops.diff
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
- // MIR for `opt` before RemoveUnneededDrops
+ // MIR for `opt` after RemoveUnneededDrops

fn opt(_1: bool) -> () {
let mut _0: ();

bb0: {
- drop(_1) -> [return: bb1, unwind unreachable];
- }
-
- bb1: {
return;
}
}

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
- // MIR for `opt_generic_copy` before RemoveUnneededDrops
+ // MIR for `opt_generic_copy` after RemoveUnneededDrops

fn opt_generic_copy(_1: T) -> () {
let mut _0: ();

bb0: {
- drop(_1) -> [return: bb1, unwind unreachable];
- }
-
- bb1: {
return;
}
}

This file was deleted.

This file was deleted.

40 changes: 34 additions & 6 deletions tests/mir-opt/remove_unneeded_drops.rs
Original file line number Diff line number Diff line change
@@ -1,28 +1,56 @@
// skip-filecheck
// EMIT_MIR_FOR_EACH_PANIC_STRATEGY
//@ test-mir-pass: RemoveUnneededDrops

#![feature(custom_mir, core_intrinsics)]
use std::intrinsics::mir::*;

// EMIT_MIR remove_unneeded_drops.opt.RemoveUnneededDrops.diff
#[custom_mir(dialect = "runtime")]
fn opt(x: bool) {
drop(x);
// CHECK-LABEL: fn opt(
// CHECK-NOT: drop(
mir! {
{ Drop(x, ReturnTo(bb1), UnwindUnreachable()) }
bb1 = { Return() }
}
}

// EMIT_MIR remove_unneeded_drops.dont_opt.RemoveUnneededDrops.diff
#[custom_mir(dialect = "runtime")]
fn dont_opt(x: Vec<bool>) {
drop(x);
// CHECK-LABEL: fn dont_opt(
// CHECK: drop(
mir! {
{ Drop(x, ReturnTo(bb1), UnwindUnreachable()) }
bb1 = { Return() }
}
}

// EMIT_MIR remove_unneeded_drops.opt_generic_copy.RemoveUnneededDrops.diff
#[custom_mir(dialect = "runtime")]
fn opt_generic_copy<T: Copy>(x: T) {
drop(x);
// CHECK-LABEL: fn opt_generic_copy(
// CHECK-NOT: drop(
mir! {
{ Drop(x, ReturnTo(bb1), UnwindUnreachable()) }
bb1 = { Return() }
}
}

// EMIT_MIR remove_unneeded_drops.cannot_opt_generic.RemoveUnneededDrops.diff
// since the pass is not running on monomorphisized code,
// we can't (but probably should) optimize this
#[custom_mir(dialect = "runtime")]
fn cannot_opt_generic<T>(x: T) {
drop(x);
// CHECK-LABEL: fn cannot_opt_generic(
// CHECK: drop(
mir! {
{ Drop(x, ReturnTo(bb1), UnwindUnreachable()) }
bb1 = { Return() }
}
}

fn main() {
// CHECK-LABEL: fn main(
opt(true);
opt_generic_copy(42);
cannot_opt_generic(42);
Expand Down