about summary refs log tree commit diff
path: root/src/test
AgeCommit message (Collapse)AuthorLines
2018-05-30Auto merge of #51215 - eddyb:visit-for-a-lifetime, r=nikomatsakisbors-1/+17
rustc: don't visit lifetime parameters through visit_lifetime. Ideally we'd also not use the `Lifetime` struct for parameters, but I'll leave that to @varkor (#48149). Fixes #51185 (discovered while auditing all the `visit_lifetime` implementations). r? @nikomatsakis
2018-05-30rustc: don't visit lifetime parameters through visit_lifetime.Eduard-Mihai Burtescu-1/+17
2018-05-30Suggest using `as_ref` on some borrow errors [hack]Esteban Küber-0/+72
When encountering the following code: ```rust struct Foo; fn takes_ref(_: &Foo) {} let ref opt = Some(Foo); opt.map(|arg| takes_ref(arg)); ``` Suggest using `opt.as_ref().map(|arg| takes_ref(arg));` instead. This is a stop gap solution until we expand typeck to deal with these cases in a more graceful way.
2018-05-30Auto merge of #50880 - glandium:oom, r=SimonSapinbors-7/+7
OOM handling changes As discussed in https://github.com/rust-lang/rust/issues/49668#issuecomment-384893456 and subsequent. This does have codegen implications. Even without the hooks, and with a handler that ignores the arguments, the compiler doesn't eliminate calling `rust_oom` with the `Layout`. Even if it managed to eliminate that, with the hooks, I don't know if the compiler would be able to figure out it can skip it if the hook is never set. A couple implementation notes: - I went with explicit enums rather than bools because it makes it clearer in callers what is being requested. - I didn't know what `feature` to put the hook setting functions behind. (and surprisingly, the compile went through without any annotation on the functions) - There's probably some bikeshedding to do on the naming. Cc: @Simonsapin, @sfackler
2018-05-30Auto merge of #51017 - estebank:crate-name-in-path, r=michaelwoeristerbors-0/+67
Use crate name for reexported `extern crate` paths Fix #43189.
2018-05-29Review feedback: Adding test cases suggested by arielb1.Felix S. Klock II-0/+146
2018-05-29Tests illustrating the bug fixes for #27282 and #24535.Felix S. Klock II-0/+211
2018-05-29Test update: Fallout from ReadForMatch statements + changes to codegen under ↵Felix S. Klock II-112/+125
NLL.
2018-05-29rust-lang/rust#41962 has a new error with my new code. Incorporate that into ↵Felix S. Klock II-8/+16
my code. In particular, I am adding an implicit injected borrow on the pattern matches, and when we go around the loop, the compiler is reporting that this injected borrow is conflicting with the move of the original value when the match succeeds.
2018-05-30Pass a `Layout` to `oom`Mike Hommey-7/+7
As discussed in https://github.com/rust-lang/rust/issues/49668#issuecomment-384893456 and subsequent, there are use-cases where the OOM handler needs to know the size of the allocation that failed. The alignment might also be a cause for allocation failure, so providing it as well can be useful.
2018-05-29Auto merge of #50475 - csmoe:debr, r=nikomatsakisbors-15/+15
Refactor DebruijnIndex to be 0-based Fixes #49813
2018-05-28change to 0-based indicesNiko Matsakis-15/+15
Co-authored-by: csmoe <35686186+csmoe@users.noreply.github.com>
2018-05-28Add test for reexported crate namesEsteban Küber-0/+67
2018-05-28Auto merge of #50521 - gnzlbg:simd_float, r=alexcrichtonbors-4/+1801
Add simd math intrinsics and gather/scatter This PR adds simd math intrinsics for floating-point vectors (sqrt, sin, cos, pow, exp, log, fma, abs, etc.) and the generic simd gather/scatter intrinsics.
2018-05-28Auto merge of #50724 - zackmdavis:applicability_rush, r=Manishearthbors-28/+218
add suggestion applicabilities to librustc and libsyntax A down payment on #50723. Interested in feedback on whether my `MaybeIncorrect` vs. `MachineApplicable` judgement calls are well-calibrated (and that we have a consensus on what this means). r? @Manishearth cc @killercup @estebank
2018-05-28Auto merge of #50612 - Zoxc:thin-slice, r=michaelwoeristerbors-1/+1
Make &Slice a thin pointer Split out from https://github.com/rust-lang/rust/pull/50395 r? @michaelwoerister
2018-05-27Auto merge of #48309 - mark-i-m:anon_param_lint, r=nikomatsakisbors-4/+67
Make anon params lint warn-by-default This is intended as a followup on anonymous parameters deprecation. Cross-posting from #41686: > After having read a bit more of the discussion that I can find, I propose a more aggressive deprecation strategy: > - We make the lint warn-by-default as soon as possible > - We make anon parameters a hard error at the epoch boundary cc @matklad @est31 @aturon
2018-05-27Make anon params lint warn-by-defaultMark Mansi-4/+67
2018-05-27Make &Slice a thin pointerJohn Kåre Alsaker-1/+1
2018-05-27Address comments in pull request #51084.Simon Martin-1/+10
2018-05-27Auto merge of #51084 - simartin:issue_51022, r=estebankbors-0/+12
Issue #51022: Improve E0131 message when lifetimes are involved. Fixes #51022
2018-05-27Ensure every unstable feature has a tracking issue.kennytm-13/+13
2018-05-27Auto merge of #51075 - ↵bors-1/+27
estebank:and_the_case_of_the_confusable_float_exponent, r=eddyb Check for confusable Unicode chars in float literal exponent Fixing tests for #49989. Resolves #49746.
2018-05-27Auto merge of #51066 - est31:master, r=sfacklerbors-2/+2
Point to the current box syntax tracking issue The issue was used for both box syntax as well as placement new. It got closed due to placement new being unapproved. So a new one got created for box syntax, yet neither the unstable book nor feature_gate.rs got updated. We are doing this now. r? @aidanhs
2018-05-27Issue #51022: Improve E0131 message when lifetimes are involved.Simon Martin-0/+12
2018-05-26Fix testEsteban Küber-7/+7
2018-05-26Point to the current box syntax tracking issueest31-2/+2
The issue was used for both box syntax as well as placement new. It got closed due to placement new being unapproved. So a new one got created for box syntax, yet neither the unstable book nor feature_gate.rs got updated. We are doing this now.
2018-05-26Rollup merge of #51057 - pnkfelix:issue-51025-make-ui-tests-robust-wrt-nll, ↵Mark Simulacrum-362/+725
r=nikomatsakis make ui tests robust with respect to NLL This PR revises the `ui` tests that I could quickly identify that: 1. previously had successful compilations under non-lexical lifetimes (NLL) because they assumed lexical lifetimes, but 2. such assumption of lexical lifetimes was actually not necessarily part of the spirit of the original issue/bug we want to witness. In many cases, this is simply a matter of adding a use of a borrow so that it gets extended long enough to observe a conflict. (In some cases the revision was more subtle, such as adding a destructor, or revising the order of declaration of some variables.) ---- With these test revisions in place, I subsequently updated the expected stderr output under the NLL compiletest mode. So now we should get even more testing of NLL than we were before. Fix #51025
2018-05-26Rollup merge of #51049 - varkor:break-while-condition, r=nikomatsakisMark Simulacrum-0/+82
Fix behaviour of divergence in while loop conditions This fixes `'a: while break 'a {};` being treated as diverging, by tracking break expressions in the same way as in `loop` expressions. Fixes #50856. r? @nikomatsakis
2018-05-26Auto merge of #51052 - nikomatsakis:obsolete-arrow, r=petrochenkovbors-0/+43
restore emplacement syntax (obsolete) Fix https://github.com/rust-lang/rust/issues/50832 r? @petrochenkov
2018-05-26Auto merge of #51082 - kennytm:rollup, r=kennytmbors-11/+75
Rollup of 11 pull requests Successful merges: - #50987 (Underline multiple suggested replacements in the same line) - #51014 (Add documentation about env! second argument) - #51034 (Remove unused lowering field and method) - #51047 (Use AllFacts from polonius-engine) - #51048 (Add more missing examples for Formatter) - #51056 (Mention and use `Once::new` instead of `ONCE_INIT`) - #51059 (What does an expression look like, that consists only of special characters?) - #51065 (Update nomicon link in transmute docs) - #51067 (Add inner links in documentation) - #51070 (Fail typecheck if we encounter a bogus break) - #51073 (Rename TokenStream::empty to TokenStream::new) Failed merges:
2018-05-26Rollup merge of #51073 - dtolnay:empty, r=alexcrichtonkennytm-4/+4
Rename TokenStream::empty to TokenStream::new There is no precedent for the `empty` name -- we do not have `Vec::empty` or `HashMap::empty` etc. I would propose landing this but reflecting it in a non-breaking release of proc-macro2 that provides both `new` and a deprecated `empty` constructor. Tracking issue: #38356 r? @alexcrichton
2018-05-26Rollup merge of #51070 - est31:fix_break_const_ice, r=estebankkennytm-0/+61
Fail typecheck if we encounter a bogus break Lone breaks outside of loops create errors in the loop check pass but as they are not fatal, compilation continues. MIR building code assumes all HIR break statements to point to valid locations and fires ICEs if this assumption is violated. In normal compilation, this causes no issues, as code apparently prevents MIR from being built if errors are present. However, before that, typecheck runs and with it MIR const eval. Here we operate differently from normal compilation: it doesn't check for any errors except for type checker ones and then directly builds the MIR. This constellation causes an ICE-on-error if bogus break statements are being put into array length expressions. This commit fixes this ICE by letting typecheck fail if bogus break statements are encountered. This way, MIR const eval fails cleanly with a type check error. Fixes #50576 Fixes #50581
2018-05-26Rollup merge of #51059 - oberien:patch-1, r=nikomatsakiskennytm-0/+7
What does an expression look like, that consists only of special characters? I had a lot of fun creating this together with @CryZe
2018-05-26Rollup merge of #50987 - estebank:underline-multiple-suggestions, r=petrochencovkennytm-7/+3
Underline multiple suggested replacements in the same line <img width="685" alt="screen shot 2018-05-22 at 21 06 48" src="https://user-images.githubusercontent.com/1606434/40403051-174f3180-5e04-11e8-86b6-261630c5ff80.png"> Follow up to #50943. Fix #50977.
2018-05-26Auto merge of #51041 - alexcrichton:better-unwind, r=nikomatsakisbors-0/+21
std: Ensure OOM is classified as `nounwind` OOM can't unwind today, and historically it's been optimized as if it can't unwind. This accidentally regressed with recent changes to the OOM handler, so this commit adds in a codegen test to assert that everything gets optimized away after the OOM function is approrpiately classified as nounwind Closes #50925
2018-05-25in which we check for confusable Unicodepoints in float literal exponentZack M. Davis-0/+26
The `FatalError.raise()` might seem unmotivated (in most places in the compiler, `err.emit()` suffices), but it's actually used to maintain behavior (viz., stop lexing, don't emit potentially spurious errors looking for the next token after the bad Unicodepoint in the exponent): the previous revision's `self.err_span_` ultimately calls `Handler::emit`, which aborts if the `Handler`'s continue_after_error flag is set, which seems to typically be true during lexing (see `phase_1_parse_input` and and how `CompileController::basic` has `continue_parse_after_error: false` in librustc_driver). Also, let's avoid apostrophes in error messages (the present author would argue that users expect a reassuringly detached, formal, above-it-all tone from a Serious tool like a compiler), and use an RLS-friendly structured suggestion. Resolves #49746.
2018-05-26Auto merge of #51035 - oli-obk:unsupported_crate_type, r=eddybbors-0/+20
Don't ICE if crate has no valid crate types left fixes #50993
2018-05-25Rename TokenStream::empty to TokenStream::newDavid Tolnay-4/+4
There is no precedent for the `empty` name -- we do not have `Vec::empty` or `HashMap::empty` etc.
2018-05-26Fail typecheck if we encounter a bogus breakest31-0/+61
Lone breaks outside of loops create errors in the loop check pass but as they are not fatal, compilation continues. MIR building code assumes all HIR break statements to point to valid locations and fires ICEs if this assumption is violated. In normal compilation, this causes no issues, as code apparently prevents MIR from being built if errors are present. However, before that, typecheck runs and with it MIR const eval. Here we operate differently from normal compilation: it doesn't check for any errors except for type checker ones and then directly builds the MIR. This constellation causes an ICE-on-error if bogus break statements are being put into array length expressions. This commit fixes this ICE by letting typecheck fail if bogus break statements are encountered. This way, MIR const eval fails cleanly with a type check error. Fixes #50576 Fixes #50581
2018-05-26Auto merge of #50070 - toidiu:ak-2093-outlives, r=nikomatsakisbors-411/+288
2093 infer outlives requirements Tracking issue: #44493 RFC: https://github.com/rust-lang/rfcs/pull/2093 - [x] add `rustc_attrs` flag - [x] use `RequirePredicates` type - [x] handle explicit predicates on `dyn` Trait - [x] handle explicit predicates on projections - [x] more tests - [x] remove `unused`, `dead_code` and etc.. - [x] documentation
2018-05-25--bless the testsvarkor-6/+6
2018-05-25Add a test for returning inside a while loopvarkor-10/+60
2018-05-25Fix behaviour of divergence in while loop conditionsvarkor-0/+32
This fixes `'a: while break 'a {};` being treated as diverging, by tracking break expressions in the same way as in `loop` expressions.
2018-05-25Don't use a char that's already used within the exprJaro Fietz-1/+1
2018-05-25Call itJaro Fietz-0/+1
2018-05-25What does an expression look like, that consists only of special characters?Jaro Fietz-0/+6
2018-05-25Auto merge of #50967 - oli-obk:miri_api_refactor, r=eddybbors-0/+68
Miri api refactor r? @eddyb cc @Zoxc based on https://github.com/rust-lang/rust/pull/50916
2018-05-25Implement outlives requirements inference for dyn and projections.toidiu-411/+288
Add tests, documentation and attr for feature.
2018-05-25Adjust test for 32 bit targetsOliver Schneider-2/+3