]> git.lizzy.rs Git - rust.git/log
rust.git
3 years agoUpdate compiler/rustc_middle/src/ty/normalize_erasing_regions.rs
Niko Matsakis [Sun, 4 Jul 2021 16:37:25 +0000 (12:37 -0400)]
Update compiler/rustc_middle/src/ty/normalize_erasing_regions.rs

Co-authored-by: Rémy Rakic <remy.rakic+github@gmail.com>
3 years agoremove some ad-hoc has_infer_types checks that aren't needed anymore
Niko Matsakis [Sun, 4 Jul 2021 15:43:22 +0000 (11:43 -0400)]
remove some ad-hoc has_infer_types checks that aren't needed anymore

3 years agobe conservative in has_significant_drop
Niko Matsakis [Sun, 4 Jul 2021 15:41:40 +0000 (11:41 -0400)]
be conservative in has_significant_drop

3 years agoallow inference vars in type_implements_trait
Niko Matsakis [Sun, 4 Jul 2021 15:26:32 +0000 (11:26 -0400)]
allow inference vars in  type_implements_trait

3 years agoremove unused Option
Niko Matsakis [Sun, 4 Jul 2021 15:09:32 +0000 (11:09 -0400)]
remove unused Option

3 years agointroduce helper function
Niko Matsakis [Sun, 4 Jul 2021 02:15:32 +0000 (22:15 -0400)]
introduce helper function

3 years agoadd test case
Niko Matsakis [Sat, 3 Jul 2021 22:32:26 +0000 (18:32 -0400)]
add test case

3 years agoAuto merge of #80182 - in42:stack_trace, r=tmandry
bors [Fri, 2 Jul 2021 05:40:51 +0000 (05:40 +0000)]
Auto merge of #80182 - in42:stack_trace, r=tmandry

Implement printing of stack traces on LLVM segfaults and aborts

Implement #79153

Based on discussion, try to extend the rust_backtrace=1 feature to handle segfault or aborts in the llvm backend

3 years agoAuto merge of #86782 - flip1995:clippyup, r=Manishearth
bors [Fri, 2 Jul 2021 02:56:45 +0000 (02:56 +0000)]
Auto merge of #86782 - flip1995:clippyup, r=Manishearth

Update Clippy

Biweekly Clippy Update

r? `@Manishearth`

3 years agoUse signal handler only on supported platforms
Tyler Mandry [Fri, 2 Jul 2021 00:20:04 +0000 (00:20 +0000)]
Use signal handler only on supported platforms

3 years agoAuto merge of #86777 - tmiasko:estimate-terminators, r=estebank
bors [Fri, 2 Jul 2021 00:15:58 +0000 (00:15 +0000)]
Auto merge of #86777 - tmiasko:estimate-terminators, r=estebank

Include terminators in instance size estimate

For example, drop glue generated for struct below, doesn't have any
statements, only terminators. Previously it received an estimate of 0,
the new estimate is 13 (6+5 drop terminators, +1 resume, +1 return).

```rust
struct S {
    a: String,
    b: String,
    c: String,
    d: String,
    e: String,
    f: String,
}
```

Originally reported in https://github.com/rust-lang/rust/issues/69382#issue-569392141

3 years agoAuto merge of #86791 - JohnTitor:rollup-96ltzpz, r=JohnTitor
bors [Thu, 1 Jul 2021 21:45:19 +0000 (21:45 +0000)]
Auto merge of #86791 - JohnTitor:rollup-96ltzpz, r=JohnTitor

Rollup of 7 pull requests

Successful merges:

 - #86148 (Check the number of generic lifetime and const parameters of intrinsics)
 - #86659 (fix(rustdoc): generics search)
 - #86768 (Add myself to mailmap)
 - #86775 (Test for const trait impls behind feature gates)
 - #86779 (Allow anyone to add or remove any label starting with perf-)
 - #86783 (Move Mutex::unlock to T: ?Sized)
 - #86785 (proc_macro/bridge: Remove dead code Slice type)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup

3 years agoRollup merge of #86785 - lf-:dead-code, r=Mark-Simulacrum
Yuki Okushi [Thu, 1 Jul 2021 21:20:34 +0000 (06:20 +0900)]
Rollup merge of #86785 - lf-:dead-code, r=Mark-Simulacrum

proc_macro/bridge: Remove dead code Slice type

See https://github.com/rust-lang/rust/pull/85390#discussion_r662464868

3 years agoRollup merge of #86783 - mark-i-m:mutex-drop-unsized, r=Xanewok
Yuki Okushi [Thu, 1 Jul 2021 21:20:33 +0000 (06:20 +0900)]
Rollup merge of #86783 - mark-i-m:mutex-drop-unsized, r=Xanewok

Move Mutex::unlock to T: ?Sized

r? ``@mbrubeck``

cc https://github.com/rust-lang/rust/issues/81872

3 years agoRollup merge of #86779 - rylev:all-perf-labels, r=Mark-Simulacrum
Yuki Okushi [Thu, 1 Jul 2021 21:20:32 +0000 (06:20 +0900)]
Rollup merge of #86779 - rylev:all-perf-labels, r=Mark-Simulacrum

Allow anyone to add or remove any label starting with perf-

In order to fully realize planned changes to the performance tracking process, we'd like to allow anyone to change the perf related labels.

r? ``@Mark-Simulacrum``

3 years agoRollup merge of #86775 - fee1-dead:impl-const-test, r=jonas-schievink
Yuki Okushi [Thu, 1 Jul 2021 21:20:31 +0000 (06:20 +0900)]
Rollup merge of #86775 - fee1-dead:impl-const-test, r=jonas-schievink

Test for const trait impls behind feature gates

 - Make the previous cross-crate tests use revisions instead of being separate files
 - Added test for gating const trait impls.

cc ``@oli-obk`` ``@jonas-schievink``

