Commit Graph

209968 Commits

Author SHA1 Message Date
Manish Goregaokar
c9fc5cbeb5
Rollup merge of #103744 - palfrey:unwind-upgrade-cc, r=Mark-Simulacrum
Upgrade cc for working is_flag_supported on cross-compiles

https://github.com/rust-lang/rust/pull/85806 fixed unwind v.s gcc support on later Android ndks using `is_flag_supported`. However, due to https://github.com/rust-lang/cc-rs/issues/675, this didn't work properly on cross-compiles. 3eeb50b391 fixes this, and was released in cc 1.0.74, hence the upgrade
2022-11-13 21:49:24 -05:00
Manish Goregaokar
1b91bdfda9
Rollup merge of #103709 - cuviper:netbsd-9, r=pietroalbini
ci: Upgrade dist-x86_64-netbsd to NetBSD 9.0

This is another step in toolchain upgrades for LLVM 16, which will need at least GCC 7.1.

Our previous NetBSD 8.0 cross-toolchain used its system GCC 5.5. While there are newer versions available in pkgsrc, I could not get those working for cross-compilation. Upgrading to NetBSD 9.0 gets us GCC 7.4, which is sufficient for now.

This will affect the compatibility of the build we ship for `x86_64-unknown-netbsd`, but others may still build their own from source if that is needed. It is expected that NetBSD 8 will reach EOL soon anyway, approximately one month after 10 is released, but there is no firm date for that.
2022-11-13 21:49:24 -05:00
bors
7b513af6c4 Auto merge of #103894 - mati865:gnullvm-libunwind-changes, r=thomcc
Change the way libunwind is linked for *-windows-gnullvm targets

I have no idea why previous way works for `x86_64-fortanix-unknown-sgx` (assuming it actually works...) but not for `gnullvm`. It fails when linking libtest during Rust build (unless somebody adds `RUSTFLAGS='-Clinkarg=-lunwind'`).
Also fixes exception handling on AArch64.
2022-11-13 21:12:48 +00:00
bors
e631891f7a Auto merge of #104370 - matthiaskrgr:rollup-c3b38sm, r=matthiaskrgr
Rollup of 5 pull requests

Successful merges:

 - #103996 (Add small clarification around using pointers derived from references)
 - #104315 (Improve spans with `use crate::{self}`)
 - #104320 (Use `derive_const` and rm manual StructuralEq impl)
 - #104357 (add is_sized method on Abi and Layout, and use it)
 - #104365 (Add x tool to triagebot)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2022-11-13 18:13:08 +00:00
Matthias Krüger
39ff9d2872
Rollup merge of #104365 - albertlarsan68:add-x-tool-to-triagebot, r=Mark-Simulacrum
Add x tool to triagebot

Assign the A-bootstrap label when a pr modifies the x tool.

Happened in #104350.
2022-11-13 17:37:38 +01:00
Matthias Krüger
8076b5903a
Rollup merge of #104357 - RalfJung:is-sized, r=cjgillot
add is_sized method on Abi and Layout, and use it

This avoids the double negation of `!is_unsized()` that we have quite a lot.
2022-11-13 17:37:38 +01:00
Matthias Krüger
eefea28dea
Rollup merge of #104320 - fee1-dead-contrib:use-derive-const-in-std, r=oli-obk
Use `derive_const` and rm manual StructuralEq impl

This does not change any semantics of the impl except for the const stability. It should be fine because trait methods and const bounds can never be used in stable without enabling `const_trait_impl`.

cc `@oli-obk`
2022-11-13 17:37:37 +01:00
Matthias Krüger
5c764da9b0
Rollup merge of #104315 - SparkyPotato:fix-104276, r=cjgillot
Improve spans with `use crate::{self}`

Fixes #104276.

The error becomes:
```
error: crate root imports need to be explicitly named: `use crate as name;`
 --> src/lib.rs.rs:1:13
  |
1 | use crate::{self};
  |             ^^^^

warning: unused import: `self`
 --> src/lib.rs:1:13
  |
1 | use crate::{self};
  |             ^^^^
  |
  = note: `#[warn(unused_imports)]` on by default
