about summary refs log tree commit diff
diff options
context:
space:
mode:
authorAlex Crichton <alex@alexcrichton.com>2014-06-16 13:53:09 -0700
committerAlex Crichton <alex@alexcrichton.com>2014-06-16 18:16:28 -0700
commitaccb442b38cb5e7f64ed80199ce5d77f3e4c4dd7 (patch)
tree7d8c74911540155f05cbc55afeb7155a126cd7f4
parent01dc27a219435714ec38d0a2ddd1594d96e4da72 (diff)
downloadrust-accb442b38cb5e7f64ed80199ce5d77f3e4c4dd7.tar.gz
rust-accb442b38cb5e7f64ed80199ce5d77f3e4c4dd7.zip
rustc: Don't mark type parameters as exported
This ends up causing the privacy pass to get all confused, and there's nothing
inherently exported about them anyway.

Closes #14933
-rw-r--r--src/librustc/middle/privacy.rs2
-rw-r--r--src/test/run-pass/issue-14933.rs15
2 files changed, 16 insertions, 1 deletions
diff --git a/src/librustc/middle/privacy.rs b/src/librustc/middle/privacy.rs
index 37d535e7d16..f69dc8e31d6 100644
--- a/src/librustc/middle/privacy.rs
+++ b/src/librustc/middle/privacy.rs
@@ -303,7 +303,7 @@ impl<'a> Visitor<()> for EmbargoVisitor<'a> {
                 match ty.node {
                     ast::TyPath(_, _, id) => {
                         match self.tcx.def_map.borrow().get_copy(&id) {
-                            def::DefPrimTy(..) => {},
+                            def::DefPrimTy(..) | def::DefTyParam(..) => {},
                             def => {
                                 let did = def.def_id();
                                 if is_local(did) {
diff --git a/src/test/run-pass/issue-14933.rs b/src/test/run-pass/issue-14933.rs
new file mode 100644
index 00000000000..9796322b264
--- /dev/null
+++ b/src/test/run-pass/issue-14933.rs
@@ -0,0 +1,15 @@
+// Copyright 2014 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.
+
+#![feature(default_type_params)]
+
+pub type BigRat<T = int> = T;
+
+fn main() {}