-
Notifications
You must be signed in to change notification settings - Fork 12.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Auto merge of #82053 - JohnTitor:rollup-ymi9q0g, r=JohnTitor
Rollup of 8 pull requests Successful merges: - #81811 (Fix doc test for Vec::retain(), now passes clippy::eval_order_dependence) - #81900 (Organize trait test files) - #81995 (Fix suggestion to introduce explicit lifetime) - #82031 (Drop an unnecessary intermediate variable) - #82033 (Refactor `get_word_attr` to return only `Option`) - #82040 (Add test to prevent src link regression) - #82041 (Add docs for shared_from_slice From impls) - #82050 (Added tests to drain an empty vec) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
- Loading branch information
Showing
300 changed files
with
491 additions
and
309 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#![crate_name = "foo"] | ||
|
||
// This test ensures that the [src] link is present on traits items. | ||
|
||
// @has foo/trait.Iterator.html '//h3[@id="method.zip"]/a[@class="srclink"]' "[src]" | ||
pub use std::iter::Iterator; |
17 changes: 17 additions & 0 deletions
17
src/test/ui/suggestions/lifetimes/missing-lifetimes-in-signature-2.nll.stderr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
error[E0311]: the parameter type `T` may not live long enough | ||
--> $DIR/missing-lifetimes-in-signature-2.rs:20:5 | ||
| | ||
LL | / foo.bar(move |_| { | ||
LL | | | ||
LL | | t.test(); | ||
LL | | }); | ||
| |______^ | ||
| | ||
note: the parameter type `T` must be valid for the anonymous lifetime #2 defined on the function body at 19:1... | ||
--> $DIR/missing-lifetimes-in-signature-2.rs:19:1 | ||
| | ||
LL | fn func<T: Test>(foo: &Foo, t: T) { | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
|
||
error: aborting due to previous error | ||
|
26 changes: 26 additions & 0 deletions
26
src/test/ui/suggestions/lifetimes/missing-lifetimes-in-signature-2.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
// Regression test for #81650 | ||
|
||
struct Foo<'a> { | ||
x: &'a mut &'a i32, | ||
} | ||
|
||
impl<'a> Foo<'a> { | ||
fn bar<F, T>(&self, f: F) | ||
where | ||
F: FnOnce(&Foo<'a>) -> T, | ||
F: 'a, | ||
{} | ||
} | ||
|
||
trait Test { | ||
fn test(&self); | ||
} | ||
|
||
fn func<T: Test>(foo: &Foo, t: T) { | ||
foo.bar(move |_| { | ||
//~^ ERROR the parameter type `T` may not live long enough | ||
t.test(); | ||
}); | ||
} | ||
|
||
fn main() {} |
21 changes: 21 additions & 0 deletions
21
src/test/ui/suggestions/lifetimes/missing-lifetimes-in-signature-2.stderr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
error[E0311]: the parameter type `T` may not live long enough | ||
--> $DIR/missing-lifetimes-in-signature-2.rs:20:9 | ||
| | ||
LL | fn func<T: Test>(foo: &Foo, t: T) { | ||
| -- help: consider adding an explicit lifetime bound...: `T: 'a +` | ||
LL | foo.bar(move |_| { | ||
| ^^^ | ||
| | ||
note: the parameter type `T` must be valid for the anonymous lifetime #2 defined on the function body at 19:1... | ||
--> $DIR/missing-lifetimes-in-signature-2.rs:19:1 | ||
| | ||
LL | fn func<T: Test>(foo: &Foo, t: T) { | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
note: ...so that the type `[closure@$DIR/missing-lifetimes-in-signature-2.rs:20:13: 23:6]` will meet its required lifetime bounds | ||
--> $DIR/missing-lifetimes-in-signature-2.rs:20:9 | ||
| | ||
LL | foo.bar(move |_| { | ||
| ^^^ | ||
|
||
error: aborting due to previous error | ||
|
File renamed without changes.
6 changes: 3 additions & 3 deletions
6
...st/ui/traits/trait-alias-ambiguous.stderr → src/test/ui/traits/alias/ambiguous.stderr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Oops, something went wrong.