Skip to content

Rollup of 7 pull requests #115665

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 17 commits into from
Sep 8, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
ac76882
MCP661: Move wasm32-wasi-preview1-threads to Tier2
g0djan Aug 23, 2023
1abbd4c
Render missing fields in tuple struct/enum as /* private fields */
compiler-errors Apr 24, 2023
c4bb70f
Add regression test for private fields in tuple struct
GuillaumeGomez Sep 6, 2023
748476d
Print the path of an RPITIT in RTN
compiler-errors Sep 7, 2023
ee9727e
Don't suggest dereferencing to unsized type
compiler-errors Sep 7, 2023
67e7d85
Rename folder typo
compiler-errors Sep 7, 2023
3bf3dad
Ensure that dyn trait bounds stay sorted
compiler-errors Sep 7, 2023
a932990
Use `newtype_index` for `IntVid` and `FloatVid`.
nnethercote Sep 7, 2023
31e5dd3
diagnostics: add test case for trait bounds diagnostic
notriddle Sep 7, 2023
00b7d70
rustdoc: remove unused ID `mainThemeStyle`
notriddle Sep 7, 2023
6b00cfb
Rollup merge of #115345 - g0djan:godjan/tier2-wasi-threads, r=WaffleL…
matthiaskrgr Sep 8, 2023
403a18f
Rollup merge of #115604 - GuillaumeGomez:private-fields-tuple-struct,…
matthiaskrgr Sep 8, 2023
bef5187
Rollup merge of #115624 - compiler-errors:rtn-path, r=WaffleLapkin
matthiaskrgr Sep 8, 2023
38adedc
Rollup merge of #115629 - compiler-errors:sugg-deref-unsize, r=oli-obk
matthiaskrgr Sep 8, 2023
1979772
Rollup merge of #115634 - nnethercote:IntVid-FloatVid, r=oli-obk
matthiaskrgr Sep 8, 2023
7ec8136
Rollup merge of #115649 - notriddle:notriddle/82038, r=compiler-errors
matthiaskrgr Sep 8, 2023
dfa6622
Rollup merge of #115655 - notriddle:notriddle/rustdoc-fe-cleanup, r=G…
matthiaskrgr Sep 8, 2023
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
Prev Previous commit
Next Next commit
Print the path of an RPITIT in RTN
  • Loading branch information
compiler-errors committed Sep 7, 2023
commit 748476d94d0fd87a0ee149e49ab3b196bbb08420
11 changes: 11 additions & 0 deletions compiler/rustc_middle/src/ty/print/pretty.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1123,6 +1123,17 @@ pub trait PrettyPrinter<'tcx>:
}
}

if self.tcx().features().return_type_notation
&& let Some(ty::ImplTraitInTraitData::Trait { fn_def_id, .. }) = self.tcx().opt_rpitit_info(def_id)
&& let ty::Alias(_, alias_ty) = self.tcx().fn_sig(fn_def_id).skip_binder().output().skip_binder().kind()
&& alias_ty.def_id == def_id
{
let num_args = self.tcx().generics_of(fn_def_id).count();
write!(self, " {{ ")?;
self = self.print_def_path(fn_def_id, &args[..num_args])?;
write!(self, "() }}")?;
}

Ok(self)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ error: future cannot be sent between threads safely
LL | is_send(foo::<T>());
| ^^^^^^^^^^ future returned by `foo` is not `Send`
|
= help: within `impl Future<Output = Result<(), ()>>`, the trait `Send` is not implemented for `impl Future<Output = Result<(), ()>>`
= help: within `impl Future<Output = Result<(), ()>>`, the trait `Send` is not implemented for `impl Future<Output = Result<(), ()>> { <T as Foo>::method() }`
note: future is not `Send` as it awaits another future which is not `Send`
--> $DIR/basic.rs:13:5
|
LL | T::method().await?;
| ^^^^^^^^^^^ await occurs here on type `impl Future<Output = Result<(), ()>>`, which is not `Send`
| ^^^^^^^^^^^ await occurs here on type `impl Future<Output = Result<(), ()>> { <T as Foo>::method() }`, which is not `Send`
note: required by a bound in `is_send`
--> $DIR/basic.rs:17:20
|
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
warning: the feature `return_type_notation` is incomplete and may not be safe to use and/or cause compiler crashes
--> $DIR/normalizing-self-auto-trait-issue-109924.rs:8:12
|
LL | #![feature(return_type_notation)]
| ^^^^^^^^^^^^^^^^^^^^
|
= note: see issue #109417 <https://github.com/rust-lang/rust/issues/109417> for more information
= note: `#[warn(incomplete_features)]` on by default

error[E0277]: `impl Future<Output = ()> { <_ as Foo>::bar() }` cannot be sent between threads safely
--> $DIR/normalizing-self-auto-trait-issue-109924.rs:23:11
|
LL | build(Bar);
| ----- ^^^ `impl Future<Output = ()> { <_ as Foo>::bar() }` cannot be sent between threads safely
| |
| required by a bound introduced by this call
|
= help: the trait `for<'a> Send` is not implemented for `impl Future<Output = ()> { <_ as Foo>::bar() }`
note: required by a bound in `build`
--> $DIR/normalizing-self-auto-trait-issue-109924.rs:20:39
|
LL | fn build<T>(_: T) where T: Foo<bar(): Send> {}
| ^^^^ required by this bound in `build`

error: aborting due to previous error; 1 warning emitted

For more information about this error, try `rustc --explain E0277`.
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
warning: the feature `return_type_notation` is incomplete and may not be safe to use and/or cause compiler crashes
--> $DIR/normalizing-self-auto-trait-issue-109924.rs:8:12
|
LL | #![feature(return_type_notation)]
| ^^^^^^^^^^^^^^^^^^^^
|
= note: see issue #109417 <https://github.com/rust-lang/rust/issues/109417> for more information
= note: `#[warn(incomplete_features)]` on by default

warning: 1 warning emitted

Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
// revisions: current next
//[current] known-bug: #109924
//[next] check-pass
//[next] compile-flags: -Ztrait-solver=next
// edition:2021

#![feature(async_fn_in_trait)]
#![feature(return_type_notation)]
//[next]~^ WARN the feature `return_type_notation` is incomplete

trait Foo {
async fn bar(&self);
}

struct Bar;
impl Foo for Bar {
async fn bar(&self) {}
}

fn build<T>(_: T) where T: Foo<bar(): Send> {}

fn main() {
build(Bar);
}