rust/compiler/rustc_span/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
..
analyze_source_file
lev_distance Rework SESSION_GLOBALS API to prevent overwriting it 2021-07-08 16:16:28 +02:00
source_map
symbol Move the Lock into symbol::Interner 2021-09-15 18:46:45 +02:00
analyze_source_file.rs
caching_source_map_view.rs Convert debug_assert to assert in CachingSourceMapView 2021-09-17 12:01:29 -05:00
def_id.rs Encode ExpnId using ExpnHash for incr. comp. 2021-07-17 19:41:08 +02:00
edition.rs Update LATEST_STABLE_EDITION to 2021. 2021-08-30 15:33:09 +02:00
fatal_error.rs
hygiene.rs don't clone types that are Copy (clippy::clone_on_copy) 2021-09-11 10:18:56 +02:00
lev_distance.rs
lib.rs Move the Lock into symbol::Interner 2021-09-15 18:46:45 +02:00
source_map.rs Keep a parent LocalDefId in SpanData. 2021-09-10 20:17:33 +02:00
span_encoding.rs Rename decode to data_untracked. 2021-09-10 20:18:22 +02:00
symbol.rs Auto merge of #88865 - guswynn:must_not_suspend, r=oli-obk 2021-09-22 06:43:33 +00:00
tests.rs Inline implementation of lookup_line 2021-07-08 23:30:53 +02:00