Skip to content

Commit 1c48025

Browse files
committed
Address review feedback
1 parent 0dcd812 commit 1c48025

File tree

6 files changed

+41
-42
lines changed

6 files changed

+41
-42
lines changed

compiler/rustc_lint/src/context.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -772,7 +772,6 @@ pub trait LintContext: Sized {
772772
}
773773
BuiltinLintDiagnostics::NamedAsmLabel(help) => {
774774
db.help(&help);
775-
//db.note("see the asm section of the unstable book <https://doc.rust-lang.org/nightly/unstable-book/library-features/asm.html#labels> for more information");
776775
}
777776
}
778777
// Rewrap `db`, and pass control to the user.

library/std/src/sys/solid/abi/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ pub fn breakpoint_program_exited(tid: usize) {
1111
// SOLID_BP_PROGRAM_EXITED = 15
1212
#[cfg(target_arch = "arm")]
1313
() => core::arch::asm!("bkpt #15", in("r0") tid),
14-
#[cfg(core::arch::asm = "aarch64")]
14+
#[cfg(target_arch = "aarch64")]
1515
() => core::arch::asm!("hlt #15", in("x0") tid),
1616
}
1717
}

src/doc/unstable-book/src/compiler-flags/sanitizer.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,7 @@ LLVM CFI can be enabled with -Zsanitizer=cfi and requires LTO (i.e., -Clto).
201201
```text
202202
#![feature(naked_functions)]
203203
204+
use std::arch::asm;
204205
use std::mem;
205206
206207
fn add_one(x: i32) -> i32 {

src/test/assembly/x86_64-fortanix-unknown-sgx-lvi-inline-assembly.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,9 @@ pub extern "C" fn get(ptr: *const u64) -> u64 {
2929
pub extern "C" fn myret() {
3030
unsafe {
3131
asm!(
32-
".start_myret_inline_asm:
33-
ret
34-
.end_myret_inline_asm:"
32+
".start_myret_inline_asm:",
33+
"ret",
34+
".end_myret_inline_asm:",
3535
);
3636
}
3737
}

src/test/ui/macros/macros-nonfatal-errors.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99
#![feature(derive_default_enum)]
1010
#![allow(deprecated)] // llvm_asm!
1111

12+
use std::arch::asm;
13+
1214
#[derive(Default)]
1315
struct DefaultInnerAttrStruct {
1416
#[default] //~ ERROR the `#[default]` attribute may only be used on unit enum variants
Lines changed: 34 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,41 @@
11
error: the `#[default]` attribute may only be used on unit enum variants
2-
--> $DIR/macros-nonfatal-errors.rs:14:5
2+
--> $DIR/macros-nonfatal-errors.rs:16:5
33
|
44
LL | #[default]
55
| ^^^^^^^^^^
66

