1
Fork 0
rust/compiler/rustc_passes/src
bors ce45663e14 Auto merge of #88865 - guswynn:must_not_suspend, r=oli-obk
Implement `#[must_not_suspend]`

implements #83310

Some notes on the impl:

1. The code that searches for the attribute on the ADT is basically copied from the `must_use` lint. It's not shared, as the logic did diverge
2. The RFC does specify that the attribute can be placed on fn's (and fn-like objects), like `must_use`. I think this is a direct copy from the `must_use` reference definition. This implementation does NOT support this, as I felt that ADT's (+ `impl Trait` + `dyn Trait`) cover the usecase's people actually want on the RFC, and adding an imp for the fn call case would be significantly harder. The `must_use` impl can do a single check at fn call stmt time, but `must_not_suspend` would need to answer the question: "for some value X with type T, find any fn call that COULD have produced this value". That would require significant changes to `generator_interior.rs`, and I would need mentorship on that. `@eholk` and I are discussing it.
3. `@estebank` do you know a way I can make the user-provided `reason` note pop out? right now it seems quite hidden

Also, I am not sure if we should run perf on this

r? `@nikomatsakis`
2021-09-22 06:43:33 +00:00
..
liveness Use iter::zip in compiler/ 2021-03-26 09:32:31 -07:00
check_attr.rs skip the uninhabitated check and comments 2021-09-11 12:10:06 -07:00
check_const.rs Introduce hir::ExprKind::Let - Take 2 2021-08-15 16:18:26 -03:00
dead.rs Ignore automatically derived impls of Clone and Debug in dead code analysis 2021-09-09 19:49:07 +02:00
diagnostic_items.rs Treat macros as HIR items 2021-08-28 00:16:34 -07:00
entry.rs Auto merge of #87449 - matthiaskrgr:clippyy_v2, r=nagisa 2021-08-01 09:15:15 +00:00
hir_id_validator.rs Do not store visibility in *ItemRef. 2021-09-20 00:29:53 +02:00
hir_stats.rs Rename walk_crate. 2021-09-02 19:23:11 +02:00
intrinsicck.rs Forbid ! from being used in asm! output 2021-08-12 20:28:35 +01:00
lang_items.rs Auto merge of #87875 - asquared31415:generic-lang-items, r=cjgillot 2021-08-25 08:12:16 +00:00
layout_test.rs ty::layout: split LayoutOf into required and (blanket) provided halves. 2021-09-02 01:17:14 +03:00
lib.rs Remove Session.used_attrs and move logic to CheckAttrVisitor 2021-08-21 13:27:27 -05:00
lib_features.rs Stop using walk_crate. 2021-09-02 19:08:58 +02:00
liveness.rs don't convert types into identical types 2021-09-11 10:32:38 +02:00
loops.rs Do not suggest using a break label when one is already present 2021-01-21 21:43:29 -08:00
naked_functions.rs Introduce hir::ExprKind::Let - Take 2 2021-08-15 16:18:26 -03:00
reachable.rs Remove obsolete MacroDef variant of OwnerNode 2021-08-28 00:24:30 -07:00
region.rs don't convert types into identical types 2021-09-11 10:32:38 +02:00
stability.rs delay error for enabling unstable lib features 2021-09-16 14:22:32 -04:00
upvars.rs mv compiler to compiler/ 2020-08-30 18:45:07 +03:00
weak_lang_items.rs Remove Session.used_attrs and move logic to CheckAttrVisitor 2021-08-21 13:27:27 -05:00