Rollup merge of #142704 - tgross35:remove-concat_idents, r=fee1-dead
Remove the deprecated unstable `concat_idents!` macro
In [rust-lang/rust#137653], the lang and libs-API teams did a joint FCP to deprecate
and eventually remove the long-unstable `concat_idents!` macro. The
deprecation is landing in 1.88, so do the removal here (target version
1.90).
This macro has been superseded by the more recent `${concat(...)}`
metavariable expression language feature, which avoids some of the
limitations of `concat_idents!`. The metavar expression is unstably
available under the [`macro_metavar_expr_concat`] feature.
History is mildly interesting here: `concat_idents!` goes back to 2011
when it was introduced with 513276e595 ("Add #concat_idents[] and
#ident_to_str[]"). The syntax looks a bit different but it still works
about the same:
let asdf_fdsa = "<.<";
assert(#concat_idents[asd,f_f,dsa] == "<.<");
assert(#ident_to_str[use_mention_distinction]
== "use_mention_distinction");
(That test existed from introduction until its removal here.)
Closes: https://github.com/rust-lang/rust/issues/29599
[rust-lang/rust#137653]: https://github.com/rust-lang/rust/pull/137653
[`macro_metavar_expr_concat`]: https://github.com/rust-lang/rust/issues/124225
This commit is contained in:
commit
0377330be4
36 changed files with 165 additions and 411 deletions
|
|
@ -118,10 +118,6 @@ builtin_macros_concat_bytes_oob = numeric literal is out of bounds
|
|||
builtin_macros_concat_bytestr = cannot concatenate a byte string literal
|
||||
builtin_macros_concat_c_str_lit = cannot concatenate a C string literal
|
||||
|
||||
builtin_macros_concat_idents_ident_args = `concat_idents!()` requires ident args
|
||||
|
||||
builtin_macros_concat_idents_missing_args = `concat_idents!()` takes 1 or more arguments
|
||||
builtin_macros_concat_idents_missing_comma = `concat_idents!()` expecting comma
|
||||
builtin_macros_concat_missing_literal = expected a literal
|
||||
.note = only literals (like `"foo"`, `-42` and `3.14`) can be passed to `concat!()`
|
||||
|
||||
|
|
|
|||
|
|
@ -1,71 +0,0 @@
|
|||
use rustc_ast::ptr::P;
|
||||
use rustc_ast::token::{self, Token};
|
||||
use rustc_ast::tokenstream::{TokenStream, TokenTree};
|
||||
use rustc_ast::{AttrVec, DUMMY_NODE_ID, Expr, ExprKind, Path, Ty, TyKind};
|
||||
use rustc_expand::base::{DummyResult, ExpandResult, ExtCtxt, MacResult, MacroExpanderResult};
|
||||
use rustc_span::{Ident, Span, Symbol};
|
||||
|
||||
use crate::errors;
|
||||
|
||||
pub(crate) fn expand_concat_idents<'cx>(
|
||||
cx: &'cx mut ExtCtxt<'_>,
|
||||
sp: Span,
|
||||
tts: TokenStream,
|
||||
) -> MacroExpanderResult<'cx> {
|
||||
if tts.is_empty() {
|
||||
let guar = cx.dcx().emit_err(errors::ConcatIdentsMissingArgs { span: sp });
|
||||
return ExpandResult::Ready(DummyResult::any(sp, guar));
|
||||
}
|
||||
|
||||
let mut res_str = String::new();
|
||||
for (i, e) in tts.iter().enumerate() {
|
||||
if i & 1 == 1 {
|
||||
match e {
|
||||
TokenTree::Token(Token { kind: token::Comma, .. }, _) => {}
|
||||
_ => {
|
||||
let guar = cx.dcx().emit_err(errors::ConcatIdentsMissingComma { span: sp });
|
||||
return ExpandResult::Ready(DummyResult::any(sp, guar));
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if let TokenTree::Token(token, _) = e {
|
||||
if let Some((ident, _)) = token.ident() {
|
||||
res_str.push_str(ident.name.as_str());
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
let guar = cx.dcx().emit_err(errors::ConcatIdentsIdentArgs { span: sp });
|
||||
return ExpandResult::Ready(DummyResult::any(sp, guar));
|
||||
}
|
||||
}
|
||||
|
||||
let ident = Ident::new(Symbol::intern(&res_str), cx.with_call_site_ctxt(sp));
|
||||
|
||||
struct ConcatIdentsResult {
|
||||
ident: Ident,
|
||||
}
|
||||
|
||||
impl MacResult for ConcatIdentsResult {
|
||||
fn make_expr(self: Box<Self>) -> Option<P<Expr>> {
|
||||
Some(P(Expr {
|
||||
id: DUMMY_NODE_ID,
|
||||
kind: ExprKind::Path(None, Path::from_ident(self.ident)),
|
||||
span: self.ident.span,
|
||||
attrs: AttrVec::new(),
|
||||
tokens: None,
|
||||
}))
|
||||
}
|
||||
|
||||
fn make_ty(self: Box<Self>) -> Option<P<Ty>> {
|
||||
Some(P(Ty {
|
||||
id: DUMMY_NODE_ID,
|
||||
kind: TyKind::Path(None, Path::from_ident(self.ident)),
|
||||
span: self.ident.span,
|
||||
tokens: None,
|
||||
}))
|
||||
}
|
||||
}
|
||||
|
||||
ExpandResult::Ready(Box::new(ConcatIdentsResult { ident }))
|
||||
}
|
||||
|
|
@ -299,27 +299,6 @@ pub(crate) struct ConcatBytesBadRepeat {
|
|||
pub(crate) span: Span,
|
||||
}
|
||||
|
||||
#[derive(Diagnostic)]
|
||||
#[diag(builtin_macros_concat_idents_missing_args)]
|
||||
pub(crate) struct ConcatIdentsMissingArgs {
|
||||
#[primary_span]
|
||||
pub(crate) span: Span,
|
||||
}
|
||||
|
||||
#[derive(Diagnostic)]
|
||||
#[diag(builtin_macros_concat_idents_missing_comma)]
|
||||
pub(crate) struct ConcatIdentsMissingComma {
|
||||
#[primary_span]
|
||||
pub(crate) span: Span,
|
||||
}
|
||||
|
||||
#[derive(Diagnostic)]
|
||||
#[diag(builtin_macros_concat_idents_ident_args)]
|
||||
pub(crate) struct ConcatIdentsIdentArgs {
|
||||
#[primary_span]
|
||||
pub(crate) span: Span,
|
||||
}
|
||||
|
||||
#[derive(Diagnostic)]
|
||||
#[diag(builtin_macros_bad_derive_target, code = E0774)]
|
||||
pub(crate) struct BadDeriveTarget {
|
||||
|
|
|
|||
|
|
@ -36,7 +36,6 @@ mod cfg_eval;
|
|||
mod compile_error;
|
||||
mod concat;
|
||||
mod concat_bytes;
|
||||
mod concat_idents;
|
||||
mod define_opaque;
|
||||
mod derive;
|
||||
mod deriving;
|
||||
|
|
@ -84,7 +83,6 @@ pub fn register_builtin_macros(resolver: &mut dyn ResolverExpand) {
|
|||
compile_error: compile_error::expand_compile_error,
|
||||
concat: concat::expand_concat,
|
||||
concat_bytes: concat_bytes::expand_concat_bytes,
|
||||
concat_idents: concat_idents::expand_concat_idents,
|
||||
const_format_args: format::expand_format_args,
|
||||
core_panic: edition_panic::expand_panic,
|
||||
env: env::expand_env,
|
||||
|
|
|
|||
|
|
@ -285,4 +285,18 @@ declare_features! (
|
|||
// -------------------------------------------------------------------------
|
||||
// feature-group-end: removed features
|
||||
// -------------------------------------------------------------------------
|
||||
|
||||
|
||||
// -------------------------------------------------------------------------
|
||||
// feature-group-start: removed library features
|
||||
// -------------------------------------------------------------------------
|
||||
//
|
||||
// FIXME(#141617): we should have a better way to track removed library features, but we reuse
|
||||
// the infrastructure here so users still get hints. The symbols used here can be remove from
|
||||
// `symbol.rs` when that happens.
|
||||
(removed, concat_idents, "CURRENT_RUSTC_VERSION", Some(29599),
|
||||
Some("use the `${concat(..)}` metavariable expression instead"), 142704),
|
||||
// -------------------------------------------------------------------------
|
||||
// feature-group-end: removed library features
|
||||
// -------------------------------------------------------------------------
|
||||
);
|
||||
|
|
|
|||
|
|
@ -1109,45 +1109,6 @@ pub(crate) mod builtin {
|
|||
($name:expr $(,)?) => {{ /* compiler built-in */ }};
|
||||
}
|
||||
|
||||
/// Concatenates identifiers into one identifier.
|
||||
///
|
||||
/// This macro takes any number of comma-separated identifiers, and
|
||||
/// concatenates them all into one, yielding an expression which is a new
|
||||
/// identifier. Note that hygiene makes it such that this macro cannot
|
||||
/// capture local variables. Also, as a general rule, macros are only
|
||||
/// allowed in item, statement or expression position. That means while
|
||||
/// you may use this macro for referring to existing variables, functions or
|
||||
/// modules etc, you cannot define a new one with it.
|
||||
///
|
||||
/// # Examples
|
||||
///
|
||||
/// ```
|
||||
/// #![feature(concat_idents)]
|
||||
///
|
||||
/// # fn main() {
|
||||
/// fn foobar() -> u32 { 23 }
|
||||
///
|
||||
/// let f = concat_idents!(foo, bar);
|
||||
/// println!("{}", f());
|
||||
///
|
||||
/// // fn concat_idents!(new, fun, name) { } // not usable in this way!
|
||||
/// # }
|
||||
/// ```
|
||||
#[unstable(
|
||||
feature = "concat_idents",
|
||||
issue = "29599",
|
||||
reason = "`concat_idents` is not stable enough for use and is subject to change"
|
||||
)]
|
||||
#[deprecated(
|
||||
since = "1.88.0",
|
||||
note = "use `${concat(...)}` with the `macro_metavar_expr_concat` feature instead"
|
||||
)]
|
||||
#[rustc_builtin_macro]
|
||||
#[macro_export]
|
||||
macro_rules! concat_idents {
|
||||
($($e:ident),+ $(,)?) => {{ /* compiler built-in */ }};
|
||||
}
|
||||
|
||||
/// Concatenates literals into a byte slice.
|
||||
///
|
||||
/// This macro takes any number of comma-separated literals, and concatenates them all into
|
||||
|
|
|
|||
|
|
@ -58,10 +58,9 @@ pub use crate::fmt::macros::Debug;
|
|||
pub use crate::hash::macros::Hash;
|
||||
|
||||
#[stable(feature = "builtin_macro_prelude", since = "1.38.0")]
|
||||
#[allow(deprecated)]
|
||||
#[doc(no_inline)]
|
||||
pub use crate::{
|
||||
assert, cfg, column, compile_error, concat, concat_idents, env, file, format_args,
|
||||
assert, cfg, column, compile_error, concat, env, file, format_args,
|
||||
format_args_nl, include, include_bytes, include_str, line, log_syntax, module_path, option_env,
|
||||
stringify, trace_macros,
|
||||
};
|
||||
|
|
|
|||
|
|
@ -281,7 +281,6 @@
|
|||
#![feature(cfg_target_thread_local)]
|
||||
#![feature(cfi_encoding)]
|
||||
#![feature(char_max_len)]
|
||||
#![feature(concat_idents)]
|
||||
#![feature(core_float_math)]
|
||||
#![feature(decl_macro)]
|
||||
#![feature(deprecated_suggestion)]
|
||||
|
|
@ -717,10 +716,9 @@ pub use core::primitive;
|
|||
pub use core::todo;
|
||||
// Re-export built-in macros defined through core.
|
||||
#[stable(feature = "builtin_macro_prelude", since = "1.38.0")]
|
||||
#[allow(deprecated)]
|
||||
pub use core::{
|
||||
assert, assert_matches, cfg, column, compile_error, concat, concat_idents, const_format_args,
|
||||
env, file, format_args, format_args_nl, include, include_bytes, include_str, line, log_syntax,
|
||||
assert, assert_matches, cfg, column, compile_error, concat, const_format_args, env, file,
|
||||
format_args, format_args_nl, include, include_bytes, include_str, line, log_syntax,
|
||||
module_path, option_env, stringify, trace_macros,
|
||||
};
|
||||
// Re-export macros defined in core.
|
||||
|
|
|
|||
|
|
@ -45,10 +45,9 @@ pub use crate::result::Result::{self, Err, Ok};
|
|||
|
||||
// Re-exported built-in macros
|
||||
#[stable(feature = "builtin_macro_prelude", since = "1.38.0")]
|
||||
#[allow(deprecated)]
|
||||
#[doc(no_inline)]
|
||||
pub use core::prelude::v1::{
|
||||
assert, cfg, column, compile_error, concat, concat_idents, env, file, format_args,
|
||||
assert, cfg, column, compile_error, concat, env, file, format_args,
|
||||
format_args_nl, include, include_bytes, include_str, line, log_syntax, module_path, option_env,
|
||||
stringify, trace_macros, Clone, Copy, Debug, Default, Eq, Hash, Ord, PartialEq, PartialOrd,
|
||||
};
|
||||
|
|
|
|||
|
|
@ -8,7 +8,8 @@ In stable Rust, there is no way to create new identifiers by joining identifiers
|
|||
`#![feature(macro_metavar_expr_concat)]` introduces a way to do this, using the concat metavariable expression.
|
||||
|
||||
> This feature uses the syntax from [`macro_metavar_expr`] but is otherwise
|
||||
> independent. It replaces the old unstable feature [`concat_idents`].
|
||||
> independent. It replaces the since-removed unstable feature
|
||||
> [`concat_idents`].
|
||||
|
||||
> This is an experimental feature; it and its syntax will require a RFC before stabilization.
|
||||
|
||||
|
|
@ -126,8 +127,7 @@ test result: ok. 6 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; fini
|
|||
|
||||
[`paste`]: https://crates.io/crates/paste
|
||||
[RFC 3086]: https://rust-lang.github.io/rfcs/3086-macro-metavar-expr.html
|
||||
[`concat_idents!`]: https://doc.rust-lang.org/nightly/std/macro.concat_idents.html
|
||||
[`macro_metavar_expr`]: ../language-features/macro-metavar-expr.md
|
||||
[`concat_idents`]: ../library-features/concat-idents.md
|
||||
[`concat_idents`]: https://github.com/rust-lang/rust/issues/29599
|
||||
[#124225]: https://github.com/rust-lang/rust/issues/124225
|
||||
[declarative macros]: https://doc.rust-lang.org/stable/reference/macros-by-example.html
|
||||
|
|
|
|||
|
|
@ -1,27 +0,0 @@
|
|||
# `concat_idents`
|
||||
|
||||
The tracking issue for this feature is: [#29599]
|
||||
|
||||
This feature is deprecated, to be replaced by [`macro_metavar_expr_concat`].
|
||||
|
||||
[#29599]: https://github.com/rust-lang/rust/issues/29599
|
||||
[`macro_metavar_expr_concat`]: https://github.com/rust-lang/rust/issues/124225
|
||||
|
||||
------------------------
|
||||
|
||||
> This feature is expected to be superseded by [`macro_metavar_expr_concat`](../language-features/macro-metavar-expr-concat.md).
|
||||
|
||||
The `concat_idents` feature adds a macro for concatenating multiple identifiers
|
||||
into one identifier.
|
||||
|
||||
## Examples
|
||||
|
||||
```rust
|
||||
#![feature(concat_idents)]
|
||||
|
||||
fn main() {
|
||||
fn foobar() -> u32 { 23 }
|
||||
let f = concat_idents!(foo, bar);
|
||||
assert_eq!(f(), 23);
|
||||
}
|
||||
```
|
||||
|
|
@ -2070,7 +2070,6 @@ ui/issues/issue-32782.rs
|
|||
ui/issues/issue-32797.rs
|
||||
ui/issues/issue-32805.rs
|
||||
ui/issues/issue-3290.rs
|
||||
ui/issues/issue-32950.rs
|
||||
ui/issues/issue-32995-2.rs
|
||||
ui/issues/issue-32995.rs
|
||||
ui/issues/issue-33202.rs
|
||||
|
|
@ -2340,7 +2339,6 @@ ui/issues/issue-49934.rs
|
|||
ui/issues/issue-49955.rs
|
||||
ui/issues/issue-49973.rs
|
||||
ui/issues/issue-50187.rs
|
||||
ui/issues/issue-50403.rs
|
||||
ui/issues/issue-50411.rs
|
||||
ui/issues/issue-50415.rs
|
||||
ui/issues/issue-50442.rs
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ use ignore::Walk;
|
|||
const ENTRY_LIMIT: u32 = 901;
|
||||
// FIXME: The following limits should be reduced eventually.
|
||||
|
||||
const ISSUES_ENTRY_LIMIT: u32 = 1623;
|
||||
const ISSUES_ENTRY_LIMIT: u32 = 1619;
|
||||
|
||||
const EXPECTED_TEST_FILE_EXTENSIONS: &[&str] = &[
|
||||
"rs", // test source files
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
#![feature(concat_idents)]
|
||||
#![allow(nonstandard_style)]
|
||||
/// Generate 250 items that all match the query, starting with the longest.
|
||||
/// Those long items should be dropped from the result set, and the short ones
|
||||
|
|
|
|||
12
tests/ui/derives/nonsense-input-to-debug.rs
Normal file
12
tests/ui/derives/nonsense-input-to-debug.rs
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
// Issue: #32950
|
||||
// Ensure that using macros rather than a type doesn't break `derive`.
|
||||
|
||||
#[derive(Debug)]
|
||||
struct Nonsense<T> {
|
||||
//~^ ERROR type parameter `T` is never used
|
||||
should_be_vec_t: vec![T],
|
||||
//~^ ERROR `derive` cannot be used on items with type macros
|
||||
//~| ERROR expected type, found `expr` metavariable
|
||||
}
|
||||
|
||||
fn main() {}
|
||||
30
tests/ui/derives/nonsense-input-to-debug.stderr
Normal file
30
tests/ui/derives/nonsense-input-to-debug.stderr
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
error: `derive` cannot be used on items with type macros
|
||||
--> $DIR/nonsense-input-to-debug.rs:7:22
|
||||
|
|
||||
LL | should_be_vec_t: vec![T],
|
||||
| ^^^^^^^
|
||||
|
||||
error: expected type, found `expr` metavariable
|
||||
--> $DIR/nonsense-input-to-debug.rs:7:22
|
||||
|
|
||||
LL | should_be_vec_t: vec![T],
|
||||
| ^^^^^^^
|
||||
| |
|
||||
| expected type
|
||||
| in this macro invocation
|
||||
| this macro call doesn't expand to a type
|
||||
|
|
||||
= note: this error originates in the macro `vec` (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
|
||||
error[E0392]: type parameter `T` is never used
|
||||
--> $DIR/nonsense-input-to-debug.rs:5:17
|
||||
|
|
||||
LL | struct Nonsense<T> {
|
||||
| ^ unused type parameter
|
||||
|
|
||||
= help: consider removing `T`, referring to it in a field, or using a marker such as `PhantomData`
|
||||
= help: if you intended `T` to be a const parameter, use `const T: /* Type */` instead
|
||||
|
||||
error: aborting due to 3 previous errors
|
||||
|
||||
For more information about this error, try `rustc --explain E0392`.
|
||||
|
|
@ -1,11 +0,0 @@
|
|||
#![expect(deprecated)] // concat_idents is deprecated
|
||||
|
||||
const XY_1: i32 = 10;
|
||||
|
||||
fn main() {
|
||||
const XY_2: i32 = 20;
|
||||
let a = concat_idents!(X, Y_1); //~ ERROR `concat_idents` is not stable
|
||||
let b = concat_idents!(X, Y_2); //~ ERROR `concat_idents` is not stable
|
||||
assert_eq!(a, 10);
|
||||
assert_eq!(b, 20);
|
||||
}
|
||||
|
|
@ -1,23 +0,0 @@
|
|||
error[E0658]: use of unstable library feature `concat_idents`: `concat_idents` is not stable enough for use and is subject to change
|
||||
--> $DIR/feature-gate-concat_idents.rs:7:13
|
||||
|
|
||||
LL | let a = concat_idents!(X, Y_1);
|
||||
| ^^^^^^^^^^^^^
|
||||
|
|
||||
= note: see issue #29599 <https://github.com/rust-lang/rust/issues/29599> for more information
|
||||
= help: add `#![feature(concat_idents)]` to the crate attributes to enable
|
||||
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
|
||||
|
||||
error[E0658]: use of unstable library feature `concat_idents`: `concat_idents` is not stable enough for use and is subject to change
|
||||
--> $DIR/feature-gate-concat_idents.rs:8:13
|
||||
|
|
||||
LL | let b = concat_idents!(X, Y_2);
|
||||
| ^^^^^^^^^^^^^
|
||||
|
|
||||
= note: see issue #29599 <https://github.com/rust-lang/rust/issues/29599> for more information
|
||||
= help: add `#![feature(concat_idents)]` to the crate attributes to enable
|
||||
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
|
||||
|
||||
error: aborting due to 2 previous errors
|
||||
|
||||
For more information about this error, try `rustc --explain E0658`.
|
||||
|
|
@ -1,6 +0,0 @@
|
|||
#![expect(deprecated)] // concat_idents is deprecated
|
||||
|
||||
fn main() {
|
||||
concat_idents!(a, b); //~ ERROR `concat_idents` is not stable enough
|
||||
//~| ERROR cannot find value `ab` in this scope
|
||||
}
|
||||
|
|
@ -1,20 +0,0 @@
|
|||
error[E0658]: use of unstable library feature `concat_idents`: `concat_idents` is not stable enough for use and is subject to change
|
||||
--> $DIR/feature-gate-concat_idents2.rs:4:5
|
||||
|
|
||||
LL | concat_idents!(a, b);
|
||||
| ^^^^^^^^^^^^^
|
||||
|
|
||||
= note: see issue #29599 <https://github.com/rust-lang/rust/issues/29599> for more information
|
||||
= help: add `#![feature(concat_idents)]` to the crate attributes to enable
|
||||
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
|
||||
|
||||
error[E0425]: cannot find value `ab` in this scope
|
||||
--> $DIR/feature-gate-concat_idents2.rs:4:5
|
||||
|
|
||||
LL | concat_idents!(a, b);
|
||||
| ^^^^^^^^^^^^^^^^^^^^ not found in this scope
|
||||
|
||||
error: aborting due to 2 previous errors
|
||||
|
||||
Some errors have detailed explanations: E0425, E0658.
|
||||
For more information about an error, try `rustc --explain E0425`.
|
||||
|
|
@ -1,9 +0,0 @@
|
|||
#![expect(deprecated)] // concat_idents is deprecated
|
||||
|
||||
const XY_1: i32 = 10;
|
||||
|
||||
fn main() {
|
||||
const XY_2: i32 = 20;
|
||||
assert_eq!(10, concat_idents!(X, Y_1)); //~ ERROR `concat_idents` is not stable
|
||||
assert_eq!(20, concat_idents!(X, Y_2)); //~ ERROR `concat_idents` is not stable
|
||||
}
|
||||
|
|
@ -1,23 +0,0 @@
|
|||
error[E0658]: use of unstable library feature `concat_idents`: `concat_idents` is not stable enough for use and is subject to change
|
||||
--> $DIR/feature-gate-concat_idents3.rs:7:20
|
||||
|
|
||||
LL | assert_eq!(10, concat_idents!(X, Y_1));
|
||||
| ^^^^^^^^^^^^^
|
||||
|
|
||||
= note: see issue #29599 <https://github.com/rust-lang/rust/issues/29599> for more information
|
||||
= help: add `#![feature(concat_idents)]` to the crate attributes to enable
|
||||
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
|
||||
|
||||
error[E0658]: use of unstable library feature `concat_idents`: `concat_idents` is not stable enough for use and is subject to change
|
||||
--> $DIR/feature-gate-concat_idents3.rs:8:20
|
||||
|
|
||||
LL | assert_eq!(20, concat_idents!(X, Y_2));
|
||||
| ^^^^^^^^^^^^^
|
||||
|
|
||||
= note: see issue #29599 <https://github.com/rust-lang/rust/issues/29599> for more information
|
||||
= help: add `#![feature(concat_idents)]` to the crate attributes to enable
|
||||
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
|
||||
|
||||
error: aborting due to 2 previous errors
|
||||
|
||||
For more information about this error, try `rustc --explain E0658`.
|
||||
|
|
@ -1,10 +0,0 @@
|
|||
#![feature(concat_idents)]
|
||||
#![expect(deprecated)] // concat_idents is deprecated
|
||||
|
||||
#[derive(Debug)]
|
||||
struct Baz<T>(
|
||||
concat_idents!(Foo, Bar) //~ ERROR `derive` cannot be used on items with type macros
|
||||
//~^ ERROR cannot find type `FooBar` in this scope
|
||||
);
|
||||
|
||||
fn main() {}
|
||||
|
|
@ -1,15 +0,0 @@
|
|||
error: `derive` cannot be used on items with type macros
|
||||
--> $DIR/issue-32950.rs:6:5
|
||||
|
|
||||
LL | concat_idents!(Foo, Bar)
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error[E0412]: cannot find type `FooBar` in this scope
|
||||
--> $DIR/issue-32950.rs:6:5
|
||||
|
|
||||
LL | concat_idents!(Foo, Bar)
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^ not found in this scope
|
||||
|
||||
error: aborting due to 2 previous errors
|
||||
|
||||
For more information about this error, try `rustc --explain E0412`.
|
||||
|
|
@ -1,6 +0,0 @@
|
|||
#![feature(concat_idents)]
|
||||
#![expect(deprecated)] // concat_idents is deprecated
|
||||
|
||||
fn main() {
|
||||
let x = concat_idents!(); //~ ERROR `concat_idents!()` takes 1 or more arguments
|
||||
}
|
||||
|
|
@ -1,8 +0,0 @@
|
|||
error: `concat_idents!()` takes 1 or more arguments
|
||||
--> $DIR/issue-50403.rs:5:13
|
||||
|
|
||||
LL | let x = concat_idents!();
|
||||
| ^^^^^^^^^^^^^^^^
|
||||
|
||||
error: aborting due to 1 previous error
|
||||
|
||||
|
|
@ -15,7 +15,6 @@
|
|||
#![cfg_attr(core, no_std)]
|
||||
|
||||
#![allow(deprecated)] // for deprecated `try!()` macro
|
||||
#![feature(concat_idents)]
|
||||
|
||||
#[cfg(std)] use std::fmt;
|
||||
#[cfg(core)] use core::fmt;
|
||||
|
|
@ -79,17 +78,6 @@ fn concat() {
|
|||
let _ = concat!("hello", " world",);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn concat_idents() {
|
||||
fn foo() {}
|
||||
fn foobar() {}
|
||||
|
||||
concat_idents!(foo)();
|
||||
concat_idents!(foo,)();
|
||||
concat_idents!(foo, bar)();
|
||||
concat_idents!(foo, bar,)();
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn debug_assert() {
|
||||
debug_assert!(true);
|
||||
|
|
|
|||
12
tests/ui/macros/macro-metavar-expr-concat/empty-input.rs
Normal file
12
tests/ui/macros/macro-metavar-expr-concat/empty-input.rs
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
// Issue 50403
|
||||
// Ensure that `concat` can't create empty identifiers
|
||||
// FIXME(macro_metavar_expr_concat): this error message could be improved
|
||||
|
||||
macro_rules! empty {
|
||||
() => { ${concat()} } //~ ERROR expected identifier or string literal
|
||||
//~^ERROR expected expression
|
||||
}
|
||||
|
||||
fn main() {
|
||||
let x = empty!();
|
||||
}
|
||||
19
tests/ui/macros/macro-metavar-expr-concat/empty-input.stderr
Normal file
19
tests/ui/macros/macro-metavar-expr-concat/empty-input.stderr
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
error: expected identifier or string literal
|
||||
--> $DIR/empty-input.rs:6:14
|
||||
|
|
||||
LL | () => { ${concat()} }
|
||||
| ^^^^^^^^^^
|
||||
|
||||
error: expected expression, found `$`
|
||||
--> $DIR/empty-input.rs:6:13
|
||||
|
|
||||
LL | () => { ${concat()} }
|
||||
| ^ expected expression
|
||||
...
|
||||
LL | let x = empty!();
|
||||
| -------- in this macro invocation
|
||||
|
|
||||
= note: this error originates in the macro `empty` (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
|
||||
error: aborting due to 2 previous errors
|
||||
|
||||
|
|
@ -3,9 +3,8 @@
|
|||
// test that errors in a (selection) of macros don't kill compilation
|
||||
// immediately, so that we get more errors listed at a time.
|
||||
|
||||
#![feature(trace_macros, concat_idents)]
|
||||
#![feature(trace_macros)]
|
||||
#![feature(stmt_expr_attributes)]
|
||||
#![expect(deprecated)] // concat_idents is deprecated
|
||||
|
||||
use std::arch::asm;
|
||||
|
||||
|
|
@ -105,8 +104,6 @@ fn main() {
|
|||
asm!(invalid); //~ ERROR
|
||||
llvm_asm!(invalid); //~ ERROR
|
||||
|
||||
concat_idents!("not", "idents"); //~ ERROR
|
||||
|
||||
option_env!(invalid); //~ ERROR
|
||||
env!(invalid); //~ ERROR
|
||||
env!(foo, abr, baz); //~ ERROR
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
error: the `#[default]` attribute may only be used on unit enum variants
|
||||
--> $DIR/macros-nonfatal-errors.rs:14:5
|
||||
--> $DIR/macros-nonfatal-errors.rs:13:5
|
||||
|
|
||||
LL | #[default]
|
||||
| ^^^^^^^^^^
|
||||
|
|
@ -7,7 +7,7 @@ LL | #[default]
|
|||
= help: consider a manual implementation of `Default`
|
||||
|
||||
error: the `#[default]` attribute may only be used on unit enum variants
|
||||
--> $DIR/macros-nonfatal-errors.rs:19:36
|
||||
--> $DIR/macros-nonfatal-errors.rs:18:36
|
||||
|
|
||||
LL | struct DefaultInnerAttrTupleStruct(#[default] ());
|
||||
| ^^^^^^^^^^
|
||||
|
|
@ -15,7 +15,7 @@ LL | struct DefaultInnerAttrTupleStruct(#[default] ());
|
|||
= help: consider a manual implementation of `Default`
|
||||
|
||||
error: the `#[default]` attribute may only be used on unit enum variants
|
||||
--> $DIR/macros-nonfatal-errors.rs:23:1
|
||||
--> $DIR/macros-nonfatal-errors.rs:22:1
|
||||
|
|
||||
LL | #[default]
|
||||
| ^^^^^^^^^^
|
||||
|
|
@ -23,7 +23,7 @@ LL | #[default]
|
|||
= help: consider a manual implementation of `Default`
|
||||
|
||||
error: the `#[default]` attribute may only be used on unit enum variants
|
||||
--> $DIR/macros-nonfatal-errors.rs:27:1
|
||||
--> $DIR/macros-nonfatal-errors.rs:26:1
|
||||
|
|
||||
LL | #[default]
|
||||
| ^^^^^^^^^^
|
||||
|
|
@ -31,7 +31,7 @@ LL | #[default]
|
|||
= help: consider a manual implementation of `Default`
|
||||
|
||||
error: the `#[default]` attribute may only be used on unit enum variants
|
||||
--> $DIR/macros-nonfatal-errors.rs:37:11
|
||||
--> $DIR/macros-nonfatal-errors.rs:36:11
|
||||
|
|
||||
LL | Foo = #[default] 0,
|
||||
| ^^^^^^^^^^
|
||||
|
|
@ -39,7 +39,7 @@ LL | Foo = #[default] 0,
|
|||
= help: consider a manual implementation of `Default`
|
||||
|
||||
error: the `#[default]` attribute may only be used on unit enum variants
|
||||
--> $DIR/macros-nonfatal-errors.rs:38:14
|
||||
--> $DIR/macros-nonfatal-errors.rs:37:14
|
||||
|
|
||||
LL | Bar([u8; #[default] 1]),
|
||||
| ^^^^^^^^^^
|
||||
|
|
@ -47,7 +47,7 @@ LL | Bar([u8; #[default] 1]),
|
|||
= help: consider a manual implementation of `Default`
|
||||
|
||||
error[E0665]: `#[derive(Default)]` on enum with no `#[default]`
|
||||
--> $DIR/macros-nonfatal-errors.rs:43:10
|
||||
--> $DIR/macros-nonfatal-errors.rs:42:10
|
||||
|
|
||||
LL | #[derive(Default)]
|
||||
| ^^^^^^^
|
||||
|
|
@ -67,7 +67,7 @@ LL | #[default] Bar,
|
|||
| ++++++++++
|
||||
|
||||
error[E0665]: `#[derive(Default)]` on enum with no `#[default]`
|
||||
--> $DIR/macros-nonfatal-errors.rs:49:10
|
||||
--> $DIR/macros-nonfatal-errors.rs:48:10
|
||||
|
|
||||
LL | #[derive(Default)]
|
||||
| ^^^^^^^
|
||||
|
|
@ -78,7 +78,7 @@ LL | | }
|
|||
| |_- this enum needs a unit variant marked with `#[default]`
|
||||
|
||||
error: multiple declared defaults
|
||||
--> $DIR/macros-nonfatal-errors.rs:55:10
|
||||
--> $DIR/macros-nonfatal-errors.rs:54:10
|
||||
|
|
||||
LL | #[derive(Default)]
|
||||
| ^^^^^^^
|
||||
|
|
@ -95,7 +95,7 @@ LL | Baz,
|
|||
= note: only one variant can be default
|
||||
|
||||
error: `#[default]` attribute does not accept a value
|
||||
--> $DIR/macros-nonfatal-errors.rs:67:5
|
||||
--> $DIR/macros-nonfatal-errors.rs:66:5
|
||||
|
|
||||
LL | #[default = 1]
|
||||
| ^^^^^^^^^^^^^^
|
||||
|
|
@ -103,7 +103,7 @@ LL | #[default = 1]
|
|||
= help: try using `#[default]`
|
||||
|
||||
error: multiple `#[default]` attributes
|
||||
--> $DIR/macros-nonfatal-errors.rs:75:5
|
||||
--> $DIR/macros-nonfatal-errors.rs:74:5
|
||||
|
|
||||
LL | #[default]
|
||||
| ---------- `#[default]` used here
|
||||
|
|
@ -114,13 +114,13 @@ LL | Foo,
|
|||
|
|
||||
= note: only one `#[default]` attribute is needed
|
||||
help: try removing this
|
||||
--> $DIR/macros-nonfatal-errors.rs:74:5
|
||||
--> $DIR/macros-nonfatal-errors.rs:73:5
|
||||
|
|
||||
LL | #[default]
|
||||
| ^^^^^^^^^^
|
||||
|
||||
error: multiple `#[default]` attributes
|
||||
--> $DIR/macros-nonfatal-errors.rs:85:5
|
||||
--> $DIR/macros-nonfatal-errors.rs:84:5
|
||||
|
|
||||
LL | #[default]
|
||||
| ---------- `#[default]` used here
|
||||
|
|
@ -132,7 +132,7 @@ LL | Foo,
|
|||
|
|
||||
= note: only one `#[default]` attribute is needed
|
||||
help: try removing these
|
||||
--> $DIR/macros-nonfatal-errors.rs:82:5
|
||||
--> $DIR/macros-nonfatal-errors.rs:81:5
|
||||
|
|
||||
LL | #[default]
|
||||
| ^^^^^^^^^^
|
||||
|
|
@ -142,7 +142,7 @@ LL | #[default]
|
|||
| ^^^^^^^^^^
|
||||
|
||||
error: the `#[default]` attribute may only be used on unit enum variants
|
||||
--> $DIR/macros-nonfatal-errors.rs:92:5
|
||||
--> $DIR/macros-nonfatal-errors.rs:91:5
|
||||
|
|
||||
LL | Foo {},
|
||||
| ^^^
|
||||
|
|
@ -150,7 +150,7 @@ LL | Foo {},
|
|||
= help: consider a manual implementation of `Default`
|
||||
|
||||
error: default variant must be exhaustive
|
||||
--> $DIR/macros-nonfatal-errors.rs:100:5
|
||||
--> $DIR/macros-nonfatal-errors.rs:99:5
|
||||
|
|
||||
LL | #[non_exhaustive]
|
||||
| ----------------- declared `#[non_exhaustive]` here
|
||||
|
|
@ -160,37 +160,31 @@ LL | Foo,
|
|||
= help: consider a manual implementation of `Default`
|
||||
|
||||
error: asm template must be a string literal
|
||||
--> $DIR/macros-nonfatal-errors.rs:105:10
|
||||
--> $DIR/macros-nonfatal-errors.rs:104:10
|
||||
|
|
||||
LL | asm!(invalid);
|
||||
| ^^^^^^^
|
||||
|
||||
error: `concat_idents!()` requires ident args
|
||||
--> $DIR/macros-nonfatal-errors.rs:108:5
|
||||
|
|
||||
LL | concat_idents!("not", "idents");
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error: argument must be a string literal
|
||||
--> $DIR/macros-nonfatal-errors.rs:110:17
|
||||
--> $DIR/macros-nonfatal-errors.rs:107:17
|
||||
|
|
||||
LL | option_env!(invalid);
|
||||
| ^^^^^^^
|
||||
|
||||
error: expected string literal
|
||||
--> $DIR/macros-nonfatal-errors.rs:111:10
|
||||
--> $DIR/macros-nonfatal-errors.rs:108:10
|
||||
|
|
||||
LL | env!(invalid);
|
||||
| ^^^^^^^
|
||||
|
||||
error: `env!()` takes 1 or 2 arguments
|
||||
--> $DIR/macros-nonfatal-errors.rs:112:5
|
||||
--> $DIR/macros-nonfatal-errors.rs:109:5
|
||||
|
|
||||
LL | env!(foo, abr, baz);
|
||||
| ^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error: environment variable `RUST_HOPEFULLY_THIS_DOESNT_EXIST` not defined at compile time
|
||||
--> $DIR/macros-nonfatal-errors.rs:113:5
|
||||
--> $DIR/macros-nonfatal-errors.rs:110:5
|
||||
|
|
||||
LL | env!("RUST_HOPEFULLY_THIS_DOESNT_EXIST");
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
|
@ -198,7 +192,7 @@ LL | env!("RUST_HOPEFULLY_THIS_DOESNT_EXIST");
|
|||
= help: use `std::env::var("RUST_HOPEFULLY_THIS_DOESNT_EXIST")` to read the variable at run time
|
||||
|
||||
error: format argument must be a string literal
|
||||
--> $DIR/macros-nonfatal-errors.rs:115:13
|
||||
--> $DIR/macros-nonfatal-errors.rs:112:13
|
||||
|
|
||||
LL | format!(invalid);
|
||||
| ^^^^^^^
|
||||
|
|
@ -209,43 +203,43 @@ LL | format!("{}", invalid);
|
|||
| +++++
|
||||
|
||||
error: argument must be a string literal
|
||||
--> $DIR/macros-nonfatal-errors.rs:117:14
|
||||
--> $DIR/macros-nonfatal-errors.rs:114:14
|
||||
|
|
||||
LL | include!(invalid);
|
||||
| ^^^^^^^
|
||||
|
||||
error: argument must be a string literal
|
||||
--> $DIR/macros-nonfatal-errors.rs:119:18
|
||||
--> $DIR/macros-nonfatal-errors.rs:116:18
|
||||
|
|
||||
LL | include_str!(invalid);
|
||||
| ^^^^^^^
|
||||
|
||||
error: couldn't read `$DIR/i'd be quite surprised if a file with this name existed`: $FILE_NOT_FOUND_MSG
|
||||
--> $DIR/macros-nonfatal-errors.rs:120:5
|
||||
--> $DIR/macros-nonfatal-errors.rs:117:5
|
||||
|
|
||||
LL | include_str!("i'd be quite surprised if a file with this name existed");
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error: argument must be a string literal
|
||||
--> $DIR/macros-nonfatal-errors.rs:121:20
|
||||
--> $DIR/macros-nonfatal-errors.rs:118:20
|
||||
|
|
||||
LL | include_bytes!(invalid);
|
||||
| ^^^^^^^
|
||||
|
||||
error: couldn't read `$DIR/i'd be quite surprised if a file with this name existed`: $FILE_NOT_FOUND_MSG
|
||||
--> $DIR/macros-nonfatal-errors.rs:122:5
|
||||
--> $DIR/macros-nonfatal-errors.rs:119:5
|
||||
|
|
||||
LL | include_bytes!("i'd be quite surprised if a file with this name existed");
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error: trace_macros! accepts only `true` or `false`
|
||||
--> $DIR/macros-nonfatal-errors.rs:124:5
|
||||
--> $DIR/macros-nonfatal-errors.rs:121:5
|
||||
|
|
||||
LL | trace_macros!(invalid);
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error: default variant must be exhaustive
|
||||
--> $DIR/macros-nonfatal-errors.rs:134:9
|
||||
--> $DIR/macros-nonfatal-errors.rs:131:9
|
||||
|
|
||||
LL | #[non_exhaustive]
|
||||
| ----------------- declared `#[non_exhaustive]` here
|
||||
|
|
@ -255,11 +249,11 @@ LL | Foo,
|
|||
= help: consider a manual implementation of `Default`
|
||||
|
||||
error: cannot find macro `llvm_asm` in this scope
|
||||
--> $DIR/macros-nonfatal-errors.rs:106:5
|
||||
--> $DIR/macros-nonfatal-errors.rs:105:5
|
||||
|
|
||||
LL | llvm_asm!(invalid);
|
||||
| ^^^^^^^^
|
||||
|
||||
error: aborting due to 29 previous errors
|
||||
error: aborting due to 28 previous errors
|
||||
|
||||
For more information about this error, try `rustc --explain E0665`.
|
||||
|
|
|
|||
|
|
@ -1,15 +0,0 @@
|
|||
//@ run-pass
|
||||
|
||||
#![feature(concat_idents)]
|
||||
#![expect(deprecated)] // concat_idents is deprecated
|
||||
|
||||
pub fn main() {
|
||||
struct Foo;
|
||||
let _: concat_idents!(F, oo) = Foo; // Test that `concat_idents!` can be used in type positions
|
||||
|
||||
let asdf_fdsa = "<.<".to_string();
|
||||
// concat_idents should have call-site hygiene.
|
||||
assert!(concat_idents!(asd, f_f, dsa) == "<.<".to_string());
|
||||
|
||||
assert_eq!(stringify!(use_mention_distinction), "use_mention_distinction");
|
||||
}
|
||||
|
|
@ -12,7 +12,6 @@
|
|||
#![feature(auto_traits)]
|
||||
#![feature(box_patterns)]
|
||||
#![feature(builtin_syntax)]
|
||||
#![feature(concat_idents)]
|
||||
#![feature(const_trait_impl)]
|
||||
#![feature(decl_macro)]
|
||||
#![feature(deref_patterns)]
|
||||
|
|
@ -309,7 +308,6 @@ mod expressions {
|
|||
|
||||
|
||||
|
||||
// concat_idents is deprecated
|
||||
|
||||
|
||||
|
||||
|
|
@ -622,8 +620,12 @@ mod types {
|
|||
/*! there is no syntax for this */
|
||||
}
|
||||
/// TyKind::MacCall
|
||||
#[expect(deprecated)]
|
||||
fn ty_mac_call() { let _: T; let _: T; let _: T; }
|
||||
fn ty_mac_call() {
|
||||
macro_rules! ty { ($ty:ty) => { $ty } }
|
||||
let _: T;
|
||||
let _: T;
|
||||
let _: T;
|
||||
}
|
||||
/// TyKind::CVarArgs
|
||||
fn ty_c_var_args() {
|
||||
/*! FIXME: todo */
|
||||
|
|
|
|||
|
|
@ -1,17 +1,17 @@
|
|||
error[E0697]: closures cannot be static
|
||||
--> $DIR/exhaustive.rs:211:9
|
||||
--> $DIR/exhaustive.rs:210:9
|
||||
|
|
||||
LL | static || value;
|
||||
| ^^^^^^^^^
|
||||
|
||||
error[E0697]: closures cannot be static
|
||||
--> $DIR/exhaustive.rs:212:9
|
||||
--> $DIR/exhaustive.rs:211:9
|
||||
|
|
||||
LL | static move || value;
|
||||
| ^^^^^^^^^^^^^^
|
||||
|
||||
error[E0728]: `await` is only allowed inside `async` functions and blocks
|
||||
--> $DIR/exhaustive.rs:241:13
|
||||
--> $DIR/exhaustive.rs:240:13
|
||||
|
|
||||
LL | fn expr_await() {
|
||||
| --------------- this is not `async`
|
||||
|
|
@ -20,19 +20,19 @@ LL | fut.await;
|
|||
| ^^^^^ only allowed inside `async` functions and blocks
|
||||
|
||||
error: in expressions, `_` can only be used on the left-hand side of an assignment
|
||||
--> $DIR/exhaustive.rs:290:9
|
||||
--> $DIR/exhaustive.rs:289:9
|
||||
|
|
||||
LL | _;
|
||||
| ^ `_` not allowed here
|
||||
|
||||
error[E0214]: parenthesized type parameters may only be used with a `Fn` trait
|
||||
--> $DIR/exhaustive.rs:300:9
|
||||
--> $DIR/exhaustive.rs:299:9
|
||||
|
|
||||
LL | x::();
|
||||
| ^^^^^ only `Fn` traits may use parentheses
|
||||
|
||||
error[E0214]: parenthesized type parameters may only be used with a `Fn` trait
|
||||
--> $DIR/exhaustive.rs:301:9
|
||||
--> $DIR/exhaustive.rs:300:9
|
||||
|
|
||||
LL | x::(T, T) -> T;
|
||||
| ^^^^^^^^^^^^^^ only `Fn` traits may use parentheses
|
||||
|
|
@ -44,31 +44,31 @@ LL + x::<T, T> -> T;
|
|||
|
|
||||
|
||||
error[E0214]: parenthesized type parameters may only be used with a `Fn` trait
|
||||
--> $DIR/exhaustive.rs:302:9
|
||||
--> $DIR/exhaustive.rs:301:9
|
||||
|
|
||||
LL | crate::() -> ()::expressions::() -> ()::expr_path;
|
||||
| ^^^^^^^^^^^^^^^ only `Fn` traits may use parentheses
|
||||
|
||||
error[E0214]: parenthesized type parameters may only be used with a `Fn` trait
|
||||
--> $DIR/exhaustive.rs:302:26
|
||||
--> $DIR/exhaustive.rs:301:26
|
||||
|
|
||||
LL | crate::() -> ()::expressions::() -> ()::expr_path;
|
||||
| ^^^^^^^^^^^^^^^^^^^^^ only `Fn` traits may use parentheses
|
||||
|
||||
error[E0214]: parenthesized type parameters may only be used with a `Fn` trait
|
||||
--> $DIR/exhaustive.rs:305:9
|
||||
--> $DIR/exhaustive.rs:304:9
|
||||
|
|
||||
LL | core::()::marker::()::PhantomData;
|
||||
| ^^^^^^^^ only `Fn` traits may use parentheses
|
||||
|
||||
error[E0214]: parenthesized type parameters may only be used with a `Fn` trait
|
||||
--> $DIR/exhaustive.rs:305:19
|
||||
--> $DIR/exhaustive.rs:304:19
|
||||
|
|
||||
LL | core::()::marker::()::PhantomData;
|
||||
| ^^^^^^^^^^ only `Fn` traits may use parentheses
|
||||
|
||||
error: `yield` can only be used in `#[coroutine]` closures, or `gen` blocks
|
||||
--> $DIR/exhaustive.rs:392:9
|
||||
--> $DIR/exhaustive.rs:391:9
|
||||
|
|
||||
LL | yield;
|
||||
| ^^^^^
|
||||
|
|
@ -79,7 +79,7 @@ LL | #[coroutine] fn expr_yield() {
|
|||
| ++++++++++++
|
||||
|
||||
error[E0703]: invalid ABI: found `C++`
|
||||
--> $DIR/exhaustive.rs:472:23
|
||||
--> $DIR/exhaustive.rs:471:23
|
||||
|
|
||||
LL | unsafe extern "C++" {}
|
||||
| ^^^^^ invalid ABI
|
||||
|
|
@ -87,7 +87,7 @@ LL | unsafe extern "C++" {}
|
|||
= note: invoke `rustc --print=calling-conventions` for a full list of supported calling conventions
|
||||
|
||||
error: `..` patterns are not allowed here
|
||||
--> $DIR/exhaustive.rs:679:13
|
||||
--> $DIR/exhaustive.rs:678:13
|
||||
|
|
||||
LL | let ..;
|
||||
| ^^
|
||||
|
|
@ -95,13 +95,13 @@ LL | let ..;
|
|||
= note: only allowed in tuple, tuple struct, and slice patterns
|
||||
|
||||
error[E0214]: parenthesized type parameters may only be used with a `Fn` trait
|
||||
--> $DIR/exhaustive.rs:794:16
|
||||
--> $DIR/exhaustive.rs:793:16
|
||||
|
|
||||
LL | let _: T() -> !;
|
||||
| ^^^^^^^^ only `Fn` traits may use parentheses
|
||||
|
||||
error[E0562]: `impl Trait` is not allowed in the type of variable bindings
|
||||
--> $DIR/exhaustive.rs:809:16
|
||||
--> $DIR/exhaustive.rs:808:16
|
||||
|
|
||||
LL | let _: impl Send;
|
||||
| ^^^^^^^^^
|
||||
|
|
@ -112,7 +112,7 @@ LL | let _: impl Send;
|
|||
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
|
||||
|
||||
error[E0562]: `impl Trait` is not allowed in the type of variable bindings
|
||||
--> $DIR/exhaustive.rs:810:16
|
||||
--> $DIR/exhaustive.rs:809:16
|
||||
|
|
||||
LL | let _: impl Send + 'static;
|
||||
| ^^^^^^^^^^^^^^^^^^^
|
||||
|
|
@ -123,7 +123,7 @@ LL | let _: impl Send + 'static;
|
|||
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
|
||||
|
||||
error[E0562]: `impl Trait` is not allowed in the type of variable bindings
|
||||
--> $DIR/exhaustive.rs:811:16
|
||||
--> $DIR/exhaustive.rs:810:16
|
||||
|
|
||||
LL | let _: impl 'static + Send;
|
||||
| ^^^^^^^^^^^^^^^^^^^
|
||||
|
|
@ -134,7 +134,7 @@ LL | let _: impl 'static + Send;
|
|||
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
|
||||
|
||||
error[E0562]: `impl Trait` is not allowed in the type of variable bindings
|
||||
--> $DIR/exhaustive.rs:812:16
|
||||
--> $DIR/exhaustive.rs:811:16
|
||||
|
|
||||
LL | let _: impl ?Sized;
|
||||
| ^^^^^^^^^^^
|
||||
|
|
@ -145,7 +145,7 @@ LL | let _: impl ?Sized;
|
|||
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
|
||||
|
||||
error[E0562]: `impl Trait` is not allowed in the type of variable bindings
|
||||
--> $DIR/exhaustive.rs:813:16
|
||||
--> $DIR/exhaustive.rs:812:16
|
||||
|
|
||||
LL | let _: impl ~const Clone;
|
||||
| ^^^^^^^^^^^^^^^^^
|
||||
|
|
@ -156,7 +156,7 @@ LL | let _: impl ~const Clone;
|
|||
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
|
||||
|
||||
error[E0562]: `impl Trait` is not allowed in the type of variable bindings
|
||||
--> $DIR/exhaustive.rs:814:16
|
||||
--> $DIR/exhaustive.rs:813:16
|
||||
|
|
||||
LL | let _: impl for<'a> Send;
|
||||
| ^^^^^^^^^^^^^^^^^
|
||||
|
|
|
|||
|
|
@ -11,7 +11,6 @@
|
|||
#![feature(auto_traits)]
|
||||
#![feature(box_patterns)]
|
||||
#![feature(builtin_syntax)]
|
||||
#![feature(concat_idents)]
|
||||
#![feature(const_trait_impl)]
|
||||
#![feature(decl_macro)]
|
||||
#![feature(deref_patterns)]
|
||||
|
|
@ -343,7 +342,6 @@ mod expressions {
|
|||
|
||||
|
||||
|
||||
// concat_idents is deprecated
|
||||
|
||||
|
||||
|
||||
|
|
@ -685,8 +683,12 @@ mod types {
|
|||
/** there is no syntax for this */
|
||||
fn ty_implicit_self() { }
|
||||
/// TyKind::MacCall
|
||||
#[expect(deprecated)]
|
||||
fn ty_mac_call() { let _: T; let _: T; let _: T; }
|
||||
fn ty_mac_call() {
|
||||
macro_rules! ty { ($ty:ty) => { $ty } }
|
||||
let _: T;
|
||||
let _: T;
|
||||
let _: T;
|
||||
}
|
||||
/// TyKind::CVarArgs
|
||||
/** FIXME: todo */
|
||||
fn ty_c_var_args() { }
|
||||
|
|
|
|||
|
|
@ -11,7 +11,6 @@
|
|||
#![feature(auto_traits)]
|
||||
#![feature(box_patterns)]
|
||||
#![feature(builtin_syntax)]
|
||||
#![feature(concat_idents)]
|
||||
#![feature(const_trait_impl)]
|
||||
#![feature(decl_macro)]
|
||||
#![feature(deref_patterns)]
|
||||
|
|
@ -835,11 +834,13 @@ mod types {
|
|||
}
|
||||
|
||||
/// TyKind::MacCall
|
||||
#[expect(deprecated)] // concat_idents is deprecated
|
||||
fn ty_mac_call() {
|
||||
let _: concat_idents!(T);
|
||||
let _: concat_idents![T];
|
||||
let _: concat_idents! { T };
|
||||
macro_rules! ty {
|
||||
($ty:ty) => { $ty }
|
||||
}
|
||||
let _: ty!(T);
|
||||
let _: ty![T];
|
||||
let _: ty! { T };
|
||||
}
|
||||
|
||||
/// TyKind::CVarArgs
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue