]> git.lizzy.rs Git - rust.git/blob - src/test/ui/asm/type-check-1.stderr
Rollup merge of #98653 - TaKO8Ki:add-regression-test-for-79494, r=Mark-Simulacrum
[rust.git] / src / test / ui / asm / type-check-1.stderr
1 error[E0435]: attempt to use a non-constant value in a constant
2   --> $DIR/type-check-1.rs:42:26
3    |
4 LL |         let x = 0;
5    |         ----- help: consider using `const` instead of `let`: `const x`
6 ...
7 LL |         asm!("{}", const x);
8    |                          ^ non-constant value
9
10 error[E0435]: attempt to use a non-constant value in a constant
11   --> $DIR/type-check-1.rs:45:36
12    |
13 LL |         let x = 0;
14    |         ----- help: consider using `const` instead of `let`: `const x`
15 ...
16 LL |         asm!("{}", const const_foo(x));
17    |                                    ^ non-constant value
18
19 error[E0435]: attempt to use a non-constant value in a constant
20   --> $DIR/type-check-1.rs:48:36
21    |
22 LL |         let x = 0;
23    |         ----- help: consider using `const` instead of `let`: `const x`
24 ...
25 LL |         asm!("{}", const const_bar(x));
26    |                                    ^ non-constant value
27
28 error: invalid `sym` operand
29   --> $DIR/type-check-1.rs:50:24
30    |
31 LL |         asm!("{}", sym x);
32    |                        ^ is a local variable
33    |
34    = help: `sym` operands must refer to either a function or a static
35
36 error[E0308]: mismatched types
37   --> $DIR/type-check-1.rs:58:26
38    |
39 LL |         asm!("{}", const 0f32);
40    |                          ^^^^ expected integer, found `f32`
41
42 error[E0308]: mismatched types
43   --> $DIR/type-check-1.rs:60:26
44    |
45 LL |         asm!("{}", const 0 as *mut u8);
46    |                          ^^^^^^^^^^^^ expected integer, found *-ptr
47    |
48    = note:     expected type `{integer}`
49            found raw pointer `*mut u8`
50
51 error[E0308]: mismatched types
52   --> $DIR/type-check-1.rs:62:26
53    |
54 LL |         asm!("{}", const &0);
55    |                          ^^ expected integer, found `&{integer}`
56    |
57 help: consider removing the borrow
58    |
59 LL -         asm!("{}", const &0);
60 LL +         asm!("{}", const 0);
61    |
62
63 error: invalid asm output
64   --> $DIR/type-check-1.rs:15:29
65    |
66 LL |         asm!("{}", out(reg) 1 + 2);
67    |                             ^^^^^ cannot assign to this expression
68
69 error: invalid asm output
70   --> $DIR/type-check-1.rs:17:31
71    |
72 LL |         asm!("{}", inout(reg) 1 + 2);
73    |                               ^^^^^ cannot assign to this expression
74
75 error[E0277]: the size for values of type `[u64]` cannot be known at compilation time
76   --> $DIR/type-check-1.rs:23:28
77    |
78 LL |         asm!("{}", in(reg) v[..]);
79    |                            ^^^^^ doesn't have a size known at compile-time
80    |
81    = help: the trait `Sized` is not implemented for `[u64]`
82    = note: all inline asm arguments must have a statically known size
83
84 error[E0277]: the size for values of type `[u64]` cannot be known at compilation time
85   --> $DIR/type-check-1.rs:26:29
86    |
87 LL |         asm!("{}", out(reg) v[..]);
88    |                             ^^^^^ doesn't have a size known at compile-time
89    |
90    = help: the trait `Sized` is not implemented for `[u64]`
91    = note: all inline asm arguments must have a statically known size
92
93 error[E0277]: the size for values of type `[u64]` cannot be known at compilation time
94   --> $DIR/type-check-1.rs:29:31
95    |
96 LL |         asm!("{}", inout(reg) v[..]);
97    |                               ^^^^^ doesn't have a size known at compile-time
98    |
99    = help: the trait `Sized` is not implemented for `[u64]`
100    = note: all inline asm arguments must have a statically known size
101
102 error: cannot use value of type `[u64]` for inline assembly
103   --> $DIR/type-check-1.rs:23:28
104    |
105 LL |         asm!("{}", in(reg) v[..]);
106    |                            ^^^^^
107    |
108    = note: only integers, floats, SIMD vectors, pointers and function pointers can be used as arguments for inline assembly
109
110 error: cannot use value of type `[u64]` for inline assembly
111   --> $DIR/type-check-1.rs:26:29
112    |
113 LL |         asm!("{}", out(reg) v[..]);
114    |                             ^^^^^
115    |
116    = note: only integers, floats, SIMD vectors, pointers and function pointers can be used as arguments for inline assembly
117
118 error: cannot use value of type `[u64]` for inline assembly
119   --> $DIR/type-check-1.rs:29:31
120    |
121 LL |         asm!("{}", inout(reg) v[..]);
122    |                               ^^^^^
123    |
124    = note: only integers, floats, SIMD vectors, pointers and function pointers can be used as arguments for inline assembly
125
126 error[E0308]: mismatched types
127   --> $DIR/type-check-1.rs:76:25
128    |
129 LL | global_asm!("{}", const 0f32);
130    |                         ^^^^ expected integer, found `f32`
131
132 error[E0308]: mismatched types
133   --> $DIR/type-check-1.rs:78:25
134    |
135 LL | global_asm!("{}", const 0 as *mut u8);
136    |                         ^^^^^^^^^^^^ expected integer, found *-ptr
137    |
138    = note:     expected type `{integer}`
139            found raw pointer `*mut u8`
140
141 error: aborting due to 17 previous errors
142
143 Some errors have detailed explanations: E0277, E0308, E0435.
144 For more information about an error, try `rustc --explain E0277`.