-
Notifications
You must be signed in to change notification settings - Fork 13.2k
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
Nullary variants should be considered rvalues, not static identifiers. #10800
Comments
I just checked trans and indeed it is always generated as an rvalue. |
(is this somehow related to #8229 ? Just curious...) |
Accepted for 1.0, P-backcompat-lang |
Should this be just closed? It looks like a duplicate of #11681 (which is closed). |
@dmski looks like you're right. Tagging as needs test. |
There is https://github.com/mozilla/rust/blob/master/src/test/compile-fail/regions-lifetime-of-struct-or-enum-variant.rs which looks like it tests exactly this. Do you think that another test for this can be added? |
@dmski looks sufficient. I had forgotten about that test :D |
[`unused_async`]: do not consider `await` in nested `async` blocks as used Fixes rust-lang#10800. This PR makes sure that `await` expressions inside of inner `async` blocks don't prevent the lint from triggering. For example ```rs async fn foo() { async { std::future::ready(()).await; } } ``` Even though there *is* a `.await` expression in this function, it's contained in an async block, which means that the enclosing function doesn't need to be `async` too. changelog: [`unused_async`]: do not consider `await` in nested `async` blocks as used
I think there's an existing issue, but I can't find it. Currently borrowck treats nullary variants (like
None
) as static identifies. This doesn't make sense for generic enums and I don't think it matches up with trans. The reason it doesn't make sense for generic enums is thatNone::<Foo>
andNone::<Bar>
have totally different sizes etc., so there couldn't possible be a single static constant to refer to. This is a relatively simple fix to themem_categorization
code, but it's worth investigating how trans handles enum variants and make sure that everything will be compatible.Nominating since it is a backwards compatibility thing.
The text was updated successfully, but these errors were encountered: