Skip to content
This repository was archived by the owner on May 23, 2024. It is now read-only.

Commit 2198d44

Browse files
committed
Merge branch 'master' into filtering+issue-101696
2 parents d951f8a + ac6d26c commit 2198d44

File tree

210 files changed

+2457
-347
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

210 files changed

+2457
-347
lines changed

Cargo.lock

+277-175
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

+7-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ edition = "2021"
88

99
[dependencies]
1010
alphanumeric-sort = "1.4.0"
11-
anyhow = "1.0.37"
11+
anyhow = { workspace = true }
1212
rayon = "1.5.0"
1313
tempfile = "3.1.0"
1414

@@ -18,5 +18,11 @@ members = [
1818
"labeler"
1919
]
2020

21+
[workspace.dependencies]
22+
anyhow = "1.0.37"
23+
once_cell = "1.2.0"
24+
reqwest = { version = "0.11", features = ["blocking", "json"] }
25+
serde = { version = "1.0.101", features = ["derive"] }
26+
2127
[patch.crates-io]
2228
glacier = { path = "." }

autofix/Cargo.toml

+5-5
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ edition = "2021"
77
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
88

99
[dependencies]
10-
anyhow = "1.0.26"
11-
git2 = { version = "0.15", default-features = false, features = ["https"] }
10+
anyhow = { workspace = true }
11+
git2 = { version = "0.16", default-features = false, features = ["https"] }
1212
glacier = "0.1.0"
13-
once_cell = "1.2.0"
14-
reqwest = { version = "0.11", features = ["blocking", "json"] }
15-
serde = { version = "1.0.101", features = ["derive"] }
13+
once_cell = { workspace = true }
14+
reqwest = { workspace = true }
15+
serde = { workspace = true }

autofix/src/fix.rs

+7-7
Original file line numberDiff line numberDiff line change
@@ -18,16 +18,16 @@ fn format_descriptions(test: &TestResult) -> Result<Descriptions> {
1818
let title = test.title();
1919
let description = test.description().unwrap();
2020

21-
let commit_message = format!("{}\n\n{}\n", title, description);
21+
let commit_message = format!("{title}\n\n{description}\n");
2222

2323
let file = read_to_string(test.path())?;
2424
let syntax = test.syntax();
2525

2626
let issue = format!("Issue: {}", test.issue_url());
27-
let file_codeblock = format!("```{}\n{}\n```", syntax, file);
28-
let description_codeblock = format!("```\n{}\n```", description);
27+
let file_codeblock = format!("```{syntax}\n{file}\n```");
28+
let description_codeblock = format!("```\n{description}\n```");
2929

30-
let pr_body = format!("{}\n{}\n{}\n", issue, file_codeblock, description_codeblock);
30+
let pr_body = format!("{issue}\n{file_codeblock}\n{description_codeblock}\n");
3131

3232
Ok(Descriptions {
3333
commit_message,
@@ -55,7 +55,7 @@ fn move_to_fixed<'a>(repo: &'a Repository, test: &TestResult) -> Result<Tree<'a>
5555
index.remove(test.path(), 0)?;
5656

5757
let new_path =
58-
new_path_bytes(test.path()).with_context(|| format!("ICE has no filename: {:?}", test))?;
58+
new_path_bytes(test.path()).with_context(|| format!("ICE has no filename: {test:?}"))?;
5959

6060
entry.path = new_path;
6161

@@ -93,7 +93,7 @@ pub(crate) fn fix(test: &TestResult, config: &github::Config) -> Result<()> {
9393
let remote_branch = format!("refs/remotes/origin/autofix/{}", &path);
9494

9595
if repo.find_reference(&remote_branch).is_ok() {
96-
println!("Branch exists: {}", remote_branch);
96+
println!("Branch exists: {remote_branch}");
9797
return Ok(());
9898
}
9999

@@ -123,6 +123,6 @@ pub(crate) fn fix(test: &TestResult, config: &github::Config) -> Result<()> {
123123
},
124124
)?;
125125

126-
println!("Created pull request: {}", url);
126+
println!("Created pull request: {url}");
127127
Ok(())
128128
}

autofix/src/github.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ pub(crate) fn pull_request(config: &Config, options: &PullRequestOptions) -> Res
5050
let url = format!("https://api.github.com/repos/{}/pulls", config.repo);
5151

5252
let pr: PullRequest = CLIENT
53-
.post(&url)
53+
.post(url)
5454
.header(reqwest::header::ACCEPT, "application/vnd.github.v3+json")
5555
.bearer_auth(&config.token)
5656
.json(&options)

ices/100114.rs fixed/100114.rs

File renamed without changes.

ices/100183.rs fixed/100183.rs

File renamed without changes.

ices/100672.rs fixed/100672.rs

File renamed without changes.

ices/100689.rs fixed/100689.rs

File renamed without changes.

ices/100772.sh fixed/100772.sh

-1
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,3 @@ fn main() {
99
}
1010
1111
EOF
12-

ices/100783.sh fixed/100783.sh

File renamed without changes.

ices/100818.rs fixed/100818.rs

File renamed without changes.

ices/101001.sh fixed/101001.sh

File renamed without changes.

ices/101036.rs fixed/101036.rs

File renamed without changes.

ices/101465.rs fixed/101465.rs

File renamed without changes.

ices/101518-1.sh fixed/101518-1.sh

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
#!/bin/bash
22

3-
rustc -Cincremental=/tmp/a -Zincremental-verify-ich=yes --crate-type lib - <<'EOF'
4-
3+
rustc -Cincremental=/tmp/a -Zincremental-verify-ich=yes --crate-type lib - <<'EOF'
54
65
#[derive(PartialEq, Eq)]
76
struct Id<'a> {

ices/101518-2.sh fixed/101518-2.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/bin/bash
22

3-
rustc -Cincremental=/tmp/a -Zincremental-verify-ich=yes --crate-type lib - <<'EOF'
3+
rustc -Cincremental=/tmp/a -Zincremental-verify-ich=yes --crate-type lib - <<'EOF'
44
55
#[derive(Eq, PartialEq)]
66
struct Id(&'static str);

ices/101660-1.rs fixed/101660-1.rs

File renamed without changes.

ices/101660-2.rs fixed/101660-2.rs

File renamed without changes.

ices/101665.rs fixed/101665.rs

File renamed without changes.

ices/101667.rs fixed/101667.rs

File renamed without changes.

fixed/101696-1.rs

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
use std::marker::PhantomData;
2+
3+
#[derive(Default)]
4+
struct MyType<'a> {
5+
field: usize,
6+
_phantom: PhantomData<&'a ()>,
7+
}
8+
9+
#[derive(Default)]
10+
struct MyTypeVariant<'a> {
11+
field: usize,
12+
_phantom: PhantomData<&'a ()>,
13+
}
14+
15+
trait AsVariantTrait {
16+
type Type;
17+
}
18+
19+
impl<'a> AsVariantTrait for MyType<'a> {
20+
type Type = MyTypeVariant<'a>;
21+
}
22+
23+
type Variant<G> = <G as AsVariantTrait>::Type;
24+
25+
fn foo<T: Default, F: FnOnce(T)>(f: F) {
26+
let input = T::default();
27+
f(input);
28+
}
29+
30+
fn main() {
31+
foo(|a: Variant<MyType>| {
32+
a.field;
33+
});
34+
}

