Skip to content

Commit 27a25df

Browse files
committed
Auto merge of rust-lang#56962 - nivkner:fixme_fixup4, r=pnkfelix
address some FIXME whose associated issues were marked as closed part of rust-lang#44366
2 parents 27c4335 + e32c63e commit 27a25df

25 files changed

+54
-94
lines changed

src/librustc_codegen_llvm/llvm/ffi.rs

+6-26
Original file line numberDiff line numberDiff line change
@@ -1601,15 +1601,12 @@ extern "C" {
16011601
-> &'a Value;
16021602
pub fn LLVMRustDIBuilderCreateOpDeref() -> i64;
16031603
pub fn LLVMRustDIBuilderCreateOpPlusUconst() -> i64;
1604-
}
16051604

1606-
#[allow(improper_ctypes)] // FIXME(#52456) needed for RustString.
1607-
extern "C" {
1605+
#[allow(improper_ctypes)]
16081606
pub fn LLVMRustWriteTypeToString(Type: &Type, s: &RustString);
1607+
#[allow(improper_ctypes)]
16091608
pub fn LLVMRustWriteValueToString(value_ref: &Value, s: &RustString);
1610-
}
16111609

1612-
extern "C" {
16131610
pub fn LLVMIsAConstantInt(value_ref: &Value) -> Option<&Value>;
16141611
pub fn LLVMIsAConstantFP(value_ref: &Value) -> Option<&Value>;
16151612

@@ -1687,56 +1684,39 @@ extern "C" {
16871684
pub fn LLVMRustDestroyArchive(AR: &'static mut Archive);
16881685

16891686
pub fn LLVMRustGetSectionName(SI: &SectionIterator, data: &mut *const c_char) -> size_t;
1690-
}
16911687

1692-
#[allow(improper_ctypes)] // FIXME(#52456) needed for RustString.
1693-
extern "C" {
1688+
#[allow(improper_ctypes)]
16941689
pub fn LLVMRustWriteTwineToString(T: &Twine, s: &RustString);
1695-
}
16961690

1697-
extern "C" {
16981691
pub fn LLVMContextSetDiagnosticHandler(C: &Context,
16991692
Handler: DiagnosticHandler,
17001693
DiagnosticContext: *mut c_void);
1701-
}
17021694

1703-
#[allow(improper_ctypes)] // FIXME(#52456) needed for RustString.
1704-
extern "C" {
1695+
#[allow(improper_ctypes)]
17051696
pub fn LLVMRustUnpackOptimizationDiagnostic(DI: &'a DiagnosticInfo,
17061697
pass_name_out: &RustString,
17071698
function_out: &mut Option<&'a Value>,
17081699
loc_line_out: &mut c_uint,
17091700
loc_column_out: &mut c_uint,
17101701
loc_filename_out: &RustString,
17111702
message_out: &RustString);
1712-
}
17131703

1714-
extern "C" {
17151704
pub fn LLVMRustUnpackInlineAsmDiagnostic(DI: &'a DiagnosticInfo,
17161705
cookie_out: &mut c_uint,
17171706
message_out: &mut Option<&'a Twine>,
17181707
instruction_out: &mut Option<&'a Value>);
1719-
}
17201708

1721-
#[allow(improper_ctypes)] // FIXME(#52456) needed for RustString.
1722-
extern "C" {
1709+
#[allow(improper_ctypes)]
17231710
pub fn LLVMRustWriteDiagnosticInfoToString(DI: &DiagnosticInfo, s: &RustString);
1724-
}
1725-
1726-
extern "C" {
17271711
pub fn LLVMRustGetDiagInfoKind(DI: &DiagnosticInfo) -> DiagnosticKind;
17281712

17291713
pub fn LLVMRustSetInlineAsmDiagnosticHandler(C: &Context,
17301714
H: InlineAsmDiagHandler,
17311715
CX: *mut c_void);
1732-
}
17331716

1734-
#[allow(improper_ctypes)] // FIXME(#52456) needed for RustString.
1735-
extern "C" {
1717+
#[allow(improper_ctypes)]
17361718
pub fn LLVMRustWriteSMDiagnosticToString(d: &SMDiagnostic, s: &RustString);
1737-
}
17381719

1739-
extern "C" {
17401720
pub fn LLVMRustWriteArchive(Dst: *const c_char,
17411721
NumMembers: size_t,
17421722
Members: *const &RustArchiveMember,

src/librustc_mir/build/matches/test.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -347,7 +347,7 @@ impl<'a, 'gcx, 'tcx> Builder<'a, 'gcx, 'tcx> {
347347
span: test.span,
348348
ty: mty,
349349

350-
// FIXME(#47184): This constant comes from user
350+
// FIXME(#54571): This constant comes from user
351351
// input (a constant in a pattern). Are
352352
// there forms where users can add type
353353
// annotations here? For example, an

src/librustc_mir/hair/pattern/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ impl<'tcx> PatternTypeProjections<'tcx> {
8383
}
8484

8585
pub(crate) fn ref_binding(&self) -> Self {
86-
// FIXME(#47184): ignore for now
86+
// FIXME(#55401): ignore for now
8787
PatternTypeProjections { contents: vec![] }
8888
}
8989

src/librustdoc/clean/cfg.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@
1010

1111
//! Representation of a `#[doc(cfg(...))]` attribute.
1212
13-
// FIXME: Once RFC #1868 is implemented, switch to use those structures instead.
13+
// FIXME: Once the portability lint RFC is implemented (see tracking issue #41619),
14+
// switch to use those structures instead.
1415

1516
use std::mem;
1617
use std::fmt::{self, Write};

src/librustdoc/html/render.rs

+5-7
Original file line numberDiff line numberDiff line change
@@ -1240,10 +1240,8 @@ fn write_minify_replacer<W: Write>(dst: &mut W,
12401240
/// static HTML tree. Each component in the cleaned path will be passed as an
12411241
/// argument to `f`. The very last component of the path (ie the file name) will
12421242
/// be passed to `f` if `keep_filename` is true, and ignored otherwise.
1243-
// FIXME (#9639): The closure should deal with &[u8] instead of &str
1244-
// FIXME (#9639): This is too conservative, rejecting non-UTF-8 paths
12451243
fn clean_srcpath<F>(src_root: &Path, p: &Path, keep_filename: bool, mut f: F) where
1246-
F: FnMut(&str),
1244+
F: FnMut(&OsStr),
12471245
{
12481246
// make it relative, if possible
12491247
let p = p.strip_prefix(src_root).unwrap_or(p);
@@ -1256,8 +1254,8 @@ fn clean_srcpath<F>(src_root: &Path, p: &Path, keep_filename: bool, mut f: F) wh
12561254
}
12571255

12581256
match c {
1259-
Component::ParentDir => f("up"),
1260-
Component::Normal(c) => f(c.to_str().unwrap()),
1257+
Component::ParentDir => f("up".as_ref()),
1258+
Component::Normal(c) => f(c),
12611259
_ => continue,
12621260
}
12631261
}
@@ -1356,7 +1354,7 @@ impl<'a> SourceCollector<'a> {
13561354
cur.push(component);
13571355
fs::create_dir_all(&cur).unwrap();
13581356
root_path.push_str("../");
1359-
href.push_str(component);
1357+
href.push_str(&component.to_string_lossy());
13601358
href.push('/');
13611359
});
13621360
let mut fname = p.file_name()
@@ -2243,7 +2241,7 @@ impl<'a> Item<'a> {
22432241
};
22442242

22452243
clean_srcpath(&src_root, file, false, |component| {
2246-
path.push_str(component);
2244+
path.push_str(&component.to_string_lossy());
22472245
path.push('/');
22482246
});
22492247
let mut fname = file.file_name().expect("source has no filename")

src/test/auxiliary/rust_test_helpers.c

+1-5
Original file line numberDiff line numberDiff line change
@@ -163,11 +163,7 @@ rust_get_null_ptr() {
163163
return 0;
164164
}
165165

166-
/* Debug helpers strictly to verify ABI conformance.
167-
*
168-
* FIXME (#2665): move these into a testcase when the testsuite
169-
* understands how to have explicit C files included.
170-
*/
166+
// Debug helpers strictly to verify ABI conformance.
171167

172168
struct quad {
173169
uint64_t a;

src/test/run-pass/impl-trait/lifetimes.rs

-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ impl<'a> SingleRegionTrait<'a> for &'a u32 {}
4141
struct SingleRegionStruct<'a>(&'a u32);
4242

4343
fn simple_type_hrtb<'b>() -> impl for<'a> SingleRegionTrait<'a> { 5 }
44-
// FIXME(cramertj) add test after #45992 lands to ensure lint is triggered
4544
fn elision_single_region_trait(x: &u32) -> impl SingleRegionTrait { x }
4645
fn elision_single_region_struct(x: SingleRegionStruct) -> impl Into<SingleRegionStruct> { x }
4746

src/test/run-pass/auxiliary/issue-31702-2.rs renamed to src/test/run-pass/issues/auxiliary/issue-31702-2.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ use std::collections::HashMap;
1616
use issue_31702_1::U256;
1717

1818
pub struct Ethash {
19-
engine_params: for<'a> fn() -> Option<&'a Vec<u8>>,
19+
engine_params: fn() -> Option<&'static Vec<u8>>,
2020
u256_params: HashMap<String, U256>,
2121
}
2222

src/test/run-pass/issues/issue-31702.rs

-5
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,6 @@
1111
// run-pass
1212
// aux-build:issue-31702-1.rs
1313
// aux-build:issue-31702-2.rs
14-
// ignore-test: FIXME(#31702) when this test was added it was thought that the
15-
// accompanying llvm update would fix it, but
16-
// unfortunately it appears that was not the case. In
17-
// the interest of not deleting the test, though,
18-
// this is just tagged with ignore-test
1914

2015
// this test is actually entirely in the linked library crates
2116

src/test/ui/borrowck/assign_mutable_fields.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
// var, but we do not permit you to use the complete var afterwards.
1313
// We hope to fix this at some point.
1414
//
15-
// FIXME(#21232)
15+
// FIXME(#54987)
1616

1717
fn assign_both_fields_and_use() {
1818
let mut x: (u32, u32);

src/test/ui/borrowck/borrowck-describe-lvalue.ast.nll.stderr

+3-3
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ LL | *y = 1;
1010
| ------ first borrow later used here
1111

1212
error[E0499]: cannot borrow `x` as mutable more than once at a time
13-
--> $DIR/borrowck-describe-lvalue.rs:307:20
13+
--> $DIR/borrowck-describe-lvalue.rs:306:20
1414
|
1515
LL | let y = &mut x;
1616
| ------ first mutable borrow occurs here
@@ -21,7 +21,7 @@ LL | *y = 1;
2121
| ------ first borrow later used here
2222

2323
error: captured variable cannot escape `FnMut` closure body
24-
--> $DIR/borrowck-describe-lvalue.rs:305:16
24+
--> $DIR/borrowck-describe-lvalue.rs:304:16
2525
|
2626
LL | || {
2727
| - inferred to be a `FnMut` closure
@@ -368,7 +368,7 @@ LL | drop(x);
368368
= warning: this represents potential undefined behavior in your code and this warning will become a hard error in the future
369369

370370
error[E0382]: use of moved value: `x`
371-
--> $DIR/borrowck-describe-lvalue.rs:318:22
371+
--> $DIR/borrowck-describe-lvalue.rs:317:22
372372
|
373373
LL | drop(x);
374374
| - value moved here

src/test/ui/borrowck/borrowck-describe-lvalue.ast.stderr

+2-2
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ LL | };
220220
| - first borrow ends here
221221

222222
error[E0499]: cannot borrow `**x` as mutable more than once at a time
223-
--> $DIR/borrowck-describe-lvalue.rs:307:25
223+
--> $DIR/borrowck-describe-lvalue.rs:306:25
224224
|
225225
LL | let y = &mut x;
226226
| - first mutable borrow occurs here
@@ -231,7 +231,7 @@ LL | }
231231
| - first borrow ends here
232232

233233
error[E0382]: use of moved value: `x`
234-
--> $DIR/borrowck-describe-lvalue.rs:318:22
234+
--> $DIR/borrowck-describe-lvalue.rs:317:22
235235
|
236236
LL | drop(x);
237237
| - value moved here

src/test/ui/borrowck/borrowck-describe-lvalue.mir.stderr

+3-3
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ LL | *y = 1;
1010
| ------ first borrow later used here
1111

1212
error[E0499]: cannot borrow `x` as mutable more than once at a time
13-
--> $DIR/borrowck-describe-lvalue.rs:307:20
13+
--> $DIR/borrowck-describe-lvalue.rs:306:20
1414
|
1515
LL | let y = &mut x;
1616
| ------ first mutable borrow occurs here
@@ -21,7 +21,7 @@ LL | *y = 1;
2121
| ------ first borrow later used here
2222

2323
error: captured variable cannot escape `FnMut` closure body
24-
--> $DIR/borrowck-describe-lvalue.rs:305:16
24+
--> $DIR/borrowck-describe-lvalue.rs:304:16
2525
|
2626
LL | || {
2727
| - inferred to be a `FnMut` closure
@@ -362,7 +362,7 @@ LL | drop(x);
362362
| - mutable borrow later used here
363363

364364
error[E0382]: use of moved value: `x`
365-
--> $DIR/borrowck-describe-lvalue.rs:318:22
365+
--> $DIR/borrowck-describe-lvalue.rs:317:22
366366
|
367367
LL | drop(x);
368368
| - value moved here

src/test/ui/borrowck/borrowck-describe-lvalue.rs

-1
Original file line numberDiff line numberDiff line change
@@ -299,7 +299,6 @@ fn main() {
299299
}
300300
// Field from upvar nested
301301
{
302-
// FIXME(#49824) -- the free region error below should probably not be there
303302
let mut x = 0;
304303
|| {
305304
|| { //[mir]~ ERROR captured variable cannot escape `FnMut` closure body

src/test/ui/issues/issue-36082.ast.nll.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error[E0716]: temporary value dropped while borrowed
2-
--> $DIR/issue-36082.rs:23:19
2+
--> $DIR/issue-36082.rs:21:19
33
|
44
LL | let val: &_ = x.borrow().0;
55
| ^^^^^^^^^^ - temporary value is freed at the end of this statement

src/test/ui/issues/issue-36082.ast.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error[E0597]: borrowed value does not live long enough
2-
--> $DIR/issue-36082.rs:23:19
2+
--> $DIR/issue-36082.rs:21:19
33
|
44
LL | let val: &_ = x.borrow().0;
55
| ^^^^^^^^^^ - temporary value dropped here while still borrowed

src/test/ui/issues/issue-36082.mir.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error[E0716]: temporary value dropped while borrowed
2-
--> $DIR/issue-36082.rs:23:19
2+
--> $DIR/issue-36082.rs:21:19
33
|
44
LL | let val: &_ = x.borrow().0;
55
| ^^^^^^^^^^ - temporary value is freed at the end of this statement

src/test/ui/issues/issue-36082.rs

-2
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@
1111
// revisions: ast mir
1212
//[mir]compile-flags: -Z borrowck=mir
1313

14-
// FIXME(#49821) -- No tip about using a let binding
15-
1614
use std::cell::RefCell;
1715

1816
fn main() {

src/test/ui/nll/closure-requirements/propagate-approximated-shorter-to-static-no-bound.rs

-3
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,6 @@
1212
// approximate the shorter end-point (`'y`) to with `'static`. This is
1313
// because `'y` is higher-ranked but we know of no relations to other
1414
// regions. Note that `'static` shows up in the stderr output as `'0`.
15-
//
16-
// FIXME(#45827) Because of shortcomings in the MIR type checker,
17-
// these errors are not (yet) reported.
1815

1916
// compile-flags:-Zborrowck=mir -Zverbose
2017

src/test/ui/nll/closure-requirements/propagate-approximated-shorter-to-static-no-bound.stderr

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
note: External requirements
2-
--> $DIR/propagate-approximated-shorter-to-static-no-bound.rs:45:47
2+
--> $DIR/propagate-approximated-shorter-to-static-no-bound.rs:42:47
33
|
44
LL | establish_relationships(&cell_a, &cell_b, |_outlives, x, y| {
55
| _______________________________________________^
@@ -20,7 +20,7 @@ LL | | });
2020
= note: where '_#1r: '_#0r
2121

2222
note: No external requirements
23-
--> $DIR/propagate-approximated-shorter-to-static-no-bound.rs:44:1
23+
--> $DIR/propagate-approximated-shorter-to-static-no-bound.rs:41:1
2424
|
2525
LL | / fn supply<'a, 'b>(cell_a: Cell<&'a u32>, cell_b: Cell<&'b u32>) {
2626
LL | | establish_relationships(&cell_a, &cell_b, |_outlives, x, y| {
@@ -34,7 +34,7 @@ LL | | }
3434
= note: defining type: DefId(0/0:6 ~ propagate_approximated_shorter_to_static_no_bound[317d]::supply[0]) with substs []
3535

3636
error[E0521]: borrowed data escapes outside of function
37-
--> $DIR/propagate-approximated-shorter-to-static-no-bound.rs:45:5
37+
--> $DIR/propagate-approximated-shorter-to-static-no-bound.rs:42:5
3838
|
3939
LL | fn supply<'a, 'b>(cell_a: Cell<&'a u32>, cell_b: Cell<&'b u32>) {
4040
| ------ `cell_a` is a reference that is only valid in the function body

src/test/ui/nll/closure-requirements/propagate-approximated-shorter-to-static-wrong-bound.rs

-3
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,6 @@
1313
// because `'y` is higher-ranked but we know of only irrelevant
1414
// relations to other regions. Note that `'static` shows up in the
1515
// stderr output as `'0`.
16-
//
17-
// FIXME(#45827) Because of shortcomings in the MIR type checker,
18-
// these errors are not (yet) reported.
1916

2017
// compile-flags:-Zborrowck=mir -Zverbose
2118

src/test/ui/nll/closure-requirements/propagate-approximated-shorter-to-static-wrong-bound.stderr

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
note: External requirements
2-
--> $DIR/propagate-approximated-shorter-to-static-wrong-bound.rs:48:47
2+
--> $DIR/propagate-approximated-shorter-to-static-wrong-bound.rs:45:47
33
|
44
LL | establish_relationships(&cell_a, &cell_b, |_outlives1, _outlives2, x, y| {
55
| _______________________________________________^
@@ -20,7 +20,7 @@ LL | | });
2020
= note: where '_#1r: '_#0r
2121

2222
note: No external requirements
23-
--> $DIR/propagate-approximated-shorter-to-static-wrong-bound.rs:47:1
23+
--> $DIR/propagate-approximated-shorter-to-static-wrong-bound.rs:44:1
2424
|
2525
LL | / fn supply<'a, 'b>(cell_a: Cell<&'a u32>, cell_b: Cell<&'b u32>) {
2626
LL | | establish_relationships(&cell_a, &cell_b, |_outlives1, _outlives2, x, y| {
@@ -34,7 +34,7 @@ LL | | }
3434
= note: defining type: DefId(0/0:6 ~ propagate_approximated_shorter_to_static_wrong_bound[317d]::supply[0]) with substs []
3535

3636
error[E0521]: borrowed data escapes outside of function
37-
--> $DIR/propagate-approximated-shorter-to-static-wrong-bound.rs:48:5
37+
--> $DIR/propagate-approximated-shorter-to-static-wrong-bound.rs:45:5
3838
|
3939
LL | fn supply<'a, 'b>(cell_a: Cell<&'a u32>, cell_b: Cell<&'b u32>) {
4040
| ------ `cell_a` is a reference that is only valid in the function body

0 commit comments

Comments
 (0)