Auto merge of #105085 - oli-obk:stop_promoting_all_the_things, r=Ralf… · rust-lang/rust@f5c3dfd (original) (raw)

``

1

`` +

error[E0493]: destructor of String cannot be evaluated at compile-time

``

``

2

`+

--> $DIR/promoted_const_call3.rs:7:30

`

``

3

`+

|

`

``

4

`+

LL | let _: &'static _ = &id(&String::new());

`

``

5

`+

| ^^^^^^^^^^^^^ - value is dropped here

`

``

6

`+

| |

`

``

7

`+

| the destructor for this type cannot be evaluated in constants

`

``

8

+

``

9

`` +

error[E0493]: destructor of String cannot be evaluated at compile-time

``

``

10

`+

--> $DIR/promoted_const_call3.rs:3:26

`

``

11

`+

|

`

``

12

`+

LL | let _: &'static _ = &String::new();

`

``

13

`+

| ^^^^^^^^^^^^^ the destructor for this type cannot be evaluated in constants

`

``

14

`+

...

`

``

15

`+

LL | };

`

``

16

`+

| - value is dropped here

`

``

17

+

``

18

`+

error[E0716]: temporary value dropped while borrowed

`

``

19

`+

--> $DIR/promoted_const_call3.rs:3:26

`

``

20

`+

|

`

``

21

`+

LL | let _: &'static _ = &String::new();

`

``

22

`+

| ---------- ^^^^^^^^^^^^^ creates a temporary value which is freed while still in use

`

``

23

`+

| |

`

``

24

`` +

| type annotation requires that borrow lasts for 'static

``

``

25

`+

...

`

``

26

`+

LL | };

`

``

27

`+

| - temporary value is freed at the end of this statement

`

``

28

+

``

29

`+

error[E0716]: temporary value dropped while borrowed

`

``

30

`+

--> $DIR/promoted_const_call3.rs:7:26

`

``

31

`+

|

`

``

32

`+

LL | let _: &'static _ = &id(&String::new());

`

``

33

`+

| ---------- ^^^^^^^^^^^^^^^^^^ creates a temporary value which is freed while still in use

`

``

34

`+

| |

`

``

35

`` +

| type annotation requires that borrow lasts for 'static

``

``

36

`+

...

`

``

37

`+

LL | };

`

``

38

`+

| - temporary value is freed at the end of this statement

`

``

39

+

``

40

`+

error[E0716]: temporary value dropped while borrowed

`

``

41

`+

--> $DIR/promoted_const_call3.rs:7:30

`

``

42

`+

|

`

``

43

`+

LL | let _: &'static _ = &id(&String::new());

`

``

44

`+

| ---------- ^^^^^^^^^^^^^ - temporary value is freed at the end of this statement

`

``

45

`+

| | |

`

``

46

`+

| | creates a temporary value which is freed while still in use

`

``

47

`` +

| type annotation requires that borrow lasts for 'static

``

``

48

+

``

49

`+

error[E0716]: temporary value dropped while borrowed

`

``

50

`+

--> $DIR/promoted_const_call3.rs:12:26

`

``

51

`+

|

`

``

52

`+

LL | let _: &'static _ = &std::mem::ManuallyDrop::new(String::new());

`

``

53

`+

| ---------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ creates a temporary value which is freed while still in use

`

``

54

`+

| |

`

``

55

`` +

| type annotation requires that borrow lasts for 'static

``

``

56

`+

LL |

`

``

57

`+

LL | };

`

``

58

`+

| - temporary value is freed at the end of this statement

`

``

59

+

``

60

`+

error[E0716]: temporary value dropped while borrowed

`

``

61

`+

--> $DIR/promoted_const_call3.rs:17:26

`

``

62

`+

|

`

``

63

`+

LL | let _: &'static _ = &String::new();

`

``

64

`+

| ---------- ^^^^^^^^^^^^^ creates a temporary value which is freed while still in use

`

``

65

`+

| |

`

``

66

`` +

| type annotation requires that borrow lasts for 'static

``

``

67

`+

...

`

``

68

`+

LL | }

`

``

69

`+

| - temporary value is freed at the end of this statement

`

``

70

+

``

71

`+

error[E0716]: temporary value dropped while borrowed

`

``

72

`+

--> $DIR/promoted_const_call3.rs:20:26

`

``

73

`+

|

`

``

74

`+

LL | let _: &'static _ = &id(&String::new());

`

``

75

`+

| ---------- ^^^^^^^^^^^^^^^^^^ creates a temporary value which is freed while still in use

`

``

76

`+

| |

`

``

77

`` +

| type annotation requires that borrow lasts for 'static

``

``

78

`+

...

`

``

79

`+

LL | }

`

``

80

`+

| - temporary value is freed at the end of this statement

`

``

81

+

``

82

`+

error[E0716]: temporary value dropped while borrowed

`

``

83

`+

--> $DIR/promoted_const_call3.rs:20:30

`

``

84

`+

|

`

``

85

`+

LL | let _: &'static _ = &id(&String::new());

`

``

86

`+

| ---------- ^^^^^^^^^^^^^ - temporary value is freed at the end of this statement

`

``

87

`+

| | |

`

``

88

`+

| | creates a temporary value which is freed while still in use

`

``

89

`` +

| type annotation requires that borrow lasts for 'static

``

``

90

+

``

91

`+

error[E0716]: temporary value dropped while borrowed

`

``

92

`+

--> $DIR/promoted_const_call3.rs:24:26

`

``

93

`+

|

`

``

94

`+

LL | let _: &'static _ = &std::mem::ManuallyDrop::new(String::new());

`

``

95

`+

| ---------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ creates a temporary value which is freed while still in use

`

``

96

`+

| |

`

``

97

`` +

| type annotation requires that borrow lasts for 'static

``

``

98

`+

LL |

`

``

99

`+

LL | }

`

``

100

`+

| - temporary value is freed at the end of this statement

`

``

101

+

``

102

`+

error: aborting due to 10 previous errors

`

``

103

+

``

104

`+

Some errors have detailed explanations: E0493, E0716.

`

``

105

`` +

For more information about an error, try rustc --explain E0493.

``