about summary refs log tree commit diff
path: root/src
AgeCommit message (Collapse)AuthorLines
2020-11-20Auto merge of #79192 - tmiasko:naked-noinline, r=oli-obkbors-0/+30
Never inline naked functions The `#[naked]` attribute disabled prologue / epilogue emission for the function and it is responsibility of a developer to provide them. The compiler is no position to inline such functions correctly. Disable inlining of naked functions at LLVM and MIR level. Closes #60919.
2020-11-20Auto merge of #78088 - fusion-engineering-forks:panic-fmt-lint, r=estebankbors-141/+160
Add lint for panic!("{}") This adds a lint that warns about `panic!("{}")`. `panic!(msg)` invocations with a single argument use their argument as panic payload literally, without using it as a format string. The same holds for `assert!(expr, msg)`. This lints checks if `msg` is a string literal (after expansion), and warns in case it contained braces. It suggests to insert `"{}", ` to use the message literally, or to add arguments to use it as a format string. ![image](https://user-images.githubusercontent.com/783247/96643867-79eb1080-1328-11eb-8d4e-a5586837c70a.png) This lint is also a good starting point for adding warnings about `panic!(not_a_string)` later, once [`panic_any()`](https://github.com/rust-lang/rust/pull/74622) becomes a stable alternative.
2020-11-20Never inline naked functionsTomasz Miąsko-0/+30
The `#[naked]` attribute disabled prologue / epilogue emission for the function and it is responsibility of a developer to provide them. The compiler is no position to inline such functions correctly. Disable inlining of naked functions at LLVM and MIR level.
2020-11-19Rollup merge of #79193 - tmiasko:revert-78969-normalize, r=davidtwcoDylan DPC-14/+8
Revert #78969 "Normalize function type during validation" Closes #79066. Reopens #78442.
2020-11-19Rollup merge of #79185 - petrochenkov:derattr2, r=Aaron1011Dylan DPC-267/+204
expand/resolve: Pre-requisites to "Turn `#[derive]` into a regular macro attribute" Miscellaneous refactorings and error reporting changes extracted from https://github.com/rust-lang/rust/pull/79078. Unlike https://github.com/rust-lang/rust/pull/79078 this PR doesn't make any observable changes to the language or library. r? ```@Aaron1011```
2020-11-19Rollup merge of #79183 - cuviper:compiletest-test-sysroot, r=Mark-SimulacrumDylan DPC-1/+4
Make compiletest testing use the local sysroot We already set `compiletest` to use the local sysroot in #68019, but that missed the configuration for testing `compiletest` itself.
2020-11-19Rollup merge of #79181 - aDotInTheVoid:provided-method-source-link, ↵Dylan DPC-42/+55
r=jyn514,GuillaumeGomez rustdoc: add [src] links to methods on a trait's page Closes #45150 ![image](https://user-images.githubusercontent.com/28781354/99565541-aba4d500-29c3-11eb-99c7-11c1f91584e9.png) ### Caveats - The way I've implemented it, links are also provided for required methods, that just link to the signature in the code. I'm not sure if this is the desired behaviour. ![image](https://user-images.githubusercontent.com/28781354/99566222-849ad300-29c4-11eb-9897-08cc5842954f.png) - I'm not sure if the css changes are correct. I inspected them visualy on firefox on desktop, and they seem to be fine. - I can't tell how `src/librustdoc/html/render/mod.rs` is structured, so I probably
2020-11-19Rollup merge of #79177 - fanzier:drop-order-test, r=RalfJungDylan DPC-0/+44
Test drop order for (destructuring) assignments Add a test that checks whether the drop order of `let` bindings is consistent with the drop order of the corresponding destructuring assignments. Thanks to ```@RalfJung``` for the suggesting this test ([here](https://github.com/rust-lang/rust/pull/79016#issuecomment-727608732)) and an implementation! r? ```@RalfJung```
2020-11-19Clippy: Match on assert!() expansions without an inner block.Mara Bos-2/+5
2020-11-19Remove the clippy::panic-params lint.Mara Bos-134/+4
Rustc itself now warns for all cases that triggered this lint.
2020-11-19Auto merge of #79200 - Dylan-DPC:rollup-su689pq, r=Dylan-DPCbors-575/+370
Rollup of 14 pull requests Successful merges: - #78961 (Make bad "rust-call" arguments no longer ICE) - #79082 (Improve the diagnostic for when an `fn` contains qualifiers inside an `extern` block.) - #79090 (libary: Forward compiler-builtins "asm" and "mangled-names" feature) - #79094 (Add //ignore-macos to pretty-std-collections.rs) - #79101 (Don't special case constant operands when lowering intrinsics) - #79102 (Add two regression tests) - #79110 (Remove redundant notes in E0275) - #79116 (compiletest: Fix a warning in debuginfo tests on windows-gnu) - #79117 (add optimization fuel checks to some mir passes) - #79147 (Highlight MIR as Rust on GitHub) - #79149 (Move capture lowering from THIR to MIR) - #79155 (fix handling the default config for profiler and sanitizers) - #79156 (Allow using `download-ci-llvm` from directories other than the root) - #79164 (Permit standalone generic parameters as const generic arguments in macros) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2020-11-19expand: Stop derive expansion un unexpected targets earlyVadim Petrochenkov-63/+6
Collect derive placeholders using `collect` instead of `push`
2020-11-19resolve: Centralize some error reporting for unexpected macro resolutionsVadim Petrochenkov-196/+196
2020-11-19expand: Tell built-in macros whether we are currently in forced expansion modeVadim Petrochenkov-8/+2
2020-11-19Rollup merge of #79164 - varkor:unbraced-single-segment-const-arguments, ↵Dylan DPC-21/+36
r=petrochenkov Permit standalone generic parameters as const generic arguments in macros Fixes https://github.com/rust-lang/rust/issues/79127. r? ```@petrochenkov```
2020-11-19Rollup merge of #79156 - jyn514:relative-llvm, r=Mark-SimulacrumDylan DPC-2/+5
Allow using `download-ci-llvm` from directories other than the root Previously, bootstrap.py would attempt to find the LLVM commit from `src/llvm-project`. However, it assumed it was always being run from the top-level directory, which isn't always the case. Before: ``` downloading https://ci-artifacts.rust-lang.org/rustc-builds//rust-dev-nightly-x86_64-unknown-linux-gnu.tar.gz curl: (22) The requested URL returned error: 404 failed to run: curl -# -y 30 -Y 10 --connect-timeout 30 --retry 3 -Sf -o /tmp/tmppyh4w8 https://ci-artifacts.rust-lang.org/rustc-builds//rust-dev-nightly-x86_64-unknown-linux-gnu.tar.gz Build completed unsuccessfully in 0:00:02 ``` After: ``` downloading https://ci-artifacts.rust-lang.org/rustc-builds/430feb24a46993e5073c1bb1b39da190d83fa2bf/rust-dev-nightly-x86_64-unknown-linux-gnu.tar.gz ###################################################################################################################################################################### 100.0% extracting /home/joshua/rustc/src/bootstrap/build/cache/llvm-430feb24a46993e5073c1bb1b39da190d83fa2bf-False/rust-dev-nightly-x86_64-unknown-linux-gnu.tar.gz ``` r? ```@Mark-Simulacrum``` cc ```@pnkfelix```
2020-11-19Rollup merge of #79155 - 12101111:fix-profiler-config, r=Mark-SimulacrumDylan DPC-8/+8
fix handling the default config for profiler and sanitizers #78354 don't handle the case that user don't add any target-specific config in `[target.*]` of `config.toml`: ```toml changelog-seen = 2 [llvm] link-shared = true [build] sanitizers = true profiler = true [install] [rust] [dist] ``` The previes code handle the default config in `Config::prase()`: ```rust target.sanitizers = cfg.sanitizers.unwrap_or(build.sanitizers.unwrap_or_default()); target.profiler = cfg.profiler.unwrap_or(build.profiler.unwrap_or_default()); config.target_config.insert(TargetSelection::from_user(&triple), target); ``` In this case, `toml.target` don't contain any target, so the above code won't execute. Instead, a default `Target` is insert in https://github.com/rust-lang/rust/blob/c919f490bbcd2b29b74016101f7ec71aaa24bdbb/src/bootstrap/sanity.rs#L162-L166 The default value for `bool` is false, hence the issue in #79124 This fix change the type of `sanitizers` and `profiler` to `Option<bool>`, so the default value is `None`, and fallback config is handled in `Config::sanitizers_enabled` and `Config::profiler_enabled` fix #79124 cc `@Mark-Simulacrum` `@richkadel`
2020-11-19Rollup merge of #79117 - cjkenn:mir-fuel, r=oli-obkDylan DPC-2/+2
add optimization fuel checks to some mir passes Fixes #77402 Inserts a bunch of calls to `consider_optimizing`. Note that `consider_optimizing` is the method that actually decrements the fuel count, so the point at which it's called is when the optimization takes place, from a fuel perspective. This means that where we call it has some thought behind it: 1. We probably don't want to decrement the fuel count before other simple checks, otherwise we count an optimization as being performed even if nothing was mutated (ie. it returned early). 2. In cases like `InstCombine`, where we gather optimizations in a pass and then mutate values, we probably would rather skip the gathering pass for performance reasons rather than skip the mutations afterwards.
2020-11-19Rollup merge of #79116 - petrochenkov:gdbwarn, r=Mark-SimulacrumDylan DPC-1/+2
compiletest: Fix a warning in debuginfo tests on windows-gnu The warning looked like this for me: ``` Warning: C:msys64homewerust./src/etc: No such file or directory. ``` It didn't affect actual testing because we don't currently emit gdb pretty-printer information into executables on windows-gnu.
2020-11-19Rollup merge of #79110 - estebank:issue-58964, r=oli-obkDylan DPC-506/+93
Remove redundant notes in E0275 Fix #58964.
2020-11-19Rollup merge of #79102 - Alexendoo:ice-regression-tests, r=Mark-SimulacrumDylan DPC-0/+90
Add two regression tests For #78721 and #78722
2020-11-19Rollup merge of #79101 - tmiasko:lower-func-type, r=jonas-schievinkDylan DPC-0/+38
Don't special case constant operands when lowering intrinsics
2020-11-19Rollup merge of #79094 - est31:ignore_macos, r=pietroalbiniDylan DPC-0/+1
Add //ignore-macos to pretty-std-collections.rs On macOS the test is flaky and sometimes fails, sometimes succeeds on CI. This is no fix for the underlying issue, but I feel the workaround is worth it as the issue makes it harder to get things merged into master. cc #78665
2020-11-19Rollup merge of #79082 - ThePuzzlemaker:issue-78941-fix, r=estebankDylan DPC-21/+42
Improve the diagnostic for when an `fn` contains qualifiers inside an `extern` block. This mitigates #78941. As suggested by ```@estebank,``` `span_suggestion` was replaced with `span_suggestion_verbose` for this specific diagnostic.
2020-11-19Rollup merge of #78961 - CraftSpider:22565, r=oli-obkDylan DPC-14/+53
Make bad "rust-call" arguments no longer ICE The simplest of bad rust-call definitions will no longer cause an ICE. There is a FIXME added for future work, as I wanted to get this easy fix in before trying to either add a hack or mess with the whole obligation system fixes #22565
2020-11-19Auto merge of #79198 - RalfJung:miri, r=RalfJungbors-7/+9
update Miri Fixes https://github.com/rust-lang/rust/issues/79176 Fixes https://github.com/rust-lang/rust/issues/79129 Cc `@rust-lang/miri` r? `@ghost`
2020-11-19update print fuel test output again...cjkenn-1/+1
2020-11-19Auto merge of #78449 - Aaron1011:fix/libstd-semi, r=dtolnaybors-1/+1
Remove semicolon from internal `err` macro This macro is used in expression position (a match arm), and only compiles because of #33953 Regardless of what happens with that issue, this makes the usage of the macro less confusing at the call site.
2020-11-19update MiriRalf Jung-7/+9
2020-11-19Auto merge of #79068 - DevJPM:ci-llvm-9-fix, r=pietroalbinibors-13/+4
Remove Hacks and Fixmes from PR CI's LLVM-9 Container Now with LLVM 9 being the minimum supported version (thanks to #78848 ), we can finally remove the hacks in the dockerfile. This wasn't in the main PR bumping the version as I didn't quite understand what's going on and needed here. Relevant issues and PRs: - Issue #69823 - PR #70989 I hope I actually adressed things correctly here?
2020-11-19Revert "Normalize function type during validation"Tomasz Miąsko-14/+8
This reverts commit d486bfcbff107e8a6769e00c59d02b13c664b6ee.
2020-11-18Bump stage0 rustfmt to nightly-2020-11-19Aaron Hill-1/+1
This pulls in https://github.com/rust-lang/rustfmt/pull/4507, allowing us to remove a semicolon in an internal libstd macro
2020-11-18Auto merge of #79106 - tmiasko:inline-hint, r=nagisa,eddybbors-0/+31
Fix setting inline hint based on `InstanceDef::requires_inline` For instances where `InstanceDef::requires_inline` is true, an attempt is made to set an inline hint though a call to the `inline` function. The attempt is ineffective, since all attributes will be usually removed by the second call. Fix the issue by applying the attributes only once, with user provided attributes having a priority when provided. Closes #79108.
2020-11-18Make compiletest testing use the local sysrootJosh Stone-1/+4
We already set `compiletest` to use the local sysroot in #68019, but that missed the configuration for testing `compiletest` itself.
2020-11-18add [src] links to methods on a trait's pageNixon Enraght-Moony-24/+43
2020-11-18Auto merge of #78995 - Nadrieril:clean-empty-match, r=varkorbors-57/+176
Handle empty matches cleanly in exhaustiveness checking This removes the special-casing of empty matches that was done in `check_match`. This fixes most of https://github.com/rust-lang/rust/issues/55123. Somewhat unrelatedly, I also made `_match.rs` more self-contained, because I think it's cleaner. r? `@varkor` `@rustbot` modify labels: +A-exhaustiveness-checking
2020-11-18Test drop order for (destructuring) assignmentsFabian Zaiser-0/+44
2020-11-18Account for indirect cyclic requirementsEsteban Küber-1/+89
2020-11-18Remove redundant notes in E0275Esteban Küber-505/+4
Fix #58964.
2020-11-18change print-fuel ui test to check-passcjkenn-2/+2
2020-11-18Rollup merge of #79158 - lcnr:lazy-norm-coerce, r=oli-obkMara Bos-18/+31
type is too big -> values of the type are too big strictly speaking, `[u8; usize::MAX]` or even `[[[u128; usize::MAX]; usize::MAX]; usize::MAX]` are absolutely fine types as long as you don't try to deal with any values of it. This error message seems to cause some confusion imo, for example in https://github.com/rust-lang/rust/pull/79135#issuecomment-729361380 so I would prefer us to be more precise here. See the added test case which uses one of these types without causing an error. r? ``@oli-obk``
2020-11-18Rollup merge of #79145 - camelid:clippy-fix-panics, r=flip1995Mara Bos-54/+106
Fix handling of panic calls This should make Clippy more resilient and will unblock #78343. This PR is made against rust-lang/rust to avoid the need for a subtree sync at ``@flip1995's`` suggestion in rust-lang/rust-clippy#6310. r? ``@flip1995`` cc ``@m-ou-se``
2020-11-18Rollup merge of #79133 - pietroalbini:simplify-stage0, r=Mark-SimulacrumMara Bos-31/+9
bootstrap: use the same version number for rustc and cargo Historically the stable tarballs were named after the version number ofthe specific tool, instead of the version number of Rust. For example, both of the following tarballs were part of the same release: rustc-1.48.0-x86_64-unknown-linux-gnu.tar.xz cargo-0.49.0-x86_64-unknown-linux-gnu.tar.xz PR #77336 changed the dist code to instead use Rust's version number for all the tarballs, regardless of the tool they contain: rustc-1.48.0-x86_64-unknown-linux-gnu.tar.xz cargo-1.48.0-x86_64-unknown-linux-gnu.tar.xz Because of that there is no need anymore to have a separate `cargo` field in `src/stage0.txt`, as the Cargo version will always be the same as the rustc version. This PR removes the field, simplifying the code and the maintenance work required while producing releases. r? ``@Mark-Simulacrum``
2020-11-18Rollup merge of #78999 - petrochenkov:deprid, r=eddybMara Bos-1/+11
stability: More precise location for deprecation lint on macros One missing piece of https://github.com/rust-lang/rust/pull/73178.
2020-11-18move fuel checks to later points in instcombine and const_prop, add opt ↵cjkenn-2/+2
level flag to test
2020-11-18Add tests for multi-segment paths in const generic argumentsvarkor-12/+49
2020-11-18Permit standalone generic parameters as const generic arguments in macrosvarkor-25/+3
2020-11-18Extract write_srclink to its own methodNixon Enraght-Moony-30/+24
2020-11-18change error for `LayoutErr::SizeOverflow`Bastian Kauschke-18/+31
2020-11-18Revert "Auto merge of #79132 - pietroalbini:beta-next, r=Mark-Simulacrum"Pietro Albini-31/+36
This was landed on master instead of beta!