fixed/101696-2.rs

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
use std::marker::PhantomData;
2+
3+
#[derive(Default)]
4+
struct MyType<'a> {
5+
field: usize,
6+
_phantom: PhantomData<&'a ()>,
7+
}
8+
9+
#[derive(Default)]
10+
struct MyTypeVariant<'a> {
11+
field: usize,
12+
_phantom: PhantomData<&'a ()>,
13+
}
14+
15+
trait AsVariantTrait {
16+
type Type;
17+
}
18+
19+
impl<'a> AsVariantTrait for MyType<'a> {
20+
type Type = MyTypeVariant<'a>;
21+
}
22+
23+
fn foo<T: Default, F: FnOnce(T)>(f: F) {
24+
let input = T::default();
25+
f(input);
26+
}
27+
28+
fn main() {
29+
foo(|a: <MyType as AsVariantTrait>::Type| {
30+
a.field;
31+
});
32+
}

fixed/101940.rs

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
pub trait Trait {
2+
type Fut<'a> where Self: 'a;
3+
fn fun<'a, 'b>(&'a self, x: &'_ mut &'b ()) -> Self::Fut<'a>
4+
where
5+
'b: 'a;
6+
}
7+
impl Trait for () {
8+
type Fut<'a> = impl ::std::future::Future + 'a
9+
where
10+
Self: 'a;
11+
fn fun<'a, 'b>(&'a self, x: &'_ mut &'b ()) -> Self::Fut<'a>
12+
where
13+
'b: 'a,
14+
{
15+
async { }
16+
}
17+
}
18+
19+
pub fn main() {}

ices/96175.rs fixed/101964.rs

+10-11
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,26 @@
1-
// build-pass
2-
// compile-flags: -Z mir-opt-level=3
3-
4-
#![crate_type="lib"]
1+
#![crate_type = "lib"]
52
#![feature(lang_items)]
63
#![no_std]
74

5+
struct NonNull<T: ?Sized>(*mut T);
6+
7+
struct Unique<T: ?Sized>(NonNull<T>);
8+
89
#[lang = "owned_box"]
9-
pub struct Box<T: ?Sized>(*mut T);
10+
pub struct Box<T: ?Sized>(Unique<T>);
1011

1112
impl<T: ?Sized> Drop for Box<T> {
12-
fn drop(&mut self) {
13-
}
13+
fn drop(&mut self) {}
1414
}
1515

1616
#[lang = "box_free"]
1717
#[inline(always)]
18-
unsafe fn box_free<T: ?Sized>(ptr: *mut T) {
19-
dealloc(ptr)
18+
unsafe fn box_free<T: ?Sized>(ptr: Unique<T>) {
19+
dealloc(ptr.0.0)
2020
}
2121

2222
#[inline(never)]
23-
fn dealloc<T: ?Sized>(_: *mut T) {
24-
}
23+
fn dealloc<T: ?Sized>(_: *mut T) {}
2524

2625
pub struct Foo<T>(T);
2726

fixed/102089.rs

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
// crash with edition=2021
2+
pub struct Example<'a, T> {
3+
a: T,
4+
b: &'a T,
5+
}
6+
7+
impl<'a, T> Example<'a, T> {
8+
pub fn error_trying_to_destructure_self_in_closure(self) {
9+
let closure = || {
10+
let Self { a, b } = self;
11+
};
12+
}
13+
}
14+
15+
pub fn main() {}

fixed/102114-1.rs

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
trait A{type B<'b>;}
2+
struct C;
3+
impl A for C {
4+
type B<b> =impl;
5+
fn a() -> Self::B<'a>;
6+
}

fixed/102114-2.rs

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
trait A {
2+
type B<'b>;
3+
fn a() -> Self::B<'static>;
4+
}
5+
6+
struct C;
7+
8+
struct Wrapper<T>(T);
9+
10+
impl A for C {
11+
type B<T> = Wrapper<T>;
12+
fn a() -> Self::B<'static> {}
13+
}

fixed/102117.rs

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
#![crate_type = "lib"]
2+
#![feature(inline_const, const_type_id)]
3+
4+
use std::alloc::Layout;
5+
use std::any::TypeId;
6+
use std::mem::transmute;
7+
use std::ptr::drop_in_place;
8+
9+
pub struct VTable {
10+
layout: Layout,
11+
type_id: TypeId,
12+
drop_in_place: unsafe fn(*mut ()),
13+
}
14+
15+
impl VTable {
16+
pub fn new<T>() -> &'static Self {
17+
const {
18+
&VTable {
19+
layout: Layout::new::<T>(),
20+
type_id: TypeId::of::<T>(),
21+
drop_in_place: unsafe {
22+
transmute::<unsafe fn(*mut T), unsafe fn(*mut ())>(drop_in_place::<T>)
23+
},
24+
}
25+
}
26+
}
27+
}

fixed/102124.sh

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
#!/bin/bash
2+
3+
rustc -Zmir-opt-level=3 - <<'EOF'
4+
5+
const L: usize = 4;
6+
7+
pub trait Print<const N: usize> {
8+
fn print(&self) -> usize {
9+
N
10+
}
11+
}
12+
13+
pub struct Printer;
14+
impl Print<L> for Printer {}
15+
16+
fn main() {
17+
let p = Printer;
18+
assert_eq!(p.print(), 4);
19+
}
20+
21+
EOF
22+

fixed/102140.rs

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
#![feature(return_position_impl_trait_in_trait)]
2+
3+
trait Marker {}
4+
impl Marker for u32 {}
5+
6+
trait MyTrait {
7+
fn foo(&self) -> impl Marker
8+
where Self: Sized;
9+
}
10+
11+
struct Outer;
12+
13+
impl MyTrait for Outer {
14+
fn foo(&self) -> impl Marker {
15+
42
16+
}
17+
}
18+
19+
impl dyn MyTrait {
20+
fn other(&self) -> impl Marker {
21+
MyTrait::foo(&self)
22+
}
23+
}

fixed/102154.sh

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
#!/bin/bash
2+
3+
cat > out.rs <<'EOF'
4+
5+
trait A<Y, N> {
6+
type B;
7+
}
8+
type MaybeBox<T> = <T as A<T, Box<T>>>::B;
9+
struct P {
10+
t: MaybeBox<P>
11+
}
12+
impl<Y, N> A<Y, N> for P {
13+
type B = N;
14+
}
15+
fn main() {
16+
let t: MaybeBox<P>;
17+
}
18+
19+
EOF
20+
21+
rustdoc --edition=2021 out.rs

fixed/102156.rs

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#![feature(allocator_api)]
2+
3+
#![feature(const_trait_impl)]
4+
use core::convert::{From, TryFrom};
5+
use std::pin::Pin;
6+
use std::alloc::Allocator;
7+
impl<T: ?Sized, A: Allocator> const From<Box<T, A>> for Pin<Box<T, A>>
8+
where
9+
A: 'static,
10+
{}
11+
12+
pub fn main() {}

fixed/102172.rs

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#![feature(dyn_star)]
2+
#![allow(incomplete_features)]
3+
4+
use std::fmt::Debug;
5+
6+
fn main() {
7+
let i = 42 as &dyn* Debug;
8+
}

0 commit comments

Comments
 (0)