Skip to content

Commit ce40513

Browse files
authored
Unrolled build for rust-lang#136403
Rollup merge of rust-lang#136403 - fmease:fix-a-ui-test, r=oli-obk Fix malformed error annotations in a UI test The compiletest DSL still features a historical remnant from the time when its directives were merely prefixed with `//` instead of `//`@`` when unknown directive names weren't rejected since they could just as well be part of prose: As an "optimization", it stops looking for directives once it stumbles upon a line which starts with either `fn` or `mod`. This allowed a malformed error annotation of the form `//`@[…]~^^^`` to go undetected & unexercised (as it's placed below `fn main() {`). Obviously a character other than ``@`` would've mangled the error annotation, too (but it might've caught the reviewer's eye). I specifically found this file because I ran `rg '^(fn|mod)[\s\S]*?//`@'` tests/ui --multiline -trust` to check how footgun-y that "special feature" of compiletest is.
2 parents 4a43094 + 43b729d commit ce40513

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

tests/ui/typeck/path-to-method-sugg-unresolved-expr.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,6 @@ fn main() {
55
let page_size = page_size::get();
66
//~^ ERROR failed to resolve: use of unresolved module or unlinked crate `page_size`
77
//~| NOTE use of unresolved module or unlinked crate `page_size`
8-
//@[cargo-invoked]~^^^ HELP if you wanted to use a crate named `page_size`, use `cargo add
9-
//@[only-rustc]~^^^^ HELP you might be missing a crate named `page_size`
8+
//[cargo-invoked]~^^^ HELP if you wanted to use a crate named `page_size`, use `cargo add
9+
//[only-rustc]~^^^^ HELP you might be missing a crate named `page_size`
1010
}

0 commit comments

Comments
 (0)