mirror of
https://github.com/rust-lang/rust.git
synced 2025-04-16 05:56:56 +00:00
Fix test output expectations
This commit is contained in:
parent
80314b1de9
commit
309b46ad68
@ -39,7 +39,7 @@ fn test_stable_mir() -> ControlFlow<()> {
|
||||
fn test_builtins(items: &CrateItems) {
|
||||
let target_fn = *get_item(&items, "builtins_fn").unwrap();
|
||||
let allow_attrs = target_fn.attrs_by_path(&["allow".to_string()]);
|
||||
assert_eq!(allow_attrs[0].as_str(), "#![allow(unused_variables)]");
|
||||
assert_eq!(allow_attrs[0].as_str(), "#[allow(unused_variables)]");
|
||||
|
||||
let inline_attrs = target_fn.attrs_by_path(&["inline".to_string()]);
|
||||
assert_eq!(inline_attrs[0].as_str(), "#[inline]");
|
||||
|
@ -1,3 +1,9 @@
|
||||
error[E0693]: incorrect `repr(align)` attribute format: `align` takes exactly one argument in parentheses
|
||||
--> $DIR/arg-error-issue-121425.rs:16:8
|
||||
|
|
||||
LL | #[repr(align())]
|
||||
| ^^^^^^^
|
||||
|
||||
error[E0693]: incorrect `repr(align)` attribute format: `align` expects a literal integer as argument
|
||||
--> $DIR/arg-error-issue-121425.rs:4:14
|
||||
|
|
||||
@ -16,12 +22,6 @@ error[E0589]: invalid `repr(align)` attribute: not an unsuffixed integer
|
||||
LL | #[repr(align("str"))]
|
||||
| ^^^^^
|
||||
|
||||
error[E0693]: incorrect `repr(align)` attribute format: `align` takes exactly one argument in parentheses
|
||||
--> $DIR/arg-error-issue-121425.rs:16:8
|
||||
|
|
||||
LL | #[repr(align())]
|
||||
| ^^^^^^^
|
||||
|
||||
error[E0552]: incorrect `repr(packed)` attribute format: `packed` expects a literal integer as argument
|
||||
--> $DIR/arg-error-issue-121425.rs:21:15
|
||||
|
|
||||
|
@ -1,8 +1,8 @@
|
||||
error[E0084]: unsupported representation for zero-variant enum
|
||||
--> $DIR/issue-100631.rs:4:1
|
||||
--> $DIR/issue-100631.rs:4:8
|
||||
|
|
||||
LL | #[repr(C)]
|
||||
| ^^^^^^^^^^
|
||||
| ^
|
||||
LL | #[repr(C)]
|
||||
LL | enum Foo {}
|
||||
| -------- zero-variant enum
|
||||
|
@ -3,7 +3,7 @@
|
||||
//@ check-pass
|
||||
|
||||
#![warn(unused_attributes)]
|
||||
//~^ WARN `#[no_mangle]` attribute may not be used in combination with `#[export_name]` [unused_attributes]
|
||||
//~^ WARN `#[unsafe(no_mangle)]` attribute may not be used in combination with `#[export_name]` [unused_attributes]
|
||||
#[export_name = "foo"]
|
||||
pub fn bar() {}
|
||||
|
||||
|
@ -4,7 +4,7 @@
|
||||
|
||||
#![warn(unused_attributes)]
|
||||
#[no_mangle]
|
||||
//~^ WARN `#[no_mangle]` attribute may not be used in combination with `#[export_name]` [unused_attributes]
|
||||
//~^ WARN `#[unsafe(no_mangle)]` attribute may not be used in combination with `#[export_name]` [unused_attributes]
|
||||
#[export_name = "foo"]
|
||||
pub fn bar() {}
|
||||
|
||||
|
@ -1,8 +1,8 @@
|
||||
warning: `#[no_mangle]` attribute may not be used in combination with `#[export_name]`
|
||||
warning: `#[unsafe(no_mangle)]` attribute may not be used in combination with `#[export_name]`
|
||||
--> $DIR/mixed_export_name_and_no_mangle.rs:6:1
|
||||
|
|
||||
LL | #[no_mangle]
|
||||
| ^^^^^^^^^^^^ `#[no_mangle]` is ignored
|
||||
| ^^^^^^^^^^^^ `#[unsafe(no_mangle)]` is ignored
|
||||
|
|
||||
note: `#[export_name]` takes precedence
|
||||
--> $DIR/mixed_export_name_and_no_mangle.rs:8:1
|
||||
@ -14,7 +14,7 @@ note: the lint level is defined here
|
||||
|
|
||||
LL | #![warn(unused_attributes)]
|
||||
| ^^^^^^^^^^^^^^^^^
|
||||
help: remove the `#[no_mangle]` attribute
|
||||
help: remove the `#[unsafe(no_mangle)]` attribute
|
||||
|
|
||||
LL - #[no_mangle]
|
||||
|
|
||||
|
@ -6,6 +6,7 @@ macro_rules! pass_nonterminal {
|
||||
($n:expr) => {
|
||||
#[repr(align($n))]
|
||||
//~^ ERROR expected unsuffixed literal, found `n!()`
|
||||
//~^^ ERROR incorrect `repr(align)` attribute format: `align` expects a literal integer as argument [E0693]
|
||||
struct S;
|
||||
};
|
||||
}
|
||||
@ -15,6 +16,5 @@ macro_rules! n {
|
||||
}
|
||||
|
||||
pass_nonterminal!(n!());
|
||||
//~^ ERROR incorrect `repr(align)` attribute format: `align` expects a literal integer as argument [E0693]
|
||||
|
||||
fn main() {}
|
||||
|
@ -10,10 +10,15 @@ LL | pass_nonterminal!(n!());
|
||||
= note: this error originates in the macro `pass_nonterminal` (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
|
||||
error[E0693]: incorrect `repr(align)` attribute format: `align` expects a literal integer as argument
|
||||
--> $DIR/nonterminal-expansion.rs:17:19
|
||||
--> $DIR/nonterminal-expansion.rs:7:22
|
||||
|
|
||||
LL | #[repr(align($n))]
|
||||
| ^^
|
||||
...
|
||||
LL | pass_nonterminal!(n!());
|
||||
| ^
|
||||
| ----------------------- in this macro invocation
|
||||
|
|
||||
= note: this error originates in the macro `pass_nonterminal` (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
|
||||
error: aborting due to 2 previous errors
|
||||
|
||||
|
6
tests/ui/attributes/repr-align-in-trait-issue-132391.rs
Normal file
6
tests/ui/attributes/repr-align-in-trait-issue-132391.rs
Normal file
@ -0,0 +1,6 @@
|
||||
trait MyTrait {
|
||||
#[repr(align)] //~ ERROR invalid `repr(align)` attribute: `align` needs an argument
|
||||
fn myfun();
|
||||
}
|
||||
|
||||
pub fn main() {}
|
@ -0,0 +1,9 @@
|
||||
error[E0589]: invalid `repr(align)` attribute: `align` needs an argument
|
||||
--> $DIR/repr-align-in-trait-issue-132391.rs:2:12
|
||||
|
|
||||
LL | #[repr(align)]
|
||||
| ^^^^^ help: supply an argument here: `align(...)`
|
||||
|
||||
error: aborting due to 1 previous error
|
||||
|
||||
For more information about this error, try `rustc --explain E0589`.
|
@ -4,12 +4,6 @@ error: malformed `rustc_confusables` attribute input
|
||||
LL | #[rustc_confusables]
|
||||
| ^^^^^^^^^^^^^^^^^^^^ help: must be of the form: `#[rustc_confusables("name1", "name2", ...)]`
|
||||
|
||||
error: attribute should be applied to an inherent method
|
||||
--> $DIR/rustc_confusables.rs:45:1
|
||||
|
|
||||
LL | #[rustc_confusables("blah")]
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error: expected at least one confusable name
|
||||
--> $DIR/rustc_confusables.rs:30:5
|
||||
|
|
||||
@ -27,6 +21,12 @@ help: consider surrounding this with quotes
|
||||
LL | #[rustc_confusables("invalid_meta_item")]
|
||||
| + +
|
||||
|
||||
error: attribute should be applied to an inherent method
|
||||
--> $DIR/rustc_confusables.rs:45:1
|
||||
|
|
||||
LL | #[rustc_confusables("blah")]
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error[E0599]: no method named `inser` found for struct `rustc_confusables_across_crate::BTreeSet` in the current scope
|
||||
--> $DIR/rustc_confusables.rs:12:7
|
||||
|
|
||||
|
@ -4,16 +4,16 @@ mod bogus_attribute_types_1 {
|
||||
#[deprecated(since = "a", note = "a", reason)] //~ ERROR unknown meta item 'reason'
|
||||
fn f1() { }
|
||||
|
||||
#[deprecated(since = "a", note)] //~ ERROR incorrect meta item
|
||||
#[deprecated(since = "a", note)] //~ ERROR expected a quoted string literal
|
||||
fn f2() { }
|
||||
|
||||
#[deprecated(since, note = "a")] //~ ERROR incorrect meta item
|
||||
#[deprecated(since, note = "a")] //~ ERROR expected a quoted string literal
|
||||
fn f3() { }
|
||||
|
||||
#[deprecated(since = "a", note(b))] //~ ERROR incorrect meta item
|
||||
#[deprecated(since = "a", note(b))] //~ ERROR expected a quoted string literal
|
||||
fn f5() { }
|
||||
|
||||
#[deprecated(since(b), note = "a")] //~ ERROR incorrect meta item
|
||||
#[deprecated(since(b), note = "a")] //~ ERROR expected a quoted string literal
|
||||
fn f6() { }
|
||||
|
||||
#[deprecated(note = b"test")] //~ ERROR literal in `deprecated` value must be a string
|
||||
|
@ -1,40 +1,28 @@
|
||||
error: multiple `deprecated` attributes
|
||||
--> $DIR/deprecation-sanity.rs:27:1
|
||||
|
|
||||
LL | #[deprecated(since = "a", note = "b")]
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: remove this attribute
|
||||
|
|
||||
note: attribute also specified here
|
||||
--> $DIR/deprecation-sanity.rs:26:1
|
||||
|
|
||||
LL | #[deprecated(since = "a", note = "b")]
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error[E0541]: unknown meta item 'reason'
|
||||
--> $DIR/deprecation-sanity.rs:4:43
|
||||
|
|
||||
LL | #[deprecated(since = "a", note = "a", reason)]
|
||||
| ^^^^^^ expected one of `since`, `note`
|
||||
|
||||
error[E0539]: incorrect meta item
|
||||
error[E0539]: expected a quoted string literal
|
||||
--> $DIR/deprecation-sanity.rs:7:31
|
||||
|
|
||||
LL | #[deprecated(since = "a", note)]
|
||||
| ^^^^
|
||||
|
||||
error[E0539]: incorrect meta item
|
||||
error[E0539]: expected a quoted string literal
|
||||
--> $DIR/deprecation-sanity.rs:10:18
|
||||
|
|
||||
LL | #[deprecated(since, note = "a")]
|
||||
| ^^^^^
|
||||
|
||||
error[E0539]: incorrect meta item
|
||||
error[E0539]: expected a quoted string literal
|
||||
--> $DIR/deprecation-sanity.rs:13:31
|
||||
|
|
||||
LL | #[deprecated(since = "a", note(b))]
|
||||
| ^^^^^^^
|
||||
|
||||
error[E0539]: incorrect meta item
|
||||
error[E0539]: expected a quoted string literal
|
||||
--> $DIR/deprecation-sanity.rs:16:18
|
||||
|
|
||||
LL | #[deprecated(since(b), note = "a")]
|
||||
@ -54,6 +42,18 @@ error[E0565]: item in `deprecated` must be a key/value pair
|
||||
LL | #[deprecated("test")]
|
||||
| ^^^^^^
|
||||
|
||||
error: multiple `deprecated` attributes
|
||||
--> $DIR/deprecation-sanity.rs:27:1
|
||||
|
|
||||
LL | #[deprecated(since = "a", note = "b")]
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: remove this attribute
|
||||
|
|
||||
note: attribute also specified here
|
||||
--> $DIR/deprecation-sanity.rs:26:1
|
||||
|
|
||||
LL | #[deprecated(since = "a", note = "b")]
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error[E0538]: multiple 'since' items
|
||||
--> $DIR/deprecation-sanity.rs:30:27
|
||||
|
|
||||
|
@ -3,7 +3,7 @@
|
||||
// was a well-formed `MetaItem`.
|
||||
|
||||
fn main() {
|
||||
foo()
|
||||
foo() //~ WARNING use of deprecated function `foo`
|
||||
}
|
||||
|
||||
#[deprecated(note = test)]
|
||||
|
@ -9,5 +9,13 @@ help: surround the identifier with quotation marks to make it into a string lite
|
||||
LL | #[deprecated(note = "test")]
|
||||
| + +
|
||||
|
||||
error: aborting due to 1 previous error
|
||||
warning: use of deprecated function `foo`
|
||||
--> $DIR/issue-66340-deprecated-attr-non-meta-grammar.rs:6:5
|
||||
|
|
||||
LL | foo()
|
||||
| ^^^
|
||||
|
|
||||
= note: `#[warn(deprecated)]` on by default
|
||||
|
||||
error: aborting due to 1 previous error; 1 warning emitted
|
||||
|
||||
|
@ -1,8 +1,8 @@
|
||||
error[E0084]: unsupported representation for zero-variant enum
|
||||
--> $DIR/E0084.rs:1:1
|
||||
--> $DIR/E0084.rs:1:8
|
||||
|
|
||||
LL | #[repr(i32)]
|
||||
| ^^^^^^^^^^^^
|
||||
| ^^^
|
||||
LL | enum Foo {}
|
||||
| -------- zero-variant enum
|
||||
|
||||
|
@ -1,8 +1,8 @@
|
||||
error[E0565]: meta item in `repr` must be an identifier
|
||||
--> $DIR/E0565.rs:2:8
|
||||
--> $DIR/E0565.rs:2:1
|
||||
|
|
||||
LL | #[repr("C")]
|
||||
| ^^^
|
||||
| ^^^^^^^^^^^^
|
||||
|
||||
error: aborting due to 1 previous error
|
||||
|
||||
|
@ -8,5 +8,3 @@
|
||||
// #[stable(feature = "foo", since = "1.0")]
|
||||
struct Foo;
|
||||
//~^ ERROR `rustc_allowed_through_unstable_modules` attribute must be paired with a `stable` attribute
|
||||
//~^^ ERROR `rustc_allowed_through_unstable_modules` attribute must be paired with a `stable` attribute
|
||||
// FIXME: we shouldn't have two errors here, only occurs when using `-Zdeduplicate-diagnostics=no`
|
||||
|
@ -4,14 +4,6 @@ error[E0789]: `rustc_allowed_through_unstable_modules` attribute must be paired
|
||||
LL | struct Foo;
|
||||
| ^^^^^^^^^^^
|
||||
|
||||
error[E0789]: `rustc_allowed_through_unstable_modules` attribute must be paired with a `stable` attribute
|
||||
--> $DIR/E0789.rs:9:1
|
||||
|
|
||||
LL | struct Foo;
|
||||
| ^^^^^^^^^^^
|
||||
|
|
||||
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
|
||||
|
||||
error: aborting due to 2 previous errors
|
||||
error: aborting due to 1 previous error
|
||||
|
||||
For more information about this error, try `rustc --explain E0789`.
|
||||
|
@ -1,7 +1,9 @@
|
||||
// checks that this attribute is caught on non-macro items.
|
||||
// this needs a different test since this is done after expansion
|
||||
|
||||
#[allow_internal_unstable()] //~ ERROR allow_internal_unstable side-steps
|
||||
// FIXME(jdonszelmann): empty attributes are currently ignored, since when its empty no actual
|
||||
// change is applied. This should be fixed when later moving this check to attribute parsing.
|
||||
#[allow_internal_unstable(something)] //~ ERROR allow_internal_unstable side-steps
|
||||
//~| ERROR attribute should
|
||||
struct S;
|
||||
|
||||
|
@ -1,17 +1,17 @@
|
||||
error[E0658]: allow_internal_unstable side-steps feature gating and stability checks
|
||||
--> $DIR/feature-gate-allow-internal-unstable-struct.rs:4:1
|
||||
--> $DIR/feature-gate-allow-internal-unstable-struct.rs:6:1
|
||||
|
|
||||
LL | #[allow_internal_unstable()]
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
LL | #[allow_internal_unstable(something)]
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
|
||||
= help: add `#![feature(allow_internal_unstable)]` 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: attribute should be applied to a macro
|
||||
--> $DIR/feature-gate-allow-internal-unstable-struct.rs:4:1
|
||||
--> $DIR/feature-gate-allow-internal-unstable-struct.rs:6:1
|
||||
|
|
||||
LL | #[allow_internal_unstable()]
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
LL | #[allow_internal_unstable(something)]
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
LL |
|
||||
LL | struct S;
|
||||
| --------- not a macro
|
||||
|
@ -130,21 +130,6 @@ LL - #![rustc_main]
|
||||
LL + #[rustc_main]
|
||||
|
|
||||
|
||||
error: `repr` attribute cannot be used at crate level
|
||||
--> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:17:1
|
||||
|
|
||||
LL | #![repr()]
|
||||
| ^^^^^^^^^^
|
||||
...
|
||||
LL | mod inline {
|
||||
| ------ the inner attribute doesn't annotate this module
|
||||
|
|
||||
help: perhaps you meant to use an outer attribute
|
||||
|
|
||||
LL - #![repr()]
|
||||
LL + #[repr()]
|
||||
|
|
||||
|
||||
error: `path` attribute cannot be used at crate level
|
||||
--> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:19:1
|
||||
|
|
||||
@ -175,6 +160,21 @@ LL - #![automatically_derived]
|
||||
LL + #[automatically_derived]
|
||||
|
|
||||
|
||||
error: `repr` attribute cannot be used at crate level
|
||||
--> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:17:1
|
||||
|
|
||||
LL | #![repr()]
|
||||
| ^^^^^^^^^^
|
||||
...
|
||||
LL | mod inline {
|
||||
| ------ the inner attribute doesn't annotate this module
|
||||
|
|
||||
help: perhaps you meant to use an outer attribute
|
||||
|
|
||||
LL - #![repr()]
|
||||
LL + #[repr()]
|
||||
|
|
||||
|
||||
error[E0518]: attribute should be applied to function or closure
|
||||
--> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:40:17
|
||||
|
|
||||
|
@ -7,7 +7,7 @@
|
||||
extern crate internal_unstable;
|
||||
|
||||
struct Baz {
|
||||
#[allow_internal_unstable]
|
||||
#[allow_internal_unstable] //~ ERROR `allow_internal_unstable` expects a list of feature names
|
||||
baz: u8,
|
||||
}
|
||||
|
||||
@ -56,7 +56,7 @@ fn main() {
|
||||
bar!(internal_unstable::unstable()); //~ ERROR use of unstable
|
||||
|
||||
match true {
|
||||
#[allow_internal_unstable]
|
||||
#[allow_internal_unstable] //~ ERROR `allow_internal_unstable` expects a list of feature names
|
||||
_ => {}
|
||||
}
|
||||
|
||||
|
@ -1,3 +1,15 @@
|
||||
error: `allow_internal_unstable` expects a list of feature names
|
||||
--> $DIR/internal-unstable.rs:10:5
|
||||
|
|
||||
LL | #[allow_internal_unstable]
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error: `allow_internal_unstable` expects a list of feature names
|
||||
--> $DIR/internal-unstable.rs:59:9
|
||||
|
|
||||
LL | #[allow_internal_unstable]
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error[E0658]: use of unstable library feature `function`
|
||||
--> $DIR/internal-unstable.rs:48:25
|
||||
|
|
||||
@ -47,6 +59,6 @@ LL | bar!(internal_unstable::unstable());
|
||||
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
|
||||
= note: this error originates in the macro `foo` which comes from the expansion of the macro `bar` (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
|
||||
error: aborting due to 5 previous errors
|
||||
error: aborting due to 7 previous errors
|
||||
|
||||
For more information about this error, try `rustc --explain E0658`.
|
||||
|
@ -10,22 +10,6 @@ error: malformed `repr` attribute input
|
||||
LL | let _z = #[repr] 1;
|
||||
| ^^^^^^^ help: must be of the form: `#[repr(C)]`
|
||||
|
||||
error[E0518]: attribute should be applied to function or closure
|
||||
--> $DIR/issue-43988.rs:5:5
|
||||
|
|
||||
LL | #[inline]
|
||||
| ^^^^^^^^^
|
||||
LL | let _a = 4;
|
||||
| ----------- not a function or closure
|
||||
|
||||
error[E0518]: attribute should be applied to function or closure
|
||||
--> $DIR/issue-43988.rs:10:5
|
||||
|
|
||||
LL | #[inline(XYZ)]
|
||||
| ^^^^^^^^^^^^^^
|
||||
LL | let _b = 4;
|
||||
| ----------- not a function or closure
|
||||
|
||||
error[E0552]: unrecognized representation hint
|
||||
--> $DIR/issue-43988.rs:14:12
|
||||
|
|
||||
@ -42,6 +26,22 @@ LL | #[repr(something_not_real)]
|
||||
|
|
||||
= help: valid reprs are `Rust` (default), `C`, `align`, `packed`, `transparent`, `simd`, `i8`, `u8`, `i16`, `u16`, `i32`, `u32`, `i64`, `u64`, `i128`, `u128`, `isize`, `usize`
|
||||
|
||||
error[E0518]: attribute should be applied to function or closure
|
||||
--> $DIR/issue-43988.rs:5:5
|
||||
|
|
||||
LL | #[inline]
|
||||
| ^^^^^^^^^
|
||||
LL | let _a = 4;
|
||||
| ----------- not a function or closure
|
||||
|
||||
error[E0518]: attribute should be applied to function or closure
|
||||
--> $DIR/issue-43988.rs:10:5
|
||||
|
|
||||
LL | #[inline(XYZ)]
|
||||
| ^^^^^^^^^^^^^^
|
||||
LL | let _b = 4;
|
||||
| ----------- not a function or closure
|
||||
|
||||
error[E0518]: attribute should be applied to function or closure
|
||||
--> $DIR/issue-43988.rs:30:5
|
||||
|
|
||||
|
@ -30,14 +30,6 @@ LL | #[repr(uwu, u8)]
|
||||
|
|
||||
= help: valid reprs are `Rust` (default), `C`, `align`, `packed`, `transparent`, `simd`, `i8`, `u8`, `i16`, `u16`, `i32`, `u32`, `i64`, `u64`, `i128`, `u128`, `isize`, `usize`
|
||||
|
||||
error: unknown `doc` attribute `owo`
|
||||
--> $DIR/invalid_repr_list_help.rs:20:7
|
||||
|
|
||||
LL | #[doc(owo)]
|
||||
| ^^^
|
||||
|
|
||||
= note: `#[deny(invalid_doc_attributes)]` on by default
|
||||
|
||||
error[E0552]: unrecognized representation hint
|
||||
--> $DIR/invalid_repr_list_help.rs:19:8
|
||||
|
|
||||
@ -46,6 +38,14 @@ LL | #[repr(uwu)]
|
||||
|
|
||||
= help: valid reprs are `Rust` (default), `C`, `align`, `packed`, `transparent`, `simd`, `i8`, `u8`, `i16`, `u16`, `i32`, `u32`, `i64`, `u64`, `i128`, `u128`, `isize`, `usize`
|
||||
|
||||
error: unknown `doc` attribute `owo`
|
||||
--> $DIR/invalid_repr_list_help.rs:20:7
|
||||
|
|
||||
LL | #[doc(owo)]
|
||||
| ^^^
|
||||
|
|
||||
= note: `#[deny(invalid_doc_attributes)]` on by default
|
||||
|
||||
error: aborting due to 6 previous errors
|
||||
|
||||
For more information about this error, try `rustc --explain E0552`.
|
||||
|
@ -26,10 +26,10 @@ LL | enum Es {}
|
||||
| ---------- not a struct
|
||||
|
||||
error[E0084]: unsupported representation for zero-variant enum
|
||||
--> $DIR/issue-83505-repr-simd.rs:5:1
|
||||
--> $DIR/issue-83505-repr-simd.rs:5:8
|
||||
|
|
||||
LL | #[repr(simd)]
|
||||
| ^^^^^^^^^^^^^
|
||||
| ^^^^
|
||||
...
|
||||
LL | enum Es {}
|
||||
| ------- zero-variant enum
|
||||
|
@ -1,15 +1,3 @@
|
||||
error[E0552]: incorrect `repr(packed)` attribute format: `packed` takes exactly one parenthesized argument, or no parentheses at all
|
||||
--> $DIR/malformed-repr-hints.rs:6:8
|
||||
|
|
||||
LL | #[repr(packed())]
|
||||
| ^^^^^^^^
|
||||
|
||||
error[E0589]: invalid `repr(align)` attribute: `align` needs an argument
|
||||
--> $DIR/malformed-repr-hints.rs:10:8
|
||||
|
|
||||
LL | #[repr(align)]
|
||||
| ^^^^^ help: supply an argument here: `align(...)`
|
||||
|
||||
error[E0693]: incorrect `repr(align)` attribute format: `align` takes exactly one argument in parentheses
|
||||
--> $DIR/malformed-repr-hints.rs:14:8
|
||||
|
|
||||
@ -22,6 +10,18 @@ error[E0693]: incorrect `repr(align)` attribute format: `align` takes exactly on
|
||||
LL | #[repr(align())]
|
||||
| ^^^^^^^
|
||||
|
||||
error[E0552]: incorrect `repr(packed)` attribute format: `packed` takes exactly one parenthesized argument, or no parentheses at all
|
||||
--> $DIR/malformed-repr-hints.rs:6:8
|
||||
|
|
||||
LL | #[repr(packed())]
|
||||
| ^^^^^^^^
|
||||
|
||||
error[E0589]: invalid `repr(align)` attribute: `align` needs an argument
|
||||
--> $DIR/malformed-repr-hints.rs:10:8
|
||||
|
|
||||
LL | #[repr(align)]
|
||||
| ^^^^^ help: supply an argument here: `align(...)`
|
||||
|
||||
error[E0552]: invalid representation hint: `Rust` does not take a parenthesized argument list
|
||||
--> $DIR/malformed-repr-hints.rs:23:8
|
||||
|
|
||||
|
@ -3,11 +3,9 @@
|
||||
#![allow(dead_code)]
|
||||
|
||||
#[repr(align(8))] //~ ERROR incorrect `repr(align)` attribute format
|
||||
//~| ERROR incorrect `repr(align)` attribute format
|
||||
struct A(u64);
|
||||
|
||||
#[repr(align(8))] //~ ERROR incorrect `repr(align)` attribute format
|
||||
//~| ERROR incorrect `repr(align)` attribute format
|
||||
struct B(u64);
|
||||
|
||||
fn main() {}
|
||||
|
@ -3,11 +3,9 @@
|
||||
#![allow(dead_code)]
|
||||
|
||||
#[repr(align=8)] //~ ERROR incorrect `repr(align)` attribute format
|
||||
//~| ERROR incorrect `repr(align)` attribute format
|
||||
struct A(u64);
|
||||
|
||||
#[repr(align="8")] //~ ERROR incorrect `repr(align)` attribute format
|
||||
//~| ERROR incorrect `repr(align)` attribute format
|
||||
struct B(u64);
|
||||
|
||||
fn main() {}
|
||||
|
@ -5,27 +5,11 @@ LL | #[repr(align=8)]
|
||||
| ^^^^^^^ help: use parentheses instead: `align(8)`
|
||||
|
||||
error[E0693]: incorrect `repr(align)` attribute format
|
||||
--> $DIR/repr-align-assign.rs:9:8
|
||||
--> $DIR/repr-align-assign.rs:8:8
|
||||
|
|
||||
LL | #[repr(align="8")]
|
||||
| ^^^^^^^^^ help: use parentheses instead: `align(8)`
|
||||
|
||||
error[E0693]: incorrect `repr(align)` attribute format
|
||||
--> $DIR/repr-align-assign.rs:5:8
|
||||
|
|
||||
LL | #[repr(align=8)]
|
||||
| ^^^^^^^ help: use parentheses instead: `align(8)`
|
||||
|
|
||||
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
|
||||
|
||||
error[E0693]: incorrect `repr(align)` attribute format
|
||||
--> $DIR/repr-align-assign.rs:9:8
|
||||
|
|
||||
LL | #[repr(align="8")]
|
||||
| ^^^^^^^^^ help: use parentheses instead: `align(8)`
|
||||
|
|
||||
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
|
||||
|
||||
error: aborting due to 4 previous errors
|
||||
error: aborting due to 2 previous errors
|
||||
|
||||
For more information about this error, try `rustc --explain E0693`.
|
||||
|
@ -1,41 +1,33 @@
|
||||
#![allow(dead_code)]
|
||||
|
||||
#[repr(align(16.0))] //~ ERROR: invalid `repr(align)` attribute: not an unsuffixed integer
|
||||
//~| ERROR: invalid `repr(align)` attribute: not an unsuffixed integer
|
||||
struct S0(i32);
|
||||
|
||||
#[repr(align(15))] //~ ERROR: invalid `repr(align)` attribute: not a power of two
|
||||
//~| ERROR: invalid `repr(align)` attribute: not a power of two
|
||||
struct S1(i32);
|
||||
|
||||
#[repr(align(4294967296))] //~ ERROR: invalid `repr(align)` attribute: larger than 2^29
|
||||
//~| ERROR: invalid `repr(align)` attribute: larger than 2^29
|
||||
struct S2(i32);
|
||||
|
||||
#[repr(align(536870912))] // ok: this is the largest accepted alignment
|
||||
struct S3(i32);
|
||||
|
||||
#[repr(align(0))] //~ ERROR: invalid `repr(align)` attribute: not a power of two
|
||||
//~| ERROR: invalid `repr(align)` attribute: not a power of two
|
||||
struct S4(i32);
|
||||
|
||||
#[repr(align(16.0))] //~ ERROR: invalid `repr(align)` attribute: not an unsuffixed integer
|
||||
//~| ERROR: invalid `repr(align)` attribute: not an unsuffixed integer
|
||||
enum E0 { A, B }
|
||||
|
||||
#[repr(align(15))] //~ ERROR: invalid `repr(align)` attribute: not a power of two
|
||||
//~| ERROR: invalid `repr(align)` attribute: not a power of two
|
||||
enum E1 { A, B }
|
||||
|
||||
#[repr(align(4294967296))] //~ ERROR: invalid `repr(align)` attribute: larger than 2^29
|
||||
//~| ERROR: invalid `repr(align)` attribute: larger than 2^29
|
||||
enum E2 { A, B }
|
||||
|
||||
#[repr(align(536870912))] // ok: this is the largest accepted alignment
|
||||
enum E3 { A, B }
|
||||
|
||||
#[repr(align(0))] //~ ERROR: invalid `repr(align)` attribute: not a power of two
|
||||
//~| ERROR: invalid `repr(align)` attribute: not a power of two
|
||||
enum E4 { A, B }
|
||||
|
||||
fn main() {}
|
||||
|
@ -5,111 +5,47 @@ LL | #[repr(align(16.0))]
|
||||
| ^^^^
|
||||
|
||||
error[E0589]: invalid `repr(align)` attribute: not a power of two
|
||||
--> $DIR/repr-align.rs:7:14
|
||||
--> $DIR/repr-align.rs:6:14
|
||||
|
|
||||
LL | #[repr(align(15))]
|
||||
| ^^
|
||||
|
||||
error[E0589]: invalid `repr(align)` attribute: larger than 2^29
|
||||
--> $DIR/repr-align.rs:11:14
|
||||
--> $DIR/repr-align.rs:9:14
|
||||
|
|
||||
LL | #[repr(align(4294967296))]
|
||||
| ^^^^^^^^^^
|
||||
|
||||
error[E0589]: invalid `repr(align)` attribute: not a power of two
|
||||
--> $DIR/repr-align.rs:15:14
|
||||
|
|
||||
LL | #[repr(align(0))]
|
||||
| ^
|
||||
|
||||
error[E0589]: invalid `repr(align)` attribute: not an unsuffixed integer
|
||||
--> $DIR/repr-align.rs:18:14
|
||||
|
|
||||
LL | #[repr(align(0))]
|
||||
| ^
|
||||
|
||||
error[E0589]: invalid `repr(align)` attribute: not an unsuffixed integer
|
||||
--> $DIR/repr-align.rs:22:14
|
||||
|
|
||||
LL | #[repr(align(16.0))]
|
||||
| ^^^^
|
||||
|
||||
error[E0589]: invalid `repr(align)` attribute: not a power of two
|
||||
--> $DIR/repr-align.rs:26:14
|
||||
--> $DIR/repr-align.rs:21:14
|
||||
|
|
||||
LL | #[repr(align(15))]
|
||||
| ^^
|
||||
|
||||
error[E0589]: invalid `repr(align)` attribute: larger than 2^29
|
||||
--> $DIR/repr-align.rs:24:14
|
||||
|
|
||||
LL | #[repr(align(4294967296))]
|
||||
| ^^^^^^^^^^
|
||||
|
||||
error[E0589]: invalid `repr(align)` attribute: not a power of two
|
||||
--> $DIR/repr-align.rs:30:14
|
||||
|
|
||||
LL | #[repr(align(4294967296))]
|
||||
| ^^^^^^^^^^
|
||||
|
||||
error[E0589]: invalid `repr(align)` attribute: not a power of two
|
||||
--> $DIR/repr-align.rs:37:14
|
||||
|
|
||||
LL | #[repr(align(0))]
|
||||
| ^
|
||||
|
||||
error[E0589]: invalid `repr(align)` attribute: not an unsuffixed integer
|
||||
--> $DIR/repr-align.rs:3:14
|
||||
|
|
||||
LL | #[repr(align(16.0))]
|
||||
| ^^^^
|
||||
|
|
||||
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
|
||||
|
||||
error[E0589]: invalid `repr(align)` attribute: not a power of two
|
||||
--> $DIR/repr-align.rs:7:14
|
||||
|
|
||||
LL | #[repr(align(15))]
|
||||
| ^^
|
||||
|
|
||||
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
|
||||
|
||||
error[E0589]: invalid `repr(align)` attribute: larger than 2^29
|
||||
--> $DIR/repr-align.rs:11:14
|
||||
|
|
||||
LL | #[repr(align(4294967296))]
|
||||
| ^^^^^^^^^^
|
||||
|
|
||||
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
|
||||
|
||||
error[E0589]: invalid `repr(align)` attribute: not a power of two
|
||||
--> $DIR/repr-align.rs:18:14
|
||||
|
|
||||
LL | #[repr(align(0))]
|
||||
| ^
|
||||
|
|
||||
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
|
||||
|
||||
error[E0589]: invalid `repr(align)` attribute: not an unsuffixed integer
|
||||
--> $DIR/repr-align.rs:22:14
|
||||
|
|
||||
LL | #[repr(align(16.0))]
|
||||
| ^^^^
|
||||
|
|
||||
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
|
||||
|
||||
error[E0589]: invalid `repr(align)` attribute: not a power of two
|
||||
--> $DIR/repr-align.rs:26:14
|
||||
|
|
||||
LL | #[repr(align(15))]
|
||||
| ^^
|
||||
|
|
||||
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
|
||||
|
||||
error[E0589]: invalid `repr(align)` attribute: larger than 2^29
|
||||
--> $DIR/repr-align.rs:30:14
|
||||
|
|
||||
LL | #[repr(align(4294967296))]
|
||||
| ^^^^^^^^^^
|
||||
|
|
||||
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
|
||||
|
||||
error[E0589]: invalid `repr(align)` attribute: not a power of two
|
||||
--> $DIR/repr-align.rs:37:14
|
||||
|
|
||||
LL | #[repr(align(0))]
|
||||
| ^
|
||||
|
|
||||
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
|
||||
|
||||
error: aborting due to 16 previous errors
|
||||
error: aborting due to 8 previous errors
|
||||
|
||||
For more information about this error, try `rustc --explain E0589`.
|
||||
|
@ -35,10 +35,10 @@ LL | struct GenericAlign<T>(ZstAlign32<T>, u32);
|
||||
| needs at most one field with non-trivial size or alignment, but has 2
|
||||
|
||||
error[E0084]: unsupported representation for zero-variant enum
|
||||
--> $DIR/repr-transparent.rs:47:1
|
||||
--> $DIR/repr-transparent.rs:47:8
|
||||
|
|
||||
LL | #[repr(transparent)]
|
||||
| ^^^^^^^^^^^^^^^^^^^^
|
||||
| ^^^^^^^^^^^
|
||||
LL | enum Void {}
|
||||
| --------- zero-variant enum
|
||||
|
||||
|
@ -8,16 +8,16 @@ mod bogus_attribute_types_1 {
|
||||
#[stable(feature = "a", since = "4.4.4", reason)] //~ ERROR unknown meta item 'reason' [E0541]
|
||||
fn f1() { }
|
||||
|
||||
#[stable(feature = "a", since)] //~ ERROR incorrect meta item [E0539]
|
||||
#[stable(feature = "a", since)] //~ ERROR expected a quoted string literal [E0539]
|
||||
fn f2() { }
|
||||
|
||||
#[stable(feature, since = "3.3.3")] //~ ERROR incorrect meta item [E0539]
|
||||
#[stable(feature, since = "3.3.3")] //~ ERROR expected a quoted string literal [E0539]
|
||||
fn f3() { }
|
||||
|
||||
#[stable(feature = "a", since(b))] //~ ERROR incorrect meta item [E0539]
|
||||
#[stable(feature = "a", since(b))] //~ ERROR expected a quoted string literal [E0539]
|
||||
fn f5() { }
|
||||
|
||||
#[stable(feature(b), since = "3.3.3")] //~ ERROR incorrect meta item [E0539]
|
||||
#[stable(feature(b), since = "3.3.3")] //~ ERROR expected a quoted string literal [E0539]
|
||||
fn f6() { }
|
||||
}
|
||||
|
||||
|
@ -1,40 +1,28 @@
|
||||
error: multiple `deprecated` attributes
|
||||
--> $DIR/stability-attribute-sanity.rs:62:1
|
||||
|
|
||||
LL | #[deprecated(since = "5.5.5", note = "text")]
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: remove this attribute
|
||||
|
|
||||
note: attribute also specified here
|
||||
--> $DIR/stability-attribute-sanity.rs:61:1
|
||||
|
|
||||
LL | #[deprecated(since = "5.5.5", note = "text")]
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error[E0541]: unknown meta item 'reason'
|
||||
--> $DIR/stability-attribute-sanity.rs:8:46
|
||||
|
|
||||
LL | #[stable(feature = "a", since = "4.4.4", reason)]
|
||||
| ^^^^^^ expected one of `feature`, `since`
|
||||
|
||||
error[E0539]: incorrect meta item
|
||||
error[E0539]: expected a quoted string literal
|
||||
--> $DIR/stability-attribute-sanity.rs:11:29
|
||||
|
|
||||
LL | #[stable(feature = "a", since)]
|
||||
| ^^^^^
|
||||
|
||||
error[E0539]: incorrect meta item
|
||||
error[E0539]: expected a quoted string literal
|
||||
--> $DIR/stability-attribute-sanity.rs:14:14
|
||||
|
|
||||
LL | #[stable(feature, since = "3.3.3")]
|
||||
| ^^^^^^^
|
||||
|
||||
error[E0539]: incorrect meta item
|
||||
error[E0539]: expected a quoted string literal
|
||||
--> $DIR/stability-attribute-sanity.rs:17:29
|
||||
|
|
||||
LL | #[stable(feature = "a", since(b))]
|
||||
| ^^^^^^^^
|
||||
|
||||
error[E0539]: incorrect meta item
|
||||
error[E0539]: expected a quoted string literal
|
||||
--> $DIR/stability-attribute-sanity.rs:20:14
|
||||
|
|
||||
LL | #[stable(feature(b), since = "3.3.3")]
|
||||
@ -100,6 +88,18 @@ error: 'since' must be a Rust version number, such as "1.31.0"
|
||||
LL | #[stable(feature = "e", since = "b")]
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error: multiple `deprecated` attributes
|
||||
--> $DIR/stability-attribute-sanity.rs:62:1
|
||||
|
|
||||
LL | #[deprecated(since = "5.5.5", note = "text")]
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: remove this attribute
|
||||
|
|
||||
note: attribute also specified here
|
||||
--> $DIR/stability-attribute-sanity.rs:61:1
|
||||
|
|
||||
LL | #[deprecated(since = "5.5.5", note = "text")]
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error[E0544]: multiple stability levels
|
||||
--> $DIR/stability-attribute-sanity.rs:64:1
|
||||
|
|
||||
|
Loading…
Reference in New Issue
Block a user