about summary refs log tree commit diff
path: root/src/test
AgeCommit message (Collapse)AuthorLines
2020-05-14Rollup merge of #72194 - doctorn:dispatch-from-dyn-ice, r=estebankDylan DPC-0/+29
Don't ICE on missing `Unsize` impl Previously code of the form ```rust #![feature(unsize, dispatch_from_dyn)] use std::marker::Unsize; use std::ops::DispatchFromDyn; pub struct Foo<'a, T: ?Sized> { _inner: &'a &'a T, } impl<'a, T: ?Sized + Unsize<U>, U: ?Sized> DispatchFromDyn<Foo<'a, U>> for Foo<'a, T> {} ``` would generate an ICE due to the missing `Unsize` impl being run through the `suggest_change_mut` suggestion. This PR adds an early exit and a pointer to the appropriate docs regarding `Unsize` instead: ``` error[E0277]: the trait bound `&'a T: std::marker::Unsize<&'a U>` is not satisfied --> src/test/ui/issues/issue-71036.rs:11:1 | 11 | impl<'a, T: ?Sized + Unsize<U>, U: ?Sized> DispatchFromDyn<Foo<'a, U>> for Foo<'a, T> {} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `std::marker::Unsize<&'a U>` is not implemented for `&'a T` | = note: all implementations of `Unsize` are provided automatically by the compiler, see <https://doc.rust-lang.org/stable/std/marker/trait.Unsize.html> for more information = note: required because of the requirements on the impl of `std::ops::DispatchFromDyn<&'a &'a U>` for `&'a &'a T` error: aborting due to previous error For more information about this error, try `rustc --explain E0277`. ``` r? @estebank Resolves #71036
2020-05-14Rollup merge of #72127 - jademcgough:long-error-explanation-E0228, ↵Dylan DPC-2/+7
r=petrochenkov add long error explanation for E0228 Add long explanation for the E0228 error code Part of #61137 Let me know if this is wrong at all (or can be written more clearly), I'm still learning Rust.
2020-05-14Rollup merge of #72087 - matthewjasper:regionck-hang, r=nikomatsakisDylan DPC-0/+7
Fix hang in lexical_region_resolve Regionck was stuck in a loop where a region value was changing between two equal regions. Closes #72051
2020-05-14Rollup merge of #71910 - mibac138:necessary-paren, r=cuviperDylan DPC-0/+23
Fix unused_parens false positive when using binary operations Fixes #71290 r? @cuviper who provided instructions
2020-05-14Don't ICE on missing `Unsize` implNathan Corbyn-0/+29
2020-05-14Auto merge of #72187 - RalfJung:rollup-a7a9jdi, r=RalfJungbors-104/+97
Rollup of 12 pull requests Successful merges: - #71525 (`prefix` should not be mutable.) - #71741 (Pointer printing: do not print 0 offset) - #71870 (Be slightly more precise about any::type_name()'s guarantees.) - #71909 (Document From trait for Option implementations) - #71964 (Fix bootstrap failing on win32) - #72137 (Clean up E0581 explanation) - #72138 (Add doc comment for `rustc_middle::mir::mono::Linkage`) - #72150 (Remove UnnormalizedProjection) - #72151 (Update books) - #72163 (docs: remove comment referencing non-existent method) - #72169 (Clean up E0582 explanation) - #72183 (Fix Arc::decr_strong_count doc test) Failed merges: r? @ghost
2020-05-14Rollup merge of #72150 - jackh726:unnorm_projection, r=nikomatsakisRalf Jung-15/+8
Remove UnnormalizedProjection This was only used for the old chalk integration with chalk-engine r? @nikomatsakis
2020-05-14Rollup merge of #71741 - RalfJung:pointer-print, r=oli-obkRalf Jung-89/+89
Pointer printing: do not print 0 offset r? @eddyb Cc @oli-obk
2020-05-14Auto merge of #69756 - wesleywiser:simplify_try, r=oli-obkbors-32/+717
Modify SimplifyArmIdentity so it can trigger on mir-opt-level=1 I also added test cases to make sure the optimization can fire on all of these cases: ```rust fn case_1(o: Option<u8>) -> Option<u8> { match o { Some(u) => Some(u), None => None, } } fn case2(r: Result<u8, i32>) -> Result<u8, i32> { match r { Ok(u) => Ok(u), Err(i) => Err(i), } } fn case3(r: Result<u8, i32>) -> Result<u8, i32> { let u = r?; Ok(u) } ``` Without MIR inlining, this still does not completely optimize away the `?` operator because the `Try::into_result()`, `From::from()` and `Try::from_error()` calls still exist. This does move us a bit closer to that goal though because: - We can now run the pass on mir-opt-level=1 - We no longer depend on the copy propagation pass running which is unlikely to stabilize anytime soon. Fixes #66855
2020-05-13Auto merge of #71451 - estebank:suggest-super-trait-constraint, r=nikomatsakisbors-92/+226
Suggest adding super trait constraints
2020-05-13Auto merge of #70416 - mzohreva:mz/sgx-test, r=nikomatsakisbors-0/+32
Process termination test for SGX The issue is described in https://github.com/fortanix/rust-sgx/issues/109 cc @jethrogb
2020-05-12add long error explanation for E0228Jade McGough-2/+7
2020-05-12fix test output after rebaseEsteban Küber-1/+1
2020-05-12Increase verbosity of bound restriction suggestionsEsteban Küber-119/+207
- Make the bound restriction suggestion `span_suggestion_verbose`. - Fix whitespace typo.
2020-05-12Suggest adding super trait constraintsEsteban Küber-9/+55
2020-05-12Pointer printing: do not print 0 offsetRalf Jung-89/+89
2020-05-12Rollup merge of #72128 - RalfJung:str-validity, r=oli-obkDylan DPC-8/+8
strings do not have to be valid UTF-8 any more Cc https://github.com/rust-lang/reference/pull/792 r? @oli-obk
2020-05-12Rollup merge of #71928 - mibac138:strikethrough, r=GuillaumeGomezDylan DPC-0/+6
Add strikethrough support to rustdoc Implements uncontroversial part of #71183. r? @GuillaumeGomez
2020-05-12strings do not have to be valid UTF-8 any moreRalf Jung-8/+8
2020-05-12Remove ty::UnnormalizedProjectionJack Huey-15/+8
2020-05-11Modify SimplifyArmIdentity so it can trigger on mir-opt-level=1Wesley Wiser-32/+717
I also added test cases to make sure the optimization can fire on all of these cases: ```rust fn case_1(o: Option<u8>) -> Option<u8> { match o { Some(u) => Some(u), None => None, } } fn case2(r: Result<u8, i32>) -> Result<u8, i32> { match r { Ok(u) => Ok(u), Err(i) => Err(i), } } fn case3(r: Result<u8, i32>) -> Result<u8, i32> { let u = r?; Ok(u) } ``` Without MIR inlining, this still does not completely optimize away the `?` operator because the `Try::into_result()`, `From::from()` and `Try::from_error()` calls still exist. This does move us a bit closer to that goal though because: - We can now run the pass on mir-opt-level=1 - We no longer depend on the copy propagation pass running which is unlikely to stabilize anytime soon.
2020-05-11Rollup merge of #72067 - jonas-schievink:fuel-warn, r=varkorDylan DPC-6/+10
Emit a warning when optimization fuel runs out `eprintln!` gets swallowed by Cargo too easily.
2020-05-11Rollup merge of #72052 - lcnr:const_pprint, r=ecstatic-morseDylan DPC-13/+13
display `ConstKind::Param`
2020-05-11Rollup merge of #72019 - matthewjasper:dont-skip-binder, r=davidtwcoDylan DPC-0/+36
Fix debug assertion in error code Closes #70813
2020-05-11Rollup merge of #72014 - GuillaumeGomez:deprecated-emoji, r=kinnison,ollie27Dylan DPC-2/+2
Deprecated emoji Fixes #67872. r? @kinnison cc @rust-lang/rustdoc
2020-05-11Fix hang in lexical_region_resolveMatthew Jasper-0/+7
2020-05-11Auto merge of #71953 - oli-obk:const_prop_deaggregates, r=wesleywiserbors-0/+284
Const prop aggregates even if partially or fully modified r? @wesleywiser cc @rust-lang/wg-mir-opt I'm moderately scared of this change, but I'm confident in having reviewed all the cases.
2020-05-10Emit a warning when optimization fuel runs outJonas Schievink-6/+10
`eprintln!` gets swallowed by Cargo too easily.
2020-05-10Auto merge of #72074 - RalfJung:rollup-1ns58no, r=RalfJungbors-977/+823
Rollup of 4 pull requests Successful merges: - #71840 (Rework MIR drop tree lowering) - #71882 (Update the `cc` crate) - #71945 (Sort "implementations on foreign types" section in the sidebar) - #72043 (Add missing backtick in E0569 explanation) Failed merges: r? @ghost
2020-05-10Rollup merge of #71840 - matthewjasper:drop-trees, r=oli-obkRalf Jung-977/+823
Rework MIR drop tree lowering This PR changes how drops are generated in MIR construction. This is the first half of the fix for #47949. Rather than generating the drops for a given unwind/break/continue/return/generator drop path as soon as they are needed, the required drops are recorded and get generated later. The motivation for this is * It simplifies the caching scheme, because it's now possible to walk up the currently scheduled drop tree to recover state. * The basic block order for MIR more closely resembles execution order. This PR also: * Highlights cleanup blocks in the graphviz MIR output. * Removes some unnecessary drop flag assignments.
2020-05-10Auto merge of #71775 - petrochenkov:crtcfg, r=matthewjasperbors-5/+2
Enable `cfg` predicate for `target_feature = "crt-static"` only if the target supports it That's what all other `target_feature`s do.
2020-05-10Auto merge of #72020 - alexcrichton:fix-incremental-linker-plugin-lto, r=oli-obkbors-0/+17
Fix disagreeement about CGU reuse and LTO This commit fixes an issue where the codegen backend's selection of LTO disagreed with what the codegen later thought was being done. Discovered in #72006 we have a longstanding issue where if `-Clinker-plugin-lto` in optimized mode is compiled incrementally it will always panic on the second compilation. The underlying issue turned out to be that the production of the original artifact determined that LTO should not be done (because it's being postponed to the linker) but the CGU reuse selection thought that LTO was done so it was trying to load pre-LTO artifacts which were never generated. The fix here is to ensure that the logic when generating code which determines what kind of LTO is being done is shared amongst the CGU reuse decision and the backend actually doing LTO. This means that they'll both be in agreement about whether the previous compilation did indeed produce incremental pre-LTO artifacts. Closes #72006
2020-05-09Fix disagreeement about CGU reuse and LTOAlex Crichton-0/+17
This commit fixes an issue where the codegen backend's selection of LTO disagreed with what the codegen later thought was being done. Discovered in #72006 we have a longstanding issue where if `-Clinker-plugin-lto` in optimized mode is compiled incrementally it will always panic on the second compilation. The underlying issue turned out to be that the production of the original artifact determined that LTO should not be done (because it's being postponed to the linker) but the CGU reuse selection thought that LTO was done so it was trying to load pre-LTO artifacts which were never generated. The fix here is to ensure that the logic when generating code which determines what kind of LTO is being done is shared amongst the CGU reuse decision and the backend actually doing LTO. This means that they'll both be in agreement about whether the previous compilation did indeed produce incremental pre-LTO artifacts. Closes #72006
2020-05-10Auto merge of #71557 - matthewjasper:mir-asymmetric-or-pattern, r=oli-obkbors-0/+51
Fix ICE for broken or-pattern in async fn closes #71297
2020-05-09display `ConstKind::Param`Bastian Kauschke-13/+13
2020-05-09Rollup merge of #71555 - cjgillot:nameless, r=matthewjasperRalf Jung-0/+1
Remove ast::{Ident, Name} reexports. The reexport of `Symbol` into `Name` confused me.
2020-05-09Rollup merge of #71185 - JohnTitor:run-fail, r=petrochenkovRalf Jung-140/+537
Move tests from `test/run-fail` to UI Fixes #65440 cc #65865 #65506 r? @nikomatsakis
2020-05-09Rollup merge of #69406 - jackh726:chalk-upgrade, r=nikomatsakisRalf Jung-0/+579
upgrade chalk and use chalk-solve/chalk-ir/chalk-rust-ir Reintegrate chalk into rustc. r? @nikomatsakis cc. @rust-lang/wg-traits
2020-05-09Bless mir-opt testsMatthew Jasper-974/+820
2020-05-09Defer creating drop trees in MIR lowering until leaving that scopeMatthew Jasper-3/+3
2020-05-09Auto merge of #72036 - Dylan-DPC:rollup-ca8b0ql, r=Dylan-DPCbors-2/+63
Rollup of 8 pull requests Successful merges: - #70834 (Add core::future::{pending,ready}) - #71839 (Make BTreeMap::new and BTreeSet::new const) - #71890 (Simplify the error Registry methods a little) - #71942 (Shrink `LocalDecl`) - #71947 (Dead-code pass highlights too much of impl functions) - #71981 (Fix `strip-priv-imports` pass name in the rustdoc documentation) - #72018 (Fix canonicalization links) - #72031 (Better documentation for io::Read::read() return value) Failed merges: r? @ghost
2020-05-09Rollup merge of #71947 - mibac138:dead-code, r=cramertjDylan DPC-2/+54
Dead-code pass highlights too much of impl functions Fixes #66627. Previous diagnostic: ``` error: method is never used: `unused_impl_fn_3` --> src/main.rs:28:5 | 28 | / fn unused_impl_fn_3( 29 | | var: i32, 30 | | ) { 31 | | println!("bar {}", var); 32 | | } | |_____^ ``` New diagnostic: ``` error: associated function is never used: `unused_impl_fn_3` --> $DIR/lint-dead-code-6.rs:13:8 | LL | fn unused_impl_fn_3( | ^^^^^^^^^^^^^^^^ ``` This makes associated functions in line with free-standing functions.
2020-05-09Rollup merge of #71839 - LG3696:master, r=cramertjDylan DPC-0/+9
Make BTreeMap::new and BTreeSet::new const
2020-05-08Auto merge of #71418 - hbina:rename_miri_undef, r=RalfJungbors-30/+30
Renamed "undef" -> "uninit" 1. InvalidUndefBytes -> InvalidUninitBytes 2. ScalarMaybeUndef -> ScalarMaybeUninit 3. UndefMask -> InitMask Related issue #71193
2020-05-08Rollup merge of #71710 - workingjubilee:jubilee-readd-test, r=nikomatsakisDylan DPC-0/+40
Test for zero-sized function items not ICEing Closes #30276. Again. Please give rustcake with no icing!
2020-05-08Fix debug assertion in error codeMatthew Jasper-0/+36
2020-05-08Add test for strikethrough in rustdocmibac138-0/+6
2020-05-08Add test for deprecated emojiGuillaume Gomez-2/+2
2020-05-08Rollup merge of #72008 - lcnr:patch-3, r=varkorDylan DPC-0/+29
Add const-generics test Taken from #71973 as this apparently already compiles. r? @varkor
2020-05-08Fix testsCamille GILLOT-0/+1