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 7 pull requests #101355

Closed
wants to merge 32 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
f46fffc
safe transmute: use `Assume` struct to provide analysis options
jswrenn Aug 18, 2022
1d844fe
safe transmute: use `FxIndex{Map,Set}` instead of `FxHash{Map,Set}`
jswrenn Aug 23, 2022
54645e8
set up rustc_metadata for SessionDiagnostics, port dependency_format.rs
CleanCut Aug 23, 2022
3ed9310
port native_libs.rs to SessionDiagnostics
CleanCut Aug 23, 2022
f7e462a
port encoder.rs to SessionDiagnostics
CleanCut Aug 23, 2022
32e1823
port creader.rs to SessionDiagnostics
CleanCut Aug 23, 2022
bd8e312
port fs.rs to SessionDiagnostics
CleanCut Aug 23, 2022
d0ba1fb
port of locator.rs to SessionDiagnostics, fix some of the errors
CleanCut Aug 24, 2022
0d65819
respond to review feedback: mainly eliminate as many conversions as p…
CleanCut Aug 26, 2022
30adfd6
port 5 new diagnostics that appeared in master
CleanCut Aug 27, 2022
fbcc038
safe transmute: use `to_valtree` to destructure const `Assume`
jswrenn Aug 31, 2022
e4e4114
Only keep one version of ImplicitSelfKind.
cjgillot Aug 27, 2022
f848d27
Use tcx.hir() utils for spans in MIR building.
cjgillot Aug 27, 2022
26037b1
Simplify MIR building entry.
cjgillot Aug 27, 2022
609a90d
Compute explicit MIR params on THIR.
cjgillot Aug 27, 2022
692064b
Also compute implicit params in THIR.
cjgillot Aug 22, 2022
8a594f0
Shrink some visibilities.
cjgillot Aug 29, 2022
d85dff7
Bless codegen test.
cjgillot Aug 30, 2022
b9e1806
Use def_span for external requirements.
cjgillot Aug 31, 2022
bc793c9
Use `BCRYPT_RNG_ALG_HANDLE` by default
ChrisDenton Sep 2, 2022
532d5f2
Fix `std::collections::HashSet::drain` documentation
wkordalski Sep 2, 2022
6fbc4d9
Fix unsupported syntax in .manifest file
diminishedprime Sep 2, 2022
df09047
rustdoc: remove unused CSS selector `.methods > .item-info`
notriddle Sep 2, 2022
6f95c89
rustdoc: remove incorrect CSS rule causing misaligned item-info
notriddle Sep 2, 2022
0f29824
rustdoc: put in rule to get alignment in desktop and mobile layouts
notriddle Sep 2, 2022
e135e37
Rollup merge of #100726 - jswrenn:transmute, r=oli-obk
matthiaskrgr Sep 3, 2022
6395082
Rollup merge of #100928 - CleanCut:rustc_metadata_diagnostics, r=davi…
matthiaskrgr Sep 3, 2022
2c0a225
Rollup merge of #101086 - cjgillot:thir-param, r=oli-obk
matthiaskrgr Sep 3, 2022
2739e70
Rollup merge of #101325 - ChrisDenton:BCRYPT_RNG_ALG_HANDLE, r=thomcc
matthiaskrgr Sep 3, 2022
afed4ff
Rollup merge of #101330 - wkordalski:hashset-drain-doc, r=jyn514
matthiaskrgr Sep 3, 2022
297793c
Rollup merge of #101335 - notriddle:notriddle/methods-stability, r=no…
matthiaskrgr Sep 3, 2022
f0fcbca
Rollup merge of #101338 - diminishedprime:patch-2, r=tmandry
matthiaskrgr Sep 3, 2022
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
Use def_span for external requirements.
  • Loading branch information