3 years agoRollup merge of #86768 - fee1-dead:patch-2, r=bjorn3
Yuki Okushi [Thu, 1 Jul 2021 21:20:30 +0000 (06:20 +0900)]
Rollup merge of #86768 - fee1-dead:patch-2, r=bjorn3

Add myself to mailmap

3 years agoRollup merge of #86659 - notriddle:notriddle/generics-rustdoc, r=GuillaumeGomez
Yuki Okushi [Thu, 1 Jul 2021 21:20:29 +0000 (06:20 +0900)]
Rollup merge of #86659 - notriddle:notriddle/generics-rustdoc, r=GuillaumeGomez

fix(rustdoc): generics search

This commit adds a test case for generics, re-adds generics data
to the search index, and tweaks function indexing to use less space in JSON.

This partially reverts commit 14ca89446c076bcf484d3d05bd991a4b7985a409.

3 years agoRollup merge of #86148 - FabianWolff:issue-85855, r=varkor
Yuki Okushi [Thu, 1 Jul 2021 21:20:28 +0000 (06:20 +0900)]
Rollup merge of #86148 - FabianWolff:issue-85855, r=varkor

Check the number of generic lifetime and const parameters of intrinsics

This pull request fixes #85855. The current code for type checking intrinsics only checks the number of generic _type_ parameters, but does not check for an incorrect number of lifetime or const parameters, which can cause problems later on, such as the ICE in #85855, where the code thought that it was looking at a type parameter but found a lifetime parameter:
```
error: internal compiler error: compiler/rustc_middle/src/ty/generics.rs:188:18:
    expected type parameter, but found another generic parameter
```

The changes in this PR add checks for the number of lifetime and const parameters, expand the scope of `E0094` to also apply to these cases, and improve the error message by properly pluralizing the number of expected generic parameters.

3 years agoAuto merge of #86749 - bjorn3:link_info_refactor_part1, r=petrochenkov
bors [Thu, 1 Jul 2021 19:00:08 +0000 (19:00 +0000)]
Auto merge of #86749 - bjorn3:link_info_refactor_part1, r=petrochenkov

Rename all_crate_nums query to crates and remove useless wrapper

Split out of https://github.com/rust-lang/rust/pull/86105

r? `@petrochenkov`

3 years agoproc_macro/bridge: Remove dead code Slice type
Jade [Thu, 1 Jul 2021 17:20:57 +0000 (10:20 -0700)]
proc_macro/bridge: Remove dead code Slice type

See https://github.com/rust-lang/rust/pull/85390#discussion_r662464868

3 years agoMove Mutex::unlock to T: ?Sized
Mark Mansi [Thu, 1 Jul 2021 17:04:41 +0000 (12:04 -0500)]
Move Mutex::unlock to T: ?Sized

3 years agoUpdate Cargo.lock
flip1995 [Thu, 1 Jul 2021 16:18:02 +0000 (18:18 +0200)]
Update Cargo.lock

3 years agoMerge commit '61eb38aeda6cb54b93b872bf503d70084c4d621c' into clippyup
flip1995 [Thu, 1 Jul 2021 16:17:38 +0000 (18:17 +0200)]
Merge commit '61eb38aeda6cb54b93b872bf503d70084c4d621c' into clippyup

3 years agoAuto merge of #86304 - klensy:hex-length, r=jackh726
bors [Thu, 1 Jul 2021 16:16:12 +0000 (16:16 +0000)]
Auto merge of #86304 - klensy:hex-length, r=jackh726

rustc_mir: calc hex number length without string allocation

3 years agoMinor adjustments and refactoring
Fabian Wolff [Thu, 1 Jul 2021 11:52:44 +0000 (13:52 +0200)]
Minor adjustments and refactoring

3 years agoAuto merge of #7418 - flip1995:rustup, r=flip1995
bors [Thu, 1 Jul 2021 15:43:14 +0000 (15:43 +0000)]
Auto merge of #7418 - flip1995:rustup, r=flip1995

Rustup

r? `@ghost`

changelog: none

3 years agoBump nightly version -> 2021-07-01
flip1995 [Thu, 1 Jul 2021 15:41:34 +0000 (17:41 +0200)]
Bump nightly version -> 2021-07-01

3 years agoMerge remote-tracking branch 'upstream/master' into rustup
flip1995 [Thu, 1 Jul 2021 15:17:19 +0000 (17:17 +0200)]
Merge remote-tracking branch 'upstream/master' into rustup

3 years agoAuto merge of #7407 - m-ou-se:doc-hidden-variants, r=flip1995
bors [Thu, 1 Jul 2021 15:02:21 +0000 (15:02 +0000)]
Auto merge of #7407 - m-ou-se:doc-hidden-variants, r=flip1995

Don't suggest doc(hidden) or unstable variants in wildcard lint

Clippy's wildcard lint would suggest doc(hidden) and unstable variants for non_exhaustive enums, even though those aren't part of the public interface (yet) and should only be matched on using a `_`, just like potential future additions to the enum. There was already some logic to exclude a *single* doc(hidden) variant. This extends that to all hidden variants, and also hides `#[unstable]` variants.

See https://github.com/rust-lang/rust/pull/85746#issuecomment-868886893

This PR includes https://github.com/rust-lang/rust-clippy/pull/7406 as the first commit.

Here's the diff that this PR adds on top of that PR: https://github.com/m-ou-se/rust-clippy/compare/std-errorkind...m-ou-se:doc-hidden-variants

---

*Please write a short comment explaining your change (or "none" for internal only changes)*

changelog: No longer suggest unstable and doc(hidden) variants in wildcard lint. wildcard_enum_match_arm, match_wildcard_for_single_variants

3 years agorustc_mir: calc hex number length without string allocation
klensy [Mon, 14 Jun 2021 18:32:42 +0000 (21:32 +0300)]
rustc_mir: calc hex number length without string allocation