77
error: the `#[default]` attribute may only be used on unit enum variants
8-
--> $DIR/macros-nonfatal-errors.rs:19:36
8+
--> $DIR/macros-nonfatal-errors.rs:21:36
99
|
1010
LL | struct DefaultInnerAttrTupleStruct(#[default] ());
1111
| ^^^^^^^^^^
1212

1313
error: the `#[default]` attribute may only be used on unit enum variants
14-
--> $DIR/macros-nonfatal-errors.rs:23:1
14+
--> $DIR/macros-nonfatal-errors.rs:25:1
1515
|
1616
LL | #[default]
1717
| ^^^^^^^^^^
1818

1919
error: the `#[default]` attribute may only be used on unit enum variants
20-
--> $DIR/macros-nonfatal-errors.rs:27:1
20+
--> $DIR/macros-nonfatal-errors.rs:29:1
2121
|
2222
LL | #[default]
2323
| ^^^^^^^^^^
2424

2525
error: the `#[default]` attribute may only be used on unit enum variants
26-
--> $DIR/macros-nonfatal-errors.rs:37:11
26+
--> $DIR/macros-nonfatal-errors.rs:39:11
2727
|
2828
LL | Foo = #[default] 0,
2929
| ^^^^^^^^^^
3030

3131
error: the `#[default]` attribute may only be used on unit enum variants
32-
--> $DIR/macros-nonfatal-errors.rs:38:14
32+
--> $DIR/macros-nonfatal-errors.rs:40:14
3333
|
3434
LL | Bar([u8; #[default] 1]),
3535
| ^^^^^^^^^^
3636

3737
error: no default declared
38-
--> $DIR/macros-nonfatal-errors.rs:43:10
38+
--> $DIR/macros-nonfatal-errors.rs:45:10
3939
|
4040
LL | #[derive(Default)]
4141
| ^^^^^^^
@@ -44,7 +44,7 @@ LL | #[derive(Default)]
4444
= note: this error originates in the derive macro `Default` (in Nightly builds, run with -Z macro-backtrace for more info)
4545

4646
error: multiple declared defaults
47-
--> $DIR/macros-nonfatal-errors.rs:49:10
47+
--> $DIR/macros-nonfatal-errors.rs:51:10
4848
|
4949
LL | #[derive(Default)]
5050
| ^^^^^^^
@@ -62,15 +62,15 @@ LL | Baz,
6262
= note: this error originates in the derive macro `Default` (in Nightly builds, run with -Z macro-backtrace for more info)
6363

6464
error: `#[default]` attribute does not accept a value
65-
--> $DIR/macros-nonfatal-errors.rs:61:5
65+
--> $DIR/macros-nonfatal-errors.rs:63:5
6666
|
6767
LL | #[default = 1]
6868
| ^^^^^^^^^^^^^^
6969
|
7070
= help: try using `#[default]`
7171

7272
error: multiple `#[default]` attributes
73-
--> $DIR/macros-nonfatal-errors.rs:69:5
73+
--> $DIR/macros-nonfatal-errors.rs:71:5
7474
|
7575
LL | #[default]
7676
| ---------- `#[default]` used here
@@ -81,13 +81,13 @@ LL | Foo,
8181
|
8282
= note: only one `#[default]` attribute is needed
8383
help: try removing this
84-
--> $DIR/macros-nonfatal-errors.rs:68:5
84+
--> $DIR/macros-nonfatal-errors.rs:70:5
8585
|
8686
LL | #[default]
8787
| ^^^^^^^^^^
8888

8989
error: multiple `#[default]` attributes
90-
--> $DIR/macros-nonfatal-errors.rs:79:5
90+
--> $DIR/macros-nonfatal-errors.rs:81:5
9191
|
9292
LL | #[default]
9393
| ---------- `#[default]` used here
@@ -99,7 +99,7 @@ LL | Foo,
9999
|
100100
= note: only one `#[default]` attribute is needed
101101
help: try removing these
102-
--> $DIR/macros-nonfatal-errors.rs:76:5
102+
--> $DIR/macros-nonfatal-errors.rs:78:5
103103
|
104104
LL | #[default]
105105
| ^^^^^^^^^^
@@ -109,15 +109,15 @@ LL | #[default]
109109
| ^^^^^^^^^^
110110

111111
error: the `#[default]` attribute may only be used on unit enum variants
112-
--> $DIR/macros-nonfatal-errors.rs:86:5
112+
--> $DIR/macros-nonfatal-errors.rs:88:5
113113
|
114114
LL | Foo {},
115115
| ^^^
116116
|
117117
= help: consider a manual implementation of `Default`
118118

119119
error: default variant must be exhaustive
120-
--> $DIR/macros-nonfatal-errors.rs:94:5
120+
--> $DIR/macros-nonfatal-errors.rs:96:5
121121
|
122122
LL | #[non_exhaustive]
123123
| ----------------- declared `#[non_exhaustive]` here
@@ -126,46 +126,52 @@ LL | Foo,
126126
|
127127
= help: consider a manual implementation of `Default`
128128

129+
error: asm template must be a string literal
130+
--> $DIR/macros-nonfatal-errors.rs:101:10
131+
|
132+
LL | asm!(invalid);
133+
| ^^^^^^^
134+
129135
error: inline assembly must be a string literal
130-
--> $DIR/macros-nonfatal-errors.rs:100:15
136+
--> $DIR/macros-nonfatal-errors.rs:102:15
131137
|
132138
LL | llvm_asm!(invalid);
133139
| ^^^^^^^
134140

135141
error: concat_idents! requires ident args
136-
--> $DIR/macros-nonfatal-errors.rs:102:5
142+
--> $DIR/macros-nonfatal-errors.rs:104:5
137143
|
138144
LL | concat_idents!("not", "idents");
139145
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
140146

141147
error: argument must be a string literal
142-
--> $DIR/macros-nonfatal-errors.rs:104:17
148+
--> $DIR/macros-nonfatal-errors.rs:106:17
143149
|
144150
LL | option_env!(invalid);
145151
| ^^^^^^^
146152

147153
error: expected string literal
148-
--> $DIR/macros-nonfatal-errors.rs:105:10
154+
--> $DIR/macros-nonfatal-errors.rs:107:10
149155
|
150156
LL | env!(invalid);
151157
| ^^^^^^^
152158

153159
error: expected string literal
154-
--> $DIR/macros-nonfatal-errors.rs:106:10
160+
--> $DIR/macros-nonfatal-errors.rs:108:10
155161
|
156162
LL | env!(foo, abr, baz);
157163
| ^^^
158164

159165
error: environment variable `RUST_HOPEFULLY_THIS_DOESNT_EXIST` not defined
160-
--> $DIR/macros-nonfatal-errors.rs:107:5
166+
--> $DIR/macros-nonfatal-errors.rs:109:5
161167
|
162168
LL | env!("RUST_HOPEFULLY_THIS_DOESNT_EXIST");
163169
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
164170
|
165171
= note: this error originates in the macro `env` (in Nightly builds, run with -Z macro-backtrace for more info)
166172

167173
error: format argument must be a string literal
168-
--> $DIR/macros-nonfatal-errors.rs:109:13
174+
--> $DIR/macros-nonfatal-errors.rs:111:13
169175
|
170176
LL | format!(invalid);
171177
| ^^^^^^^
@@ -176,53 +182,44 @@ LL | format!("{}", invalid);
176182
| +++++
177183

178184
error: argument must be a string literal
179-
--> $DIR/macros-nonfatal-errors.rs:111:14
185+
--> $DIR/macros-nonfatal-errors.rs:113:14
180186
|
181187
LL | include!(invalid);
182188
| ^^^^^^^
183189

184190
error: argument must be a string literal
185-
--> $DIR/macros-nonfatal-errors.rs:113:18
191+
--> $DIR/macros-nonfatal-errors.rs:115:18
186192
|
187193
LL | include_str!(invalid);
188194
| ^^^^^^^
189195

190196
error: couldn't read $DIR/i'd be quite surprised if a file with this name existed: $FILE_NOT_FOUND_MSG (os error 2)
191-
--> $DIR/macros-nonfatal-errors.rs:114:5
197+
--> $DIR/macros-nonfatal-errors.rs:116:5
192198
|
193199
LL | include_str!("i'd be quite surprised if a file with this name existed");
194200
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
195201
|
196202
= note: this error originates in the macro `include_str` (in Nightly builds, run with -Z macro-backtrace for more info)
197203

198204
error: argument must be a string literal
199-
--> $DIR/macros-nonfatal-errors.rs:115:20
205+
--> $DIR/macros-nonfatal-errors.rs:117:20
200206
|
201207
LL | include_bytes!(invalid);
202208
| ^^^^^^^
203209

204210
error: couldn't read $DIR/i'd be quite surprised if a file with this name existed: $FILE_NOT_FOUND_MSG (os error 2)
205-
--> $DIR/macros-nonfatal-errors.rs:116:5
211+
--> $DIR/macros-nonfatal-errors.rs:118:5
206212
|
207213
LL | include_bytes!("i'd be quite surprised if a file with this name existed");
208214
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
209215
|
210216
= note: this error originates in the macro `include_bytes` (in Nightly builds, run with -Z macro-backtrace for more info)
211217

212218
error: trace_macros! accepts only `true` or `false`
213-
--> $DIR/macros-nonfatal-errors.rs:118:5
219+
--> $DIR/macros-nonfatal-errors.rs:120:5
214220
|
215221
LL | trace_macros!(invalid);
216222
| ^^^^^^^^^^^^^^^^^^^^^^
217223

218-
error: cannot find macro `asm` in this scope
219-
--> $DIR/macros-nonfatal-errors.rs:99:5
220-
|
221-
LL | asm!(invalid);
222-
| ^^^
223-
|
224-
= note: consider importing this macro:
225-
std::arch::asm
226-
227224
error: aborting due to 27 previous errors
228225

0 commit comments

Comments
 (0)