[insecurity]: http://curlpipesh.tumblr.com
-If you're on Windows, please download either the [32-bit installer][win32] or
-the [64-bit installer][win64] and run it.
+If you're on Windows, please download the appropriate [installer][install-page].
-[win32]: https://static.rust-lang.org/dist/rust-1.0.0-i686-pc-windows-gnu.msi
-[win64]: https://static.rust-lang.org/dist/rust-1.0.0-x86_64-pc-windows-gnu.msi
+[install-page]: http://www.rust-lang.org/install.html
## Uninstalling
binary downloads][install-page].
[from-source]: https://github.com/rust-lang/rust#building-from-source
-[install-page]: http://www.rust-lang.org/install.html
Oh, we should also mention the officially supported platforms:
$ rustc --version
```
-You should see the version number, commit hash, commit date and build date:
+You should see the version number, commit hash, and commit date. If you just
+installed version 1.0.0, you should see:
```bash
-rustc 1.0.0 (a59de37e9 2015-05-13) (built 2015-05-14)
+rustc 1.0.0 (a59de37e9 2015-05-13)
```
If you did, Rust has been installed successfully! Congrats!
use std::collections::HashSet;
use syntax::ast;
use syntax::ast_util::local_def;
-use syntax::codemap::Span;
+use syntax::codemap::{DUMMY_SP, Span};
use syntax::parse::token::{self, special_idents};
use syntax::visit;
use syntax::visit::Visitor;
self.with_fcx(item, |this, fcx| {
let variants = lookup_fields(fcx);
let mut bounds_checker = BoundsChecker::new(fcx,
- item.span,
item.id,
Some(&mut this.cache));
debug!("check_type_defn at bounds_checker.scope: {:?}", bounds_checker.scope);
- for variant in &variants {
+ for variant in &variants {
for field in &variant.fields {
// Regions are checked below.
- bounds_checker.check_traits_in_ty(field.ty);
+ bounds_checker.check_traits_in_ty(field.ty, field.span);
}
// For DST, all intermediate types must be sized.
{
self.with_fcx(item, |this, fcx| {
let mut bounds_checker = BoundsChecker::new(fcx,
- item.span,
item.id,
Some(&mut this.cache));
debug!("check_item_type at bounds_checker.scope: {:?}", bounds_checker.scope);
&fcx.inh.param_env.free_substs,
&type_scheme.ty);
- bounds_checker.check_traits_in_ty(item_ty);
+ bounds_checker.check_traits_in_ty(item_ty, item.span);
});
}
{
self.with_fcx(item, |this, fcx| {
let mut bounds_checker = BoundsChecker::new(fcx,
- item.span,
item.id,
Some(&mut this.cache));
debug!("check_impl at bounds_checker.scope: {:?}", bounds_checker.scope);
&fcx.inh.param_env.free_substs,
&self_ty);
- bounds_checker.check_traits_in_ty(self_ty);
+ bounds_checker.check_traits_in_ty(self_ty, item.span);
// Similarly, obtain an "inside" reference to the trait
// that the impl implements.
// trait reference. Instead, this is done at the impl site.
// Arguably this is wrong and we should treat the trait-reference
// the same way as we treat the self-type.
- bounds_checker.check_trait_ref(&trait_ref);
+ bounds_checker.check_trait_ref(&trait_ref, item.span);
let cause =
traits::ObligationCause::new(
impl<'cx,'tcx> BoundsChecker<'cx,'tcx> {
pub fn new(fcx: &'cx FnCtxt<'cx,'tcx>,
- span: Span,
scope: ast::NodeId,
cache: Option<&'cx mut HashSet<Ty<'tcx>>>)
-> BoundsChecker<'cx,'tcx> {
- BoundsChecker { fcx: fcx, span: span, scope: scope,
+ BoundsChecker { fcx: fcx, span: DUMMY_SP, scope: scope,
cache: cache, binding_count: 0 }
}
///
/// Note that it does not (currently, at least) check that `A : Copy` (that check is delegated
/// to the point where impl `A : Trait<B>` is implemented).
- pub fn check_trait_ref(&mut self, trait_ref: &ty::TraitRef<'tcx>) {
+ pub fn check_trait_ref(&mut self, trait_ref: &ty::TraitRef<'tcx>, span: Span) {
let trait_predicates = ty::lookup_predicates(self.fcx.tcx(), trait_ref.def_id);
- let bounds = self.fcx.instantiate_bounds(self.span,
+ let bounds = self.fcx.instantiate_bounds(span,
trait_ref.substs,
&trait_predicates);
self.fcx.add_obligations_for_parameters(
traits::ObligationCause::new(
- self.span,
+ span,
self.fcx.body_id,
traits::ItemObligation(trait_ref.def_id)),
&bounds);
for &ty in &trait_ref.substs.types {
- self.check_traits_in_ty(ty);
+ self.check_traits_in_ty(ty, span);
}
}
- pub fn check_ty(&mut self, ty: Ty<'tcx>) {
+ pub fn check_ty(&mut self, ty: Ty<'tcx>, span: Span) {
+ self.span = span;
ty.fold_with(self);
}
- fn check_traits_in_ty(&mut self, ty: Ty<'tcx>) {
+ fn check_traits_in_ty(&mut self, ty: Ty<'tcx>, span: Span) {
+ self.span = span;
// When checking types outside of a type def'n, we ignore
// region obligations. See discussion below in fold_ty().
self.binding_count += 1;