forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Auto merge of rust-lang#57305 - pietroalbini:beta-rollup, r=pietroalbini
[beta] Rollup backports Cherry-picked: * rust-lang#57053: Fix alignment for array indexing * rust-lang#57181: resolve: Fix another ICE in import validation * rust-lang#57185: resolve: Fix one more ICE in import validation * rust-lang#57282: Wf-check the output type of a function in MIR-typeck * rust-lang#55318: Ensure that Rustdoc discovers all necessary auto trait bounds * rust-lang#56838: Call poly_project_and_unify_type on types that contain inference types Rolled up: * rust-lang#57300: [beta] Update RLS to include 100% CPU on hover bugfix * rust-lang#57301: beta: bootstrap from latest stable (1.31.1) * rust-lang#57292: [BETA] Update cargo r? @ghost
- Loading branch information
Showing
24 changed files
with
375 additions
and
57 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
// compile-flags: -C no-prepopulate-passes | ||
|
||
#![crate_type="rlib"] | ||
use std::usize; | ||
|
||
#[repr(align(16))] | ||
pub struct S { | ||
arr: [u32; 4], | ||
} | ||
|
||
// CHECK-LABEL: @test1 | ||
// CHECK: store i32 0, i32* %{{.+}}, align 16 | ||
// CHECK: store i32 1, i32* %{{.+}}, align 4 | ||
// CHECK: store i32 2, i32* %{{.+}}, align 8 | ||
// CHECK: store i32 3, i32* %{{.+}}, align 4 | ||
#[no_mangle] | ||
pub fn test1(s: &mut S) { | ||
s.arr[0] = 0; | ||
s.arr[1] = 1; | ||
s.arr[2] = 2; | ||
s.arr[3] = 3; | ||
} | ||
|
||
// CHECK-LABEL: @test2 | ||
// CHECK: store i32 4, i32* %{{.+}}, align 4 | ||
#[allow(const_err)] | ||
#[no_mangle] | ||
pub fn test2(s: &mut S) { | ||
s.arr[usize::MAX / 4 + 1] = 4; | ||
} | ||
|
||
// CHECK-LABEL: @test3 | ||
// CHECK: store i32 5, i32* %{{.+}}, align 4 | ||
#[no_mangle] | ||
pub fn test3(s: &mut S, i: usize) { | ||
s.arr[i] = 5; | ||
} | ||
|
||
// CHECK-LABEL: @test4 | ||
// CHECK: store i32 6, i32* %{{.+}}, align 4 | ||
#[no_mangle] | ||
pub fn test4(s: &mut S) { | ||
s.arr = [6; 4]; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
// Copyright 2018 The Rust Project Developers. See the COPYRIGHT | ||
// file at the top-level directory of this distribution and at | ||
// http://rust-lang.org/COPYRIGHT. | ||
// | ||
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or | ||
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license | ||
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your | ||
// option. This file may not be copied, modified, or distributed | ||
// except according to those terms. | ||
|
||
|
||
pub trait Signal { | ||
type Item; | ||
} | ||
|
||
pub trait Signal2 { | ||
type Item2; | ||
} | ||
|
||
impl<B, C> Signal2 for B where B: Signal<Item = C> { | ||
type Item2 = C; | ||
} | ||
|
||
// @has issue_50159/struct.Switch.html | ||
// @has - '//code' 'impl<B> Send for Switch<B> where <B as Signal>::Item: Send' | ||
// @has - '//code' 'impl<B> Sync for Switch<B> where <B as Signal>::Item: Sync' | ||
// @count - '//*[@id="implementations-list"]/*[@class="impl"]' 0 | ||
// @count - '//*[@id="synthetic-implementations-list"]/*[@class="impl"]' 2 | ||
pub struct Switch<B: Signal> { | ||
pub inner: <B as Signal2>::Item2, | ||
} |
Oops, something went wrong.