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 8 pull requests #110772

Closed
wants to merge 33 commits into from
Closed
Changes from 1 commit
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
d9256f9
Add Lazy{Cell,Lock}::into_inner
SUPERCILEX Dec 26, 2022
41e3cc4
Add some tests around (lack of) object safety of associated types and…
oli-obk Apr 20, 2023
704a9da
Ignore src/bootstrap formatting commit in .git-blame-ignore-revs
jyn514 Apr 20, 2023
06ff310
Migrate `rustc_hir_analysis` to session diagnostic
obeis Apr 14, 2023
adb5ded
add known-bug test for unsound issue 25860
whtahy Apr 18, 2023
2fb2098
add known-bug test for unsound issue 49206
whtahy Apr 18, 2023
232d685
add known-bug test for unsound issue 57893
whtahy Apr 19, 2023
fbfb620
add known-bug test for unsound issue 84366
whtahy Apr 19, 2023
cac62ab
add known-bug test for unsound issue 84533
whtahy Apr 19, 2023
be68c69
add known-bug test for unsound issue 84591
whtahy Apr 19, 2023
3c5de9a
add known-bug test for unsound issue 85099
whtahy Apr 20, 2023
0e68cbd
Remove useless special case.
cjgillot Apr 15, 2023
629cdb4
Move eval_discriminant.
cjgillot Apr 15, 2023
dd452ae
Simplify logic.
cjgillot Apr 15, 2023
dd78b99
Reduce rightward drift.
cjgillot Apr 15, 2023
3141262
add known-bug test for unsound issue 98117
whtahy Apr 22, 2023
cff6c0e
add known-bug test for unsound issue 100041
whtahy Apr 22, 2023
6f6550f
add known-bug test for unsound issue 100051
whtahy Apr 22, 2023
ebe61ce
add known-bug test for unsound issue 104005
whtahy Apr 22, 2023
f5e535c
bootstrap: update paths cargo-credential crate
weihanglo Apr 23, 2023
e496fbe
Split `{Idx, IndexVec, IndexSlice}` into their own modules
WaffleLapkin Apr 19, 2023
99ebfe2
move index code around
WaffleLapkin Apr 19, 2023
7d23b52
`const`-ify some `{IndexVec, IndexSlice}` methods
WaffleLapkin Apr 19, 2023
5d809b1
Decorative changes to `IndexVec`
WaffleLapkin Apr 19, 2023
c0daff0
Fix `rustc_index` imports outside the compiler
WaffleLapkin Apr 19, 2023
d03ebe4
Rollup merge of #106152 - SUPERCILEX:lazycell, r=Amanieu
matthiaskrgr Apr 24, 2023
66e0836
Rollup merge of #110325 - obeis:hir-analysis-migrate-diagnostics-4, r…
matthiaskrgr Apr 24, 2023
9b0db55
Rollup merge of #110480 - whtahy:105107/known-bug-tests-for-unsound-i…
matthiaskrgr Apr 24, 2023
07d4ee4
Rollup merge of #110539 - WaffleLapkin:split_index_vec&slice, r=cjgillot
matthiaskrgr Apr 24, 2023
a0cc452
Rollup merge of #110590 - oli-obk:object_safe_assoc_types, r=jackh726
matthiaskrgr Apr 24, 2023
1b540f7
Rollup merge of #110602 - jyn514:ignore-fmt, r=Mark-Simulacrum
matthiaskrgr Apr 24, 2023
704e78c
Rollup merge of #110685 - cjgillot:clean-dcp, r=oli-obk
matthiaskrgr Apr 24, 2023
79efb26
Rollup merge of #110744 - weihanglo:cargo-credential-install, r=ehuss
matthiaskrgr Apr 24, 2023
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 known-bug test for unsound issue 104005
whtahy committed Apr 22, 2023

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
commit ebe61cefc4fa30f0a719892d544abcaee25da44c
37 changes: 37 additions & 0 deletions tests/ui/wf/wf-in-fn-type-implicit.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
// check-pass
// known-bug: #104005

// Should fail. Function type parameters with implicit type annotations are not
// checked for well-formedness, which allows incorrect borrowing.

// In contrast, user annotations are always checked for well-formedness, and the
// commented code below is correctly rejected by the borrow checker.

use std::fmt::Display;

trait Displayable {
fn display(self) -> Box<dyn Display>;
}

impl<T: Display> Displayable for (T, Option<&'static T>) {
fn display(self) -> Box<dyn Display> {
Box::new(self.0)
}
}

fn extend_lt<T, U>(val: T) -> Box<dyn Display>
where
(T, Option<U>): Displayable,
{
Displayable::display((val, None))
}

fn main() {
// *incorrectly* compiles
let val = extend_lt(&String::from("blah blah blah"));
println!("{}", val);

// *correctly* fails to compile
// let val = extend_lt::<_, &_>(&String::from("blah blah blah"));
// println!("{}", val);
}