about summary refs log tree commit diff
path: root/src/libproc_macro
diff options
context:
space:
mode:
authorStein Somers <git@steinsomers.be>2019-01-09 15:15:18 +0100
committerStein Somers <git@steinsomers.be>2019-01-09 15:15:18 +0100
commitccba43df81d5bda37c9e4d231ad4443e6f3a7e44 (patch)
treeefe674e2d5ae721f38fa8558385e0a2f12997227 /src/libproc_macro
parentf9f71cc32497ee4e3cbc7d9795bcf358a9268c13 (diff)
parent664c7797f6bfddf9f5e67474c2fd8017f91d7110 (diff)
Merge remote-tracking branch 'upstream/master'
Diffstat (limited to 'src/libproc_macro')
-rw-r--r--src/libproc_macro/bridge/buffer.rs10
-rw-r--r--src/libproc_macro/bridge/client.rs10
-rw-r--r--src/libproc_macro/bridge/closure.rs10
-rw-r--r--src/libproc_macro/bridge/handle.rs10
-rw-r--r--src/libproc_macro/bridge/mod.rs10
-rw-r--r--src/libproc_macro/bridge/rpc.rs34
-rw-r--r--src/libproc_macro/bridge/scoped_cell.rs10
-rw-r--r--src/libproc_macro/bridge/server.rs10
-rw-r--r--src/libproc_macro/diagnostic.rs10
-rw-r--r--src/libproc_macro/lib.rs10
-rw-r--r--src/libproc_macro/quote.rs10
11 files changed, 15 insertions, 119 deletions
diff --git a/src/libproc_macro/bridge/buffer.rs b/src/libproc_macro/bridge/buffer.rs
index f228841c1e8..8bc4f0fec85 100644
--- a/src/libproc_macro/bridge/buffer.rs
+++ b/src/libproc_macro/bridge/buffer.rs
@@ -1,13 +1,3 @@
-// Copyright 2018 The Rust Project Developers. See the COPYRIGHT
-// file at the top-level directory of this distribution and at
-// http://rust-lang.org/COPYRIGHT.
-//
-// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
 //! Buffer management for same-process client<->server communication.
 
 use std::io::{self, Write};
diff --git a/src/libproc_macro/bridge/client.rs b/src/libproc_macro/bridge/client.rs
index f5e12713e4e..3095c8041f2 100644
--- a/src/libproc_macro/bridge/client.rs
+++ b/src/libproc_macro/bridge/client.rs
@@ -1,13 +1,3 @@
-// Copyright 2018 The Rust Project Developers. See the COPYRIGHT
-// file at the top-level directory of this distribution and at
-// http://rust-lang.org/COPYRIGHT.
-//
-// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
 //! Client-side types.
 
 use super::*;
diff --git a/src/libproc_macro/bridge/closure.rs b/src/libproc_macro/bridge/closure.rs
index 92fe7baae09..8d8adfa1caa 100644
--- a/src/libproc_macro/bridge/closure.rs
+++ b/src/libproc_macro/bridge/closure.rs
@@ -1,13 +1,3 @@
-// Copyright 2018 The Rust Project Developers. See the COPYRIGHT
-// file at the top-level directory of this distribution and at
-// http://rust-lang.org/COPYRIGHT.
-//
-// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
 //! Closure type (equivalent to `&mut dyn FnMut(A) -> R`) that's `repr(C)`.
 
 #[repr(C)]
diff --git a/src/libproc_macro/bridge/handle.rs b/src/libproc_macro/bridge/handle.rs
index 5c91a1408a4..66496ff3f1a 100644
--- a/src/libproc_macro/bridge/handle.rs
+++ b/src/libproc_macro/bridge/handle.rs
@@ -1,13 +1,3 @@
-// Copyright 2018 The Rust Project Developers. See the COPYRIGHT
-// file at the top-level directory of this distribution and at
-// http://rust-lang.org/COPYRIGHT.
-//
-// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
 //! Server-side handles and storage for per-handle data.
 
 use std::collections::{BTreeMap, HashMap};
diff --git a/src/libproc_macro/bridge/mod.rs b/src/libproc_macro/bridge/mod.rs
index edb4d3fbdaa..6c3e534bf91 100644
--- a/src/libproc_macro/bridge/mod.rs
+++ b/src/libproc_macro/bridge/mod.rs
@@ -1,13 +1,3 @@
-// Copyright 2018 The Rust Project Developers. See the COPYRIGHT
-// file at the top-level directory of this distribution and at
-// http://rust-lang.org/COPYRIGHT.
-//
-// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
 //! Internal interface for communicating between a `proc_macro` client
 //! (a proc macro crate) and a `proc_macro` server (a compiler front-end).
 //!
diff --git a/src/libproc_macro/bridge/rpc.rs b/src/libproc_macro/bridge/rpc.rs
index fafc3d00740..74ae711a473 100644
--- a/src/libproc_macro/bridge/rpc.rs
+++ b/src/libproc_macro/bridge/rpc.rs
@@ -1,14 +1,4 @@
-// Copyright 2018 The Rust Project Developers. See the COPYRIGHT
-// file at the top-level directory of this distribution and at
-// http://rust-lang.org/COPYRIGHT.
-//
-// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-//! Serialization for client<->server communication.
+//! Serialization for client-server communication.
 
 use std::any::Any;
 use std::char;
