-
Notifications
You must be signed in to change notification settings - Fork 13.3k
librustc: Require that types mentioned anywhere in public signatures be #16467
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -224,7 +224,7 @@ pub fn deref_kind(tcx: &ty::ctxt, t: ty::t) -> deref_kind { | |
} | ||
} | ||
|
||
trait ast_node { | ||
pub trait ast_node { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Similar to |
||
fn id(&self) -> ast::NodeId; | ||
fn span(&self) -> Span; | ||
} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -44,7 +44,7 @@ use std::uint; | |
// Definition mapping | ||
pub type DefMap = RefCell<NodeMap<Def>>; | ||
|
||
struct binding_info { | ||
pub struct binding_info { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Seems like a good thing that this was made public. That is, it IS reachable, so it's clearer to see it public, even if the fields are private and hence it is not used from outside the module. |
||
span: Span, | ||
binding_mode: BindingMode, | ||
} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -56,7 +56,7 @@ struct LifetimeContext<'a> { | |
named_region_map: NamedRegionMap, | ||
} | ||
|
||
enum ScopeChain<'a> { | ||
pub enum ScopeChain<'a> { | ||
/// EarlyScope(i, ['a, 'b, ...], s) extends s with early-bound | ||
/// lifetimes, assigning indexes 'a => i, 'b => i+1, ... etc. | ||
EarlyScope(subst::ParamSpace, &'a Vec<ast::LifetimeDef>, Scope<'a>), | ||
|
@@ -69,7 +69,7 @@ enum ScopeChain<'a> { | |
RootScope | ||
} | ||
|
||
type Scope<'a> = &'a ScopeChain<'a>; | ||
pub type Scope<'a> = &'a ScopeChain<'a>; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is an interesting case. I'm not sure what rule from RFC triggered the requirement that There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It's because of |
||
|
||
pub fn krate(sess: &Session, krate: &ast::Crate) -> NamedRegionMap { | ||
let mut ctxt = LifetimeContext { | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1429,7 +1429,7 @@ impl<'a> ErrorReportingHelpers for InferCtxt<'a> { | |
} | ||
} | ||
|
||
trait Resolvable { | ||
pub trait Resolvable { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Private trait that is only locally implemented. OK. |
||
fn resolve(&self, infcx: &InferCtxt) -> Self; | ||
fn contains_error(&self) -> bool; | ||
} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -45,7 +45,7 @@ use util::ppaux::Repr; | |
|
||
use std::collections::HashMap; | ||
|
||
trait LatticeValue : Clone + Repr + PartialEq { | ||
pub trait LatticeValue : Clone + Repr + PartialEq { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Private trait that is only locally implemented. OK. |
||
fn sub(cf: CombineFields, a: &Self, b: &Self) -> ures; | ||
fn lub(cf: CombineFields, a: &Self, b: &Self) -> cres<Self>; | ||
fn glb(cf: CombineFields, a: &Self, b: &Self) -> cres<Self>; | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -230,11 +230,11 @@ pub fn infer_variance(tcx: &ty::ctxt, | |
* a variable. | ||
*/ | ||
|
||
type VarianceTermPtr<'a> = &'a VarianceTerm<'a>; | ||
pub type VarianceTermPtr<'a> = &'a VarianceTerm<'a>; | ||
|
||
struct InferredIndex(uint); | ||
pub struct InferredIndex(uint); | ||
|
||
enum VarianceTerm<'a> { | ||
pub enum VarianceTerm<'a> { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Pretty sure that these changes are not necessary (per the impl rule I described above). |
||
ConstantTerm(ty::Variance), | ||
TransformTerm(VarianceTermPtr<'a>, VarianceTermPtr<'a>), | ||
InferredTerm(InferredIndex), | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -140,7 +140,7 @@ pub enum AttributeSet { | |
FunctionIndex = !0 | ||
} | ||
|
||
trait AttrHelper { | ||
pub trait AttrHelper { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Private trait that is only locally implemented. OK. |
||
fn apply_llfn(&self, idx: c_uint, llfn: ValueRef); | ||
fn apply_callsite(&self, idx: c_uint, callsite: ValueRef); | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Inner
mus be public becauseReq
is public, but it's not clear to me whyReq
is public.