- 10 5月, 2021 12 次提交
-
-
由 Dylan DPC 提交于
Fix suggestions for missing return type lifetime specifiers This pull request aims to fix #84592. The issue is that the current code seems to assume that there is only a single relevant span pointing to the missing lifetime, and only looks at the first one: https://github.com/rust-lang/rust/blob/e5f83d24aee866a14753a7cedbb4e301dfe5bef5/compiler/rustc_resolve/src/late/lifetimes.rs#L2959 This is incorrect, though, and leads to incorrect error messages and invalid suggestions. For instance, the example from #84592: ```rust struct TwoLifetimes<'x, 'y> { x: &'x (), y: &'y (), } fn two_lifetimes_needed(a: &(), b: &()) -> TwoLifetimes<'_, '_> { TwoLifetimes { x: &(), y: &() } } ``` currently leads to: ``` error[E0106]: missing lifetime specifiers --> src/main.rs:6:57 | 6 | fn two_lifetimes_needed(a: &(), b: &()) -> TwoLifetimes<'_, '_> { | --- --- ^^ expected 2 lifetime parameters | = help: this function's return type contains a borrowed value, but the signature does not say whether it is borrowed from `a` or `b` help: consider introducing a named lifetime parameter | 6 | fn two_lifetimes_needed<'a>(a: &'a (), b: &'a ()) -> TwoLifetimes<'_<'a, 'a>, '_> { | ^^^^ ^^^^^^ ^^^^^^ ^^^^^^^^^^ ``` There are two problems: - The error message is wrong. There is only _one_ lifetime parameter expected at the location pointed to by the error message (and another one at a separate location). - The suggestion is incorrect and will not lead to correct code. With the changes in this PR, I get the following output: ``` error[E0106]: missing lifetime specifiers --> p.rs:6:57 | 6 | fn two_lifetimes_needed(a: &(), b: &()) -> TwoLifetimes<'_, '_> { | --- --- ^^ ^^ expected named lifetime parameter | | | expected named lifetime parameter | = help: this function's return type contains a borrowed value, but the signature does not say whether it is borrowed from `a` or `b` help: consider introducing a named lifetime parameter | 6 | fn two_lifetimes_needed<'a>(a: &'a (), b: &'a ()) -> TwoLifetimes<'a, 'a> { | ^^^^ ^^^^^^ ^^^^^^ ^^ ^^ error: aborting due to previous error For more information about this error, try `rustc --explain E0106`. ``` Mainly, I changed `add_missing_lifetime_specifiers_label()` to receive a _vector_ of spans (and counts) instead of just one, and adjusted its body accordingly.
-
由 Fabian Wolff 提交于
-
由 bors 提交于
Fix duplicate unknown lint errors Fixes rust-lang/rust-clippy#6602
-
由 bors 提交于
Fix typo
-
由 bors 提交于
Migrate top doc and non-exhaustive toggles to details tag Fixes #83332. r? `@jsha`
-
由 bors 提交于
Add primary marker on codegen unit and generate main wrapper on primary codegen. This is the codegen part of changes extracted from #84062. This add a marker called `primary` on each codegen units, where exactly one codegen unit will be `primary = true` at a time. This specific codegen unit will take charge of generating `main` wrapper when `main` is imported from a foreign crate after the implementation of RFC 1260. cc #28937 I'm not sure who should i ask for review for codegen changes, so feel free to reassign. r? `@nagisa`
-
由 Guillaume Gomez 提交于
-
由 Guillaume Gomez 提交于
-
由 bors 提交于
Add default search path to `Target::search()` The function `Target::search()` accepts a target triple and returns a `Target` struct defining the requested target. There is a `// FIXME 16351: add a sane default search path?` comment that indicates it is desirable to include some sort of default. This was raised in https://github.com/rust-lang/rust/issues/16351 which was closed without any resolution. https://github.com/rust-lang/rust/pull/31117 was proposed, however that has platform-specific logic that is unsuitable for systems without `/etc/`. This patch implements the suggestion raised in https://github.com/rust-lang/rust/issues/16351#issuecomment-180878193 where a `target.json` file may be placed in `$(rustc --print sysroot)/lib/rustlib/<target-triple>/target.json`. This allows shipping a toolchain distribution as a single file that gets extracted to the sysroot.
-
由 Fabian Wolff 提交于
-
由 bors 提交于
Avoid predecessors having Drop impls Should be a simple win - but let's make sure with perf.
-
由 bors 提交于
Improve support for NewPM This adds various missing bits of support for NewPM and allows us to successfully run stage 2 tests with NewPM enabled. This does not yet enable NewPM by default, as there are still known issue on LLVM 12 (such as a weak fat LTO pipeline). The plan is to make the switch after we update to LLVM 13.
-
- 09 5月, 2021 15 次提交
-
-
由 bors 提交于
Remove dead or useless code from Session This is a more principled follow-up to https://github.com/rust-lang/rust/pull/83185#discussion_r601753839. - Rename `Parser::span_fatal_err` -> `Parser::span_err` - Remove some unnecessary uses of `struct_span_fatal` - Make `Diagnostic::span_fatal` unconditionally raise an error - Add `impl Deref<Target = Handler>` for Session and remove all functions that are exactly the same as their Handler counterparts - Note why `Handler::fatal` is different from `Sesssion::fatal` - Remove unused `opt_span_warn` function r? `@oli-obk` or `@estebank`
-
由 bors 提交于
Remove `FakeDefId::expect_local()` This function returned a fake `DefIndex`, with no indication that it was fake, when it was provided with a `FakeDefId::Fake`. Every use of the function uses the returned `DefIndex` in a call to `tcx.local_def_id_to_hir_id()`, which I'm pretty sure would panic if it were given a fake `DefIndex`. I removed the function and replaced all calls to it with a call to `expect_real()` followed by `DefId::expect_local()` (that's a function on the *real* `DefId`).
-
由 hi-rustin 提交于
-
由 Joshua Nelson 提交于
-
由 Joshua Nelson 提交于
-
由 Joshua Nelson 提交于
It had no callers which didn't immediately call `raise()`, and this unifies the behavior with `Session`.
-
由 Joshua Nelson 提交于
All of them immediately called `emit()` then `raise()`, so they could just call `span_fatal` directly.
-
由 Joshua Nelson 提交于
The name was misleading, it wasn't actually a fatal error.
-
由 crlf0710 提交于
-
由 bors 提交于
Enable `-W semicolon_in_expressions_from_macros` in bootstrap Now that stdarch has been updated, we can do this without breaking the build.
-
由 Camelid 提交于
Now, in the case that the function is not inlined, the panic location will be the caller's location, which is more helpful since the panic is not `expect_real()`'s fault.
-
由 Camelid 提交于
This function returned a fake `DefIndex`, with no indication that it was fake, when it was provided with a `FakeDefId::Fake`. Every use of the function uses the returned `DefIndex` in a call to `tcx.local_def_id_to_hir_id()`, which I'm pretty sure would panic if it were given a fake `DefIndex`. I removed the function and replaced all calls to it with a call to `expect_real()` followed by `DefId::expect_local()` (that's a function on the *real* `DefId`).
-
由 Aaron Hill 提交于
Now that stdarch has been updated, we can do this without breaking the build.
-
由 bors 提交于
Bump stdarch submodule Major changes: - More AVX-512 intrinsics. - More ARM & AArch64 NEON intrinsics. - Updated unstable WASM intrinsics to latest draft standards. - Intrinsics that previously used `#[rustc_args_required_const]` now use const generics. See #83167 for more details. - `std_detect` is now a separate crate instead of a submodule of `std`.
-
由 Amanieu d'Antras 提交于
-
- 08 5月, 2021 13 次提交
-
-
由 bors 提交于
Update Miri Fixes #85027 r? `@RalfJung`
-
由 hyd-dev 提交于
-
由 bors 提交于
rustdoc: Stop special casing `broken_intra_doc_links` unnecessarily
-
由 Nikita Popov 提交于
This updates the LLVM submodule with recent LLVM 12.x fixes. In particular, it resolves an assertion failure when targeting AArch64 at O0.
-
由 Nikita Popov 提交于
And report an error if parsing the additional pass pipeline fails. Threading through the error accounts for most of the changes here.
-
由 Nikita Popov 提交于
This doesn't seem to be necessary anymore, although I don't know at which point or why that changed. Forcing -O1 makes some tests fail under NewPM, because NewPM also performs inlining at -O1, so it ends up performing much more optimization in practice than before.
-
由 Nikita Popov 提交于
This causes an assertion failure under NewPM, because it also ends up disabling the NameAnonGlobals pass. Instead pass -Copt-level=0 to disable optimizations. If that should be insufficient, we can use -C no-prepopulate-passes.
-
由 Nikita Popov 提交于
-
由 Nikita Popov 提交于
Don't use "passes" for this purpose, explicitly insert it into the correct place in the pipeline instead.
-
由 Nikita Popov 提交于
To allow it to have an LLVM version dependent default.
-
由 bors 提交于
Update cargo 7 commits in f3e13226d6d17a2bc5f325303494b43a45f53b7f..e51522ab3db23b0d8f1de54eb1f0113924896331 2021-04-30 21:50:27 +0000 to 2021-05-07 21:29:52 +0000 - Add CARGO_TARGET_TMPDIR env var for integration tests & benches (rust-lang/cargo#9375) - Bump to 0.55.0, update changelog (rust-lang/cargo#9464) - Some updates to the unstable documentation (rust-lang/cargo#9457) - Add CARGO_PROFILE_<name>_SPLIT_DEBUGINFO to env docs. (rust-lang/cargo#9456) - Add `report` subcommand. (rust-lang/cargo#9438) - Respect Cargo.toml `[package.exclude]` even not in a git repo. (rust-lang/cargo#9186) - Document the other crates in the codebase in the contrib guide. (rust-lang/cargo#9439)
-
由 bors 提交于
Update RLS This mostly just includes https://github.com/rust-lang/rls/commit/e33f4e68496b296dedb100e297dc4451f169b2b3 so that this fixes #85055 (clippy-related breakage).
-
由 Mark Rousskov 提交于
-