]> git.lizzy.rs Git - rust.git/blob - src/test/ui/asm/type-check-1.stderr
Auto merge of #98471 - wesleywiser:update_measureme, 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: invalid asm output
37   --> $DIR/type-check-1.rs:15:29
38    |
39 LL |         asm!("{}", out(reg) 1 + 2);
40    |                             ^^^^^ cannot assign to this expression
41
42 error: invalid asm output
43   --> $DIR/type-check-1.rs:17:31
44    |
45 LL |         asm!("{}", inout(reg) 1 + 2);
46    |                               ^^^^^ cannot assign to this expression
47
48 error[E0277]: the size for values of type `[u64]` cannot be known at compilation time
49   --> $DIR/type-check-1.rs:23:28
50    |
51 LL |         asm!("{}", in(reg) v[..]);
52    |                            ^^^^^ doesn't have a size known at compile-time
53    |
54    = help: the trait `Sized` is not implemented for `[u64]`
55    = note: all inline asm arguments must have a statically known size
56
57 error[E0277]: the size for values of type `[u64]` cannot be known at compilation time
58   --> $DIR/type-check-1.rs:26:29
59    |
60 LL |         asm!("{}", out(reg) v[..]);
61    |                             ^^^^^ doesn't have a size known at compile-time
62    |
63    = help: the trait `Sized` is not implemented for `[u64]`
64    = note: all inline asm arguments must have a statically known size
65
66 error[E0277]: the size for values of type `[u64]` cannot be known at compilation time
67   --> $DIR/type-check-1.rs:29:31
68    |
69 LL |         asm!("{}", inout(reg) v[..]);
70    |                               ^^^^^ doesn't have a size known at compile-time
71    |
72    = help: the trait `Sized` is not implemented for `[u64]`
73    = note: all inline asm arguments must have a statically known size
74
75 error: cannot use value of type `[u64]` for inline assembly
76   --> $DIR/type-check-1.rs:23:28
77    |
78 LL |         asm!("{}", in(reg) v[..]);
79    |                            ^^^^^
80    |
81    = note: only integers, floats, SIMD vectors, pointers and function pointers can be used as arguments for inline assembly
82
83 error: cannot use value of type `[u64]` for inline assembly
84   --> $DIR/type-check-1.rs:26:29
85    |
86 LL |         asm!("{}", out(reg) v[..]);
87    |                             ^^^^^
88    |
89    = note: only integers, floats, SIMD vectors, pointers and function pointers can be used as arguments for inline assembly
90
91 error: cannot use value of type `[u64]` for inline assembly
92   --> $DIR/type-check-1.rs:29:31
93    |
94 LL |         asm!("{}", inout(reg) v[..]);
95    |                               ^^^^^
96    |
97    = note: only integers, floats, SIMD vectors, pointers and function pointers can be used as arguments for inline assembly
98
99 error[E0308]: mismatched types
100   --> $DIR/type-check-1.rs:58:26
101    |
102 LL |         asm!("{}", const 0f32);
103    |                          ^^^^ expected integer, found `f32`
104
105 error[E0308]: mismatched types
106   --> $DIR/type-check-1.rs:60:26
107    |
108 LL |         asm!("{}", const 0 as *mut u8);
109    |                          ^^^^^^^^^^^^ expected integer, found *-ptr
110    |
111    = note:     expected type `{integer}`
112            found raw pointer `*mut u8`
113
114 error[E0308]: mismatched types
115   --> $DIR/type-check-1.rs:62:26
116    |
117 LL |         asm!("{}", const &0);
118    |                          ^^ expected integer, found `&{integer}`
119    |
120 help: consider removing the borrow
121    |
122 LL -         asm!("{}", const &0);
123 LL +         asm!("{}", const 0);
124    |
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`.