about summary refs log tree commit diff
path: root/src
AgeCommit message (Collapse)AuthorLines
2020-05-15Rollup merge of #72062 - overdrivenpotato:psp, r=jonas-schievinkDylan DPC-0/+111
Add built in PSP target This adds a new target, `mipsel-sony-psp`, corresponding to the Sony PSP. The linker script is necessary to handle special sections, which are required by the target. This has been tested with my [rust-psp] crate and I can confirm it works as intended. The linker script is taken from [here]. It has been slightly adapted to work with rust and LLD. The `stdarch` submodule was also updated in order for `libcore` to build successfully. [rust-psp]: https://github.com/overdrivenpotato/rust-psp [here]: https://github.com/pspdev/pspsdk/blob/master/src/base/linkfile.prx.in
2020-05-15Rollup merge of #71809 - marmeladema:fix-issue-71104, r=eddybDylan DPC-36/+41
Use `LocalDefId` in `DumpVisitor::nest_tables` This is a partial fix for #71104
2020-05-14Rollup merge of #72194 - doctorn:dispatch-from-dyn-ice, r=estebankDylan DPC-6/+52
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 #72191 - GuillaumeGomez:cleanup-e0589, r=Dylan-DPCDylan DPC-0/+2
Clean up E0589 explanation r? @Dylan-DPC
2020-05-14Rollup merge of #72170 - lcnr:lang_item, r=oli-obkDylan DPC-27/+38
use `require_lang_item` over `unwrap`. Does not yet replace all uses of `lang_items\(\)\.*\.unwrap\(\)`, as there are more than I expected :sweat_smile: Fixes #72099 r? @RalfJung *edit: The goal of this this PR is to change ICE from missing lang items to a fatal error.*
2020-05-14Rollup merge of #72141 - kornelski:dontsleep, r=joshtriplettDylan DPC-0/+4
Warn against thread::sleep in async fn I've seen `thread::sleep` wrecking havoc in async servers. There's already an [issue for clippy](https://github.com/rust-lang/rust-clippy/issues/4377), but the std docs could warn against it too.
2020-05-14Rollup merge of #72127 - jademcgough:long-error-explanation-E0228, ↵Dylan DPC-3/+48
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 #72126 - nnethercote:change-WorkProduct-saved_files, ↵Dylan DPC-42/+36
r=alexcrichton Change `WorkProduct::saved_files` to an `Option`. Because there is at most one file. r? @bjorn3
2020-05-14Rollup merge of #72087 - matthewjasper:regionck-hang, r=nikomatsakisDylan DPC-4/+23
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-4/+43
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-6/+52
2020-05-14Auto merge of #72187 - RalfJung:rollup-a7a9jdi, r=RalfJungbors-233/+222
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-14Rewrite link script from scratchMarko Mijalkovic-276/+21
This absolves previous licensing issues.
2020-05-14Clean up E0589 explanationGuillaume Gomez-0/+2
2020-05-14Rollup merge of #72183 - tmiasko:decr-strong-count, r=Mark-SimulacrumRalf Jung-3/+5
Fix Arc::decr_strong_count doc test
2020-05-14Rollup merge of #72169 - GuillaumeGomez:cleanup-e0582, r=Dylan-DPCRalf Jung-2/+2
Clean up E0582 explanation r? @Dylan-DPC
2020-05-14Rollup merge of #72163 - tshepang:nonexistent-link, r=matthewjasperRalf Jung-1/+1
docs: remove comment referencing non-existent method
2020-05-14Rollup merge of #72151 - ehuss:update-books, r=ehussRalf Jung-0/+0
Update books ## book 2 commits in e37c0e84e2ef73d3a4ebffda8011db6814a3b02d..6247be15a7f7509559f7981ee2209b9e0cc121df 2020-04-26 09:31:36 -0500 to 2020-05-03 10:55:09 -0500 - Fix guessing game listing explanation (rust-lang/book#2321) - Update ch01-01-installation.md (rust-lang/book#2325) ## edition-guide 1 commits in 8204c1d123472cd17f0c1c5c77300ae802eb0271..49270740c7a4bff2763e6bc730b191d45b7d5167 2020-04-09 18:55:50 -0700 to 2020-05-11 08:50:29 -0500 - Use rust-lang/rust linkchecker on CI. (rust-lang/edition-guide#197) ## embedded-book 1 commits in 40beccdf1bb8eb9184a2e3b42db8b8c6e394247f..366c50a03bed928589771eba8a6f18e0c0c01d23 2020-04-26 17:44:14 +0000 to 2020-05-07 09:04:42 +0000 - Add HAL patterns/guidelines/recommendations (rust-embedded/book#235) ## nomicon 3 commits in 4d2d275997746d35eabfc4d992dfbdcce2f626ed..d1517d4e3f29264c5c67bce2658516bb5202c800 2020-04-27 10:24:52 -0400 to 2020-05-12 13:47:00 -0400 - Rename Unique::empty to Unique::dangling - Use simpler link syntax - Replace catch_panic by catch_unwind ## reference 3 commits in ed22e6fbfcb6ce436e9ea3b4bb4a55b2fb50a57e..892b928b565e35d25b6f9c47faee03b94bc41489 2020-04-24 12:46:22 -0700 to 2020-05-11 11:13:51 -0700 - clarify that str data must still be initialized - remove language-level UB for non-UTF-8 str - Replace incorrect term "parent modules" with "ancestor modules". (rust-lang/reference#806) ## rust-by-example 2 commits in ffc99581689fe2455908aaef5f5cf50dd03bb8f5..ab072b14393cbd9e8a1d1d75879bf51e27217bbb 2020-04-24 15:05:04 -0300 to 2020-05-09 08:46:39 -0300 - Fix link of formatting traits (rust-lang/rust-by-example#1346) - Remove stale footnote (rust-lang/rust-by-example#1345)
2020-05-14Rollup merge of #72150 - jackh726:unnorm_projection, r=nikomatsakisRalf Jung-100/+24
Remove UnnormalizedProjection This was only used for the old chalk integration with chalk-engine r? @nikomatsakis
2020-05-14Rollup merge of #72138 - wesleywiser:add_doc_comment, r=matthewjasperRalf Jung-0/+3
Add doc comment for `rustc_middle::mir::mono::Linkage`
2020-05-14Rollup merge of #72137 - GuillaumeGomez:cleanup-e0581, r=Dylan-DPCRalf Jung-3/+6
Clean up E0581 explanation r? @Dylan-DPC
2020-05-14Rollup merge of #71964 - jcotton42:bootstrap_decode_none_windows, ↵Ralf Jung-3/+6
r=Mark-Simulacrum Fix bootstrap failing on win32 ```powershell python x.py -h # or really any x.py command ``` would fail with ``` info: Downloading and building bootstrap before processing --help command. See src/bootstrap/README.md for help with common commands. Updating only changed submodules Submodules updated in 0.15 seconds Traceback (most recent call last): File "x.py", line 11, in <module> bootstrap.main() File "C:\Users\Joshua\Projects\forks\rust\src\bootstrap\bootstrap.py", line 960, in main bootstrap(help_triggered) File "C:\Users\Joshua\Projects\forks\rust\src\bootstrap\bootstrap.py", line 925, in bootstrap build.build = args.build or build.build_triple() File "C:\Users\Joshua\Projects\forks\rust\src\bootstrap\bootstrap.py", line 731, in build_triple return default_build_triple() File "C:\Users\Joshua\Projects\forks\rust\src\bootstrap\bootstrap.py", line 184, in default_build_triple ostype = require(["uname", "-s"], exit=required).decode(default_encoding) AttributeError: 'NoneType' object has no attribute 'decode' ``` This PR defers the `decode` call until after we're sure `ostype` and `cputype` are not `None`, as they would be on Windows since `uname` doesn't exist
2020-05-14Rollup merge of #71909 - Dolpheyn:doc-from-trait-for-option, r=steveklabnikRalf Jung-0/+45
Document From trait for Option implementations Add documentation for ```From``` trait for ```std::option::Option``` implementations This PR solves a part of #51430 ( CC @skade ) This is my first PR ever in contributing for OSS. I'm happy to learn and make any changes if necessary :)
2020-05-14Rollup merge of #71870 - ltratt:more_specific_type_name_doc, r=kennytmRalf Jung-7/+9
Be slightly more precise about any::type_name()'s guarantees. The first commit in this PR rephrases the current documentation for `any::type_name()` to be a little more specific about the guarantees (or lack thereof) that this function makes. The second commit explicitly documents that lifetimes are currently not included in the output (since this bit me particularly hard recently).
2020-05-14Rollup merge of #71741 - RalfJung:pointer-print, r=oli-obkRalf Jung-99/+107
Pointer printing: do not print 0 offset r? @eddyb Cc @oli-obk
2020-05-14Rollup merge of #71525 - ldm0:intosug, r=Mark-SimulacrumRalf Jung-15/+14
`prefix` should not be mutable. Change the process from for loop to find, which makes the `prefix` able to be immutable.
2020-05-14Auto merge of #69756 - wesleywiser:simplify_try, r=oli-obkbors-73/+1032
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-14Auto merge of #72058 - RalfJung:no-dist-lldb, r=Mark-Simulacrumbors-180/+7
bootstrap: remove lldb dist packaging The lldb-preview rustup package is missing on every single target, and has never been shipped beyond x86_64-apple-darwin. It was removed in #62592 which landed around a year ago, and there's not been demand that we re-enable it since, so we're now removing support entirely to cleanup the code a bit. The hope is that this will also kill the useless "lldb-preview" row on https://rust-lang.github.io/rustup-components-history/.
2020-05-14Fix Arc::decr_strong_count doc testTomasz Miąsko-3/+5
2020-05-13Auto merge of #72118 - flip1995:clippyup, r=oli-obkbors-257/+1574
Update Clippy to 43a1777 Updates Clippy to https://github.com/rust-lang/rust-clippy/commit/43a1777b89cf6791f9e20878b4e5e3ae907867a5 We should establish a process on how often and when to update Clippy. (After X feature PRs? Once per week? Only on bug fixes and in the release week? ...?) r? @oli-obk
2020-05-13docs: fix linkTshepang Lekhonkhobe-1/+1
source https://github.com/rust-lang/rust/pull/72163#issuecomment-628234966
2020-05-13add spans to `require_lang_items`Bastian Kauschke-8/+14
2020-05-13Auto merge of #72013 - nnethercote:make-RawVec-grow-mostly-non-generic, ↵bors-149/+95
r=Amanieu Make `RawVec::grow` mostly non-generic. `cargo-llvm-lines` shows that, in various benchmarks, `RawVec::grow` is instantiated 10s or 100s of times and accounts for 1-8% of lines of generated LLVM IR. This commit moves most of `RawVec::grow` into a separate function that isn't parameterized by `T`, which means it doesn't need to be instantiated many times. This reduces compile time significantly. r? @ghost
2020-05-13Update src/libcore/option.rsFaris Sufyan-0/+2
Co-authored-by: Steve Klabnik <steve@steveklabnik.com>
2020-05-13Update src/libcore/option.rsFaris Sufyan-0/+1
Co-authored-by: Steve Klabnik <steve@steveklabnik.com>
2020-05-13Update src/libcore/option.rsFaris Sufyan-1/+1
Co-authored-by: Steve Klabnik <steve@steveklabnik.com>
2020-05-13Update src/libcore/option.rsFaris Sufyan-0/+1
Co-authored-by: Steve Klabnik <steve@steveklabnik.com>
2020-05-13Update src/libcore/option.rsFaris Sufyan-0/+1
Co-authored-by: Steve Klabnik <steve@steveklabnik.com>
2020-05-13Update src/libcore/option.rsFaris Sufyan-1/+1
Co-authored-by: Steve Klabnik <steve@steveklabnik.com>
2020-05-13Update src/libcore/option.rsFaris Sufyan-0/+1
Co-authored-by: Steve Klabnik <steve@steveklabnik.com>
2020-05-13Update src/libcore/option.rsFaris Sufyan-1/+1
Co-authored-by: Steve Klabnik <steve@steveklabnik.com>
2020-05-13use `require_lang_item` over `unwrap`.Bastian Kauschke-26/+31
2020-05-13Clean up E0582 explanationGuillaume Gomez-2/+2
2020-05-13Auto merge of #71451 - estebank:suggest-super-trait-constraint, r=nikomatsakisbors-100/+282
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-3/+48
2020-05-12review commentsEsteban Küber-2/+9
2020-05-12Update booksEric Huss-0/+0
2020-05-12fix test output after rebaseEsteban Küber-1/+1
2020-05-12Increase verbosity of bound restriction suggestionsEsteban Küber-123/+215
- Make the bound restriction suggestion `span_suggestion_verbose`. - Fix whitespace typo.