Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rollup of 9 pull requests #90712

Closed
wants to merge 27 commits into from
Closed
Changes from 1 commit
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
9cab312
ARMv6K Horizon OS panic change
Meziu Nov 2, 2021
d379147
Updated backtrace submodule
Meziu Nov 2, 2021
084b232
add const generics test
lcnr Nov 4, 2021
dbc3bf4
treat illumos like solaris in failing ui tests which need it
richlowe Nov 4, 2021
ed7e438
use filter(|x| matches!(..)) instead of filter_map(|x| match x ... =>…
matthiaskrgr Nov 6, 2021
e8f1d57
Fix last doc code comment being removed if it only had one character
GuillaumeGomez Nov 6, 2021
aa6f6f4
Add test for removed one character last line in rustdoc
GuillaumeGomez Nov 6, 2021
02c1774
Give inline const separate DefKind
nbdd0121 Oct 2, 2021
468192a
Implement type inference for inline consts
nbdd0121 Oct 2, 2021
4acef9a
Add unit test for issue 78132
nbdd0121 Oct 3, 2021
1d32b20
Add unit test for issue 78174
nbdd0121 Oct 3, 2021
ff055e2
Ensure closure requirements are proven for inline const
nbdd0121 Oct 3, 2021
4060ed7
Add a FIXME note about what's missing
nbdd0121 Oct 3, 2021
d0f59f6
Fix closures within inline const
nbdd0121 Oct 23, 2021
c4103d4
Rename functions reflect that inline const is also "typeck_child"
nbdd0121 Nov 6, 2021
1e56dd4
:arrow_up: rust-analyzer
lnicola Nov 8, 2021
86c0ef8
Add comments regarding superfluous `!Sync` impls
bstrie Jul 27, 2021
048e1c9
Add a note about feature(explicit_generic_args_with_impl_trait) to th…
meithecatte Nov 8, 2021
efc320c
Rollup merge of #87530 - bstrie:commentsync, r=bstrie
matthiaskrgr Nov 8, 2021
e4ce370
Rollup merge of #89561 - nbdd0121:const_typeck, r=nikomatsakis
matthiaskrgr Nov 8, 2021
8cbe7a8
Rollup merge of #90494 - Meziu:armv6k-3ds-target, r=sanxiyn
matthiaskrgr Nov 8, 2021
98db52d
Rollup merge of #90578 - lcnr:add-test, r=Mark-Simulacrum
matthiaskrgr Nov 8, 2021
1eebe3e
Rollup merge of #90591 - richlowe:illumos-ui-target, r=Mark-Simulacrum
matthiaskrgr Nov 8, 2021
21554e6
Rollup merge of #90652 - matthiaskrgr:unnnec_filter_map, r=jyn514
matthiaskrgr Nov 8, 2021
f9d481c
Rollup merge of #90657 - GuillaumeGomez:one-char-last-line-removed, r…
matthiaskrgr Nov 8, 2021
e1093a7
Rollup merge of #90689 - lnicola:rust-analyzer-2021-11-08, r=lnicola
matthiaskrgr Nov 8, 2021
fb94698
Rollup merge of #90708 - NieDzejkob:feature-note, r=jackh726
matthiaskrgr Nov 8, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add unit test for issue 78174
  • Loading branch information
nbdd0121 committed Nov 7, 2021
commit 1d32b201707ce6327c0ab322c4e06d8e0367f563
36 changes: 36 additions & 0 deletions src/test/ui/inline-const/const-expr-lifetime.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
// run-pass

#![allow(incomplete_features)]
#![feature(const_mut_refs)]
#![feature(inline_const)]

use std::marker::PhantomData;

// rust-lang/rust#78174: ICE: "cannot convert ReErased to a region vid"
fn issue_78174() {
let foo = const { "foo" };
assert_eq!(foo, "foo");
}

pub struct InvariantRef<'a, T: ?Sized>(&'a T, PhantomData<&'a mut &'a T>);

impl<'a, T: ?Sized> InvariantRef<'a, T> {
pub const fn new(r: &'a T) -> Self {
InvariantRef(r, PhantomData)
}
}

fn get_invariant_ref<'a>() -> InvariantRef<'a, ()> {
const { InvariantRef::<'a, ()>::new(&()) }
}

fn get_invariant_ref2<'a>() -> InvariantRef<'a, ()> {
// Try some type inference
const { InvariantRef::new(&()) }
}

fn main() {
issue_78174();
get_invariant_ref();
get_invariant_ref2();
}
36 changes: 36 additions & 0 deletions src/test/ui/inline-const/const-match-pat-lifetime.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
// run-pass

#![allow(incomplete_features)]
#![feature(const_mut_refs)]
#![feature(inline_const)]

use std::marker::PhantomData;

// rust-lang/rust#78174: ICE: "cannot convert ReErased to a region vid"
fn issue_78174() {
match "foo" {
const { concat!("fo", "o") } => (),
_ => unreachable!(),
}
}

#[derive(PartialEq, Eq)]
pub struct InvariantRef<'a, T: ?Sized>(&'a T, PhantomData<&'a mut &'a T>);

impl<'a, T: ?Sized> InvariantRef<'a, T> {
pub const fn new(r: &'a T) -> Self {
InvariantRef(r, PhantomData)
}
}

fn match_invariant_ref<'a>() {
match const { InvariantRef::<'a, _>::new(&()) } {
const { InvariantRef::<'a, ()>::new(&()) } => {
}
}
}

fn main() {
issue_78174();
match_invariant_ref();
}