Commit 8513a6d
authored
relax return value of
# Objective
Follow-up to #22290
Currently, when calling `resource_scope` or `try_resource_scope`, the
function will panic or return `None`, respectively, if
`World::clear_resources` is called from within the scope. This behavior
was intentionally preserved in #22290 to reduce user-facing changes,
however the behavior is not necessary, as, at the point where it becomes
relevant, the user-provided scope closure has already completed
successfully. Since we explicitly support methods such as
`clear_resources`, we should treat them as valid to call, and avoid
causing unnecessary knock-on errors.
## Testing
A test added in #22290 was updated to reflect the new behavior.World::resource_scope (#22686)1 parent d734e7f commit 8513a6d
2 files changed
+32
-36
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1604 | 1604 | | |
1605 | 1605 | | |
1606 | 1606 | | |
1607 | | - | |
1608 | | - | |
1609 | 1607 | | |
1610 | 1608 | | |
1611 | 1609 | | |
| |||
1615 | 1613 | | |
1616 | 1614 | | |
1617 | 1615 | | |
1618 | | - | |
| 1616 | + | |
1619 | 1617 | | |
1620 | 1618 | | |
1621 | 1619 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2705 | 2705 | | |
2706 | 2706 | | |
2707 | 2707 | | |
| 2708 | + | |
| 2709 | + | |
| 2710 | + | |
| 2711 | + | |
| 2712 | + | |
| 2713 | + | |
2708 | 2714 | | |
2709 | 2715 | | |
2710 | 2716 | | |
| |||
2718 | 2724 | | |
2719 | 2725 | | |
2720 | 2726 | | |
| 2727 | + | |
| 2728 | + | |
| 2729 | + | |
| 2730 | + | |
| 2731 | + | |
| 2732 | + | |
2721 | 2733 | | |
2722 | 2734 | | |
2723 | 2735 | | |
| |||
2742 | 2754 | | |
2743 | 2755 | | |
2744 | 2756 | | |
2745 | | - | |
2746 | 2757 | | |
2747 | 2758 | | |
2748 | 2759 | | |
| |||
2796 | 2807 | | |
2797 | 2808 | | |
2798 | 2809 | | |
2799 | | - | |
2800 | | - | |
2801 | 2810 | | |
2802 | 2811 | | |
2803 | 2812 | | |
2804 | | - | |
2805 | | - | |
2806 | | - | |
2807 | | - | |
2808 | | - | |
2809 | | - | |
2810 | | - | |
2811 | | - | |
2812 | | - | |
2813 | | - | |
2814 | | - | |
2815 | | - | |
2816 | | - | |
2817 | | - | |
2818 | | - | |
2819 | | - | |
2820 | | - | |
2821 | | - | |
2822 | | - | |
2823 | | - | |
2824 | | - | |
2825 | | - | |
2826 | | - | |
2827 | | - | |
2828 | | - | |
2829 | | - | |
2830 | | - | |
2831 | | - | |
| 2813 | + | |
| 2814 | + | |
| 2815 | + | |
| 2816 | + | |
| 2817 | + | |
| 2818 | + | |
| 2819 | + | |
2832 | 2820 | | |
2833 | | - | |
| 2821 | + | |
| 2822 | + | |
| 2823 | + | |
| 2824 | + | |
| 2825 | + | |
| 2826 | + | |
| 2827 | + | |
| 2828 | + | |
| 2829 | + | |
2834 | 2830 | | |
2835 | 2831 | | |
2836 | | - | |
| 2832 | + | |
| 2833 | + | |
| 2834 | + | |
2837 | 2835 | | |
2838 | 2836 | | |
2839 | 2837 | | |
| |||
0 commit comments