diff options
| author | bors <bors@rust-lang.org> | 2014-06-28 20:11:34 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2014-06-28 20:11:34 +0000 |
| commit | fe8bc178014dc2c5badd8443329c179478a40cc4 (patch) | |
| tree | b5bfc8f15cc996fe751306924595f81bcc558a27 /src/libsyntax | |
| parent | de337f3ddfbef800a8cf731e0b593e341af1e3e5 (diff) | |
| parent | 0dfc90ab15475aa64bea393671463a8e9784ae3f (diff) | |
| download | rust-fe8bc178014dc2c5badd8443329c179478a40cc4.tar.gz rust-fe8bc178014dc2c5badd8443329c179478a40cc4.zip | |
auto merge of #15208 : alexcrichton/rust/snapshots, r=pcwalton
This change registers new snapshots, allowing `*T` to be removed from the language. This is a large breaking change, and it is recommended that if compiler errors are seen that any FFI calls are audited to determine whether they should be actually taking `*mut T`.
Diffstat (limited to 'src/libsyntax')
| -rw-r--r-- | src/libsyntax/owned_slice.rs | 4 | ||||
| -rw-r--r-- | src/libsyntax/parse/parser.rs | 6 | ||||
| -rw-r--r-- | src/libsyntax/print/pprust.rs | 6 |
3 files changed, 12 insertions, 4 deletions
diff --git a/src/libsyntax/owned_slice.rs b/src/libsyntax/owned_slice.rs index 016dd879dcd..530ea013112 100644 --- a/src/libsyntax/owned_slice.rs +++ b/src/libsyntax/owned_slice.rs @@ -69,9 +69,9 @@ impl<T> OwnedSlice<T> { static PTR_MARKER: u8 = 0; let ptr = if self.data.is_null() { // length zero, i.e. this will never be read as a T. - &PTR_MARKER as *u8 as *T + &PTR_MARKER as *const u8 as *const T } else { - self.data as *T + self.data as *const T }; let slice: &[T] = unsafe {mem::transmute(raw::Slice { diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs index 1cb09bb8d89..0fd5a7086b7 100644 --- a/src/libsyntax/parse/parser.rs +++ b/src/libsyntax/parse/parser.rs @@ -1448,7 +1448,11 @@ impl<'a> Parser<'a> { } else if self.eat_keyword(keywords::Const) { MutImmutable } else { - // NOTE: after a stage0 snap this should turn into a span_err. + let span = self.last_span; + self.span_err(span, + "bare raw pointers are no longer allowed, you should \ + likely use `*mut T`, but otherwise `*T` is now \ + known as `*const T`"); MutImmutable }; let t = self.parse_ty(true); diff --git a/src/libsyntax/print/pprust.rs b/src/libsyntax/print/pprust.rs index 87ed2076d61..6719f25abb9 100644 --- a/src/libsyntax/print/pprust.rs +++ b/src/libsyntax/print/pprust.rs @@ -479,7 +479,11 @@ impl<'a> State<'a> { } ast::TyPtr(ref mt) => { try!(word(&mut self.s, "*")); - try!(self.print_mt(mt)); + match mt.mutbl { + ast::MutMutable => try!(self.word_nbsp("mut")), + ast::MutImmutable => try!(self.word_nbsp("const")), + } + try!(self.print_type(&*mt.ty)); } ast::TyRptr(ref lifetime, ref mt) => { try!(word(&mut self.s, "&")); |