```
2022-11-13 17:37:37 +01:00
Matthias Krüger
a1b0702ea5
Rollup merge of #103996 - SUPERCILEX:docs, r=RalfJung
Add small clarification around using pointers derived from references

r? `@RalfJung`

One question about your example from https://github.com/rust-lang/libs-team/issues/122: at what point does UB arise? If writing 0 does not cause UB and the reference `x` is never read or written to (explicitly or implicitly by being wrapped in another data structure) after the call to `foo`, does UB only arise when dropping the value? I don't really get that since I thought references were always supposed to point to valid data?

```rust
fn foo(x: &mut NonZeroI32)  {
  let ptr = x as *mut NonZeroI32;
  unsafe { ptr.cast::<i32>().write(0); } // no UB here
  // What now? x is considered garbage when?
}
```
2022-11-13 17:37:36 +01:00
Albert Larsan
94b9fbd12d
Make it also assign correct people 2022-11-13 16:09:15 +01:00
bors
e4d6307c63 Auto merge of #104292 - GuillaumeGomez:fix-missing-reexports-doc-comments, r=notriddle
Fix missing reexports' doc comments

Fixes #81893.

The issue was that an import directly "links" to the target without the intermediate imports. Unfortunately, to fix this bug we need to go through them one by one. To do so, I take the import path direct parent (so `b` in `a:🅱️:c`) and then look for `c` into it.

r? `@notriddle`
2022-11-13 15:02:10 +00:00
Albert Larsan
cf70c3d7ee
Add x tool to triagebot
Assign the A-bootstrap label when a pr modifies the x tool.
2022-11-13 15:31:49 +01:00
bors
afd7977c85 Auto merge of #93563 - ibraheemdev:crossbeam-channel, r=Amanieu
Merge crossbeam-channel into `std::sync::mpsc`

This PR imports the [`crossbeam-channel`](https://github.com/crossbeam-rs/crossbeam/tree/master/crossbeam-channel#crossbeam-channel) crate into the standard library as a private module, `sync::mpmc`. `sync::mpsc` is now implemented as a thin wrapper around `sync::mpmc`. The primary purpose of this PR is to resolve https://github.com/rust-lang/rust/issues/39364. The public API intentionally remains the same.

The reason https://github.com/rust-lang/rust/issues/39364 has not been fixed in over 5 years is that the current channel is *incredibly* complex. It was written many years ago and has sat mostly untouched since. `crossbeam-channel` has become the most popular alternative on crates.io, amassing over 30 million downloads. While crossbeam's channel is also complex, like all fast concurrent data structures, it avoids some of the major issues with the current implementation around dynamic flavor upgrades. The new implementation decides on the datastructure to be used when the channel is created, and the channel retains that structure until it is dropped.

Replacing `sync::mpsc` with a simpler, less performant implementation has been discussed as an alternative. However, Rust touts itself as enabling *fearless concurrency*, and having the standard library feature a subpar implementation of a core concurrency primitive doesn't feel right. The argument is that slower is better than broken, but this PR shows that we can do better.

As mentioned before, the primary purpose of this PR is to fix https://github.com/rust-lang/rust/issues/39364, and so the public API intentionally remains the same. *After* that problem is fixed, the fact that `sync::mpmc` now exists makes it easier to fix the primary limitation of `mpsc`, the fact that it only supports a single consumer. spmc and mpmc are two other common concurrency patterns, and this change enables a path to deprecating `mpsc` and exposing a general `sync::channel` module that supports multiple consumers. It also implements other useful methods such as `send_timeout`. That said, exposing MPMC and other new functionality is mostly out of scope for this PR, and it would be helpful if discussion stays on topic :)

For what it's worth, the new implementation has also been shown to be more performant in [some basic benchmarks](https://github.com/crossbeam-rs/crossbeam/tree/master/crossbeam-channel/benchmarks#results).

cc `@taiki-e`

r? rust-lang/libs
2022-11-13 12:08:42 +00:00
Ralf Jung
c78021709a add is_sized method on Abi and Layout, and use it 2022-11-13 12:23:53 +01:00
bors
928d14bcd1 Auto merge of #104351 - JohnTitor:rollup-ikh2dzr, r=JohnTitor
Rollup of 5 pull requests

Successful merges:

 - #103650 (rustdoc: change `.src-line-numbers > span` to `.src-line-numbers > a`)
 - #104177 (rustdoc: use consistent "popover" styling for notable traits)
 - #104318 (Move tests)
 - #104323 (rustdoc: remove no-op CSS `.scrape-help { background: transparent }`)
 - #104345 (Fix up a Fluent message)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2022-11-13 09:13:41 +00:00
SparkyPotato
c7b2891315 move span to self instead of crate 2022-11-13 13:46:11 +05:30
Yuki Okushi
05cd26b22d
Rollup merge of #104345 - fmease:fix-up-a-fluent-message, r=compiler-errors
Fix up a Fluent message

Fix up a Fluent message which contained arrows `->` after [selectors](https://projectfluent.org/fluent/guide/selectors.html). The original author probably thought that they were required as part of the selector syntax but in reality they were interpreted as literal text and actually showed up in the emitted diagnostic.

This wasn't caught during the diagnostic migration since the branch constructing the diagnostic in question (`rustc_infer::errors::LifetimeMismatchLabels::Normal`) was not exercised by the UI test suite. I've added two more test cases to do so (one testing `LifetimeMismatchLabels::Normal` where `hir_equal == true` and one where `hir_equal == false`).

Diff visualizing the `->` bug (`master` vs `fix-up-a-fluent-message`):

```diff
 error[E0623]: lifetime mismatch
   --> src/test/ui/implied-bounds/hrlt-implied-trait-bounds-guard.rs:39:30
    |
 39 | fn badboi3<'in_, 'out, T>(a: Foo<'in_, 'out, (&'in_ T, &'out T)>, sadness: &'in_ T) {
    |                              ^^^^^^^^^^^^^^^^^-------^^-------^^
    |                              |                |
    |                              |                these two types are declared with different lifetimes...
-   |                              ...but data->  from `a` flows->  into `a` here
+   |                              ...but data from `a` flows into `a` here
```
2022-11-13 16:41:46 +09:00
Yuki Okushi
0d2e94a9f1
Rollup merge of #104323 - notriddle:notriddle/scrape-help-background, r=GuillaumeGomez
rustdoc: remove no-op CSS `.scrape-help { background: transparent }`

It's a link. This is the default CSS for it.
2022-11-13 16:41:45 +09:00
Yuki Okushi
534c0999d1
Rollup merge of #104318 - c410-f3r:moar-errors, r=petrochenkov
Move tests

r? `@petrochenkov`

https://github.com/rust-lang/rust/pull/46521 -> enum-discriminant
2022-11-13 16:41:45 +09:00
Yuki Okushi
528b4af796
Rollup merge of #104177 - notriddle:notriddle/js-notable-trait-v2, r=GuillaumeGomez
rustdoc: use consistent "popover" styling for notable traits

Follow-up to #104129
Fixes https://github.com/rust-lang/rust/issues/104313.

Preview: https://notriddle.com/notriddle-rustdoc-demos/js-notable-trait-v2/std/iter/trait.Iterator.html#method.step_by

## Before

![image](https://user-images.githubusercontent.com/1593513/200710372-d2d992ce-0bdc-4437-9a2e-379a29df09cf.png)

![image](https://user-images.githubusercontent.com/1593513/200711266-e372b176-daa9-45f3-a022-738ef0a77d3c.png)

## After

![image](https://user-images.githubusercontent.com/1593513/200710601-09b3b717-116f-43c6-b14f-34a8b02b33c0.png)

![image](https://user-images.githubusercontent.com/1593513/200711288-3978cdc1-a6c2-47f6-9216-e22e3c1f5bdf.png)
2022-11-13 16:41:44 +09:00
Yuki Okushi
96753eb0e0
Rollup merge of #103650 - notriddle:notriddle/line-anchors, r=GuillaumeGomez
rustdoc: change `.src-line-numbers > span` to `.src-line-numbers > a`

Example: https://notriddle.com/notriddle-rustdoc-demos/line-anchors/test_dingus/fn.test.html

This allows people to treat them like real links, such as right-click to copy URL, and makes the line numbers in a scraped example work at all, when before this commit was added, they had the clickable pointer cursor but did not actually do anything when clicked.
2022-11-13 16:41:44 +09:00
bors
3be81dd0ce Auto merge of #104282 - cjgillot:intern-span, r=compiler-errors
Hash spans when interning types

Ignoring hash for spans creates an inconsistency between the `Hash` impl for `WithStableHash`, which takes them into account, and the `HashStable` impl which does not.

cc `@compiler-errors`

Fixes https://github.com/rust-lang/rust/issues/104271
Fixes https://github.com/rust-lang/rust/issues/104255
Fixes https://github.com/rust-lang/rust/issues/104238
2022-11-13 06:23:18 +00:00
Ibraheem Ahmed
a2f58ab2cb avoid using channels in thread-local tests 2022-11-12 23:44:52 -05:00
Ibraheem Ahmed
a22426916d avoid calling thread::current in channel destructor 2022-11-12 23:13:58 -05:00
bors
229e875878 Auto merge of #104078 - jyn514:dry-run-progress, r=Mark-Simulacrum
Print "Checking/Building ..." message even when --dry-run is passed

Print "Checking/Building ..." message even when --dry-run is passed

This makes it a lot easier to understand what commands will be run without
having to parse the `-vv` output, which isn't meant to be user facing.

I also want to change these messages at some point (https://github.com/rust-lang/rust/issues/102003) and this change will make it easier to paste a before/after comparison without having to actually build a stage 2 compiler.
2022-11-13 03:38:31 +00:00
León Orell Valerian Liehr
23dadb5617
fix up a fluent message 2022-11-13 04:16:08 +01:00
bors
fb6667a233 Auto merge of #103311 - petrochenkov:pblfix, r=bjorn3
linker: Refactoring and fixes to native library linking

This PR contains a bunch of code cleanup and comment rearrangements + 2 fixes for `-Zpacked-bundled-libs`.
It's better to look at individual commits.
2022-11-12 23:29:11 +00:00
Joshua Nelson
24378885c8 Print "Checking/Building ..." message even when --dry-run is passed
This makes it a lot easier to understand what commands will be run without
having to parse the `-vv` output, which isn't meant to be user facing.
2022-11-12 15:38:01 -06:00
Joshua Nelson
34972c512b Distinguish --dry-run from the automatic dry run check 2022-11-12 15:37:58 -06:00
bors
6284998a26 Auto merge of #103913 - Neutron3529:patch-1, r=thomcc
Improve performance of `rem_euclid()` for signed integers

such code is copy from
https://github.com/rust-lang/rust/blob/master/library/std/src/f32.rs and
https://github.com/rust-lang/rust/blob/master/library/std/src/f64.rs
using `r+rhs.abs()` is faster than calc it with an if clause. Bench result:
```
$ cargo bench
   Compiling div-euclid v0.1.0 (/me/div-euclid)
    Finished bench [optimized] target(s) in 1.01s
     Running unittests src/lib.rs (target/release/deps/div_euclid-7a4530ca7817d1ef)

running 7 tests
test tests::it_works ... ignored
test tests::bench_aaabs     ... bench:  10,498,793 ns/iter (+/- 104,360)
test tests::bench_aadefault ... bench:  11,061,862 ns/iter (+/- 94,107)
test tests::bench_abs       ... bench:  10,477,193 ns/iter (+/- 81,942)
test tests::bench_default   ... bench:  10,622,983 ns/iter (+/- 25,119)
test tests::bench_zzabs     ... bench:  10,481,971 ns/iter (+/- 43,787)
test tests::bench_zzdefault ... bench:  11,074,976 ns/iter (+/- 29,633)

test result: ok. 0 passed; 0 failed; 1 ignored; 6 measured; 0 filtered out; finished in 19.35s
```
It seems that, default `rem_euclid` triggered a branch prediction, thus `bench_default` is faster than `bench_aadefault` and `bench_aadefault`, which shuffles the order of calculations. but all of them slower than what it was in `f64`'s and `f32`'s `rem_euclid`, thus I submit this PR.

bench code:
```rust
#![feature(test)]
extern crate test;

fn rem_euclid(a:i32,rhs:i32)->i32{
    let r = a % rhs;
    if r < 0 { r + rhs.abs() } else { r }
}

#[cfg(test)]
mod tests {
    use super::*;
    use test::Bencher;
    use rand::prelude::*;
    use rand::rngs::SmallRng;
    const N:i32=1000;
    #[test]
    fn it_works() {
        let a: i32 = 7; // or any other integer type
        let b = 4;

        let d:Vec<i32>=(-N..=N).collect();
        let n:Vec<i32>=(-N..0).chain(1..=N).collect();

        for i in &d {
            for j in &n {
                assert_eq!(i.rem_euclid(*j),rem_euclid(*i,*j));
            }
        }

        assert_eq!(rem_euclid(a,b), 3);
        assert_eq!(rem_euclid(-a,b), 1);
        assert_eq!(rem_euclid(a,-b), 3);
        assert_eq!(rem_euclid(-a,-b), 1);
    }

    #[bench]
    fn bench_aaabs(b: &mut Bencher) {
        let mut d:Vec<i32>=(-N..=N).collect();
        let mut n:Vec<i32>=(-N..0).chain(1..=N).collect();
        let mut rng=SmallRng::from_seed([1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,21]);
        n.shuffle(&mut rng);
        d.shuffle(&mut rng);
        n.shuffle(&mut rng);
        b.iter(||{
            let mut res=0;
            for i in &d {
                for j in &n {
                    res+=rem_euclid(*i,*j);
                }
            }
            res
        });
    }
    #[bench]
    fn bench_aadefault(b: &mut Bencher) {
        let mut d:Vec<i32>=(-N..=N).collect();
        let mut n:Vec<i32>=(-N..0).chain(1..=N).collect();
        let mut rng=SmallRng::from_seed([1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,21]);
        n.shuffle(&mut rng);
        d.shuffle(&mut rng);
        n.shuffle(&mut rng);
        b.iter(||{
            let mut res=0;
            for i in &d {
                for j in &n {
                    res+=i.rem_euclid(*j);
                }
            }
            res
        });
    }

    #[bench]
    fn bench_abs(b: &mut Bencher) {
        let d:Vec<i32>=(-N..=N).collect();
        let n:Vec<i32>=(-N..0).chain(1..=N).collect();
        b.iter(||{
            let mut res=0;
            for i in &d {
                for j in &n {
                    res+=rem_euclid(*i,*j);
                }
            }
            res
        });
    }
    #[bench]
    fn bench_default(b: &mut Bencher) {
        let d:Vec<i32>=(-N..=N).collect();
        let n:Vec<i32>=(-N..0).chain(1..=N).collect();
        b.iter(||{
            let mut res=0;
            for i in &d {
                for j in &n {
                    res+=i.rem_euclid(*j);
                }
            }
            res
        });
    }

    #[bench]
    fn bench_zzabs(b: &mut Bencher) {
        let mut d:Vec<i32>=(-N..=N).collect();
        let mut n:Vec<i32>=(-N..0).chain(1..=N).collect();
        let mut rng=SmallRng::from_seed([1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,21]);
        d.shuffle(&mut rng);
        n.shuffle(&mut rng);
        d.shuffle(&mut rng);
        b.iter(||{
            let mut res=0;
            for i in &d {
                for j in &n {
                    res+=rem_euclid(*i,*j);
                }
            }
            res
        });
    }
    #[bench]
    fn bench_zzdefault(b: &mut Bencher) {
        let mut d:Vec<i32>=(-N..=N).collect();
        let mut n:Vec<i32>=(-N..0).chain(1..=N).collect();
        let mut rng=SmallRng::from_seed([1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,21]);
        d.shuffle(&mut rng);
        n.shuffle(&mut rng);
        d.shuffle(&mut rng);
        b.iter(||{
            let mut res=0;
            for i in &d {
                for j in &n {
                    res+=i.rem_euclid(*j);
                }
            }
            res
        });
    }
}
```
2022-11-12 20:48:27 +00:00
Vadim Petrochenkov
c2358a15f3 linker: Link profiler_builtins even if it's marked as NotLinked 2022-11-12 23:02:33 +03:00
Vadim Petrochenkov
58e4644969 Update run-make-fulldeps tests
Adjacent identical native libraries are no longer deduplicated if they come from different crates
2022-11-12 23:02:33 +03:00
Vadim Petrochenkov
82ecfd4ed6 linker: Support mixing crates built with different values of -Zpacked_bundled_libs
So you can change the value of `-Zpacked_bundled_libs` without rebuilding standard library
2022-11-12 23:02:33 +03:00
Vadim Petrochenkov
fe7aab13b1 linker: Move some inner functions to the outside
Inline `fn unlib`
2022-11-12 23:02:33 +03:00
Vadim Petrochenkov
e792de28c8 linker: Simplify linking of compiler_builtins and profiler_builtins
This also fixes linking of native libraries bundled into these crates when `-Zpacked-bundled-libs` is enabled
2022-11-12 23:02:33 +03:00
Vadim Petrochenkov
cae3c936eb linker: Factor out native library linking to a separate function 2022-11-12 23:02:32 +03:00
bors
cd128880b1 Auto merge of #104325 - GuillaumeGomez:rollup-19bzwoa, r=GuillaumeGomez
Rollup of 8 pull requests

Successful merges:

 - #104110 (prevent uninitialized access in black_box for zero-sized-types)
 - #104117 (Mark `trait_upcasting` feature no longer incomplete.)
 - #104144 (Suggest removing unnecessary `.` to use a floating point literal)
 - #104250 (Migrate no result page link color to CSS variables)
 - #104261 (More accurately report error when formal and expected signature types differ)
 - #104263 (Add a reference to ilog2 in leading_zeros integer docs)
 - #104308 (Remove the old `ValidAlign` name)
 - #104319 (Fix non clickable source link)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2022-11-12 17:39:11 +00:00
Guillaume Gomez
d532d67821
Rollup merge of #104319 - GuillaumeGomez:fix-non-clickable-source-link, r=notriddle
Fix non clickable source link

Fixes https://github.com/rust-lang/rust/issues/104313.

It was also fixed in https://github.com/rust-lang/rust/pull/104177. If https://github.com/rust-lang/rust/pull/104177 is merged first, I'll simply remove the first commit to keep the test.

r? ``@notriddle``
2022-11-12 17:25:04 +01:00
Guillaume Gomez
f48dba1422
Rollup merge of #104308 - scottmcm:no-more-validalign, r=thomcc
Remove the old `ValidAlign` name

Since it looks like there won't be any reverts needed in `Layout` for https://github.com/rust-lang/rust/issues/101899#issuecomment-1290805223, finish off this change that I'd left out of #102072.

r? ``@thomcc``
cc tracking issue #102070
2022-11-12 17:25:03 +01:00
Guillaume Gomez
cd4b3ac379
Rollup merge of #104263 - albertlarsan68:add-ilog2-to-leading-zeroes-docs, r=scottmcm
Add a reference to ilog2 in leading_zeros integer docs

Fixes #104248
2022-11-12 17:25:03 +01:00
Guillaume Gomez
fe80364500
Rollup merge of #104261 - compiler-errors:formal-and-expected-differ, r=estebank
More accurately report error when formal and expected signature types differ

Fixes #104242
2022-11-12 17:25:02 +01:00
Guillaume Gomez
6601e20148
Rollup merge of #104250 - GuillaumeGomez:migrate-not-found-link-color, r=notriddle
Migrate no result page link color to CSS variables

r? ``@notriddle``
2022-11-12 17:25:02 +01:00
Guillaume Gomez
55ae6516f9
Rollup merge of #104144 - TaKO8Ki:suggest-removing-unnecessary-dot, r=fee1-dead
Suggest removing unnecessary `.` to use a floating point literal

Fixes a part of #101883
2022-11-12 17:25:01 +01:00
Guillaume Gomez
bef2da0629
Rollup merge of #104117 - crlf0710:update_feature_gate, r=jackh726
Mark `trait_upcasting` feature no longer incomplete.

This marks the `trait_upcasting` feature no longer incomplete since #101336 has been settled for a little while.

r? ``````@jackh726``````
2022-11-12 17:25:01 +01:00
Guillaume Gomez
798815aec5
Rollup merge of #104110 - krasimirgg:msan-16, r=nagisa
prevent uninitialized access in black_box for zero-sized-types

Don't read the pointer location in black_box for zero sized types, just emit a memory clobber instead. Addresses  https://github.com/rust-lang/rust/issues/103304 when rust is build against LLVM at HEAD.

Zulip thread: https://rust-lang.zulipchat.com/#narrow/stream/187780-t-compiler.2Fwg-llvm/topic/.28with.20llvm.20at.20HEAD.29.3A.20msan.20error.20in.20core.3A.3Ahint.3A.3Ablack_box
2022-11-12 17:25:00 +01:00
Michael Howell
cb3a04b6ef rustdoc: avoid excessive HTML generated in example sources 2022-11-12 09:23:09 -07:00
Michael Howell
fa2c08112f rustdoc: remove no-op CSS .scrape-help { background: transparent }
It's a link. This is the default CSS for it.
2022-11-12 09:21:29 -07:00
bors
8ef2485bd5 Auto merge of #103812 - clubby789:improve-include-bytes, r=petrochenkov
Delay `include_bytes` to AST lowering

Hopefully addresses #65818.
This PR introduces a new `ExprKind::IncludedBytes` which stores the path and bytes of a file included with `include_bytes!()`. We can then create a literal from the bytes during AST lowering, which means we don't need to escape the bytes into valid UTF8 which is the cause of most of the overhead of embedding large binary blobs.
2022-11-12 14:30:34 +00:00
Guillaume Gomez
c645d3e063 Add GUI test to ensure that source links can be clicked 2022-11-12 13:58:59 +01:00
Deadbeef
4b217e4624 Use derive_const and rm manual StructuralEq impl 2022-11-12 12:57:10 +00:00