Skip to content

Rollup of 6 pull requests #104758

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 27 commits into from
Nov 23, 2022
Merged
Changes from 2 commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
b59090e
Lower return type outside async block creation
Swatinem Nov 19, 2022
4e9ceef
Refactor `must_use` lint into two parts
Noratrieb Nov 13, 2022
1e4adaf
Fix CrateLocationUnknownType error
YC Nov 19, 2022
40b7e0e
Fix metadata_lib_filename_form
YC Nov 19, 2022
a1ea1c1
Check that library is file
YC Nov 19, 2022
644a5a3
enable fuzzy_provenance_casts lint in liballoc
RalfJung Nov 20, 2022
7f5addd
enable fuzzy_provenance_casts lint in libstd
RalfJung Nov 20, 2022
1a69666
dont attempt strict provenance in SGX
RalfJung Nov 21, 2022
2752e32
Allow opaque types in trait impl headers and rely on coherence to rej…
oli-obk Oct 24, 2022
94fe30f
Treat different opaque types of the same def id as equal during coher…
oli-obk Oct 27, 2022
ae80c76
Add an always-ambiguous predicate to make sure that we don't accident…
oli-obk Nov 2, 2022
9cd44f8
nit treat different opaque types
oli-obk Nov 14, 2022
9a8e1ee
Move a field around
oli-obk Nov 14, 2022
f42e490
Register obligations from type relation
oli-obk Nov 14, 2022
11ae334
Remove a function that doesn't actually do anything
oli-obk Nov 15, 2022
7301cd7
Type generalization should not look at opaque type in coherence
oli-obk Nov 17, 2022
11adf03
Add some more assertions for type relations not used during coherence
oli-obk Nov 17, 2022
c16a90f
Test generalization during coherence
oli-obk Nov 17, 2022
395f2b8
Remove extra . in metadata_lib_filename_form
YC Nov 22, 2022
7169c7d
Tests for bad --extern library path and file
YC Nov 22, 2022
cd22ce6
Bump `fd-lock` in `bootstrap` again
mati865 Nov 22, 2022
53eab24
Rollup merge of #103488 - oli-obk:impl_trait_for_tait, r=lcnr
Manishearth Nov 23, 2022
a673364
Rollup merge of #104359 - Nilstrieb:plus-one, r=fee1-dead
Manishearth Nov 23, 2022
36815c6
Rollup merge of #104612 - Swatinem:async-ret-y, r=estebank
Manishearth Nov 23, 2022
54b6292
Rollup merge of #104621 - YC:master, r=davidtwco
Manishearth Nov 23, 2022
316bda8
Rollup merge of #104647 - RalfJung:alloc-strict-provenance, r=thomcc
Manishearth Nov 23, 2022
42afb70
Rollup merge of #104750 - mati865:bump-fd-lock-again, r=jyn514
Manishearth Nov 23, 2022
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
18 changes: 9 additions & 9 deletions compiler/rustc_ast_lowering/src/expr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -588,17 +588,12 @@ impl<'hir> LoweringContext<'_, 'hir> {
&mut self,
capture_clause: CaptureBy,
closure_node_id: NodeId,
ret_ty: Option<AstP<Ty>>,
ret_ty: Option<hir::FnRetTy<'hir>>,
span: Span,
async_gen_kind: hir::AsyncGeneratorKind,
body: impl FnOnce(&mut Self) -> hir::Expr<'hir>,
) -> hir::ExprKind<'hir> {
let output = match ret_ty {
Some(ty) => hir::FnRetTy::Return(
self.lower_ty(&ty, &ImplTraitContext::Disallowed(ImplTraitPosition::AsyncBlock)),
),
None => hir::FnRetTy::DefaultReturn(self.lower_span(span)),
};
let output = ret_ty.unwrap_or_else(|| hir::FnRetTy::DefaultReturn(self.lower_span(span)));

// Resume argument type. We let the compiler infer this to simplify the lowering. It is
// fully constrained by `future::from_generator`.
Expand Down Expand Up @@ -1003,8 +998,13 @@ impl<'hir> LoweringContext<'_, 'hir> {
// Transform `async |x: u8| -> X { ... }` into
// `|x: u8| future_from_generator(|| -> X { ... })`.
let body_id = this.lower_fn_body(&outer_decl, |this| {
let async_ret_ty =
if let FnRetTy::Ty(ty) = &decl.output { Some(ty.clone()) } else { None };
let async_ret_ty = if let FnRetTy::Ty(ty) = &decl.output {
let itctx = ImplTraitContext::Disallowed(ImplTraitPosition::AsyncBlock);
Some(hir::FnRetTy::Return(this.lower_ty(&ty, &itctx)))
} else {
None
};

let async_body = this.make_async_expr(
capture_clause,
inner_closure_id,
Expand Down