cjgillot committed Sep 1, 2022
commit b9e18065d19acf63b4589447569030d8a3a5b939
5 changes: 3 additions & 2 deletions compiler/rustc_borrowck/src/nll.rs
Original file line number Diff line number Diff line change
Expand Up @@ -389,8 +389,9 @@ pub(super) fn dump_annotation<'a, 'tcx>(
// viewing the intraprocedural state, the -Zdump-mir output is
// better.

let def_span = tcx.def_span(body.source.def_id());
let mut err = if let Some(closure_region_requirements) = closure_region_requirements {
let mut err = tcx.sess.diagnostic().span_note_diag(body.span, "external requirements");
let mut err = tcx.sess.diagnostic().span_note_diag(def_span, "external requirements");

regioncx.annotate(tcx, &mut err);

Expand All @@ -409,7 +410,7 @@ pub(super) fn dump_annotation<'a, 'tcx>(

err
} else {
let mut err = tcx.sess.diagnostic().span_note_diag(body.span, "no external requirements");
let mut err = tcx.sess.diagnostic().span_note_diag(def_span, "no external requirements");
regioncx.annotate(tcx, &mut err);

err
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ note: no external requirements
--> $DIR/escape-argument-callee.rs:26:38
|
LL | let mut closure = expect_sig(|p, y| *p = y);
| ^^^^^^^^^^^^^
| ^^^^^^
|
= note: defining type: test::{closure#0} with closure substs [
i16,
Expand All @@ -22,14 +22,8 @@ LL | let mut closure = expect_sig(|p, y| *p = y);
note: no external requirements
--> $DIR/escape-argument-callee.rs:20:1
|
LL | / fn test() {
LL | | let x = 44;
LL | | let mut p = &x;
LL | |
... |
LL | | deref(p);
LL | | }
| |_^
LL | fn test() {
| ^^^^^^^^^
|
= note: defining type: test

Expand Down
12 changes: 3 additions & 9 deletions src/test/ui/nll/closure-requirements/escape-argument.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ note: no external requirements
--> $DIR/escape-argument.rs:26:38
|
LL | let mut closure = expect_sig(|p, y| *p = y);
| ^^^^^^^^^^^^^
| ^^^^^^
|
= note: defining type: test::{closure#0} with closure substs [
i16,
Expand All @@ -13,14 +13,8 @@ LL | let mut closure = expect_sig(|p, y| *p = y);
note: no external requirements
--> $DIR/escape-argument.rs:20:1
|
LL | / fn test() {
LL | | let x = 44;
LL | | let mut p = &x;
LL | |
... |
LL | | deref(p);
LL | | }
| |_^
LL | fn test() {
| ^^^^^^^^^
|
= note: defining type: test

Expand Down
20 changes: 5 additions & 15 deletions src/test/ui/nll/closure-requirements/escape-upvar-nested.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ note: external requirements
--> $DIR/escape-upvar-nested.rs:21:32
|
LL | let mut closure1 = || p = &y;
| ^^^^^^^^^
| ^^
|
= note: defining type: test::{closure#0}::{closure#0} with closure substs [
i16,
Expand All @@ -15,12 +15,8 @@ LL | let mut closure1 = || p = &y;
note: external requirements
--> $DIR/escape-upvar-nested.rs:20:27
|
LL | let mut closure = || {
| ___________________________^
LL | | let mut closure1 = || p = &y;
LL | | closure1();
LL | | };
| |_________^
LL | let mut closure = || {
| ^^
|
= note: defining type: test::{closure#0} with closure substs [
i16,
Expand All @@ -33,14 +29,8 @@ LL | | };
note: no external requirements
--> $DIR/escape-upvar-nested.rs:13:1
|
LL | / fn test() {
LL | | let x = 44;
LL | | let mut p = &x;
LL | |
... |
LL | | deref(p);
LL | | }
| |_^
LL | fn test() {
| ^^^^^^^^^
|
= note: defining type: test

Expand Down
12 changes: 3 additions & 9 deletions src/test/ui/nll/closure-requirements/escape-upvar-ref.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ note: external requirements
--> $DIR/escape-upvar-ref.rs:23:27
|
LL | let mut closure = || p = &y;
| ^^^^^^^^^
| ^^
|
= note: defining type: test::{closure#0} with closure substs [
i16,
Expand All @@ -15,14 +15,8 @@ LL | let mut closure = || p = &y;
note: no external requirements
--> $DIR/escape-upvar-ref.rs:17:1
|
LL | / fn test() {
LL | | let x = 44;
LL | | let mut p = &x;
LL | |
... |
LL | | deref(p);
LL | | }
| |_^
LL | fn test() {
| ^^^^^^^^^
|
= note: defining type: test

Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,8 @@
note: no external requirements
--> $DIR/propagate-approximated-fail-no-postdom.rs:43:9
|
LL | / |_outlives1, _outlives2, _outlives3, x, y| {
LL | | // Only works if 'x: 'y:
LL | | let p = x.get();
LL | | demand_y(x, y, p)
LL | | },
| |_________^
LL | |_outlives1, _outlives2, _outlives3, x, y| {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: defining type: supply::{closure#0} with closure substs [
i16,
Expand All @@ -31,14 +27,8 @@ LL | demand_y(x, y, p)
note: no external requirements
--> $DIR/propagate-approximated-fail-no-postdom.rs:38:1
|
LL | / fn supply<'a, 'b, 'c>(cell_a: Cell<&'a u32>, cell_b: Cell<&'b u32>, cell_c: Cell<&'c u32>) {
LL | | establish_relationships(
LL | | cell_a,
LL | | cell_b,
... |
LL | | );
LL | | }
| |_^
LL | fn supply<'a, 'b, 'c>(cell_a: Cell<&'a u32>, cell_b: Cell<&'b u32>, cell_c: Cell<&'c u32>) {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: defining type: supply

Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,8 @@
note: external requirements
--> $DIR/propagate-approximated-ref.rs:43:47
|
LL | establish_relationships(&cell_a, &cell_b, |_outlives1, _outlives2, x, y| {
| _______________________________________________^
LL | | // Only works if 'x: 'y:
LL | | demand_y(x, y, x.get())
LL | |
LL | | });
| |_____^
LL | establish_relationships(&cell_a, &cell_b, |_outlives1, _outlives2, x, y| {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: defining type: supply::{closure#0} with closure substs [
i16,
Expand All @@ -22,14 +17,8 @@ LL | | });
note: no external requirements
--> $DIR/propagate-approximated-ref.rs:42:1
|
LL | / fn supply<'a, 'b>(cell_a: Cell<&'a u32>, cell_b: Cell<&'b u32>) {
LL | | establish_relationships(&cell_a, &cell_b, |_outlives1, _outlives2, x, y| {
LL | | // Only works if 'x: 'y:
LL | | demand_y(x, y, x.get())
LL | |
LL | | });
LL | | }
| |_^
LL | fn supply<'a, 'b>(cell_a: Cell<&'a u32>, cell_b: Cell<&'b u32>) {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: defining type: supply

Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,8 @@
note: no external requirements
--> $DIR/propagate-approximated-shorter-to-static-comparing-against-free.rs:21:15
|
LL | foo(cell, |cell_a, cell_x| {
| _______________^
LL | | cell_a.set(cell_x.get()); // forces 'x: 'a, error in closure
LL | |
LL | | })
| |_____^
LL | foo(cell, |cell_a, cell_x| {
| ^^^^^^^^^^^^^^^^
|
= note: defining type: case1::{closure#0} with closure substs [
i32,
Expand All @@ -27,25 +23,16 @@ LL | cell_a.set(cell_x.get()); // forces 'x: 'a, error in closure
note: no external requirements
--> $DIR/propagate-approximated-shorter-to-static-comparing-against-free.rs:18:1
|
LL | / fn case1() {
LL | | let a = 0;
LL | | let cell = Cell::new(&a);
LL | | foo(cell, |cell_a, cell_x| {
... |
LL | | })
LL | | }
| |_^
LL | fn case1() {
| ^^^^^^^^^^
|
= note: defining type: case1

note: external requirements
--> $DIR/propagate-approximated-shorter-to-static-comparing-against-free.rs:35:15
|
LL | foo(cell, |cell_a, cell_x| {
| _______________^
LL | | cell_x.set(cell_a.get()); // forces 'a: 'x, implies 'a = 'static -> borrow error
LL | | })
| |_____^
LL | foo(cell, |cell_a, cell_x| {
| ^^^^^^^^^^^^^^^^
|
= note: defining type: case2::{closure#0} with closure substs [
i32,
Expand All @@ -58,14 +45,8 @@ LL | | })
note: no external requirements
--> $DIR/propagate-approximated-shorter-to-static-comparing-against-free.rs:28:1
|
LL | / fn case2() {
LL | | let a = 0;
LL | | let cell = Cell::new(&a);
LL | |
... |
LL | | })
LL | | }
| |_^
LL | fn case2() {
| ^^^^^^^^^^
|
= note: defining type: case2

Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,8 @@
note: external requirements
--> $DIR/propagate-approximated-shorter-to-static-no-bound.rs:32:47
|
LL | establish_relationships(&cell_a, &cell_b, |_outlives, x, y| {
| _______________________________________________^
LL | |
LL | |
LL | | // Only works if 'x: 'y:
LL | | demand_y(x, y, x.get())
LL | | });
| |_____^
LL | establish_relationships(&cell_a, &cell_b, |_outlives, x, y| {
| ^^^^^^^^^^^^^^^^^
|
= note: defining type: supply::{closure#0} with closure substs [
i16,
Expand All @@ -23,14 +17,8 @@ LL | | });
note: no external requirements
--> $DIR/propagate-approximated-shorter-to-static-no-bound.rs:31:1
|
LL | / fn supply<'a, 'b>(cell_a: Cell<&'a u32>, cell_b: Cell<&'b u32>) {
LL | | establish_relationships(&cell_a, &cell_b, |_outlives, x, y| {
LL | |
LL | |
... |
LL | | });
LL | | }
| |_^
LL | fn supply<'a, 'b>(cell_a: Cell<&'a u32>, cell_b: Cell<&'b u32>) {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: defining type: supply

Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,8 @@
note: external requirements
--> $DIR/propagate-approximated-shorter-to-static-wrong-bound.rs:35:47
|
LL | establish_relationships(&cell_a, &cell_b, |_outlives1, _outlives2, x, y| {
| _______________________________________________^
LL | |
LL | |
LL | | // Only works if 'x: 'y:
LL | | demand_y(x, y, x.get())
LL | | });
| |_____^
LL | establish_relationships(&cell_a, &cell_b, |_outlives1, _outlives2, x, y| {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: defining type: supply::{closure#0} with closure substs [
i16,
Expand All @@ -23,14 +17,8 @@ LL | | });
note: no external requirements
--> $DIR/propagate-approximated-shorter-to-static-wrong-bound.rs:34:1
|
LL | / fn supply<'a, 'b>(cell_a: Cell<&'a u32>, cell_b: Cell<&'b u32>) {
LL | | establish_relationships(&cell_a, &cell_b, |_outlives1, _outlives2, x, y| {
LL | |
LL | |
... |
LL | | });
LL | | }
| |_^
LL | fn supply<'a, 'b>(cell_a: Cell<&'a u32>, cell_b: Cell<&'b u32>) {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: defining type: supply

Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,8 @@
note: external requirements
--> $DIR/propagate-approximated-val.rs:36:45
|
LL | establish_relationships(cell_a, cell_b, |outlives1, outlives2, x, y| {
| _____________________________________________^
LL | | // Only works if 'x: 'y:
LL | | demand_y(outlives1, outlives2, x.get())
LL | |
LL | | });
| |_____^
LL | establish_relationships(cell_a, cell_b, |outlives1, outlives2, x, y| {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: defining type: test::{closure#0} with closure substs [
i16,
Expand All @@ -22,14 +17,8 @@ LL | | });
note: no external requirements
--> $DIR/propagate-approximated-val.rs:35:1
|
LL | / fn test<'a, 'b>(cell_a: Cell<&'a u32>, cell_b: Cell<&'b u32>) {
LL | | establish_relationships(cell_a, cell_b, |outlives1, outlives2, x, y| {
LL | | // Only works if 'x: 'y:
LL | | demand_y(outlives1, outlives2, x.get())
LL | |
LL | | });
LL | | }
| |_^
LL | fn test<'a, 'b>(cell_a: Cell<&'a u32>, cell_b: Cell<&'b u32>) {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: defining type: test

Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,8 @@
note: external requirements
--> $DIR/propagate-despite-same-free-region.rs:42:9
|
LL | / |_outlives1, _outlives2, x, y| {
LL | | // Only works if 'x: 'y:
LL | | let p = x.get();
LL | | demand_y(x, y, p)
LL | | },
| |_________^
LL | |_outlives1, _outlives2, x, y| {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: defining type: supply::{closure#0} with closure substs [
i16,
Expand All @@ -20,14 +16,8 @@ LL | | },
note: no external requirements
--> $DIR/propagate-despite-same-free-region.rs:39:1
|
LL | / fn supply<'a>(cell_a: Cell<&'a u32>) {
LL | | establish_relationships(
LL | | cell_a,
LL | | |_outlives1, _outlives2, x, y| {
... |
LL | | );
LL | | }
| |_^
LL | fn supply<'a>(cell_a: Cell<&'a u32>) {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: defining type: supply

Loading