forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 6
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#113038 - matthiaskrgr:rollup-sdcfkxa, r=matth…
…iaskrgr Rollup of 5 pull requests Successful merges: - rust-lang#112976 (Add test for futures with HRTB) - rust-lang#113013 (rustdoc: get rid of extra line when line-wrapping fn decls with empty arg list) - rust-lang#113030 (Add a regression test for rust-lang#109071) - rust-lang#113031 (Add a regression test for rust-lang#110933) - rust-lang#113036 (Accept `ReStatic` for RPITIT) r? `@ghost` `@rustbot` modify labels: rollup
- Loading branch information
Showing
11 changed files
with
171 additions
and
2 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
<pre class="rust item-decl"><code>pub fn create( | ||
) -> <a class="struct" href="struct.Padding00000000000000000000000000000000000000000000000000000000000000000000000000000000.html" title="struct decl_line_wrapping_empty_arg_list::Padding00000000000000000000000000000000000000000000000000000000000000000000000000000000">Padding00000000000000000000000000000000000000000000000000000000000000000000000000000000</a></code></pre> |
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,12 @@ | ||
// Ensure that we don't add an extra line containing nothing but whitespace in between the two | ||
// parentheses of an empty argument list when line-wrapping a function declaration. | ||
|
||
// ignore-tidy-linelength | ||
|
||
pub struct Padding00000000000000000000000000000000000000000000000000000000000000000000000000000000; | ||
|
||
// @has 'decl_line_wrapping_empty_arg_list/fn.create.html' | ||
// @snapshot decl - '//pre[@class="rust item-decl"]' | ||
pub fn create() -> Padding00000000000000000000000000000000000000000000000000000000000000000000000000000000 { | ||
loop {} | ||
} |
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,20 @@ | ||
// check-pass | ||
|
||
#![feature(associated_const_equality)] | ||
|
||
pub trait Trait { | ||
const ASSOC: usize; | ||
} | ||
|
||
pub fn foo< | ||
T: Trait< | ||
ASSOC = { | ||
let a = 10_usize; | ||
let b: &'_ usize = &a; | ||
*b | ||
}, | ||
>, | ||
>() { | ||
} | ||
|
||
fn main() {} |
35 changes: 35 additions & 0 deletions
35
tests/ui/associated-inherent-types/issue-109071.no_gate.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,35 @@ | ||
error[E0637]: `&` without an explicit lifetime name cannot be used here | ||
--> $DIR/issue-109071.rs:8:17 | ||
| | ||
LL | type Item = &[T]; | ||
| ^ explicit lifetime name needed here | ||
|
||
error[E0107]: missing generics for struct `Windows` | ||
--> $DIR/issue-109071.rs:7:9 | ||
| | ||
LL | impl<T> Windows { | ||
| ^^^^^^^ expected 1 generic argument | ||
| | ||
note: struct defined here, with 1 generic parameter: `T` | ||
--> $DIR/issue-109071.rs:5:8 | ||
| | ||
LL | struct Windows<T> {} | ||
| ^^^^^^^ - | ||
help: add missing generic argument | ||
| | ||
LL | impl<T> Windows<T> { | ||
| +++ | ||
|
||
error[E0658]: inherent associated types are unstable | ||
--> $DIR/issue-109071.rs:8:5 | ||
| | ||
LL | type Item = &[T]; | ||
| ^^^^^^^^^^^^^^^^^ | ||
| | ||
= note: see issue #8995 <https://github.com/rust-lang/rust/issues/8995> for more information | ||
= help: add `#![feature(inherent_associated_types)]` to the crate attributes to enable | ||
|
||
error: aborting due to 3 previous errors | ||
|
||
Some errors have detailed explanations: E0107, E0637, E0658. | ||
For more information about an error, try `rustc --explain E0107`. |
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,18 @@ | ||
// revisions: with_gate no_gate | ||
#![cfg_attr(with_gate, feature(inherent_associated_types))] | ||
#![cfg_attr(with_gate, allow(incomplete_features))] | ||
|
||
struct Windows<T> {} | ||
|
||
impl<T> Windows { //~ ERROR: missing generics for struct `Windows` | ||
type Item = &[T]; //~ ERROR: `&` without an explicit lifetime name cannot be used here | ||
//[no_gate]~^ ERROR: inherent associated types are unstable | ||
|
||
fn next() -> Option<Self::Item> {} | ||
} | ||
|
||
impl<T> Windows<T> { | ||
fn T() -> Option<Self::Item> {} | ||
} | ||
|
||
fn main() {} |
26 changes: 26 additions & 0 deletions
26
tests/ui/associated-inherent-types/issue-109071.with_gate.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,26 @@ | ||
error[E0637]: `&` without an explicit lifetime name cannot be used here | ||
--> $DIR/issue-109071.rs:8:17 | ||
| | ||
LL | type Item = &[T]; | ||
| ^ explicit lifetime name needed here | ||
|
||
error[E0107]: missing generics for struct `Windows` | ||
--> $DIR/issue-109071.rs:7:9 | ||
| | ||
LL | impl<T> Windows { | ||
| ^^^^^^^ expected 1 generic argument | ||
| | ||
note: struct defined here, with 1 generic parameter: `T` | ||
--> $DIR/issue-109071.rs:5:8 | ||
| | ||
LL | struct Windows<T> {} | ||
| ^^^^^^^ - | ||
help: add missing generic argument | ||
| | ||
LL | impl<T> Windows<T> { | ||
| +++ | ||
|
||
error: aborting due to 2 previous errors | ||
|
||
Some errors have detailed explanations: E0107, E0637. | ||
For more information about an error, try `rustc --explain E0107`. |
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 @@ | ||
error: the compiler unexpectedly panicked. this is a bug. | ||
|
||
query stack during panic: | ||
#0 [evaluate_obligation] evaluating trait selection obligation `for<'a> [async fn body@$DIR/future.rs:32:35: 34:2]: core::future::future::Future` | ||
#1 [codegen_select_candidate] computing candidate for `<strlen as Trait>` | ||
end of query stack |
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,38 @@ | ||
// ignore-tidy-linelength | ||
// edition:2021 | ||
// revisions: classic next | ||
//[next] compile-flags: -Ztrait-solver=next | ||
//[next] check-pass | ||
//[classic] known-bug: #112347 | ||
//[classic] build-fail | ||
//[classic] failure-status: 101 | ||
//[classic] normalize-stderr-test "note: .*\n\n" -> "" | ||
//[classic] normalize-stderr-test "thread 'rustc' panicked.*\n" -> "" | ||
//[classic] normalize-stderr-test "(error: internal compiler error: [^:]+):\d+:\d+: " -> "$1:LL:CC: " | ||
//[classic] rustc-env:RUST_BACKTRACE=0 | ||
|
||
#![feature(unboxed_closures)] | ||
|
||
use std::future::Future; | ||
|
||
trait Trait { | ||
fn func(&self, _: &str); | ||
} | ||
|
||
impl<T> Trait for T | ||
where | ||
for<'a> T: Fn<(&'a str,)> + Send + Sync, | ||
for<'a> <T as FnOnce<(&'a str,)>>::Output: Future<Output = usize> + Send, | ||
{ | ||
fn func(&self, _: &str) { | ||
println!("hello!"); | ||
} | ||
} | ||
|
||
async fn strlen(x: &str) -> usize { | ||
x.len() | ||
} | ||
|
||
fn main() { | ||
strlen.func("hi"); | ||
} |
12 changes: 12 additions & 0 deletions
12
tests/ui/impl-trait/static-lifetime-return-position-impl-trait.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,12 @@ | ||
// check-pass | ||
|
||
#![allow(incomplete_features)] | ||
#![feature(adt_const_params, return_position_impl_trait_in_trait)] | ||
|
||
pub struct Element; | ||
|
||
pub trait Node { | ||
fn elements<const T: &'static str>(&self) -> impl Iterator<Item = Element>; | ||
} | ||
|
||
fn main() {} |