Skip to content

Commit 222f47a

Browse files
committed
Improve message for raw pointer missing mut and const
"Bare raw pointer" does not exist as a concept.
1 parent 3d50ad7 commit 222f47a

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/libsyntax/parse/parser.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1532,8 +1532,8 @@ impl<'a> Parser<'a> {
15321532
} else {
15331533
let span = self.last_span;
15341534
self.span_err(span,
1535-
"bare raw pointers are not allowed, use `*mut T` or \
1536-
`*const T` as appropriate");
1535+
"expected mut or const in raw pointer type (use \
1536+
`*mut T` or `*const T` as appropriate)");
15371537
Mutability::Immutable
15381538
};
15391539
let t = self.parse_ty()?;

src/test/parse-fail/bare-raw-pointer.rs renamed to src/test/parse-fail/bad-pointer-type.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,5 @@
1111
// compile-flags: -Z parse-only
1212

1313
fn foo(_: *()) {
14-
//~^ bare raw pointers are not allowed, use `*mut T` or `*const T` as appropriate
14+
//~^ expected mut or const in raw pointer type (use `*mut T` or `*const T` as appropriate)
1515
}

0 commit comments

Comments
 (0)