forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 7
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 rust-lang#126463 - matthiaskrgr:rollup-lnkfibf, r=matth…
…iaskrgr Rollup of 5 pull requests Successful merges: - rust-lang#124884 (place explicit lifetime bound after generic param) - rust-lang#126343 (Remove some msys2 utils) - rust-lang#126351 (std::unix::fs::link using direct linkat call for Solaris.) - rust-lang#126368 (Remove some unnecessary crate dependencies.) - rust-lang#126386 (Migrate `run-make/allow-non-lint-warnings-cmdline` to `rmake.rs`) r? `@ghost` `@rustbot` modify labels: rollup
- Loading branch information
Showing
13 changed files
with
181 additions
and
42 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
This file was deleted.
Oops, something went wrong.
3 changes: 3 additions & 0 deletions
3
...ke/allow-non-lint-warnings-cmdline/foo.rs → tests/ui/allow-non-lint-warnings.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 |
---|---|---|
@@ -1,3 +1,6 @@ | ||
//@ compile-flags: -Awarnings | ||
//@ check-pass | ||
|
||
#[derive()] | ||
#[derive(Copy, Clone)] | ||
pub struct Foo; | ||
|
26 changes: 26 additions & 0 deletions
26
tests/ui/generic-associated-types/static-lifetime-tip-with-default-type.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 @@ | ||
//@ error-pattern: r#T: 'static | ||
//@ error-pattern: r#K: 'static | ||
//@ error-pattern: T: 'static= | ||
|
||
// https://github.com/rust-lang/rust/issues/124785 | ||
|
||
struct Foo<T, K = i32>(&'static T, &'static K); | ||
//~^ ERROR: the parameter type `T` may not live long enough | ||
//~| ERROR: the parameter type `K` may not live long enough | ||
|
||
struct Bar<r#T, r#K = i32>(&'static r#T, &'static r#K); | ||
//~^ ERROR: the parameter type `T` may not live long enough | ||
//~| ERROR: the parameter type `K` may not live long enough | ||
|
||
struct Boo<T= i32>(&'static T); | ||
//~^ ERROR: the parameter type `T` may not live long enough | ||
|
||
struct Far<T | ||
= i32>(&'static T); | ||
//~^ ERROR: the parameter type `T` may not live long enough | ||
|
||
struct S<'a, K: 'a = i32>(&'static K); | ||
//~^ ERROR: lifetime parameter `'a` is never used | ||
//~| ERROR: the parameter type `K` may not live long enough | ||
|
||
fn main() {} |
110 changes: 110 additions & 0 deletions
110
tests/ui/generic-associated-types/static-lifetime-tip-with-default-type.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,110 @@ | ||
error[E0310]: the parameter type `T` may not live long enough | ||
--> $DIR/static-lifetime-tip-with-default-type.rs:7:24 | ||
| | ||
LL | struct Foo<T, K = i32>(&'static T, &'static K); | ||
| ^^^^^^^^^^ | ||
| | | ||
| the parameter type `T` must be valid for the static lifetime... | ||
| ...so that the reference type `&'static T` does not outlive the data it points at | ||
| | ||
help: consider adding an explicit lifetime bound | ||
| | ||
LL | struct Foo<T: 'static, K = i32>(&'static T, &'static K); | ||
| +++++++++ | ||
|
||
error[E0310]: the parameter type `K` may not live long enough | ||
--> $DIR/static-lifetime-tip-with-default-type.rs:7:36 | ||
| | ||
LL | struct Foo<T, K = i32>(&'static T, &'static K); | ||
| ^^^^^^^^^^ | ||
| | | ||
| the parameter type `K` must be valid for the static lifetime... | ||
| ...so that the reference type `&'static K` does not outlive the data it points at | ||
| | ||
help: consider adding an explicit lifetime bound | ||
| | ||
LL | struct Foo<T, K: 'static = i32>(&'static T, &'static K); | ||
| +++++++++ | ||
|
||
error[E0310]: the parameter type `T` may not live long enough | ||
--> $DIR/static-lifetime-tip-with-default-type.rs:11:28 | ||
| | ||
LL | struct Bar<r#T, r#K = i32>(&'static r#T, &'static r#K); | ||
| ^^^^^^^^^^^^ | ||
| | | ||
| the parameter type `T` must be valid for the static lifetime... | ||
| ...so that the reference type `&'static T` does not outlive the data it points at | ||
| | ||
help: consider adding an explicit lifetime bound | ||
| | ||
LL | struct Bar<r#T: 'static, r#K = i32>(&'static r#T, &'static r#K); | ||
| +++++++++ | ||
|
||
error[E0310]: the parameter type `K` may not live long enough | ||
--> $DIR/static-lifetime-tip-with-default-type.rs:11:42 | ||
| | ||
LL | struct Bar<r#T, r#K = i32>(&'static r#T, &'static r#K); | ||
| ^^^^^^^^^^^^ | ||
| | | ||
| the parameter type `K` must be valid for the static lifetime... | ||
| ...so that the reference type `&'static K` does not outlive the data it points at | ||
| | ||
help: consider adding an explicit lifetime bound | ||
| | ||
LL | struct Bar<r#T, r#K: 'static = i32>(&'static r#T, &'static r#K); | ||
| +++++++++ | ||
|
||
error[E0310]: the parameter type `T` may not live long enough | ||
--> $DIR/static-lifetime-tip-with-default-type.rs:15:20 | ||
| | ||
LL | struct Boo<T= i32>(&'static T); | ||
| ^^^^^^^^^^ | ||
| | | ||
| the parameter type `T` must be valid for the static lifetime... | ||
| ...so that the reference type `&'static T` does not outlive the data it points at | ||
| | ||
help: consider adding an explicit lifetime bound | ||
| | ||
LL | struct Boo<T: 'static= i32>(&'static T); | ||
| +++++++++ | ||
|
||
error[E0310]: the parameter type `T` may not live long enough | ||
--> $DIR/static-lifetime-tip-with-default-type.rs:19:8 | ||
| | ||
LL | = i32>(&'static T); | ||
| ^^^^^^^^^^ | ||
| | | ||
| the parameter type `T` must be valid for the static lifetime... | ||
| ...so that the reference type `&'static T` does not outlive the data it points at | ||
| | ||
help: consider adding an explicit lifetime bound | ||
| | ||
LL | struct Far<T: 'static | ||
| +++++++++ | ||
|
||
error[E0310]: the parameter type `K` may not live long enough | ||
--> $DIR/static-lifetime-tip-with-default-type.rs:22:27 | ||
| | ||
LL | struct S<'a, K: 'a = i32>(&'static K); | ||
| ^^^^^^^^^^ | ||
| | | ||
| the parameter type `K` must be valid for the static lifetime... | ||
| ...so that the reference type `&'static K` does not outlive the data it points at | ||
| | ||
help: consider adding an explicit lifetime bound | ||
| | ||
LL | struct S<'a, K: 'a + 'static = i32>(&'static K); | ||
| +++++++++ | ||
|
||
error[E0392]: lifetime parameter `'a` is never used | ||
--> $DIR/static-lifetime-tip-with-default-type.rs:22:10 | ||
| | ||
LL | struct S<'a, K: 'a = i32>(&'static K); | ||
| ^^ unused lifetime parameter | ||
| | ||
= help: consider removing `'a`, referring to it in a field, or using a marker such as `PhantomData` | ||
|
||
error: aborting due to 8 previous errors | ||
|
||
Some errors have detailed explanations: E0310, E0392. | ||
For more information about an error, try `rustc --explain E0310`. |