3 years agoRename all_crate_nums query to crates and remove useless wrapper
bjorn3 [Mon, 7 Jun 2021 09:03:17 +0000 (11:03 +0200)]
Rename all_crate_nums query to crates and remove useless wrapper

3 years agofix(rustdoc): generics search
Michael Howell [Sat, 26 Jun 2021 19:00:26 +0000 (12:00 -0700)]
fix(rustdoc): generics search

This commit adds a test case for generics, re-adds generics data
to the search index, and tweaks function indexing to use less space in JSON.

This reverts commit 14ca89446c076bcf484d3d05bd991a4b7985a409.

3 years agoAuto merge of #86769 - ehuss:update-cargo, r=ehuss
bors [Thu, 1 Jul 2021 13:35:14 +0000 (13:35 +0000)]
Auto merge of #86769 - ehuss:update-cargo, r=ehuss

Update cargo

9 commits in 9233aa06c801801cff75df65df718d70905a235e..4952979031e2cf1d901c817a32e25a156a19db4c
2021-06-22 21:32:55 +0000 to 2021-07-01 01:14:50 +0000
- Fix `BorrowMutError` when calling `cargo doc --open` (rust-lang/cargo#9531)
- Exclude `target` from content-indexing on Windows (rust-lang/cargo#9635)
- Temporarily ignore 2021 edition fix. (rust-lang/cargo#9642)
- Temporarily disable future_incompat tests. (rust-lang/cargo#9638)
- Include toolchain specification in error message (rust-lang/cargo#9625)
- Error when packaging with git dependencies without version (rust-lang/cargo#9612)
- simply 'if' block (rust-lang/cargo#9615)
- tidy some closures and iterators (rust-lang/cargo#9614)
- use 'writeln' instead of appending newline character (rust-lang/cargo#9620)

3 years agoAllow anyone to add or remove any label starting with perf-
Ryan Levick [Thu, 1 Jul 2021 12:56:24 +0000 (14:56 +0200)]
Allow anyone to add or remove any label starting with perf-

3 years agoInclude terminators in instance size estimate
Tomasz Miąsko [Tue, 29 Jun 2021 00:00:00 +0000 (00:00 +0000)]
Include terminators in instance size estimate

For example, drop glue generated for struct below, doesn't have any
statements, only terminators. Previously it received an estimate of 0,
the new estimate is 13 (6+5 drop terminators, +1 resume, +1 return).

struct S {
    a: String,
    b: String,
    c: String,
    d: String,
    e: String,
    f: String,
}

Originally reported in https://github.com/rust-lang/rust/issues/69382#issue-569392141

3 years agoTest for const trait impls behind feature gates
Deadbeef [Thu, 1 Jul 2021 10:43:08 +0000 (18:43 +0800)]
Test for const trait impls behind feature gates

3 years agomatch_wildcard_for_single_variants: don't produce bad suggestion
flip1995 [Thu, 1 Jul 2021 10:35:16 +0000 (12:35 +0200)]
match_wildcard_for_single_variants: don't produce bad suggestion

This fixes a bug where match_wildcard_for_single_variants produced a
bad suggestion where besides the missing variant, one or more hidden
variants were left.

This also adds tests to the ui-tests match_wildcard_for_single_variants
and wildcard_enum_match_arm to make sure that the correct suggestion is
produced.

3 years agoSimplify wildcard_enum_match_arm test
flip1995 [Thu, 1 Jul 2021 09:47:56 +0000 (11:47 +0200)]
Simplify wildcard_enum_match_arm test

3 years agoUse revisions for cross-crate test
Deadbeef [Thu, 1 Jul 2021 09:24:45 +0000 (17:24 +0800)]
Use revisions for cross-crate test

3 years agoAuto merge of #86774 - GuillaumeGomez:rollup-rkcgvph, r=GuillaumeGomez
bors [Thu, 1 Jul 2021 09:20:38 +0000 (09:20 +0000)]
Auto merge of #86774 - GuillaumeGomez:rollup-rkcgvph, r=GuillaumeGomez

Rollup of 6 pull requests

Successful merges:

 - #86558 (Add suggestions for "undefined reference" link errors)
 - #86616 (rustc_span: Explicitly handle crates that differ from package names)
 - #86652 (Add support for leaf function frame pointer elimination)
 - #86666 (Fix misleading "impl Trait" error)
 - #86762 (mailmap: Add my work email address)
 - #86773 (Enable the tests developed with #86594)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup

3 years agoRollup merge of #86773 - dns2utf8:rustdoc_enable_near_tests, r=GuillaumeGomez
Guillaume Gomez [Thu, 1 Jul 2021 09:15:44 +0000 (11:15 +0200)]
Rollup merge of #86773 - dns2utf8:rustdoc_enable_near_tests, r=GuillaumeGomez

Enable the tests developed with #86594

This PR requires `browser-ui-test@0.4.1`. Can we centralise the version number somehow and maybe automatically install it when tests are run?

r? `@GuillaumeGomez`

3 years agoRollup merge of #86762 - JohnTitor:mailmap-for-work, r=Mark-Simulacrum
Guillaume Gomez [Thu, 1 Jul 2021 09:15:43 +0000 (11:15 +0200)]
Rollup merge of #86762 - JohnTitor:mailmap-for-work, r=Mark-Simulacrum

mailmap: Add my work email address

This de-duplicates the entry on the thanks.

3 years agoRollup merge of #86666 - ptrojahn:compare_kinds, r=petrochenkov
Guillaume Gomez [Thu, 1 Jul 2021 09:15:42 +0000 (11:15 +0200)]
Rollup merge of #86666 - ptrojahn:compare_kinds, r=petrochenkov

Fix misleading "impl Trait" error

The kinds can't be compared directly, as types with references are treated as different because the lifetimes aren't bound in ty, but are in expected.
Closes #84160

3 years agoRollup merge of #86652 - nagisa:nagisa/non-leaf-fp, r=petrochenkov
Guillaume Gomez [Thu, 1 Jul 2021 09:15:41 +0000 (11:15 +0200)]
Rollup merge of #86652 - nagisa:nagisa/non-leaf-fp, r=petrochenkov

Add support for leaf function frame pointer elimination

This PR adds ability for the target specifications to specify frame
pointer emission type that's not just “always” or “whatever cg decides”.

In particular there's a new mode that allows omission of the frame
pointer for leaf functions (those that don't call any other functions).

We then set this new mode for Aarch64-based Apple targets.

Fixes #86196

3 years agoRollup merge of #86616 - joshtriplett:simplify-crate-package-discrepancies, r=varkor
Guillaume Gomez [Thu, 1 Jul 2021 09:15:40 +0000 (11:15 +0200)]
Rollup merge of #86616 - joshtriplett:simplify-crate-package-discrepancies, r=varkor

rustc_span: Explicitly handle crates that differ from package names

The sha-1 and md-5 packages contain crates named sha1 and md5,
respectively. This discrepancy makes it somewhat more challenging to
automate detection of unused crates. Explicitly rename the packages to
the names of the crates they contain, to simplify such detection.

3 years agoRollup merge of #86558 - Smittyvb:link-error-sugg, r=petrochenkov
Guillaume Gomez [Thu, 1 Jul 2021 09:15:39 +0000 (11:15 +0200)]
Rollup merge of #86558 - Smittyvb:link-error-sugg, r=petrochenkov

Add suggestions for "undefined reference" link errors

This adds a suggestion for "undefined reference to ..." linking errors to install or specify the location to an external library. Since there is no defined error format for linkers, we just check if there was a failure and if that failure contains the string `undefined reference to`. This also makes it impossible to test this, since the output depends on the system linker. The output now looks like:
```
error: linking with `cc` failed: exit status: 1
  |
  = note: "cc" "-m64" "linking_failure.linking_failure.7rcbfp3g-cgu.0.rcgu.o" "linking_failure.linking_failure.7rcbfp3g-cgu.1.rcgu.o" "linking_failure.linking_failure.7rcbfp3g-cgu.2.rcgu.o" "linking_failure.linking_failure.7rcbfp3g-cgu.3.rcgu.o" "linking_failure.linking_failure.7rcbfp3g-cgu.4.rcgu.o" "linking_failure.linking_failure.7rcbfp3g-cgu.5.rcgu.o" "linking_failure.linking_failure.7rcbfp3g-cgu.6.rcgu.o" "linking_failure.linking_failure.7rcbfp3g-cgu.7.rcgu.o" "linking_failure.linking_failure.7rcbfp3g-cgu.8.rcgu.o" "linking_failure.53u64zklswtfazes.rcgu.o" "-Wl,--as-needed" "-L" "/home/smit/rustc-dev/rust/build/x86_64-unknown-linux-gnu/stage1/lib/rustlib/x86_64-unknown-linux-gnu/lib" "-Wl,--start-group" "-Wl,-Bstatic" "/home/smit/rustc-dev/rust/build/x86_64-unknown-linux-gnu/stage1/lib/rustlib/x86_64-unknown-linux-gnu/lib/libstd-01ce3ba5c629d02f.rlib" "/home/smit/rustc-dev/rust/build/x86_64-unknown-linux-gnu/stage1/lib/rustlib/x86_64-unknown-linux-gnu/lib/libpanic_unwind-f1f2102409186354.rlib" "/home/smit/rustc-dev/rust/build/x86_64-unknown-linux-gnu/stage1/lib/rustlib/x86_64-unknown-linux-gnu/lib/libminiz_oxide-1e8b6b56a999f838.rlib" "/home/smit/rustc-dev/rust/build/x86_64-unknown-linux-gnu/stage1/lib/rustlib/x86_64-unknown-linux-gnu/lib/libadler-d0e93eb4e14f1d19.rlib" "/home/smit/rustc-dev/rust/build/x86_64-unknown-linux-gnu/stage1/lib/rustlib/x86_64-unknown-linux-gnu/lib/libobject-1d7e39d75d082b43.rlib" "/home/smit/rustc-dev/rust/build/x86_64-unknown-linux-gnu/stage1/lib/rustlib/x86_64-unknown-linux-gnu/lib/libaddr2line-ade42e945045b261.rlib" "/home/smit/rustc-dev/rust/build/x86_64-unknown-linux-gnu/stage1/lib/rustlib/x86_64-unknown-linux-gnu/lib/libgimli-1a65064fccf4ebc1.rlib" "/home/smit/rustc-dev/rust/build/x86_64-unknown-linux-gnu/stage1/lib/rustlib/x86_64-unknown-linux-gnu/lib/libstd_detect-4d699c310fdfe72d.rlib" "/home/smit/rustc-dev/rust/build/x86_64-unknown-linux-gnu/stage1/lib/rustlib/x86_64-unknown-linux-gnu/lib/librustc_demangle-1cafa68a696ec800.rlib" "/home/smit/rustc-dev/rust/build/x86_64-unknown-linux-gnu/stage1/lib/rustlib/x86_64-unknown-linux-gnu/lib/libhashbrown-e9f1c8c4dab2f046.rlib" "/home/smit/rustc-dev/rust/build/x86_64-unknown-linux-gnu/stage1/lib/rustlib/x86_64-unknown-linux-gnu/lib/librustc_std_workspace_alloc-ecc1a743be25c7f7.rlib" "/home/smit/rustc-dev/rust/build/x86_64-unknown-linux-gnu/stage1/lib/rustlib/x86_64-unknown-linux-gnu/lib/libunwind-e074031c4b66b6b6.rlib" "/home/smit/rustc-dev/rust/build/x86_64-unknown-linux-gnu/stage1/lib/rustlib/x86_64-unknown-linux-gnu/lib/libcfg_if-9aa6ed9f1d3bfd53.rlib" "/home/smit/rustc-dev/rust/build/x86_64-unknown-linux-gnu/stage1/lib/rustlib/x86_64-unknown-linux-gnu/lib/liblibc-7862bf96c2250ca0.rlib" "/home/smit/rustc-dev/rust/build/x86_64-unknown-linux-gnu/stage1/lib/rustlib/x86_64-unknown-linux-gnu/lib/liballoc-f02ce0dc7895b5fd.rlib" "/home/smit/rustc-dev/rust/build/x86_64-unknown-linux-gnu/stage1/lib/rustlib/x86_64-unknown-linux-gnu/lib/librustc_std_workspace_core-3af9c60917570521.rlib" "/home/smit/rustc-dev/rust/build/x86_64-unknown-linux-gnu/stage1/lib/rustlib/x86_64-unknown-linux-gnu/lib/libcore-ca16fc7bb3645684.rlib" "-Wl,--end-group" "/home/smit/rustc-dev/rust/build/x86_64-unknown-linux-gnu/stage1/lib/rustlib/x86_64-unknown-linux-gnu/lib/libcompiler_builtins-d8e1a5b7299604cc.rlib" "-Wl,-Bdynamic" "-lgcc_s" "-lutil" "-lrt" "-lpthread" "-lm" "-ldl" "-lc" "-Wl,--eh-frame-hdr" "-Wl,-znoexecstack" "-L" "/home/smit/rustc-dev/rust/build/x86_64-unknown-linux-gnu/stage1/lib/rustlib/x86_64-unknown-linux-gnu/lib" "-o" "linking_failure" "-Wl,--gc-sections" "-pie" "-Wl,-zrelro" "-Wl,-znow" "-nodefaultlibs"
  = note: /usr/bin/ld: linking_failure.linking_failure.7rcbfp3g-cgu.3.rcgu.o: in function `linking_failure::main':
          linking_failure.7rcbfp3g-cgu.3:(.text._ZN15linking_failure4main17h52b6e3052e444479E+0x3): undefined reference to `doesnt_exist_thiwthwfyl'
          clang: error: linker command failed with exit code 1 (use -v to see invocation)

  = help: some `extern` functions couldn't be found; you may need to install or specify the path to some dependencies
  = note: use the -L flag to specify the library lookup path
  = note: use the cargo:rustc-link-search directive to specify the library lookup path with Cargo (see https://doc.rust-lang.org/cargo/reference/build-scripts.html#rustc-link-search)

error: aborting due to previous error
```

3 years agoUpdate container browser-ui-test@0.4.1
Stefan Schindler [Thu, 1 Jul 2021 08:22:03 +0000 (10:22 +0200)]
Update container browser-ui-test@0.4.1

3 years agoEnable the tests developed with #86594
Stefan Schindler [Thu, 1 Jul 2021 08:13:28 +0000 (10:13 +0200)]
Enable the tests developed with #86594

3 years agoAuto merge of #86190 - asquared31415:extern-main-86110-fix, r=varkor
bors [Thu, 1 Jul 2021 06:39:37 +0000 (06:39 +0000)]
Auto merge of #86190 - asquared31415:extern-main-86110-fix, r=varkor

Fix ICE when `main` is declared in an `extern` block

Changes in #84401 to implement `imported_main` changed how the crate entry point is found, and a declared `main` in an `extern` block was detected erroneously.  This was causing the ICE described in #86110.

This PR adds a check for this case and emits an error instead.  Previously a `main` declaration in an `extern` block was not detected as an entry point at all, so emitting an error shouldn't break anything that worked previously.  In 1.52.1 stable this is demonstrated, with a `` `main` function not found`` error.

Fixes #86110

3 years agoUpdate cargo
Eric Huss [Thu, 1 Jul 2021 04:43:47 +0000 (21:43 -0700)]
Update cargo

3 years agoAuto merge of #86617 - joshtriplett:prune-dependencies, r=Mark-Simulacrum
bors [Thu, 1 Jul 2021 03:49:47 +0000 (03:49 +0000)]
Auto merge of #86617 - joshtriplett:prune-dependencies, r=Mark-Simulacrum

Remove unused dependencies from compiler crates

Various compiler crates have dependencies that they don't appear to use. I used some scripting to detect such dependencies, filtered them based on some manual review, and removed those that do indeed appear to be entirely unused.

3 years agoUpdate mailmap for me
fee1-dead [Thu, 1 Jul 2021 02:05:37 +0000 (10:05 +0800)]
Update mailmap for me

3 years agoAuto merge of #86757 - JohnTitor:rollup-acevhz7, r=JohnTitor
bors [Thu, 1 Jul 2021 01:08:46 +0000 (01:08 +0000)]
Auto merge of #86757 - JohnTitor:rollup-acevhz7, r=JohnTitor

Rollup of 8 pull requests

Successful merges:

 - #85504 (the foundation owns rust trademarks)
 - #85520 (Fix typo and improve documentation for E0632)
 - #86680 (Improve error for missing -Z with debugging option)
 - #86728 (Check node kind to avoid ICE in `check_expr_return()`)
 - #86740 (copy rust-lld as ld in dist)
 - #86746 (Fix rustdoc query type filter)
 - #86750 (Test cross-crate usage of `feature(const_trait_impl)`)
 - #86755 (alloc: `RawVec<T, A>::shrink` can be in `no_global_oom_handling`.)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup

3 years agomailmap: Add my work email address
Yuki Okushi [Wed, 30 Jun 2021 22:37:31 +0000 (07:37 +0900)]
mailmap: Add my work email address

3 years agoAuto merge of #86489 - cjgillot:lower, r=petrochenkov
bors [Wed, 30 Jun 2021 22:20:36 +0000 (22:20 +0000)]
Auto merge of #86489 - cjgillot:lower, r=petrochenkov

Simplify early compilation interface

* separate resolver creation and AST configuration.
* bundle lowering with global_ctxt creation.

3 years agoAdd suggestions for "undefined reference" link errors
Smitty [Tue, 22 Jun 2021 21:46:34 +0000 (17:46 -0400)]
Add suggestions for "undefined reference" link errors

3 years agoRollup merge of #86755 - ojeda:shrink, r=Mark-Simulacrum
Yuki Okushi [Wed, 30 Jun 2021 20:21:03 +0000 (05:21 +0900)]
Rollup merge of #86755 - ojeda:shrink, r=Mark-Simulacrum

alloc: `RawVec<T, A>::shrink` can be in `no_global_oom_handling`.

Found in https://github.com/Rust-for-Linux/linux/pull/402.

Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
3 years agoRollup merge of #86750 - fee1-dead:impl-const-test, r=jonas-schievink
Yuki Okushi [Wed, 30 Jun 2021 20:21:02 +0000 (05:21 +0900)]
Rollup merge of #86750 - fee1-dead:impl-const-test, r=jonas-schievink

Test cross-crate usage of `feature(const_trait_impl)`

This PR does two things:

 - Fixes metadata not encoded properly for functions in const trait impls.
 - Adds tests for using const trait impls cross-crate with the feature gate on the user crate either enabled or disabled.

AFAIK, this means we can now constify some trait impls in the standard library 🎉

See #67792 for the tracking issue, cc `@oli-obk`

3 years agoRollup merge of #86746 - GuillaumeGomez:query-type-filter, r=notriddle
Yuki Okushi [Wed, 30 Jun 2021 20:21:00 +0000 (05:21 +0900)]
Rollup merge of #86746 - GuillaumeGomez:query-type-filter, r=notriddle

Fix rustdoc query type filter

I realized while reviewing #86659 that the type filter was broken on search so I'd prefer it to get merged before merging #86659.

r? `@notriddle`

3 years agoRollup merge of #86740 - 1000teslas:issue-71519-fix, r=petrochenkov
Yuki Okushi [Wed, 30 Jun 2021 20:20:59 +0000 (05:20 +0900)]
Rollup merge of #86740 - 1000teslas:issue-71519-fix, r=petrochenkov

copy rust-lld as ld in dist

Fixes bug in https://github.com/rust-lang/rust/pull/85961. Linking seems to work for pure Rust projects, but not when a C library needs to be dynamically linked.

3 years agoRollup merge of #86728 - FabianWolff:issue-86721, r=LeSeulArtichaut
Yuki Okushi [Wed, 30 Jun 2021 20:20:58 +0000 (05:20 +0900)]
Rollup merge of #86728 - FabianWolff:issue-86721, r=LeSeulArtichaut

Check node kind to avoid ICE in `check_expr_return()`

This PR fixes #86721. The ICE described there is apparently due to a misunderstanding:
https://github.com/rust-lang/rust/blob/e98897e5dc9898707bf4331c43b2e76ab7e282fe/compiler/rustc_typeck/src/check/expr.rs#L684-L685

Intuitively, one would think that calling `expect_item()` after `get_parent_item()` should succeed, but as it turns out, `get_parent_item()` can also return foreign, trait, and impl items as well as crates, whereas `expect_item()` specifically expects a `Node::Item`. I have therefore added an extra check to prevent this ICE.

3 years agoRollup merge of #86680 - camsteffen:dbg-opt-error, r=petrochenkov
Yuki Okushi [Wed, 30 Jun 2021 20:20:57 +0000 (05:20 +0900)]
Rollup merge of #86680 - camsteffen:dbg-opt-error, r=petrochenkov

Improve error for missing -Z with debugging option

Before:
```text
❯ rustc --unpretty=hir
error: Unrecognized option: 'unpretty'
```
After:
```text
❯ rustc --unpretty=hir
error: Unrecognized option: 'unpretty'. Did you mean `-Z unpretty`?
```

3 years agoRollup merge of #85520 - FabianWolff:issue-85475, r=jackh726
Yuki Okushi [Wed, 30 Jun 2021 20:20:55 +0000 (05:20 +0900)]
Rollup merge of #85520 - FabianWolff:issue-85475, r=jackh726

Fix typo and improve documentation for E0632

Edit: After https://github.com/rust-lang/rust/pull/85520#issuecomment-870095546, this PR has been boiled down to just an extended description for `E0632` and a fixed typo.

3 years agoRollup merge of #85504 - liigo:patch-13, r=Mark-Simulacrum
Yuki Okushi [Wed, 30 Jun 2021 20:20:54 +0000 (05:20 +0900)]
Rollup merge of #85504 - liigo:patch-13, r=Mark-Simulacrum

the foundation owns rust trademarks

3 years agoUpdate comments.
Camille GILLOT [Wed, 30 Jun 2021 18:52:00 +0000 (20:52 +0200)]
Update comments.

3 years agoFix AST pretty.
Camille GILLOT [Sun, 20 Jun 2021 16:52:35 +0000 (18:52 +0200)]
Fix AST pretty.

3 years agoMove AST crate.
Camille GILLOT [Fri, 11 Jun 2021 16:55:30 +0000 (18:55 +0200)]
Move AST crate.

3 years agoArena-allocate Crate during lowering.
Camille GILLOT [Fri, 11 Jun 2021 16:55:14 +0000 (18:55 +0200)]
Arena-allocate Crate during lowering.

3 years agoMove lowering to create_global_ctxt.
Camille GILLOT [Sun, 23 May 2021 19:42:16 +0000 (21:42 +0200)]
Move lowering to create_global_ctxt.

3 years agoInline lower_to_hir.
Camille GILLOT [Sun, 23 May 2021 19:30:03 +0000 (21:30 +0200)]
Inline lower_to_hir.

3 years agoSeparate resolver creation from expansion.
Camille GILLOT [Mon, 24 May 2021 16:45:21 +0000 (18:45 +0200)]
Separate resolver creation from expansion.

3 years agoSimplify DepGraph creation.
Camille GILLOT [Mon, 24 May 2021 17:24:58 +0000 (19:24 +0200)]
Simplify DepGraph creation.

3 years agoAdd suggestion for missing compile flag group
Cameron Steffen [Sun, 27 Jun 2021 23:15:16 +0000 (18:15 -0500)]
Add suggestion for missing compile flag group

3 years agoAuto merge of #7400 - popzxc:restrict-locales, r=Manishearth
bors [Wed, 30 Jun 2021 18:14:16 +0000 (18:14 +0000)]
Auto merge of #7400 - popzxc:restrict-locales, r=Manishearth

New lint: `disallowed_script_idents`

This PR implements a new lint to restrict locales that can be used in the code,
as proposed in #7376.

Current concerns / unresolved questions:

- ~~Mixed usage of `script` (as a Unicode term) and `locale` (as something that is easier to understand for the broad audience). I'm not sure whether these terms are fully interchangeable and whether in the current form it is more confusing than helpful.~~ `script` is now used everywhere.
- ~~Having to mostly copy-paste `AllowedScript`. Probably it's not a big problem, as the list of scripts is standardized and is unlikely to change, and even if we'd stick to the `unicode_script::Script`, we'll still have to implement custom deserialization, and I don't think that it will be shorter in terms of the amount of LoC.~~ `unicode::Script` is used together with a filtering deserialize function.
- Should we stick to the list of "recommended scripts" from [UAX #31](http://www.unicode.org/reports/tr31/#Table_Recommended_Scripts) in the configuration?

*Please write a short comment explaining your change (or "none" for internal only changes)*

changelog: ``[`disallowed_script_idents`]``

r? `@Manishearth`

3 years agoalloc: `RawVec<T, A>::shrink` can be in `no_global_oom_handling`.
Miguel Ojeda [Wed, 30 Jun 2021 17:41:49 +0000 (19:41 +0200)]
alloc: `RawVec<T, A>::shrink` can be in `no_global_oom_handling`.

Found in https://github.com/Rust-for-Linux/linux/pull/402.

Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
3 years agoAdd support for leaf fn frame pointer elimination
Simonas Kazlauskas [Sat, 26 Jun 2021 20:53:35 +0000 (23:53 +0300)]
Add support for leaf fn frame pointer elimination

This PR adds ability for the target specifications to specify frame
pointer emission type that's not just “always” or “whatever cg decides”.

In particular there's a new mode that allows omission of the frame
pointer for leaf functions (those that don't call any other functions).

We then set this new mode for Aarch64-based Apple targets.

Fixes #86196

3 years agoMatch on `hir::TraitFn::Provided` instead of using `maybe_body_owned_by`
Fabian Wolff [Wed, 30 Jun 2021 16:27:07 +0000 (18:27 +0200)]
Match on `hir::TraitFn::Provided` instead of using `maybe_body_owned_by`

3 years agoImplement 'disallowed_script_idents' lint
Igor Aleksanov [Wed, 30 Jun 2021 16:06:33 +0000 (19:06 +0300)]
Implement 'disallowed_script_idents' lint

3 years agoAdd tests for cross-crate usage of `impl const`
Deadbeef [Wed, 30 Jun 2021 15:57:17 +0000 (23:57 +0800)]
Add tests for cross-crate usage of `impl const`

3 years agouse is_const_fn_raw when encoding constness
Deadbeef [Wed, 30 Jun 2021 15:56:43 +0000 (23:56 +0800)]
use is_const_fn_raw when encoding constness

this properly encodes cross-crate constness data.

3 years agoAuto merge of #7390 - popzxc:issue-7331, r=flip1995
bors [Wed, 30 Jun 2021 15:12:55 +0000 (15:12 +0000)]
Auto merge of #7390 - popzxc:issue-7331, r=flip1995

Improve lint message for match-same-arms lint

fixes #7331

Follow-up to #7377

This PR improves the lint message for `match-same-arms` lint and adds `todo!(..)`  example to the lint docs.

*Please write a short comment explaining your change (or "none" for internal only changes)*

changelog: None

3 years agoAuto merge of #86695 - sexxi-goose:closure_size, r=nikomatsakis
bors [Wed, 30 Jun 2021 13:42:50 +0000 (13:42 +0000)]
Auto merge of #86695 - sexxi-goose:closure_size, r=nikomatsakis

Introduce -Zprofile-closures to evaluate the impact of 2229

This creates a CSV with name "closure_profile_XXXXX.csv", where the
variable part is the process id of the compiler.

To profile a cargo project you can run one of the following depending on
if you're compiling a library or a binary:

```
cargo +nightly rustc --lib -- -Zprofile-closures
cargo +nightly rustc --bin {binary_name} -- -Zprofile-closures
```

r? `@nikomatsakis`

3 years agoAdd test to ensure that the typed queries are not including other types
Guillaume Gomez [Wed, 30 Jun 2021 12:20:17 +0000 (14:20 +0200)]
Add test to ensure that the typed queries are not including other types

3 years agoEnforce search typed queries
Guillaume Gomez [Wed, 30 Jun 2021 12:11:09 +0000 (14:11 +0200)]
Enforce search typed queries

3 years agoEmit explanatory note for functions in trait and impl items as well
Fabian Wolff [Wed, 30 Jun 2021 11:56:26 +0000 (13:56 +0200)]
Emit explanatory note for functions in trait and impl items as well

3 years agoAuto merge of #86650 - GuillaumeGomez:fix-boldness, r=Nemo157
bors [Wed, 30 Jun 2021 10:54:08 +0000 (10:54 +0000)]
Auto merge of #86650 - GuillaumeGomez:fix-boldness, r=Nemo157

Fix boldness (put it back where needed)

I realized that I created a GUI test that wasn't run because it had ".rs" extension instead of ".goml" so I moved its content into `font-weight.goml` (since it was checking font weight).

3 years agoAuto merge of #86739 - RalfJung:miri, r=RalfJung
bors [Wed, 30 Jun 2021 07:28:42 +0000 (07:28 +0000)]
Auto merge of #86739 - RalfJung:miri, r=RalfJung

update Miri

Fixes https://github.com/rust-lang/rust/issues/86723
Cc `@rust-lang/miri` r? `@ghost`

3 years agoupdate Miri
Ralf Jung [Wed, 30 Jun 2021 07:21:20 +0000 (09:21 +0200)]
update Miri

3 years agocopy rust-lld as ld in dist
1000teslas [Sun, 13 Jun 2021 11:45:22 +0000 (21:45 +1000)]
copy rust-lld as ld in dist

3 years agoAuto merge of #86689 - rylev:future-compat-lint-group, r=nikomatsakis
bors [Wed, 30 Jun 2021 05:02:01 +0000 (05:02 +0000)]
Auto merge of #86689 - rylev:future-compat-lint-group, r=nikomatsakis

Only include lint in future_incompatible lint group if not an edition lint

A follow up to #86330 - this only includes lints annotated with `FutureIncompatibleInfo` in the `future_incompatibile` lint group if the future compatibility is not tied to an edition.

We probably want to rename `FutureIncompatibleInfo` to something else since this type is now used to indicate future breakages of all kinds (even those that happen in editions). I'd prefer to do that in a separate PR though.

r? `@nikomatsakis`

3 years agoAuto merge of #86724 - cuviper:indexmap-1.7, r=Mark-Simulacrum
bors [Wed, 30 Jun 2021 02:20:50 +0000 (02:20 +0000)]
Auto merge of #86724 - cuviper:indexmap-1.7, r=Mark-Simulacrum

Upgrade to indexmap 1.7, using hashbrown 0.11

3 years agoAuto merge of #86522 - JohnTitor:move-ui-tests, r=petrochenkov
bors [Tue, 29 Jun 2021 23:40:00 +0000 (23:40 +0000)]
Auto merge of #86522 - JohnTitor:move-ui-tests, r=petrochenkov

Move some UI tests to more suitable subdirs

cc #73494
The classified result is here: https://gist.github.com/JohnTitor/c9e00840990b5e4a8fc562ec3571e427

- issues/issue-27060.rs: misclassified, should be packed.
- issues/issue-45157.rs: moved to nll.
- issues/issue-69532.rs: ~~couldn't figured out the best place, placed a new `llvm` dir~~ moved to consts.
- fsu-moves-and-copies.rs: moved to borrowck.
- issues/issue-36638.rs: misclassified, moved to keyword.
- issues/issue-48636.rs: moved to parser.
- issues/issue-37655.rs: I'm not sure but associated-types shouldn't the best, moved to coercion but region may be better.
- issues/issue-20005.rs: moved to associated-types.
- issues/issue-82869.rs: moved to asm.
- issues/issue-24535-allow-mutable-borrow-in-match-guard.rs: moved to nll.
- issues/issue-52169.rs: moved to macros.
- test-passed.rs: moved to test-attrs along with `test-` prefixed tests.
  - test-cfg.rs: moved to conditional-compilation.
- non-integer-atomic.rs: moved to intrinsics.
- issues/issue-54521-2.rs: moved to parser.
- issues/issue-17756.rs: moved to consts.
- conversion-methods.rs: ~~moved to suggestions~~ moved to typeck.

r? `@petrochenkov`

3 years agoMove some UI tests to more suitable subdirs
Yuki Okushi [Mon, 21 Jun 2021 20:29:18 +0000 (05:29 +0900)]
Move some UI tests to more suitable subdirs

3 years agoAuto merge of #86725 - JohnTitor:normalizecss-8, r=GuillaumeGomez
bors [Tue, 29 Jun 2021 20:59:14 +0000 (20:59 +0000)]
Auto merge of #86725 - JohnTitor:normalizecss-8, r=GuillaumeGomez

Upgrade normalize.css to v8.0.1

Fixes #86629, this addresses #82548 and #82542 with tweaks. I expect that this changes the style *slightly* but shouldn't have any major changes.
Here's some changes I observed, I'd say they all are an improvement.

<details>
<summary>Before</summary>

![before 1](https://user-images.githubusercontent.com/25030997/123854746-0fc84800-d95a-11eb-8484-ea86dfe0ae14.png)
![before 2](https://user-images.githubusercontent.com/25030997/123854754-135bcf00-d95a-11eb-8cca-f49994629e08.png)

</details>

<details>
<summary>After</summary>

![after 1](https://user-images.githubusercontent.com/25030997/123854809-21115480-d95a-11eb-9dd2-0d3b9ca45edd.png)
![after 2](https://user-images.githubusercontent.com/25030997/123854818-22428180-d95a-11eb-83aa-fb5a698124f9.png)

</details>

r? `@jsha`

3 years agoCheck node kind to avoid ICE in `check_expr_return()`
Fabian Wolff [Tue, 29 Jun 2021 20:11:48 +0000 (22:11 +0200)]
Check node kind to avoid ICE in `check_expr_return()`

3 years agoFix some style regressions due to normalize.css 8
Yuki Okushi [Tue, 29 Jun 2021 19:13:46 +0000 (04:13 +0900)]
Fix some style regressions due to normalize.css 8

3 years agoUpgrade normalize.css to v8.0.1
Yuki Okushi [Tue, 29 Jun 2021 19:13:16 +0000 (04:13 +0900)]
Upgrade normalize.css to v8.0.1

3 years agoUpgrade to indexmap 1.7, using hashbrown 0.11
Josh Stone [Tue, 29 Jun 2021 18:38:16 +0000 (11:38 -0700)]
Upgrade to indexmap 1.7, using hashbrown 0.11

3 years agoAuto merge of #86603 - Mark-Simulacrum:stage-step, r=pietroalbini
bors [Tue, 29 Jun 2021 18:33:13 +0000 (18:33 +0000)]
Auto merge of #86603 - Mark-Simulacrum:stage-step, r=pietroalbini

Update to new bootstrap compiler

r? `@pietroalbini`