about summary refs log tree commit diff
path: root/src/test/ui
AgeCommit message (Collapse)AuthorLines
2020-08-08Auto merge of #75260 - davidtwco:polymorphization-promoted-substs, r=lcnrbors-2/+72
polymorphize: unevaluated constants This PR makes polymorphization visit the promoted MIR of unevaluated constants with available promoted MIR instead of visiting the substitutions of that constant - which will mark all of the generic parameters as used; in addition polymorphization will now visit non-promoted unevaluated constants rather than visit their substs. r? @lcnr
2020-08-08Auto merge of #74877 - lcnr:min_const_generics, r=oli-obkbors-66/+321
Implement the `min_const_generics` feature gate Implements both https://github.com/rust-lang/lang-team/issues/37 and https://github.com/rust-lang/compiler-team/issues/332. Adds the new feature gate `#![feature(min_const_generics)]`. This feature gate adds the following limitations to using const generics: - generic parameters must only be used in types if they are trivial. (either `N` or `{ N }`) - generic parameters must be either integers, `bool` or `char`. We do allow arbitrary expressions in associated consts though, meaning that the following is allowed, even if `<[u8; 0] as Foo>::ASSOC` is not const evaluatable. ```rust trait Foo { const ASSOC: usize; } impl<const N: usize> Foo for [u8; N] { const ASSOC: usize = 64 / N; } ``` r? @varkor cc @eddyb @withoutboats
2020-08-08Auto merge of #75048 - eggyal:force-no-tco-start-backtrace-frame, ↵bors-0/+23
r=Mark-Simulacrum Prevent `__rust_begin_short_backtrace` frames from being tail-call optimised away I've stumbled across some situations where there (unexpectedly) was no `__rust_begin_short_backtrace` frame on the stack during unwinding. On closer examination, it appeared that the calls to that function had been tail-call optimised away. This PR follows [@bjorn3's suggestion on Zulip](https://rust-lang.zulipchat.com/#narrow/stream/131828-t-compiler/topic/Disabling.20tail.20call.20optimisation.3F/near/205699133), by adding calls to `black_box` that hint to rustc not to perform TCO. Fixes #47429
2020-08-07Prevent `__rust_begin_short_backtrace` frames from being tail-call optimised ↵Alan Egerton-0/+23
away
2020-08-07Auto merge of #75255 - ↵bors-0/+135
davidtwco:polymorphisation-symbol-mangling-v0-upvar-closures, r=lcnr instance: polymorphize upvar closures/generators This PR modifies how instances are polymorphized so that closures and generators have any closures or generators captured within their upvars also polymorphized. With the new symbol mangling, a fully polymorphised closure will produce the same symbol regardless of what it was instantiated with. However, when that polymorphised closure captures another closure as an upvar, then the type of that other closure in the upvar substitution wouldn't have been polymorphised. The other closure will still refer to the initial substitutions. Therefore, the polymorphised closure will end up hashing differently but producing the same symbol - triggering `assert_symbols_are_distinct` in MIR partitioning. The old mangling scheme had a hash at the end that meant this didn't happen (this would still have been an issue, we just didn't have a way to notice). See [this Zulip discussion for further elaboration](https://rust-lang.zulipchat.com/#narrow/stream/216091-t-compiler.2Fwg-polymorphization/topic/symbol.20mangling.20v0.20.E2.9C.95.20polymorphisation/near/206152008). r? @eddyb cc @lcnr
2020-08-07instance: polymorphize upvar closures/generatorsDavid Wood-0/+135
This commit modifies how instances are polymorphized so that closures and generators have any closures or generators captured within their upvars also polymorphized - this avoids symbol clashes with the new symbol mangling scheme. Signed-off-by: David Wood <david@davidtw.co>
2020-08-07polymorphize: non-promoted unevaluated constantsDavid Wood-0/+33
This commit makes polymorphization visit non-promoted unevaluated constants rather than visit their substs directly. Signed-off-by: David Wood <david@davidtw.co>
2020-08-07Auto merge of #74821 - oli-obk:const_eval_read_uninit_fast_path, r=wesleywiserbors-3/+3
Check whether locals are too large instead of whether accesses into them are too large Essentially this stops const prop from attempting to optimize ```rust let mut x = [0_u8; 5000]; x[42] = 3; ``` I don't expect this to be a perf improvement without #73656 (which is also where the lack of this PR will be a perf regression). r? @wesleywiser
2020-08-07polymorphize: visit promoted MIRDavid Wood-2/+39
This commit makes polymorphization visited the MIR of unevaluated constants with available promoted MIR instead of visiting the substitutions of that constant - which will mark all of the generic parameters as used. Signed-off-by: David Wood <david@davidtw.co>
2020-08-07Auto merge of #74627 - petrochenkov:docbeauty2, r=Aaron1011bors-0/+78
rustc_ast: Stop using "string typing" for doc comment tokens Explicitly store their kind and style retrieved during lexing in the `token::DocComment`. Also don't "beautify" doc comments before converting them to `#[doc]` attributes when passing them to macros (both declarative and procedural). The trimming of empty lines, lines containing only `*`s, etc is purely a rustdoc's job as a part of its presentation of doc strings to users, rustc must not do this and must pass tokens as precisely as possible internally.
2020-08-06Rollup merge of #75227 - Amanieu:fix_asm_arch, r=Mark-SimulacrumManish Goregaokar-2/+28
Fix ICE when using asm! on an unsupported architecture Fixes #75220
2020-08-06Rollup merge of #75203 - canova:btreemap-into-iter, r=dtolnayManish Goregaokar-0/+23
Make `IntoIterator` lifetime bounds of `&BTreeMap` match with `&HashMap` This is a pretty small change on the lifetime bounds of `IntoIterator` implementations of both `&BTreeMap` and `&mut BTreeMap`. This is loosening the lifetime bounds, so more code should be accepted with this PR. This is lifetime bounds will still be implicit since we have `type Item = (&'a K, &'a V);` in the implementation. This change will make the HashMap and BTreeMap share the same signature, so we can share the same function/trait with both HashMap and BTreeMap in the code. Fixes #74034. r? @dtolnay hey, I was touching this file on my previous PR and wanted to fix this on the way. Would you mind taking a look at this, or redirecting it if you are busy?
2020-08-07test min_const_generics using revisionsBastian Kauschke-52/+154
2020-08-07Rollup merge of #75188 - Aaron1011:fix/fieldless-tuple-error, r=varkorYuki Okushi-0/+25
Handle fieldless tuple structs in diagnostic code Fixes #75062
2020-08-07Rollup merge of #74888 - infinity0:ignore-endian-big, r=nikomatsakisYuki Okushi-4/+2
compiletest: ignore-endian-big, fixes #74829, fixes #74885 See discussion on #74829 I tested it on a Debian s390x machine, works well.
2020-08-06allow complex expressions in assoc constsBastian Kauschke-17/+19
2020-08-06Add some comments for magic numbers + Add testsVadim Petrochenkov-0/+78
2020-08-06Fix ICE when using asm! on an unsupported architectureAmanieu d'Antras-2/+28
Fixes #75220
2020-08-06Auto merge of #74889 - JohnTitor:hrtb-tests, r=nikomatsakisbors-0/+28
Add HRTB-related regression test Closes #59311 and cc #71546 This closes the former but the test is taken from https://github.com/rust-lang/rust/issues/71546#issuecomment-620638437 since it seems they have the same cause and it's simplified.
2020-08-05Add a test for BTreeMap lifetime bound to see if it compilesNazım Can Altınova-0/+23
2020-08-06Add a FIXME commentYuki Okushi-1/+5
2020-08-05Auto merge of #75166 - JulianKnodt:i64494, r=lcnrbors-0/+37
Add regression test for #64494 Add regression test to indicate if this compilation ever succeeds. Fixes #64494 r? @lcnr
2020-08-05impl reviewBastian Kauschke-16/+20
2020-08-05forbid complex types for generic parametersBastian Kauschke-0/+52
2020-08-05forbid generic params in complex constsBastian Kauschke-0/+95
2020-08-05Auto merge of #75194 - Aaron1011:feature/macro-backtrace-numbers, r=eddybbors-4/+4
Show backtrace numbers in backtrace whenever more than one is involved Previously, we only displayed 'frame' numbers in a macro backtrace when more than two frames were involved. This commit should help make backtrace more readable, since these kinds of messages can quickly get confusing.
2020-08-05Show backtrace numbers in backtrace whenever more than one is involvedAaron Hill-4/+4
Previously, we only displayed 'frame' numbers in a macro backtrace when more than two frames were involved. This commit should help make backtrace more readable, since these kinds of messages can quickly get confusing.
2020-08-05Auto merge of #75165 - JulianKnodt:i72787, r=lcnrbors-0/+74
Add regression test for #72787 Add regression test for Issue #72787 Fixes #72787 ~~Still waiting on running tests locally to bless the error output~~ r? @lcnr
2020-08-05Handle fieldless tuple structs in diagnostic codeAaron Hill-0/+25
Fixes #75062
2020-08-05Auto merge of #75174 - JohnTitor:rollup-z9djftk, r=JohnTitorbors-16/+19
Rollup of 5 pull requests Successful merges: - #75139 (Remove log alias from librustdoc) - #75140 (Clean up E0745) - #75149 (Correct a typo in interpret/memory.rs) - #75152 (Replace `Memoryblock` with `NonNull<[u8]>`) - #75168 (Update books) Failed merges: r? @ghost
2020-08-05Rollup merge of #75152 - TimDiekmann:replace_memblock, r=AmanieuYuki Okushi-16/+19
Replace `Memoryblock` with `NonNull<[u8]>` Closes rust-lang/wg-allocators#61 r? @Amanieu
2020-08-05Auto merge of #75130 - lcnr:array_chunks, r=ecstatic-morsebors-3/+38
forbid `#[track_caller]` on main fixes #75125 cc @anp
2020-08-04Add regression testkadmin-0/+37
2020-08-04Add regression testkadmin-0/+74
As well as matching error outputs
2020-08-04Auto merge of #75136 - JohnTitor:unsizing-casts-non-null, r=oli-obkbors-0/+22
Forbid non-derefable types explicitly in unsizing casts Fixes #75118 r? @oli-obk
2020-08-04tweak error messageBastian Kauschke-6/+6
2020-08-04Replace `Memoryblock` with `NonNull<[u8]>`Tim Diekmann-16/+19
2020-08-04Auto merge of #74850 - TimDiekmann:remove-in-place-alloc, r=Amanieubors-17/+11
Remove in-place allocation and revert to separate methods for zeroed allocations closes rust-lang/wg-allocators#58
2020-08-04Forbid non-derefable types explicitly in unsizing castsYuki Okushi-0/+22
2020-08-04forbid `#[track_caller]` on mainBastian Kauschke-0/+35
2020-08-04Rollup merge of #75084 - Aaron1011:stabilize/ident-new-raw, r=petrochenkovYuki Okushi-0/+61
Stabilize Ident::new_raw Tracking issue: #54723 This is a continuation of PR #59002
2020-08-04Rollup merge of #75083 - JohnTitor:follow-up-unused-braces, r=lcnrYuki Okushi-24/+17
Do not trigger `unused_braces` for `while let` Follow-up for #75031 r? @lcnr
2020-08-04Rollup merge of #75056 - Veykril:path_statements_lint, r=oli-obkYuki Okushi-3/+26
Lint path statements to suggest using drop when the type needs drop Fixes #48852. With this change the current lint description doesn't really fit entirely anymore I think.
2020-08-03Auto merge of #74526 - erikdesjardins:reftrack, r=Mark-Simulacrumbors-1/+8
Add track_caller to RefCell::{borrow, borrow_mut} So panic messages point at the offending borrow. Fixes #74472
2020-08-03Stabilize Ident::new_rawAaron Hill-0/+61
Tracking issue: #54723 This is a continuation of PR #59002
2020-08-03Auto merge of #75076 - tmiasko:simplify-goto, r=oli-obkbors-0/+7
Fix change detection in CfgSimplifier::collapse_goto_chain Check that the old target is different from the new collapsed one, before concluding that anything changed. Fixes #75074 Fixes #75051
2020-08-03Do not trigger `unused_braces` for `while let`Yuki Okushi-24/+17
2020-08-03Merge branch 'master' into remove-in-place-allocTim Diekmann-1029/+2018
2020-08-02Auto merge of #74948 - lzutao:stalize-result-as-deref, r=dtolnaybors-45/+3
Stabilize `Result::as_deref` and `as_deref_mut` FCP completed in https://github.com/rust-lang/rust/issues/50264#issuecomment-645681400. This PR stabilizes two new APIs for `std::result::Result`: ```rust fn as_deref(&self) -> Result<&T::Target, &E> where T: Deref; fn as_deref_mut(&mut self) -> Result<&mut T::Target, &mut E> where T: DerefMut; ``` This PR also removes two rarely used unstable APIs from `Result`: ```rust fn as_deref_err(&self) -> Result<&T, &E::Target> where E: Deref; fn as_deref_mut_err(&mut self) -> Result<&mut T, &mut E::Target> where E: DerefMut; ``` Closes #50264
2020-08-03Fix change detection in CfgSimplifier::collapse_goto_chainTomasz Miąsko-0/+7
Check that the old target is different from the new collapsed one, before concluding that anything changed.