1
Fork 0
rust/compiler/rustc_lint/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
..
nonstandard_style
array_into_iter.rs Adjust documentation for compatibility with 2021 2021-09-20 22:21:43 -04:00
builtin.rs Adjust documentation for compatibility with 2021 2021-09-20 22:21:43 -04:00
context.rs ty::layout: split LayoutOf into required and (blanket) provided halves. 2021-09-02 01:17:14 +03:00
early.rs Add additional missing lint handling logic 2021-07-17 23:03:58 -05:00
internal.rs Auto merge of #86827 - camsteffen:hash-lint-resolved, r=oli-obk 2021-07-13 15:06:10 +00:00
late.rs Gather module items after lowering. 2021-09-12 16:33:16 +02:00
levels.rs Rename walk_crate. 2021-09-02 19:23:11 +02:00
lib.rs must_not_suspend impl 2021-09-11 10:45:17 -07:00
methods.rs Fix doctest 2020-10-26 18:19:49 -04:00
non_ascii_idents.rs Stablize non_ascii_idents feature. 2021-04-08 02:52:00 +08:00
non_fmt_panic.rs Adjust documentation for compatibility with 2021 2021-09-20 22:21:43 -04:00
nonstandard_style.rs Fix more “a”/“an” typos 2021-08-22 17:27:18 +02:00
noop_method_call.rs review 2021-08-26 11:14:31 +02:00
passes.rs Add inferred args to typeck 2021-07-25 07:28:51 +00:00
redundant_semicolon.rs Lint on redundant trailing semicolon after item 2020-12-29 16:30:02 -05:00
tests.rs Update to last upstream version 2021-07-08 17:14:28 +02:00
traits.rs fmt 2021-09-09 05:21:30 +00:00
types.rs Rollup merge of #87529 - FabianWolff:issue-87496, r=nikomatsakis 2021-09-17 14:09:44 +09:00
unused.rs Use more accurate spans for "unused delimiter" lint 2021-09-09 14:24:33 +00:00