forked from rust-lang/glacier
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
rust-lang/rust#99318 rust-lang/rust#99319 rust-lang/rust#99325 rust-lang/rust#99331 rust-lang/rust#99348 rust-lang/rust#99363
- Loading branch information
1 parent
d4afad7
commit cb73b16
Showing
6 changed files
with
100 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#!/bin/bash | ||
|
||
rustc -Zunpretty=hir - <<'EOF' | ||
#![feature(let_else)] | ||
pub fn main() { | ||
let Some(x) = &Some(3) else { | ||
panic!(); | ||
}; | ||
*x += 1; //~ ERROR: cannot assign to `*x`, which is behind a `&` reference | ||
} | ||
EOF | ||
|
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,13 @@ | ||
#!/bin/bash | ||
|
||
rustc -Zunpretty=hir - <<'EOF' | ||
#![feature(let_else)] | ||
fn main() { | ||
let true = true && false else { return }; //~ ERROR a `&&` expression cannot be directly assigned in `let...else` | ||
let true = true || false else { return }; //~ ERROR a `||` expression cannot be directly assigned in `let...else` | ||
} | ||
EOF | ||
|
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,18 @@ | ||
#!/bin/bash | ||
|
||
rustc -Zunpretty=mir - <<'EOF' | ||
#![feature(adt_const_params)] | ||
#![allow(incomplete_features)] | ||
pub fn function_with_bytes<const BYTES: &'static [u8; 4]>() -> &'static [u8] { | ||
BYTES | ||
} | ||
pub fn main() { | ||
assert_eq!(function_with_bytes::<b"AAAA">(), &[0x41, 0x41, 0x41, 0x41]); | ||
assert_eq!(function_with_bytes::<{ &[0x41, 0x41, 0x41, 0x41] }>(), b"AAAA"); | ||
} | ||
EOF | ||
|
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,10 @@ | ||
#!/bin/bash | ||
|
||
rustc -Zunpretty=expanded - <<'EOF' | ||
extern "路濫狼á́́" fn foo() {} //~ ERROR invalid ABI | ||
fn main() { } | ||
EOF | ||
|
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,25 @@ | ||
#![feature(type_alias_impl_trait)] | ||
|
||
struct Concrete; | ||
|
||
type Tait = impl Sized; | ||
|
||
impl Foo for Concrete { | ||
type Item = Concrete; | ||
} | ||
|
||
impl Bar for Concrete { | ||
type Other = Tait; | ||
} | ||
|
||
trait Foo { | ||
type Item: Bar<Other = Self>; | ||
} | ||
|
||
trait Bar { | ||
type Other; | ||
} | ||
|
||
fn tait() -> Tait {} | ||
|
||
pub fn main() {} |
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,19 @@ | ||
#!/bin/bash | ||
|
||
rustc --edition=2021 - <<'EOF' | ||
#![feature(type_alias_impl_trait)] | ||
#[derive(Copy, Clone)] | ||
struct Foo((u32, u32)); | ||
fn main() { | ||
type T = impl Copy; | ||
let foo: T = Foo((1u32, 2u32)); | ||
let x = move || { | ||
let Foo((a, b)) = foo; | ||
}; | ||
} | ||
EOF | ||
|