@@ -81,15 +71,18 @@ macro_rules! rpc_encode_decode {
     (enum $name:ident $(<$($T:ident),+>)* { $($variant:ident $(($field:ident))*),* $(,)* }) => {
         impl<S, $($($T: Encode<S>),+)*> Encode<S> for $name $(<$($T),+>)* {
             fn encode(self, w: &mut Writer, s: &mut S) {
-                // HACK(eddyb) `Tag` enum duplicated between the
+                // HACK(eddyb): `Tag` enum duplicated between the
                 // two impls as there's no other place to stash it.
-                #[repr(u8)] enum Tag { $($variant),* }
                 #[allow(non_upper_case_globals)]
-                impl Tag { $(const $variant: u8 = Tag::$variant as u8;)* }
+                mod tag {
+                    #[repr(u8)] enum Tag { $($variant),* }
+
+                    $(pub const $variant: u8 = Tag::$variant as u8;)*
+                }
 
                 match self {
                     $($name::$variant $(($field))* => {
-                        <Tag>::$variant.encode(w, s);
+                        tag::$variant.encode(w, s);
                         $($field.encode(w, s);)*
                     })*
                 }
@@ -100,14 +93,17 @@ macro_rules! rpc_encode_decode {
             for $name $(<$($T),+>)*
         {
             fn decode(r: &mut Reader<'a>, s: &mut S) -> Self {
-                // HACK(eddyb) `Tag` enum duplicated between the
+                // HACK(eddyb): `Tag` enum duplicated between the
                 // two impls as there's no other place to stash it.
-                #[repr(u8)] enum Tag { $($variant),* }
                 #[allow(non_upper_case_globals)]
-                impl Tag { $(const $variant: u8 = Tag::$variant as u8;)* }
+                mod tag {
+                    #[repr(u8)] enum Tag { $($variant),* }
+
+                    $(pub const $variant: u8 = Tag::$variant as u8;)*
+                }
 
                 match u8::decode(r, s) {
-                    $(<Tag>::$variant => {
+                    $(tag::$variant => {
                         $(let $field = DecodeMut::decode(r, s);)*
                         $name::$variant $(($field))*
                     })*
diff --git a/src/libproc_macro/bridge/scoped_cell.rs b/src/libproc_macro/bridge/scoped_cell.rs
index c86d5fc309a..b1ab27c153e 100644
--- a/src/libproc_macro/bridge/scoped_cell.rs
+++ b/src/libproc_macro/bridge/scoped_cell.rs
@@ -1,13 +1,3 @@
-// Copyright 2018 The Rust Project Developers. See the COPYRIGHT
-// file at the top-level directory of this distribution and at
-// http://rust-lang.org/COPYRIGHT.
-//
-// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
 //! `Cell` variant for (scoped) existential lifetimes.
 
 use std::cell::Cell;
diff --git a/src/libproc_macro/bridge/server.rs b/src/libproc_macro/bridge/server.rs
index 0c1d4f7cc50..9a7cb1318db 100644
--- a/src/libproc_macro/bridge/server.rs
+++ b/src/libproc_macro/bridge/server.rs
@@ -1,13 +1,3 @@
-// Copyright 2018 The Rust Project Developers. See the COPYRIGHT
-// file at the top-level directory of this distribution and at
-// http://rust-lang.org/COPYRIGHT.
-//
-// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
 //! Server-side traits.
 
 use super::*;
diff --git a/src/libproc_macro/diagnostic.rs b/src/libproc_macro/diagnostic.rs
index 4234f0bcd21..64d0c3893c7 100644
--- a/src/libproc_macro/diagnostic.rs
+++ b/src/libproc_macro/diagnostic.rs
@@ -1,13 +1,3 @@
-// Copyright 2017 The Rust Project Developers. See the COPYRIGHT
-// file at the top-level directory of this distribution and at
-// http://rust-lang.org/COPYRIGHT.
-//
-// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
 use Span;
 
 /// An enum representing a diagnostic level.
diff --git a/src/libproc_macro/lib.rs b/src/libproc_macro/lib.rs
index ebba5c81fe0..868190d0105 100644
--- a/src/libproc_macro/lib.rs
+++ b/src/libproc_macro/lib.rs
@@ -1,13 +1,3 @@
-// Copyright 2016 The Rust Project Developers. See the COPYRIGHT
-// file at the top-level directory of this distribution and at
-// http://rust-lang.org/COPYRIGHT.
-//
-// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
 //! A support library for macro authors when defining new macros.
 //!
 //! This library, provided by the standard distribution, provides the types
diff --git a/src/libproc_macro/quote.rs b/src/libproc_macro/quote.rs
index 0f454a79055..bd7e96210a9 100644
--- a/src/libproc_macro/quote.rs
+++ b/src/libproc_macro/quote.rs
@@ -1,13 +1,3 @@
-// Copyright 2016 The Rust Project Developers. See the COPYRIGHT
-// file at the top-level directory of this distribution and at
-// http://rust-lang.org/COPYRIGHT.
-//
-// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
 //! # Quasiquoter
 //! This file contains the implementation internals of the quasiquoter provided by `quote!`.