mirror of
https://github.com/rust-lang/rust
synced 2024-10-14 04:23:37 +00:00
fix more typos found by codespell.
This commit is contained in:
parent
b298607864
commit
4452446292
|
@ -29,7 +29,7 @@ Libraries
|
||||||
- [Copied `AsciiExt` methods onto `char`][46077]
|
- [Copied `AsciiExt` methods onto `char`][46077]
|
||||||
- [Remove `T: Sized` requirement on `ptr::is_null()`][46094]
|
- [Remove `T: Sized` requirement on `ptr::is_null()`][46094]
|
||||||
- [impl `From<RecvError>` for `{TryRecvError, RecvTimeoutError}`][45506]
|
- [impl `From<RecvError>` for `{TryRecvError, RecvTimeoutError}`][45506]
|
||||||
- [Optimised `f32::{min, max}` to generate more efficent x86 assembly][47080]
|
- [Optimised `f32::{min, max}` to generate more efficient x86 assembly][47080]
|
||||||
- [`[u8]::contains` now uses memchr which provides a 3x speed improvement][46713]
|
- [`[u8]::contains` now uses memchr which provides a 3x speed improvement][46713]
|
||||||
|
|
||||||
Stabilized APIs
|
Stabilized APIs
|
||||||
|
|
|
@ -151,8 +151,8 @@
|
||||||
# default.
|
# default.
|
||||||
#extended = false
|
#extended = false
|
||||||
|
|
||||||
# Installs choosen set of extended tools if enables. By default builds all.
|
# Installs chosen set of extended tools if enables. By default builds all.
|
||||||
# If choosen tool failed to build the installation fails.
|
# If chosen tool failed to build the installation fails.
|
||||||
#tools = ["cargo", "rls", "rustfmt", "analysis", "src"]
|
#tools = ["cargo", "rls", "rustfmt", "analysis", "src"]
|
||||||
|
|
||||||
# Verbosity level: 0 == not verbose, 1 == verbose, 2 == very verbose
|
# Verbosity level: 0 == not verbose, 1 == verbose, 2 == very verbose
|
||||||
|
|
|
@ -935,7 +935,7 @@ fn run(self, builder: &Builder) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if suite == "run-make" && !build.config.llvm_enabled {
|
if suite == "run-make" && !build.config.llvm_enabled {
|
||||||
println!("Ignoring run-make test suite as they generally dont work without LLVM");
|
println!("Ignoring run-make test suite as they generally don't work without LLVM");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1891,7 +1891,7 @@ extern "C" fn foo(userdata: Box<i32>) {
|
||||||
This pattern should be rewritten. There are a few possible ways to do this:
|
This pattern should be rewritten. There are a few possible ways to do this:
|
||||||
|
|
||||||
- change the original fn declaration to match the expected signature,
|
- change the original fn declaration to match the expected signature,
|
||||||
and do the cast in the fn body (the prefered option)
|
and do the cast in the fn body (the preferred option)
|
||||||
- cast the fn item fo a fn pointer before calling transmute, as shown here:
|
- cast the fn item fo a fn pointer before calling transmute, as shown here:
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
|
@ -543,7 +543,7 @@ pub fn carries_unsafe_attr(&self) -> Option<UnsafeGeneric> {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Synthetic Type Parameters are converted to an other form during lowering, this allows
|
/// Synthetic Type Parameters are converted to an other form during lowering, this allows
|
||||||
/// to track the original form they had. Usefull for error messages.
|
/// to track the original form they had. Useful for error messages.
|
||||||
#[derive(Copy, Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Debug)]
|
#[derive(Copy, Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Debug)]
|
||||||
pub enum SyntheticTyParamKind {
|
pub enum SyntheticTyParamKind {
|
||||||
ImplTrait
|
ImplTrait
|
||||||
|
|
|
@ -734,7 +734,7 @@ fn lifetime_display(lifetime: Region) -> String {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// When finding T != &T, hightlight only the borrow
|
// When finding T != &T, highlight only the borrow
|
||||||
(&ty::TyRef(r1, ref tnm1), _) if equals(&tnm1.ty, &t2) => {
|
(&ty::TyRef(r1, ref tnm1), _) if equals(&tnm1.ty, &t2) => {
|
||||||
let mut values = (DiagnosticStyledString::new(), DiagnosticStyledString::new());
|
let mut values = (DiagnosticStyledString::new(), DiagnosticStyledString::new());
|
||||||
push_ty_ref(&r1, tnm1, &mut values.0);
|
push_ty_ref(&r1, tnm1, &mut values.0);
|
||||||
|
@ -946,7 +946,7 @@ pub fn report_generic_bound_failure(&self,
|
||||||
let type_param = generics.type_param(param, self.tcx);
|
let type_param = generics.type_param(param, self.tcx);
|
||||||
let hir = &self.tcx.hir;
|
let hir = &self.tcx.hir;
|
||||||
hir.as_local_node_id(type_param.def_id).map(|id| {
|
hir.as_local_node_id(type_param.def_id).map(|id| {
|
||||||
// Get the `hir::TyParam` to verify wether it already has any bounds.
|
// Get the `hir::TyParam` to verify whether it already has any bounds.
|
||||||
// We do this to avoid suggesting code that ends up as `T: 'a'b`,
|
// We do this to avoid suggesting code that ends up as `T: 'a'b`,
|
||||||
// instead we suggest `T: 'a + 'b` in that case.
|
// instead we suggest `T: 'a + 'b` in that case.
|
||||||
let has_lifetimes = if let hir_map::NodeTyParam(ref p) = hir.get(id) {
|
let has_lifetimes = if let hir_map::NodeTyParam(ref p) = hir.get(id) {
|
||||||
|
|
|
@ -106,7 +106,7 @@ pub fn register_region_obligation(
|
||||||
/// done (or else an assert will fire).
|
/// done (or else an assert will fire).
|
||||||
///
|
///
|
||||||
/// See the `region_obligations` field of `InferCtxt` for some
|
/// See the `region_obligations` field of `InferCtxt` for some
|
||||||
/// comments about how this funtion fits into the overall expected
|
/// comments about how this function fits into the overall expected
|
||||||
/// flow of the the inferencer. The key point is that it is
|
/// flow of the the inferencer. The key point is that it is
|
||||||
/// invoked after all type-inference variables have been bound --
|
/// invoked after all type-inference variables have been bound --
|
||||||
/// towards the end of regionck. This also ensures that the
|
/// towards the end of regionck. This also ensures that the
|
||||||
|
|
|
@ -19,7 +19,7 @@ The constraints are always of one of three possible forms:
|
||||||
a subregion of Rj
|
a subregion of Rj
|
||||||
- `ConstrainRegSubVar(R, Ri)` states that the concrete region R (which
|
- `ConstrainRegSubVar(R, Ri)` states that the concrete region R (which
|
||||||
must not be a variable) must be a subregion of the variable Ri
|
must not be a variable) must be a subregion of the variable Ri
|
||||||
- `ConstrainVarSubReg(Ri, R)` states the variable Ri shoudl be less
|
- `ConstrainVarSubReg(Ri, R)` states the variable Ri should be less
|
||||||
than the concrete region R. This is kind of deprecated and ought to
|
than the concrete region R. This is kind of deprecated and ought to
|
||||||
be replaced with a verify (they essentially play the same role).
|
be replaced with a verify (they essentially play the same role).
|
||||||
|
|
||||||
|
|
|
@ -886,7 +886,7 @@ fn resolve_block<'a, 'tcx>(visitor: &mut RegionResolutionVisitor<'a, 'tcx>, blk:
|
||||||
//
|
//
|
||||||
// Each of the statements within the block is a terminating
|
// Each of the statements within the block is a terminating
|
||||||
// scope, and thus a temporary (e.g. the result of calling
|
// scope, and thus a temporary (e.g. the result of calling
|
||||||
// `bar()` in the initalizer expression for `let inner = ...;`)
|
// `bar()` in the initializer expression for `let inner = ...;`)
|
||||||
// will be cleaned up immediately after its corresponding
|
// will be cleaned up immediately after its corresponding
|
||||||
// statement (i.e. `let inner = ...;`) executes.
|
// statement (i.e. `let inner = ...;`) executes.
|
||||||
//
|
//
|
||||||
|
|
|
@ -56,7 +56,7 @@ pub struct GlobalId<'tcx> {
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
pub trait PointerArithmetic: layout::HasDataLayout {
|
pub trait PointerArithmetic: layout::HasDataLayout {
|
||||||
// These are not supposed to be overriden.
|
// These are not supposed to be overridden.
|
||||||
|
|
||||||
//// Trunace the given value to the pointer size; also return whether there was an overflow
|
//// Trunace the given value to the pointer size; also return whether there was an overflow
|
||||||
fn truncate_to_ptr(self, val: u128) -> (u64, bool) {
|
fn truncate_to_ptr(self, val: u128) -> (u64, bool) {
|
||||||
|
|
|
@ -1950,7 +1950,7 @@ pub struct GeneratorLayout<'tcx> {
|
||||||
/// ```
|
/// ```
|
||||||
///
|
///
|
||||||
/// here, there is one unique free region (`'a`) but it appears
|
/// here, there is one unique free region (`'a`) but it appears
|
||||||
/// twice. We would "renumber" each occurence to a unique vid, as follows:
|
/// twice. We would "renumber" each occurrence to a unique vid, as follows:
|
||||||
///
|
///
|
||||||
/// ```text
|
/// ```text
|
||||||
/// ClosureSubsts = [
|
/// ClosureSubsts = [
|
||||||
|
|
|
@ -277,7 +277,7 @@ pub fn orphan_check<'a, 'gcx, 'tcx>(tcx: TyCtxt<'a, 'gcx, 'tcx>,
|
||||||
/// is bad, because the only local type with `T` as a subtree is
|
/// is bad, because the only local type with `T` as a subtree is
|
||||||
/// `LocalType<T>`, and `Vec<->` is between it and the type parameter.
|
/// `LocalType<T>`, and `Vec<->` is between it and the type parameter.
|
||||||
/// - similarly, `FundamentalPair<LocalType<T>, T>` is bad, because
|
/// - similarly, `FundamentalPair<LocalType<T>, T>` is bad, because
|
||||||
/// the second occurence of `T` is not a subtree of *any* local type.
|
/// the second occurrence of `T` is not a subtree of *any* local type.
|
||||||
/// - however, `LocalType<Vec<T>>` is OK, because `T` is a subtree of
|
/// - however, `LocalType<Vec<T>>` is OK, because `T` is a subtree of
|
||||||
/// `LocalType<Vec<T>>`, which is local and has no types between it and
|
/// `LocalType<Vec<T>>`, which is local and has no types between it and
|
||||||
/// the type parameter.
|
/// the type parameter.
|
||||||
|
|
|
@ -621,7 +621,7 @@ pub fn fully_normalize<'a, 'gcx, 'tcx, T>(infcx: &InferCtxt<'a, 'gcx, 'tcx>,
|
||||||
// FIXME (@jroesch) ISSUE 26721
|
// FIXME (@jroesch) ISSUE 26721
|
||||||
// I'm not sure if this is a bug or not, needs further investigation.
|
// I'm not sure if this is a bug or not, needs further investigation.
|
||||||
// It appears that by reusing the fulfillment_cx here we incur more
|
// It appears that by reusing the fulfillment_cx here we incur more
|
||||||
// obligations and later trip an asssertion on regionck.rs line 337.
|
// obligations and later trip an assertion on regionck.rs line 337.
|
||||||
//
|
//
|
||||||
// The two possibilities I see is:
|
// The two possibilities I see is:
|
||||||
// - normalization is not actually fully happening and we
|
// - normalization is not actually fully happening and we
|
||||||
|
|
|
@ -2059,7 +2059,7 @@ fn layout_of(self, ty: Ty<'tcx>) -> Self::TyLayout {
|
||||||
// can however trigger recursive invocations of `layout_of`.
|
// can however trigger recursive invocations of `layout_of`.
|
||||||
// Therefore, we execute it *after* the main query has
|
// Therefore, we execute it *after* the main query has
|
||||||
// completed, to avoid problems around recursive structures
|
// completed, to avoid problems around recursive structures
|
||||||
// and the like. (Admitedly, I wasn't able to reproduce a problem
|
// and the like. (Admittedly, I wasn't able to reproduce a problem
|
||||||
// here, but it seems like the right thing to do. -nmatsakis)
|
// here, but it seems like the right thing to do. -nmatsakis)
|
||||||
self.record_layout_for_printing(layout);
|
self.record_layout_for_printing(layout);
|
||||||
|
|
||||||
|
@ -2085,7 +2085,7 @@ fn layout_of(self, ty: Ty<'tcx>) -> Self::TyLayout {
|
||||||
// can however trigger recursive invocations of `layout_of`.
|
// can however trigger recursive invocations of `layout_of`.
|
||||||
// Therefore, we execute it *after* the main query has
|
// Therefore, we execute it *after* the main query has
|
||||||
// completed, to avoid problems around recursive structures
|
// completed, to avoid problems around recursive structures
|
||||||
// and the like. (Admitedly, I wasn't able to reproduce a problem
|
// and the like. (Admittedly, I wasn't able to reproduce a problem
|
||||||
// here, but it seems like the right thing to do. -nmatsakis)
|
// here, but it seems like the right thing to do. -nmatsakis)
|
||||||
let cx = LayoutCx {
|
let cx = LayoutCx {
|
||||||
tcx: *self.tcx,
|
tcx: *self.tcx,
|
||||||
|
|
|
@ -2201,12 +2201,12 @@ fn is_finite_non_zero() {
|
||||||
assert!(!Single::ZERO.is_finite_non_zero());
|
assert!(!Single::ZERO.is_finite_non_zero());
|
||||||
assert!(!(-Single::ZERO).is_finite_non_zero());
|
assert!(!(-Single::ZERO).is_finite_non_zero());
|
||||||
|
|
||||||
// Test +/- qNaN. +/- dont mean anything with qNaN but paranoia can't hurt in
|
// Test +/- qNaN. +/- don't mean anything with qNaN but paranoia can't hurt in
|
||||||
// this instance.
|
// this instance.
|
||||||
assert!(!Single::NAN.is_finite_non_zero());
|
assert!(!Single::NAN.is_finite_non_zero());
|
||||||
assert!(!(-Single::NAN).is_finite_non_zero());
|
assert!(!(-Single::NAN).is_finite_non_zero());
|
||||||
|
|
||||||
// Test +/- sNaN. +/- dont mean anything with sNaN but paranoia can't hurt in
|
// Test +/- sNaN. +/- don't mean anything with sNaN but paranoia can't hurt in
|
||||||
// this instance.
|
// this instance.
|
||||||
assert!(!Single::snan(None).is_finite_non_zero());
|
assert!(!Single::snan(None).is_finite_non_zero());
|
||||||
assert!(!(-Single::snan(None)).is_finite_non_zero());
|
assert!(!(-Single::snan(None)).is_finite_non_zero());
|
||||||
|
|
|
@ -1111,7 +1111,7 @@ pub fn report_aliasability_violation(&self,
|
||||||
|
|
||||||
/// Given a type, if it is an immutable reference, return a suggestion to make it mutable
|
/// Given a type, if it is an immutable reference, return a suggestion to make it mutable
|
||||||
fn suggest_mut_for_immutable(&self, pty: &hir::Ty, is_implicit_self: bool) -> Option<String> {
|
fn suggest_mut_for_immutable(&self, pty: &hir::Ty, is_implicit_self: bool) -> Option<String> {
|
||||||
// Check wether the argument is an immutable reference
|
// Check whether the argument is an immutable reference
|
||||||
debug!("suggest_mut_for_immutable({:?}, {:?})", pty, is_implicit_self);
|
debug!("suggest_mut_for_immutable({:?}, {:?})", pty, is_implicit_self);
|
||||||
if let hir::TyRptr(lifetime, hir::MutTy {
|
if let hir::TyRptr(lifetime, hir::MutTy {
|
||||||
mutbl: hir::Mutability::MutImmutable,
|
mutbl: hir::Mutability::MutImmutable,
|
||||||
|
|
|
@ -607,7 +607,7 @@ pub fn is_useful<'p, 'a: 'p, 'tcx: 'a>(cx: &mut MatchCheckCtxt<'a, 'tcx>,
|
||||||
// be able to observe whether the types of the struct's fields are
|
// be able to observe whether the types of the struct's fields are
|
||||||
// inhabited.
|
// inhabited.
|
||||||
//
|
//
|
||||||
// If the field is truely inaccessible, then all the patterns
|
// If the field is truly inaccessible, then all the patterns
|
||||||
// matching against it must be wildcard patterns, so its type
|
// matching against it must be wildcard patterns, so its type
|
||||||
// does not matter.
|
// does not matter.
|
||||||
//
|
//
|
||||||
|
|
|
@ -204,7 +204,7 @@ fn fmt(&self, fmt: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
|
||||||
$($tokens)*);
|
$($tokens)*);
|
||||||
);
|
);
|
||||||
|
|
||||||
// The case where no derives are added, but encodable is overriden. Don't
|
// The case where no derives are added, but encodable is overridden. Don't
|
||||||
// derive serialization traits
|
// derive serialization traits
|
||||||
(@pub [$($pub:tt)*]
|
(@pub [$($pub:tt)*]
|
||||||
@type [$type:ident]
|
@type [$type:ident]
|
||||||
|
|
|
@ -117,7 +117,7 @@ fn do_mir_borrowck<'a, 'gcx, 'tcx>(
|
||||||
for move_error in move_errors {
|
for move_error in move_errors {
|
||||||
let (span, kind): (Span, IllegalMoveOriginKind) = match move_error {
|
let (span, kind): (Span, IllegalMoveOriginKind) = match move_error {
|
||||||
MoveError::UnionMove { .. } => {
|
MoveError::UnionMove { .. } => {
|
||||||
unimplemented!("dont know how to report union move errors yet.")
|
unimplemented!("don't know how to report union move errors yet.")
|
||||||
}
|
}
|
||||||
MoveError::IllegalMove {
|
MoveError::IllegalMove {
|
||||||
cannot_move_out_of: o,
|
cannot_move_out_of: o,
|
||||||
|
@ -1424,7 +1424,7 @@ fn check_if_path_is_moved(
|
||||||
/// tracked in the MoveData.
|
/// tracked in the MoveData.
|
||||||
///
|
///
|
||||||
/// An Err result includes a tag indicated why the search failed.
|
/// An Err result includes a tag indicated why the search failed.
|
||||||
/// Currenly this can only occur if the place is built off of a
|
/// Currently this can only occur if the place is built off of a
|
||||||
/// static variable, as we do not track those in the MoveData.
|
/// static variable, as we do not track those in the MoveData.
|
||||||
fn move_path_closest_to(
|
fn move_path_closest_to(
|
||||||
&mut self,
|
&mut self,
|
||||||
|
@ -1439,7 +1439,7 @@ fn move_path_closest_to(
|
||||||
}
|
}
|
||||||
match *last_prefix {
|
match *last_prefix {
|
||||||
Place::Local(_) => panic!("should have move path for every Local"),
|
Place::Local(_) => panic!("should have move path for every Local"),
|
||||||
Place::Projection(_) => panic!("PrefixSet::All meant dont stop for Projection"),
|
Place::Projection(_) => panic!("PrefixSet::All meant don't stop for Projection"),
|
||||||
Place::Static(_) => return Err(NoMovePathFound::ReachedStatic),
|
Place::Static(_) => return Err(NoMovePathFound::ReachedStatic),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1484,7 +1484,7 @@ fn check_if_assigned_path_is_moved(
|
||||||
{ }
|
{ }
|
||||||
|
|
||||||
ProjectionElem::Subslice { .. } => {
|
ProjectionElem::Subslice { .. } => {
|
||||||
panic!("we dont allow assignments to subslices, context: {:?}",
|
panic!("we don't allow assignments to subslices, context: {:?}",
|
||||||
context);
|
context);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -278,7 +278,7 @@ fn for_each_region_constraint(
|
||||||
|
|
||||||
/// Right now, we piggy back on the `ReVar` to store our NLL inference
|
/// Right now, we piggy back on the `ReVar` to store our NLL inference
|
||||||
/// regions. These are indexed with `RegionVid`. This method will
|
/// regions. These are indexed with `RegionVid`. This method will
|
||||||
/// assert that the region is a `ReVar` and extract its interal index.
|
/// assert that the region is a `ReVar` and extract its internal index.
|
||||||
/// This is reasonable because in our MIR we replace all universal regions
|
/// This is reasonable because in our MIR we replace all universal regions
|
||||||
/// with inference variables.
|
/// with inference variables.
|
||||||
pub trait ToRegionVid {
|
pub trait ToRegionVid {
|
||||||
|
|
|
@ -964,7 +964,7 @@ fn check_universal_region<'gcx>(
|
||||||
debug!("check_universal_region: fr_minus={:?}", fr_minus);
|
debug!("check_universal_region: fr_minus={:?}", fr_minus);
|
||||||
|
|
||||||
// Grow `shorter_fr` until we find a non-local
|
// Grow `shorter_fr` until we find a non-local
|
||||||
// regon. (We always will.) We'll call that
|
// region. (We always will.) We'll call that
|
||||||
// `shorter_fr+` -- it's ever so slightly larger than
|
// `shorter_fr+` -- it's ever so slightly larger than
|
||||||
// `fr`.
|
// `fr`.
|
||||||
let shorter_fr_plus = self.universal_regions.non_local_upper_bound(shorter_fr);
|
let shorter_fr_plus = self.universal_regions.non_local_upper_bound(shorter_fr);
|
||||||
|
|
|
@ -150,7 +150,7 @@ pub(super) enum RegionElement {
|
||||||
/// A point in the control-flow graph.
|
/// A point in the control-flow graph.
|
||||||
Location(Location),
|
Location(Location),
|
||||||
|
|
||||||
/// An in-scope, universally quantified region (e.g., a liftime parameter).
|
/// An in-scope, universally quantified region (e.g., a lifetime parameter).
|
||||||
UniversalRegion(RegionVid),
|
UniversalRegion(RegionVid),
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
// option. This file may not be copied, modified, or distributed
|
// option. This file may not be copied, modified, or distributed
|
||||||
// except according to those terms.
|
// except according to those terms.
|
||||||
|
|
||||||
//! Code related to match expresions. These are sufficiently complex
|
//! Code related to match expressions. These are sufficiently complex
|
||||||
//! to warrant their own module and submodules. :) This main module
|
//! to warrant their own module and submodules. :) This main module
|
||||||
//! includes the high-level algorithm, the submodules contain the
|
//! includes the high-level algorithm, the submodules contain the
|
||||||
//! details.
|
//! details.
|
||||||
|
|
|
@ -80,14 +80,14 @@ pub struct Borrows<'a, 'gcx: 'tcx, 'tcx: 'a> {
|
||||||
/// tracking (phased) borrows. It computes where a borrow is reserved;
|
/// tracking (phased) borrows. It computes where a borrow is reserved;
|
||||||
/// i.e. where it can reach in the control flow starting from its
|
/// i.e. where it can reach in the control flow starting from its
|
||||||
/// initial `assigned = &'rgn borrowed` statement, and ending
|
/// initial `assigned = &'rgn borrowed` statement, and ending
|
||||||
/// whereever `'rgn` itself ends.
|
/// wherever `'rgn` itself ends.
|
||||||
pub(crate) struct Reservations<'a, 'gcx: 'tcx, 'tcx: 'a>(pub(crate) Borrows<'a, 'gcx, 'tcx>);
|
pub(crate) struct Reservations<'a, 'gcx: 'tcx, 'tcx: 'a>(pub(crate) Borrows<'a, 'gcx, 'tcx>);
|
||||||
|
|
||||||
/// The `ActiveBorrows` analysis is the second of the two flow
|
/// The `ActiveBorrows` analysis is the second of the two flow
|
||||||
/// analyses tracking (phased) borrows. It computes where any given
|
/// analyses tracking (phased) borrows. It computes where any given
|
||||||
/// borrow `&assigned = &'rgn borrowed` is *active*, which starts at
|
/// borrow `&assigned = &'rgn borrowed` is *active*, which starts at
|
||||||
/// the first use of `assigned` after the reservation has started, and
|
/// the first use of `assigned` after the reservation has started, and
|
||||||
/// ends whereever `'rgn` itself ends.
|
/// ends wherever `'rgn` itself ends.
|
||||||
pub(crate) struct ActiveBorrows<'a, 'gcx: 'tcx, 'tcx: 'a>(pub(crate) Borrows<'a, 'gcx, 'tcx>);
|
pub(crate) struct ActiveBorrows<'a, 'gcx: 'tcx, 'tcx: 'a>(pub(crate) Borrows<'a, 'gcx, 'tcx>);
|
||||||
|
|
||||||
impl<'a, 'gcx, 'tcx> Reservations<'a, 'gcx, 'tcx> {
|
impl<'a, 'gcx, 'tcx> Reservations<'a, 'gcx, 'tcx> {
|
||||||
|
|
|
@ -365,7 +365,7 @@ fn main() {
|
||||||
Some types have no ownership semantics at all and are trivial to duplicate. An
|
Some types have no ownership semantics at all and are trivial to duplicate. An
|
||||||
example is `i32` and the other number types. We don't have to call `.clone()` to
|
example is `i32` and the other number types. We don't have to call `.clone()` to
|
||||||
clone them, because they are marked `Copy` in addition to `Clone`. Implicit
|
clone them, because they are marked `Copy` in addition to `Clone`. Implicit
|
||||||
cloning is more convienient in this case. We can mark our own types `Copy` if
|
cloning is more convenient in this case. We can mark our own types `Copy` if
|
||||||
all their members also are marked `Copy`.
|
all their members also are marked `Copy`.
|
||||||
|
|
||||||
In the example below, we implement a `Point` type. Because it only stores two
|
In the example below, we implement a `Point` type. Because it only stores two
|
||||||
|
|
|
@ -84,7 +84,7 @@ pub struct Frame<'tcx> {
|
||||||
/// return).
|
/// return).
|
||||||
pub block: mir::BasicBlock,
|
pub block: mir::BasicBlock,
|
||||||
|
|
||||||
/// The index of the currently evaluated statment.
|
/// The index of the currently evaluated statement.
|
||||||
pub stmt: usize,
|
pub stmt: usize,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -68,7 +68,7 @@ pub enum InstantiationMode {
|
||||||
/// however, our local copy may conflict with other crates also
|
/// however, our local copy may conflict with other crates also
|
||||||
/// inlining the same function.
|
/// inlining the same function.
|
||||||
///
|
///
|
||||||
/// This flag indicates that this situation is occuring, and informs
|
/// This flag indicates that this situation is occurring, and informs
|
||||||
/// symbol name calculation that some extra mangling is needed to
|
/// symbol name calculation that some extra mangling is needed to
|
||||||
/// avoid conflicts. Note that this may eventually go away entirely if
|
/// avoid conflicts. Note that this may eventually go away entirely if
|
||||||
/// ThinLTO enables us to *always* have a globally shared instance of a
|
/// ThinLTO enables us to *always* have a globally shared instance of a
|
||||||
|
|
|
@ -781,7 +781,7 @@ fn visit_expr(&mut self, expr: &'tcx hir::Expr) {
|
||||||
// Additionally, until better reachability analysis for macros 2.0 is available,
|
// Additionally, until better reachability analysis for macros 2.0 is available,
|
||||||
// we prohibit access to private statics from other crates, this allows to give
|
// we prohibit access to private statics from other crates, this allows to give
|
||||||
// more code internal visibility at link time. (Access to private functions
|
// more code internal visibility at link time. (Access to private functions
|
||||||
// is already prohibited by type privacy for funciton types.)
|
// is already prohibited by type privacy for function types.)
|
||||||
fn visit_qpath(&mut self, qpath: &'tcx hir::QPath, id: ast::NodeId, span: Span) {
|
fn visit_qpath(&mut self, qpath: &'tcx hir::QPath, id: ast::NodeId, span: Span) {
|
||||||
let def = match *qpath {
|
let def = match *qpath {
|
||||||
hir::QPath::Resolved(_, ref path) => match path.def {
|
hir::QPath::Resolved(_, ref path) => match path.def {
|
||||||
|
|
|
@ -17,7 +17,7 @@
|
||||||
// `use` directives.
|
// `use` directives.
|
||||||
//
|
//
|
||||||
// Unused trait imports can't be checked until the method resolution. We save
|
// Unused trait imports can't be checked until the method resolution. We save
|
||||||
// candidates here, and do the acutal check in librustc_typeck/check_unused.rs.
|
// candidates here, and do the actual check in librustc_typeck/check_unused.rs.
|
||||||
|
|
||||||
use std::ops::{Deref, DerefMut};
|
use std::ops::{Deref, DerefMut};
|
||||||
|
|
||||||
|
|
|
@ -1440,7 +1440,7 @@ impl<'a> Resolver<'a> {
|
||||||
/// Rustdoc uses this to resolve things in a recoverable way. ResolutionError<'a>
|
/// Rustdoc uses this to resolve things in a recoverable way. ResolutionError<'a>
|
||||||
/// isn't something that can be returned because it can't be made to live that long,
|
/// isn't something that can be returned because it can't be made to live that long,
|
||||||
/// and also it's a private type. Fortunately rustdoc doesn't need to know the error,
|
/// and also it's a private type. Fortunately rustdoc doesn't need to know the error,
|
||||||
/// just that an error occured.
|
/// just that an error occurred.
|
||||||
pub fn resolve_str_path_error(&mut self, span: Span, path_str: &str, is_value: bool)
|
pub fn resolve_str_path_error(&mut self, span: Span, path_str: &str, is_value: bool)
|
||||||
-> Result<hir::Path, ()> {
|
-> Result<hir::Path, ()> {
|
||||||
use std::iter;
|
use std::iter;
|
||||||
|
|
|
@ -186,7 +186,7 @@ pub fn resolve_ident_in_module_unadjusted(&mut self,
|
||||||
}
|
}
|
||||||
|
|
||||||
let check_usable = |this: &mut Self, binding: &'a NameBinding<'a>| {
|
let check_usable = |this: &mut Self, binding: &'a NameBinding<'a>| {
|
||||||
// `extern crate` are always usable for backwards compatability, see issue #37020.
|
// `extern crate` are always usable for backwards compatibility, see issue #37020.
|
||||||
let usable = this.is_accessible(binding.vis) || binding.is_extern_crate();
|
let usable = this.is_accessible(binding.vis) || binding.is_extern_crate();
|
||||||
if usable { Ok(binding) } else { Err(Determined) }
|
if usable { Ok(binding) } else { Err(Determined) }
|
||||||
};
|
};
|
||||||
|
|
|
@ -84,7 +84,7 @@ pub(crate) unsafe fn optimize(&mut self,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// A "guage" of how costly it is to optimize this module, used to sort
|
/// A "gauge" of how costly it is to optimize this module, used to sort
|
||||||
/// biggest modules first.
|
/// biggest modules first.
|
||||||
pub fn cost(&self) -> u64 {
|
pub fn cost(&self) -> u64 {
|
||||||
match *self {
|
match *self {
|
||||||
|
@ -726,7 +726,7 @@ unsafe fn optimize(&mut self, cgcx: &CodegenContext, timeline: &mut Timeline)
|
||||||
// which was basically a resurgence of #45511 after LLVM's bug 35212 was
|
// which was basically a resurgence of #45511 after LLVM's bug 35212 was
|
||||||
// fixed.
|
// fixed.
|
||||||
//
|
//
|
||||||
// This function below is a huge hack around tihs problem. The function
|
// This function below is a huge hack around this problem. The function
|
||||||
// below is defined in `PassWrapper.cpp` and will basically "merge"
|
// below is defined in `PassWrapper.cpp` and will basically "merge"
|
||||||
// all `DICompileUnit` instances in a module. Basically it'll take all
|
// all `DICompileUnit` instances in a module. Basically it'll take all
|
||||||
// the objects, rewrite all pointers of `DISubprogram` to point to the
|
// the objects, rewrite all pointers of `DISubprogram` to point to the
|
||||||
|
|
|
@ -1240,7 +1240,7 @@ pub fn lifetime_end(&self, ptr: ValueRef, size: Size) {
|
||||||
/// on), and `ptr` is nonzero-sized, then extracts the size of `ptr`
|
/// on), and `ptr` is nonzero-sized, then extracts the size of `ptr`
|
||||||
/// and the intrinsic for `lt` and passes them to `emit`, which is in
|
/// and the intrinsic for `lt` and passes them to `emit`, which is in
|
||||||
/// charge of generating code to call the passed intrinsic on whatever
|
/// charge of generating code to call the passed intrinsic on whatever
|
||||||
/// block of generated code is targetted for the intrinsic.
|
/// block of generated code is targeted for the intrinsic.
|
||||||
///
|
///
|
||||||
/// If LLVM lifetime intrinsic support is disabled (i.e. optimizations
|
/// If LLVM lifetime intrinsic support is disabled (i.e. optimizations
|
||||||
/// off) or `ptr` is zero-sized, then no-op (does not call `emit`).
|
/// off) or `ptr` is zero-sized, then no-op (does not call `emit`).
|
||||||
|
|
|
@ -844,7 +844,7 @@ fn cast_float_to_int(bx: &Builder,
|
||||||
// They are exactly equal to int_ty::{MIN,MAX} if float_ty has enough significand bits.
|
// They are exactly equal to int_ty::{MIN,MAX} if float_ty has enough significand bits.
|
||||||
// Otherwise, int_ty::MAX must be rounded towards zero, as it is one less than a power of two.
|
// Otherwise, int_ty::MAX must be rounded towards zero, as it is one less than a power of two.
|
||||||
// int_ty::MIN, however, is either zero or a negative power of two and is thus exactly
|
// int_ty::MIN, however, is either zero or a negative power of two and is thus exactly
|
||||||
// representable. Note that this only works if float_ty's exponent range is sufficently large.
|
// representable. Note that this only works if float_ty's exponent range is sufficiently large.
|
||||||
// f16 or 256 bit integers would break this property. Right now the smallest float type is f32
|
// f16 or 256 bit integers would break this property. Right now the smallest float type is f32
|
||||||
// with exponents ranging up to 127, which is barely enough for i128::MIN = -2^127.
|
// with exponents ranging up to 127, which is barely enough for i128::MIN = -2^127.
|
||||||
// On the other hand, f_max works even if int_ty::MAX is greater than float_ty::MAX. Because
|
// On the other hand, f_max works even if int_ty::MAX is greater than float_ty::MAX. Because
|
||||||
|
|
|
@ -151,7 +151,7 @@ fn get_rlib_metadata(&self, _: &Target, filename: &Path) -> Result<ErasedBoxRef<
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Err("Couldnt find metadata section".to_string())
|
Err("Couldn't find metadata section".to_string())
|
||||||
}
|
}
|
||||||
|
|
||||||
fn get_dylib_metadata(
|
fn get_dylib_metadata(
|
||||||
|
|
|
@ -293,7 +293,7 @@ impl<R: Seek> Seek for BufReader<R> {
|
||||||
/// where `n` minus the internal buffer length overflows an `i64`, two
|
/// where `n` minus the internal buffer length overflows an `i64`, two
|
||||||
/// seeks will be performed instead of one. If the second seek returns
|
/// seeks will be performed instead of one. If the second seek returns
|
||||||
/// `Err`, the underlying reader will be left at the same position it would
|
/// `Err`, the underlying reader will be left at the same position it would
|
||||||
/// have if you seeked to `SeekFrom::Current(0)`.
|
/// have if you called `seek` with `SeekFrom::Current(0)`.
|
||||||
///
|
///
|
||||||
/// [`seek_relative`]: #method.seek_relative
|
/// [`seek_relative`]: #method.seek_relative
|
||||||
fn seek(&mut self, pos: SeekFrom) -> io::Result<u64> {
|
fn seek(&mut self, pos: SeekFrom) -> io::Result<u64> {
|
||||||
|
|
|
@ -24,8 +24,8 @@
|
||||||
/// typically allows for read-only access (shared access).
|
/// typically allows for read-only access (shared access).
|
||||||
///
|
///
|
||||||
/// In comparison, a [`Mutex`] does not distinguish between readers or writers
|
/// In comparison, a [`Mutex`] does not distinguish between readers or writers
|
||||||
/// that aquire the lock, therefore blocking any threads waiting for the lock to
|
/// that acquire the lock, therefore blocking any threads waiting for the lock to
|
||||||
/// become available. An `RwLock` will allow any number of readers to aquire the
|
/// become available. An `RwLock` will allow any number of readers to acquire the
|
||||||
/// lock as long as a writer is not holding the lock.
|
/// lock as long as a writer is not holding the lock.
|
||||||
///
|
///
|
||||||
/// The priority policy of the lock is dependent on the underlying operating
|
/// The priority policy of the lock is dependent on the underlying operating
|
||||||
|
|
|
@ -136,7 +136,7 @@ pub fn __rust_begin_short_backtrace<F, T>(f: F) -> T
|
||||||
f()
|
f()
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Controls how the backtrace should be formated.
|
/// Controls how the backtrace should be formatted.
|
||||||
#[derive(Debug, Copy, Clone, Eq, PartialEq)]
|
#[derive(Debug, Copy, Clone, Eq, PartialEq)]
|
||||||
pub enum PrintFormat {
|
pub enum PrintFormat {
|
||||||
/// Show all the frames with absolute path for files.
|
/// Show all the frames with absolute path for files.
|
||||||
|
|
|
@ -98,7 +98,7 @@ pub struct PoisonError<T> {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// An enumeration of possible errors associated with a [`TryLockResult`] which
|
/// An enumeration of possible errors associated with a [`TryLockResult`] which
|
||||||
/// can occur while trying to aquire a lock, from the [`try_lock`] method on a
|
/// can occur while trying to acquire a lock, from the [`try_lock`] method on a
|
||||||
/// [`Mutex`] or the [`try_read`] and [`try_write`] methods on an [`RwLock`].
|
/// [`Mutex`] or the [`try_read`] and [`try_write`] methods on an [`RwLock`].
|
||||||
///
|
///
|
||||||
/// [`Mutex`]: struct.Mutex.html
|
/// [`Mutex`]: struct.Mutex.html
|
||||||
|
|
|
@ -918,7 +918,7 @@ pub struct Expr {
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Expr {
|
impl Expr {
|
||||||
/// Wether this expression would be valid somewhere that expects a value, for example, an `if`
|
/// Whether this expression would be valid somewhere that expects a value, for example, an `if`
|
||||||
/// condition.
|
/// condition.
|
||||||
pub fn returns(&self) -> bool {
|
pub fn returns(&self) -> bool {
|
||||||
if let ExprKind::Block(ref block) = self.node {
|
if let ExprKind::Block(ref block) = self.node {
|
||||||
|
|
|
@ -114,7 +114,7 @@ fn process_cfg_attr(&mut self, attr: ast::Attribute) -> Option<ast::Attribute> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Determine if a node with the given attributes should be included in this configuation.
|
// Determine if a node with the given attributes should be included in this configuration.
|
||||||
pub fn in_cfg(&mut self, attrs: &[ast::Attribute]) -> bool {
|
pub fn in_cfg(&mut self, attrs: &[ast::Attribute]) -> bool {
|
||||||
attrs.iter().all(|attr| {
|
attrs.iter().all(|attr| {
|
||||||
// When not compiling with --test we should not compile the #[test] functions
|
// When not compiling with --test we should not compile the #[test] functions
|
||||||
|
|
|
@ -3912,7 +3912,7 @@ fn parse_local(&mut self, attrs: ThinVec<Attribute>) -> PResult<'a, P<Local>> {
|
||||||
"use `=` if you meant to assign",
|
"use `=` if you meant to assign",
|
||||||
"=".to_string());
|
"=".to_string());
|
||||||
err.emit();
|
err.emit();
|
||||||
// As this was parsed successfuly, continue as if the code has been fixed for the
|
// As this was parsed successfully, continue as if the code has been fixed for the
|
||||||
// rest of the file. It will still fail due to the emitted error, but we avoid
|
// rest of the file. It will still fail due to the emitted error, but we avoid
|
||||||
// extra noise.
|
// extra noise.
|
||||||
init
|
init
|
||||||
|
@ -6571,7 +6571,7 @@ fn parse_item_(&mut self, attrs: Vec<Attribute>,
|
||||||
return Ok(Some(macro_def));
|
return Ok(Some(macro_def));
|
||||||
}
|
}
|
||||||
|
|
||||||
// Verify wether we have encountered a struct or method definition where the user forgot to
|
// Verify whether we have encountered a struct or method definition where the user forgot to
|
||||||
// add the `struct` or `fn` keyword after writing `pub`: `pub S {}`
|
// add the `struct` or `fn` keyword after writing `pub`: `pub S {}`
|
||||||
if visibility == Visibility::Public &&
|
if visibility == Visibility::Public &&
|
||||||
self.check_ident() &&
|
self.check_ident() &&
|
||||||
|
|
|
@ -14,7 +14,7 @@
|
||||||
fn foo(x: usize, y: !, z: usize) { }
|
fn foo(x: usize, y: !, z: usize) { }
|
||||||
|
|
||||||
fn call_foo_a() {
|
fn call_foo_a() {
|
||||||
// FIXME(#40800) -- accepted beacuse divergence happens **before**
|
// FIXME(#40800) -- accepted because divergence happens **before**
|
||||||
// the coercion to `!`, but within same expression. Not clear that
|
// the coercion to `!`, but within same expression. Not clear that
|
||||||
// these are the rules we want.
|
// these are the rules we want.
|
||||||
foo(return, 22, 44);
|
foo(return, 22, 44);
|
||||||
|
|
|
@ -8,4 +8,4 @@
|
||||||
// option. This file may not be copied, modified, or distributed
|
// option. This file may not be copied, modified, or distributed
|
||||||
// except according to those terms.
|
// except according to those terms.
|
||||||
|
|
||||||
// ignore-test not a test, auxillary
|
// ignore-test not a test, auxiliary
|
||||||
|
|
|
@ -8,6 +8,6 @@
|
||||||
// option. This file may not be copied, modified, or distributed
|
// option. This file may not be copied, modified, or distributed
|
||||||
// except according to those terms.
|
// except according to those terms.
|
||||||
|
|
||||||
// ignore-test not a test, auxillary
|
// ignore-test not a test, auxiliary
|
||||||
|
|
||||||
mod_decl!(bar);
|
mod_decl!(bar);
|
||||||
|
|
|
@ -84,7 +84,7 @@ fn supertype<'x,'y:'x,'z:'y>() {
|
||||||
fn(Inv<'y>)) }
|
fn(Inv<'y>)) }
|
||||||
|
|
||||||
// Somewhat surprisingly, a fn taking two distinct bound lifetimes and
|
// Somewhat surprisingly, a fn taking two distinct bound lifetimes and
|
||||||
// a fn taking one bound lifetime can be interchangable, but only if
|
// a fn taking one bound lifetime can be interchangeable, but only if
|
||||||
// we are co- or contra-variant with respect to both lifetimes.
|
// we are co- or contra-variant with respect to both lifetimes.
|
||||||
//
|
//
|
||||||
// The reason is:
|
// The reason is:
|
||||||
|
@ -100,7 +100,7 @@ fn supertype<'x,'y:'x,'z:'y>() {
|
||||||
check! { bound_co_a_co_b_ret_contra_a: (for<'a,'b> fn(Co<'a>, Co<'b>) -> Contra<'a>,
|
check! { bound_co_a_co_b_ret_contra_a: (for<'a,'b> fn(Co<'a>, Co<'b>) -> Contra<'a>,
|
||||||
for<'a> fn(Co<'a>, Co<'a>) -> Contra<'a>) }
|
for<'a> fn(Co<'a>, Co<'a>) -> Contra<'a>) }
|
||||||
|
|
||||||
// If we make those lifetimes invariant, then the two types are not interchangable.
|
// If we make those lifetimes invariant, then the two types are not interchangeable.
|
||||||
check! { bound_inv_a_b_vs_bound_inv_a: (for<'a,'b> fn(Inv<'a>, Inv<'b>),
|
check! { bound_inv_a_b_vs_bound_inv_a: (for<'a,'b> fn(Inv<'a>, Inv<'b>),
|
||||||
for<'a> fn(Inv<'a>, Inv<'a>)) }
|
for<'a> fn(Inv<'a>, Inv<'a>)) }
|
||||||
check! { bound_a_b_ret_a_vs_bound_a_ret_a: (for<'a,'b> fn(&'a u32, &'b u32) -> &'a u32,
|
check! { bound_a_b_ret_a_vs_bound_a_ret_a: (for<'a,'b> fn(&'a u32, &'b u32) -> &'a u32,
|
||||||
|
|
|
@ -9,7 +9,7 @@
|
||||||
// except according to those terms.
|
// except according to those terms.
|
||||||
|
|
||||||
// We need all these 9 issue-20616-N.rs files
|
// We need all these 9 issue-20616-N.rs files
|
||||||
// becase we can only catch one parsing error at a time
|
// because we can only catch one parsing error at a time
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -9,7 +9,7 @@
|
||||||
// except according to those terms.
|
// except according to those terms.
|
||||||
|
|
||||||
// We need all these 9 issue-20616-N.rs files
|
// We need all these 9 issue-20616-N.rs files
|
||||||
// becase we can only catch one parsing error at a time
|
// because we can only catch one parsing error at a time
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -9,7 +9,7 @@
|
||||||
// except according to those terms.
|
// except according to those terms.
|
||||||
|
|
||||||
// We need all these 9 issue-20616-N.rs files
|
// We need all these 9 issue-20616-N.rs files
|
||||||
// becase we can only catch one parsing error at a time
|
// because we can only catch one parsing error at a time
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -9,7 +9,7 @@
|
||||||
// except according to those terms.
|
// except according to those terms.
|
||||||
|
|
||||||
// We need all these 9 issue-20616-N.rs files
|
// We need all these 9 issue-20616-N.rs files
|
||||||
// becase we can only catch one parsing error at a time
|
// because we can only catch one parsing error at a time
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -9,7 +9,7 @@
|
||||||
// except according to those terms.
|
// except according to those terms.
|
||||||
|
|
||||||
// We need all these 9 issue-20616-N.rs files
|
// We need all these 9 issue-20616-N.rs files
|
||||||
// becase we can only catch one parsing error at a time
|
// because we can only catch one parsing error at a time
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -9,7 +9,7 @@
|
||||||
// except according to those terms.
|
// except according to those terms.
|
||||||
|
|
||||||
// We need all these 9 issue-20616-N.rs files
|
// We need all these 9 issue-20616-N.rs files
|
||||||
// becase we can only catch one parsing error at a time
|
// because we can only catch one parsing error at a time
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -9,7 +9,7 @@
|
||||||
// except according to those terms.
|
// except according to those terms.
|
||||||
|
|
||||||
// We need all these 9 issue-20616-N.rs files
|
// We need all these 9 issue-20616-N.rs files
|
||||||
// becase we can only catch one parsing error at a time
|
// because we can only catch one parsing error at a time
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -9,7 +9,7 @@
|
||||||
// except according to those terms.
|
// except according to those terms.
|
||||||
|
|
||||||
// We need all these 9 issue-20616-N.rs files
|
// We need all these 9 issue-20616-N.rs files
|
||||||
// becase we can only catch one parsing error at a time
|
// because we can only catch one parsing error at a time
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -9,7 +9,7 @@
|
||||||
// except according to those terms.
|
// except according to those terms.
|
||||||
|
|
||||||
// We need all these 9 issue-20616-N.rs files
|
// We need all these 9 issue-20616-N.rs files
|
||||||
// becase we can only catch one parsing error at a time
|
// because we can only catch one parsing error at a time
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
// option. This file may not be copied, modified, or distributed
|
// option. This file may not be copied, modified, or distributed
|
||||||
// except according to those terms.
|
// except according to those terms.
|
||||||
|
|
||||||
// regresion test for issue 11256
|
// regression test for issue 11256
|
||||||
#![crate_type] //~ ERROR `crate_type` requires a value
|
#![crate_type] //~ ERROR `crate_type` requires a value
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
|
|
|
@ -26,7 +26,7 @@ other non-matched lines before and after, but not between $expected_lines,
|
||||||
should you want to skip lines, you must include an elision comment, of the form
|
should you want to skip lines, you must include an elision comment, of the form
|
||||||
(as a regex) `//\s*...\s*`. The lines will be skipped lazily, that is, if there
|
(as a regex) `//\s*...\s*`. The lines will be skipped lazily, that is, if there
|
||||||
are two identical lines in the output that match the line after the elision
|
are two identical lines in the output that match the line after the elision
|
||||||
comment, the first one wil be matched.
|
comment, the first one will be matched.
|
||||||
|
|
||||||
Examples:
|
Examples:
|
||||||
|
|
||||||
|
|
|
@ -255,7 +255,7 @@ fn _11() {
|
||||||
while true { let _ = #[attr] break ; }
|
while true { let _ = #[attr] break ; }
|
||||||
|| #[attr] return;
|
|| #[attr] return;
|
||||||
let _ = #[attr] expr_mac!();
|
let _ = #[attr] expr_mac!();
|
||||||
/* FIXME: pp bug, loosing delimiter styles
|
/* FIXME: pp bug, losing delimiter styles
|
||||||
let _ = #[attr] expr_mac![];
|
let _ = #[attr] expr_mac![];
|
||||||
let _ = #[attr] expr_mac!{};
|
let _ = #[attr] expr_mac!{};
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -6,4 +6,4 @@ all:
|
||||||
-o $(TMPDIR)/the_backend.dylib
|
-o $(TMPDIR)/the_backend.dylib
|
||||||
$(RUSTC) some_crate.rs --crate-name some_crate --crate-type bin -o $(TMPDIR)/some_crate \
|
$(RUSTC) some_crate.rs --crate-name some_crate --crate-type bin -o $(TMPDIR)/some_crate \
|
||||||
-Z codegen-backend=$(TMPDIR)/the_backend.dylib -Z unstable-options
|
-Z codegen-backend=$(TMPDIR)/the_backend.dylib -Z unstable-options
|
||||||
grep -x "This has been \"compiled\" succesfully." $(TMPDIR)/some_crate
|
grep -x "This has been \"compiled\" successfully." $(TMPDIR)/some_crate
|
||||||
|
|
|
@ -69,7 +69,7 @@ fn join_trans_and_link(
|
||||||
let output_name =
|
let output_name =
|
||||||
out_filename(sess, crate_type, &outputs, &*crate_name.as_str());
|
out_filename(sess, crate_type, &outputs, &*crate_name.as_str());
|
||||||
let mut out_file = ::std::fs::File::create(output_name).unwrap();
|
let mut out_file = ::std::fs::File::create(output_name).unwrap();
|
||||||
write!(out_file, "This has been \"compiled\" succesfully.").unwrap();
|
write!(out_file, "This has been \"compiled\" successfully.").unwrap();
|
||||||
}
|
}
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
// option. This file may not be copied, modified, or distributed
|
// option. This file may not be copied, modified, or distributed
|
||||||
// except according to those terms.
|
// except according to those terms.
|
||||||
|
|
||||||
// ignore-test not a test, auxillary
|
// ignore-test not a test, auxiliary
|
||||||
|
|
||||||
#![feature(macro_reexport)]
|
#![feature(macro_reexport)]
|
||||||
|
|
||||||
|
|
|
@ -17,7 +17,7 @@ macro_rules! zip {
|
||||||
};
|
};
|
||||||
|
|
||||||
// Intermediate steps to build the zipped expression, the match pattern, and
|
// Intermediate steps to build the zipped expression, the match pattern, and
|
||||||
// and the output tuple of the closure, using macro hygene to repeatedly
|
// and the output tuple of the closure, using macro hygiene to repeatedly
|
||||||
// introduce new variables named 'x'.
|
// introduce new variables named 'x'.
|
||||||
([$a:expr, $($rest:expr),*], $zip:expr, $pat:pat, [$($flat:expr),*]) => {
|
([$a:expr, $($rest:expr),*], $zip:expr, $pat:pat, [$($flat:expr),*]) => {
|
||||||
zip!([$($rest),*], $zip.zip($a), ($pat,x), [$($flat),*, x])
|
zip!([$($rest),*], $zip.zip($a), ($pat,x), [$($flat),*, x])
|
||||||
|
|
|
@ -9,7 +9,7 @@
|
||||||
// except according to those terms.
|
// except according to those terms.
|
||||||
|
|
||||||
// Tests that binary operators allow subtyping on both the LHS and RHS,
|
// Tests that binary operators allow subtyping on both the LHS and RHS,
|
||||||
// and as such do not introduce unnecesarily strict lifetime constraints.
|
// and as such do not introduce unnecessarily strict lifetime constraints.
|
||||||
|
|
||||||
use std::ops::Add;
|
use std::ops::Add;
|
||||||
|
|
||||||
|
|
|
@ -67,7 +67,7 @@ fn test_drop_tuple() {
|
||||||
panic::catch_unwind(|| {
|
panic::catch_unwind(|| {
|
||||||
(PushOnDrop::new(2, cloned.clone()),
|
(PushOnDrop::new(2, cloned.clone()),
|
||||||
PushOnDrop::new(1, cloned.clone()),
|
PushOnDrop::new(1, cloned.clone()),
|
||||||
panic!("this panic is catched :D"));
|
panic!("this panic is caught :D"));
|
||||||
}).err().unwrap();
|
}).err().unwrap();
|
||||||
assert_eq!(*dropped_fields.borrow(), &[1, 2]);
|
assert_eq!(*dropped_fields.borrow(), &[1, 2]);
|
||||||
}
|
}
|
||||||
|
@ -99,7 +99,7 @@ fn test_drop_struct() {
|
||||||
TestStruct {
|
TestStruct {
|
||||||
x: PushOnDrop::new(2, cloned.clone()),
|
x: PushOnDrop::new(2, cloned.clone()),
|
||||||
y: PushOnDrop::new(1, cloned.clone()),
|
y: PushOnDrop::new(1, cloned.clone()),
|
||||||
z: panic!("this panic is catched :D")
|
z: panic!("this panic is caught :D")
|
||||||
};
|
};
|
||||||
}).err().unwrap();
|
}).err().unwrap();
|
||||||
assert_eq!(*dropped_fields.borrow(), &[1, 2]);
|
assert_eq!(*dropped_fields.borrow(), &[1, 2]);
|
||||||
|
@ -111,7 +111,7 @@ fn test_drop_struct() {
|
||||||
TestStruct {
|
TestStruct {
|
||||||
y: PushOnDrop::new(2, cloned.clone()),
|
y: PushOnDrop::new(2, cloned.clone()),
|
||||||
x: PushOnDrop::new(1, cloned.clone()),
|
x: PushOnDrop::new(1, cloned.clone()),
|
||||||
z: panic!("this panic is catched :D")
|
z: panic!("this panic is caught :D")
|
||||||
};
|
};
|
||||||
}).err().unwrap();
|
}).err().unwrap();
|
||||||
assert_eq!(*dropped_fields.borrow(), &[1, 2]);
|
assert_eq!(*dropped_fields.borrow(), &[1, 2]);
|
||||||
|
@ -122,7 +122,7 @@ fn test_drop_struct() {
|
||||||
panic::catch_unwind(|| {
|
panic::catch_unwind(|| {
|
||||||
TestTupleStruct(PushOnDrop::new(2, cloned.clone()),
|
TestTupleStruct(PushOnDrop::new(2, cloned.clone()),
|
||||||
PushOnDrop::new(1, cloned.clone()),
|
PushOnDrop::new(1, cloned.clone()),
|
||||||
panic!("this panic is catched :D"));
|
panic!("this panic is caught :D"));
|
||||||
}).err().unwrap();
|
}).err().unwrap();
|
||||||
assert_eq!(*dropped_fields.borrow(), &[1, 2]);
|
assert_eq!(*dropped_fields.borrow(), &[1, 2]);
|
||||||
}
|
}
|
||||||
|
@ -154,7 +154,7 @@ fn test_drop_enum() {
|
||||||
TestEnum::Struct {
|
TestEnum::Struct {
|
||||||
x: PushOnDrop::new(2, cloned.clone()),
|
x: PushOnDrop::new(2, cloned.clone()),
|
||||||
y: PushOnDrop::new(1, cloned.clone()),
|
y: PushOnDrop::new(1, cloned.clone()),
|
||||||
z: panic!("this panic is catched :D")
|
z: panic!("this panic is caught :D")
|
||||||
};
|
};
|
||||||
}).err().unwrap();
|
}).err().unwrap();
|
||||||
assert_eq!(*dropped_fields.borrow(), &[1, 2]);
|
assert_eq!(*dropped_fields.borrow(), &[1, 2]);
|
||||||
|
@ -166,7 +166,7 @@ fn test_drop_enum() {
|
||||||
TestEnum::Struct {
|
TestEnum::Struct {
|
||||||
y: PushOnDrop::new(2, cloned.clone()),
|
y: PushOnDrop::new(2, cloned.clone()),
|
||||||
x: PushOnDrop::new(1, cloned.clone()),
|
x: PushOnDrop::new(1, cloned.clone()),
|
||||||
z: panic!("this panic is catched :D")
|
z: panic!("this panic is caught :D")
|
||||||
};
|
};
|
||||||
}).err().unwrap();
|
}).err().unwrap();
|
||||||
assert_eq!(*dropped_fields.borrow(), &[1, 2]);
|
assert_eq!(*dropped_fields.borrow(), &[1, 2]);
|
||||||
|
@ -177,7 +177,7 @@ fn test_drop_enum() {
|
||||||
panic::catch_unwind(|| {
|
panic::catch_unwind(|| {
|
||||||
TestEnum::Tuple(PushOnDrop::new(2, cloned.clone()),
|
TestEnum::Tuple(PushOnDrop::new(2, cloned.clone()),
|
||||||
PushOnDrop::new(1, cloned.clone()),
|
PushOnDrop::new(1, cloned.clone()),
|
||||||
panic!("this panic is catched :D"));
|
panic!("this panic is caught :D"));
|
||||||
}).err().unwrap();
|
}).err().unwrap();
|
||||||
assert_eq!(*dropped_fields.borrow(), &[1, 2]);
|
assert_eq!(*dropped_fields.borrow(), &[1, 2]);
|
||||||
}
|
}
|
||||||
|
@ -207,7 +207,7 @@ fn test_drop_list() {
|
||||||
vec![
|
vec![
|
||||||
PushOnDrop::new(2, cloned.clone()),
|
PushOnDrop::new(2, cloned.clone()),
|
||||||
PushOnDrop::new(1, cloned.clone()),
|
PushOnDrop::new(1, cloned.clone()),
|
||||||
panic!("this panic is catched :D")
|
panic!("this panic is caught :D")
|
||||||
];
|
];
|
||||||
}).err().unwrap();
|
}).err().unwrap();
|
||||||
assert_eq!(*dropped_fields.borrow(), &[1, 2]);
|
assert_eq!(*dropped_fields.borrow(), &[1, 2]);
|
||||||
|
@ -219,7 +219,7 @@ fn test_drop_list() {
|
||||||
[
|
[
|
||||||
PushOnDrop::new(2, cloned.clone()),
|
PushOnDrop::new(2, cloned.clone()),
|
||||||
PushOnDrop::new(1, cloned.clone()),
|
PushOnDrop::new(1, cloned.clone()),
|
||||||
panic!("this panic is catched :D")
|
panic!("this panic is caught :D")
|
||||||
];
|
];
|
||||||
}).err().unwrap();
|
}).err().unwrap();
|
||||||
assert_eq!(*dropped_fields.borrow(), &[1, 2]);
|
assert_eq!(*dropped_fields.borrow(), &[1, 2]);
|
||||||
|
|
|
@ -30,7 +30,7 @@ fn main() {
|
||||||
|
|
||||||
// We don't actually know if our computer has the requisite target features
|
// We don't actually know if our computer has the requisite target features
|
||||||
// for the test below. Testing for that will get added to libstd later so
|
// for the test below. Testing for that will get added to libstd later so
|
||||||
// for now just asume sigill means this is a machine that can't run this test.
|
// for now just assume sigill means this is a machine that can't run this test.
|
||||||
if is_sigill(status) {
|
if is_sigill(status) {
|
||||||
println!("sigill with {}, assuming spurious", level);
|
println!("sigill with {}, assuming spurious", level);
|
||||||
continue
|
continue
|
||||||
|
|
|
@ -17,7 +17,7 @@
|
||||||
|
|
||||||
pub struct Bar<T> { t: T }
|
pub struct Bar<T> { t: T }
|
||||||
|
|
||||||
// The output file is html embeded in javascript, so the html tags
|
// The output file is html embedded in javascript, so the html tags
|
||||||
// aren't stripped by the processing script and we can't check for the
|
// aren't stripped by the processing script and we can't check for the
|
||||||
// full impl string. Instead, just make sure something from each part
|
// full impl string. Instead, just make sure something from each part
|
||||||
// is mentioned.
|
// is mentioned.
|
||||||
|
|
|
@ -45,7 +45,7 @@ is a function pointer, which is not zero-sized.
|
||||||
This pattern should be rewritten. There are a few possible ways to do this:
|
This pattern should be rewritten. There are a few possible ways to do this:
|
||||||
|
|
||||||
- change the original fn declaration to match the expected signature,
|
- change the original fn declaration to match the expected signature,
|
||||||
and do the cast in the fn body (the prefered option)
|
and do the cast in the fn body (the preferred option)
|
||||||
- cast the fn item fo a fn pointer before calling transmute, as shown here:
|
- cast the fn item fo a fn pointer before calling transmute, as shown here:
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
|
@ -509,7 +509,7 @@ mod inner { #![reexport_test_harness_main="2900"] }
|
||||||
//~^ WARN unused attribute
|
//~^ WARN unused attribute
|
||||||
}
|
}
|
||||||
|
|
||||||
// Cannnot feed "2700" to `#[macro_escape]` without signaling an error.
|
// Cannot feed "2700" to `#[macro_escape]` without signaling an error.
|
||||||
#[macro_escape]
|
#[macro_escape]
|
||||||
//~^ WARN macro_escape is a deprecated synonym for macro_use
|
//~^ WARN macro_escape is a deprecated synonym for macro_use
|
||||||
mod macro_escape {
|
mod macro_escape {
|
||||||
|
|
|
@ -9,7 +9,7 @@
|
||||||
// except according to those terms.
|
// except according to those terms.
|
||||||
|
|
||||||
// FIXME: Change to UI Test
|
// FIXME: Change to UI Test
|
||||||
// Check notes are placed on an assignment that can actually preceed the current assigmnent
|
// Check notes are placed on an assignment that can actually precede the current assigmnent
|
||||||
// Don't emmit a first assignment for assignment in a loop.
|
// Don't emmit a first assignment for assignment in a loop.
|
||||||
|
|
||||||
// compile-flags: -Zborrowck=compare
|
// compile-flags: -Zborrowck=compare
|
||||||
|
|
Loading…
Reference in a new issue