summary refs log tree commit diff
path: root/src/librustc
AgeCommit message (Collapse)AuthorLines
2015-11-21backport: Fix hygiene regression in patternsVadim Petrochenkov-2/+3
2015-11-04Do some slight refactoring, leave the rest for #29436Niko Matsakis-41/+25
2015-11-04Update docs for region inference to reflect current state betterNiko Matsakis-46/+46
2015-11-04Don't "double check" var-sub-var constraints, which are handled inNiko Matsakis-12/+4
expansion already by growing the RHS to be bigger than LHS (all the way to `'static` if necessary). This is needed because contraction doesn't handle givens. Fixes #28934.
2015-11-04remove SupSupConflict, which is now dead codeNiko Matsakis-49/+0
2015-11-04Remove contraction. The contraction rules predated the notion of anNiko Matsakis-291/+18
empty region, and they complicate region inference to no particular end. They also lead in some cases to spurious errors like #29048 (though in some cases these errors are helpful in tracking down missing constraints).
2015-11-04do not dump extern def-ids with path for nowNiko Matsakis-6/+10
2015-10-27Auto merge of #26848 - oli-obk:const_fn_const_eval, r=pnkfelixbors-21/+98
this has the funky side-effect of also allowing constant evaluation of function calls to functions that are not `const fn` as long as `check_const` didn't mark that function `NOT_CONST` It's still not possible to call a normal function from a `const fn`, but let statements' initialization value can get const evaluated (this caused the fallout in the overflowing tests) we can now do this: ```rust const fn add(x: usize, y: usize) -> usize { x + y } const ARR: [i32; add(1, 2)] = [5, 6, 7]; ``` also added a test for destructuring in const fn args ```rust const fn i((a, b): (u32, u32)) -> u32 { a + b } //~ ERROR: E0022 ``` This is a **[breaking change]**, since it turns some runtime panics into compile-time errors. This statement is true for ANY improvement to the const evaluator.
2015-10-27Auto merge of #29327 - sanxiyn:argument, r=nrcbors-34/+28
Fix #24114.
2015-10-27the const evaluator might run before check_constOliver Schneider-8/+16
So we cannot assume that the function call was marked NOT_CONST by check_const.
2015-10-27Remove NodeArgSeo Sanghyeon-28/+2
2015-10-27Distinguish argument from local variableSeo Sanghyeon-6/+26
2015-10-26Auto merge of #29303 - petrochenkov:unistrimp, r=eddybbors-2/+2
And use `VariantData` instead of `P<VariantData>` in `Item_` and `Variant_` Improvements suggested by @eddyb in https://github.com/rust-lang/rust/pull/28816#discussion_r42483587 and https://github.com/rust-lang/rust/pull/28816#discussion_r42483648 plugin-[breaking-change] r? @eddyb
2015-10-25Auto merge of #29254 - alexcrichton:stabilize-1.5, r=brsonbors-11/+7
This commit stabilizes and deprecates library APIs whose FCP has closed in the last cycle, specifically: Stabilized APIs: * `fs::canonicalize` * `Path::{metadata, symlink_metadata, canonicalize, read_link, read_dir, exists, is_file, is_dir}` - all moved to inherent methods from the `PathExt` trait. * `Formatter::fill` * `Formatter::width` * `Formatter::precision` * `Formatter::sign_plus` * `Formatter::sign_minus` * `Formatter::alternate` * `Formatter::sign_aware_zero_pad` * `string::ParseError` * `Utf8Error::valid_up_to` * `Iterator::{cmp, partial_cmp, eq, ne, lt, le, gt, ge}` * `<[T]>::split_{first,last}{,_mut}` * `Condvar::wait_timeout` - note that `wait_timeout_ms` is not yet deprecated but will be once 1.5 is released. * `str::{R,}MatchIndices` * `str::{r,}match_indices` * `char::from_u32_unchecked` * `VecDeque::insert` * `VecDeque::shrink_to_fit` * `VecDeque::as_slices` * `VecDeque::as_mut_slices` * `VecDeque::swap_remove_front` - (renamed from `swap_front_remove`) * `VecDeque::swap_remove_back` - (renamed from `swap_back_remove`) * `Vec::resize` * `str::slice_mut_unchecked` * `FileTypeExt` * `FileTypeExt::{is_block_device, is_char_device, is_fifo, is_socket}` * `BinaryHeap::from` - `from_vec` deprecated in favor of this * `BinaryHeap::into_vec` - plus a `Into` impl * `BinaryHeap::into_sorted_vec` Deprecated APIs * `slice::ref_slice` * `slice::mut_ref_slice` * `iter::{range_inclusive, RangeInclusive}` * `std::dynamic_lib` Closes #27706 Closes #27725 cc #27726 (align not stabilized yet) Closes #27734 Closes #27737 Closes #27742 Closes #27743 Closes #27772 Closes #27774 Closes #27777 Closes #27781 cc #27788 (a few remaining methods though) Closes #27790 Closes #27793 Closes #27796 Closes #27810 cc #28147 (not all parts stabilized)
2015-10-25std: Stabilize library APIs for 1.5Alex Crichton-11/+7
This commit stabilizes and deprecates library APIs whose FCP has closed in the last cycle, specifically: Stabilized APIs: * `fs::canonicalize` * `Path::{metadata, symlink_metadata, canonicalize, read_link, read_dir, exists, is_file, is_dir}` - all moved to inherent methods from the `PathExt` trait. * `Formatter::fill` * `Formatter::width` * `Formatter::precision` * `Formatter::sign_plus` * `Formatter::sign_minus` * `Formatter::alternate` * `Formatter::sign_aware_zero_pad` * `string::ParseError` * `Utf8Error::valid_up_to` * `Iterator::{cmp, partial_cmp, eq, ne, lt, le, gt, ge}` * `<[T]>::split_{first,last}{,_mut}` * `Condvar::wait_timeout` - note that `wait_timeout_ms` is not yet deprecated but will be once 1.5 is released. * `str::{R,}MatchIndices` * `str::{r,}match_indices` * `char::from_u32_unchecked` * `VecDeque::insert` * `VecDeque::shrink_to_fit` * `VecDeque::as_slices` * `VecDeque::as_mut_slices` * `VecDeque::swap_remove_front` - (renamed from `swap_front_remove`) * `VecDeque::swap_remove_back` - (renamed from `swap_back_remove`) * `Vec::resize` * `str::slice_mut_unchecked` * `FileTypeExt` * `FileTypeExt::{is_block_device, is_char_device, is_fifo, is_socket}` * `BinaryHeap::from` - `from_vec` deprecated in favor of this * `BinaryHeap::into_vec` - plus a `Into` impl * `BinaryHeap::into_sorted_vec` Deprecated APIs * `slice::ref_slice` * `slice::mut_ref_slice` * `iter::{range_inclusive, RangeInclusive}` * `std::dynamic_lib` Closes #27706 Closes #27725 cc #27726 (align not stabilized yet) Closes #27734 Closes #27737 Closes #27742 Closes #27743 Closes #27772 Closes #27774 Closes #27777 Closes #27781 cc #27788 (a few remaining methods though) Closes #27790 Closes #27793 Closes #27796 Closes #27810 cc #28147 (not all parts stabilized)
2015-10-25syntax/rustc_front: Simplify VariantData::fieldsVadim Petrochenkov-2/+2
And use VariantData instead of P<VariantData> in Item_ and Variant_
2015-10-24Auto merge of #29215 - fhahn:issue-28157-bad-semicolon, r=alexcrichtonbors-1/+1
PR for #28157. At the moment, `rustc` emits a warning when a bare semicolon is encountered (could also be a fail, but I think this is a backwards incompatible change). Also I am not sure where the best place for a test for that warning would be. Seems run-pass tests do not check warnings.
2015-10-24Auto merge of #29259 - arielb1:supertrait-self-2, r=eddybbors-10/+3
…being it This is a [breaking-change]:lang, but the broken code does not make much sense. Fixes #26056 r? @eddyb
2015-10-24Remove bare semicolonsFlorian Hahn-1/+1
2015-10-24object_safety: check whether a supertrait contains Self even without being itAriel Ben-Yehuda-10/+3
This is a [breaking-change]:lang, but the broken code does not make much sense. Fixes #26056
2015-10-22improve Scope to print node-ids etcNiko Matsakis-1/+18
2015-10-22distinguish projections from the env/obj-types vs those fromNiko Matsakis-12/+62
trait definitions, and give prefence to the former. This is consistent with what we do for selection. It also works around a limitation that was leading to #28871.
2015-10-21save-analysis: don't recompute crate nameNick Cameron-2/+2
2015-10-19copy paste error of stable attributeOliver Schneider-1/+0
2015-10-19allow constant evaluation of function callsOliver Schneider-20/+90
2015-10-18Auto merge of #28845 - oli-obk:rfc1229, r=pnkfelixbors-5/+12
This PR turns statically known erroneous code (e.g. numeric overflow) into a warning and continues normal code-generation to emit the same code that would have been generated without `check_const` detecting that the result can be computed at compile-time. <del>It's not done yet, as I don't know how to properly emit a lint from trans. I can't seem to extract the real lint level of the item the erroneous expression is in.</del> It's an unconditional warning now. r? @pnkfelix cc @nikomatsakis * [RFC 1229 text](https://github.com/rust-lang/rfcs/blob/master/text/1229-compile-time-asserts.md) * RFC PR: rust-lang/rfcs#1229 * tracking issue: https://github.com/rust-lang/rust/issues/28238
2015-10-17Auto merge of #29109 - nxnfufunezn:master, r=Manishearthbors-0/+22
Fixes : #19668 r? @Manishearth
2015-10-17Auto merge of #29102 - petrochenkov:spanvis, r=alexcrichtonbors-1/+1
Closes https://github.com/rust-lang/rust/issues/28750 `Arm` and `Generics` don't have spans at all, so it's not a visitor's problem, `visit_struct_def` was fixed in https://github.com/rust-lang/rust/pull/28816
2015-10-17Add span_lint_note and span_lint_help to the LintContextnxnfufunezn-0/+22
2015-10-16Auto merge of #29014 - petrochenkov:stability, r=brsonbors-18/+30
Stricter checking of stability attributes + enforcement of their invariants at compile time (+ removed dead file librustc_front/attr.rs) I intended to enforce use of `reason` for unstable items as well (it normally presents for new items), but it turned out too intrusive, many older unstable items don't have `reason`s. r? @aturon I'm studying how stability works and do some refactoring along the way, so it's probably not the last PR.
2015-10-16Provide span for visit_enum_defVadim Petrochenkov-1/+1
2015-10-15Add docs for `ast_ty_to_prim_ty`Manish Goregaokar-0/+2
Confusion about what this does caused a bug in Servo's lints.
2015-10-14Rollup merge of #29006 - arielb1:callee-outlives-call, r=pnkfelixManish Goregaokar-1/+4
This rather crucial requirement was not checked. In most cases, that didn't cause any trouble because the argument types are required to outlive the call and are subtypes of a subformula of the callee type. However, binary ops are taken by ref only indirectly, without it being marked in the argument types, which led to the argument types not being constrained anywhere causing spurious errors (as these are basically unconstrainable, I don't think this change can break code). Of course, the old way was also incorrent with contravariance, but that is still unsound for other reasons. This also improves rustc::front to get RUST_LOG to *somewhat* work. Fixes #28999. That issue is one of the several regression introduced by #28669. r? @pnkfelix
2015-10-13implement RFC 1229Oliver Schneider-5/+12
const eval errors outside of true constant enviroments are not reported anymore, but instead forwarded to a lint.
2015-10-13Merge VariantData and VariantData_Vadim Petrochenkov-20/+21
2015-10-13Fix rebase 2Vadim Petrochenkov-3/+3
2015-10-13Merge struct fields and struct kindVadim Petrochenkov-13/+14
2015-10-13Dict -> Struct, StructDef -> VariantData, def -> dataVadim Petrochenkov-39/+39
2015-10-13Fix rebaseVadim Petrochenkov-4/+4
2015-10-13Provide span for visit_struct_def + remove some dead codeVadim Petrochenkov-3/+5
2015-10-13Remove now redundant NodeId from VariantVadim Petrochenkov-27/+28
2015-10-13Decouple structure kinds from NodeIdsVadim Petrochenkov-17/+14
2015-10-13Unify structures and enum variants in HIRVadim Petrochenkov-19/+8
2015-10-13Refactor attr::StabilityVadim Petrochenkov-18/+30
Stricter checking + enforcement of invariants at compile time
2015-10-12require a method callee's type to outlive the callAriel Ben-Yehuda-1/+4
This rather crucial requirement was not checked. In most cases, that didn't cause any trouble because the argument types are required to outlive the call and are subtypes of a subformula of the callee type. However, binary ops are taken by ref only indirectly, without it being marked in the argument types, which led to the argument types not being constrained anywhere causing spurious errors (as these are basically unconstrainable, I don't think this change can break code). Of course, the old way was also incorrent with contravariance, but that is still unsound for other reasons. This also improves rustc::front to get RUST_LOG to *somewhat* work. Fixes #28999
2015-10-10Auto merge of #28938 - GlenDC:master, r=Manishearthbors-0/+1
Here is my attempt to resolve issue #28822, @Manishearth. Please let me know if it's fine. And if not, what should I do instead? This issue felt like quite a good start for some rust contributions. It allows me to get used to the workflow and codebase of rust in an easy-to-swallow manner. Are there any other issues you would recommend me to look at? :) Would love to do some more stuff!
2015-10-10Whitelisting PatWild for E0022. Fix #28822glendc-0/+1
2015-10-10Auto merge of #28861 - pnkfelix:fsk-nonparam-dropck-issue28498, r=arielb1bors-72/+22
implement RFC 1238: nonparametric dropck. cc #28498 cc @nikomatsakis
2015-10-09review comment: further refinement of comment above `fn is_adt_dtorck`.Felix S. Klock II-3/+12
2015-10-09Auto merge of #28857 - nrc:lowering, r=nikomatsakisbors-24/+79
r? @nikomatsakis