Rollup merge of #117420 - Jules-Bertholet:internal-unstable-stmt-expr-attributes, r=petrochenkov
Make `#![allow_internal_unstable(..)]` work with `stmt_expr_attributes` This is a necessary first step to fixing #117304, as explained in https://github.com/rust-lang/rust/issues/117304#issuecomment-1784414453. `@rustbot` label T-compiler
This commit is contained in:
commit
4808aa8872
3 changed files with 17 additions and 5 deletions
|
@ -373,7 +373,9 @@ impl<'a> StripUnconfigured<'a> {
|
|||
/// If attributes are not allowed on expressions, emit an error for `attr`
|
||||
#[instrument(level = "trace", skip(self))]
|
||||
pub(crate) fn maybe_emit_expr_attr_err(&self, attr: &Attribute) {
|
||||
if self.features.is_some_and(|features| !features.stmt_expr_attributes) {
|
||||
if self.features.is_some_and(|features| !features.stmt_expr_attributes)
|
||||
&& !attr.span.allows_unstable(sym::stmt_expr_attributes)
|
||||
{
|
||||
let mut err = feature_err(
|
||||
&self.sess,
|
||||
sym::stmt_expr_attributes,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue